mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-03 02:06:44 +03:00
Compare commits
3 Commits
v2018.09
...
v2016.09.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3363c0604 | ||
|
|
44e3dd1402 | ||
|
|
6baa904ad2 |
@@ -25,6 +25,3 @@
|
||||
# Ignore "WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet
|
||||
# addresses are __aligned(2)".
|
||||
--ignore PREFER_ETHER_ADDR_COPY
|
||||
|
||||
# A bit shorter of a description is OK with us.
|
||||
--min-conf-desc-length=2
|
||||
|
||||
34
.gitignore
vendored
34
.gitignore
vendored
@@ -3,30 +3,26 @@
|
||||
# subdirectories here. Add them in the ".gitignore" file
|
||||
# in that subdirectory instead.
|
||||
#
|
||||
# Normal rules (sorted alphabetically)
|
||||
# Normal rules
|
||||
#
|
||||
.*
|
||||
*.a
|
||||
*.bin
|
||||
*.cfgout
|
||||
*.dtb
|
||||
*.dtb.S
|
||||
*.elf
|
||||
*.exe
|
||||
*.gcda
|
||||
*.gcno
|
||||
*.i
|
||||
*.lex.c
|
||||
*.lst
|
||||
*.mod.c
|
||||
*.o
|
||||
*.o.*
|
||||
*.order
|
||||
*.patch
|
||||
*.a
|
||||
*.s
|
||||
*.su
|
||||
*.mod.c
|
||||
*.i
|
||||
*.lst
|
||||
*.order
|
||||
*.elf
|
||||
*.swp
|
||||
*.tab.[ch]
|
||||
*.bin
|
||||
*.patch
|
||||
*.cfgtmp
|
||||
|
||||
# host programs on Cygwin
|
||||
*.exe
|
||||
|
||||
# Build tree
|
||||
/build-*
|
||||
@@ -34,9 +30,8 @@
|
||||
#
|
||||
# Top-level generic files
|
||||
#
|
||||
fit-dtb.blob
|
||||
/MLO*
|
||||
/SPL*
|
||||
/SPL
|
||||
/System.map
|
||||
/u-boot*
|
||||
/boards.cfg
|
||||
@@ -50,6 +45,7 @@ fit-dtb.blob
|
||||
#
|
||||
# Generated files
|
||||
#
|
||||
/LOG
|
||||
/spl/
|
||||
/tpl/
|
||||
/defconfig
|
||||
|
||||
3
.mailmap
3
.mailmap
@@ -20,7 +20,6 @@ Jagan Teki <jaganna@xilinx.com>
|
||||
Jagan Teki <jagannadh.teki@gmail.com>
|
||||
Jagan Teki <jagannadha.sutradharudu-teki@xilinx.com>
|
||||
Markus Klotzbuecher <mk@denx.de>
|
||||
Paul Burton <paul.burton@mips.com> <paul.burton@imgtec.com>
|
||||
Prabhakar Kushwaha <prabhakar@freescale.com>
|
||||
Rajeshwari Shinde <rajeshwari.s@samsung.com>
|
||||
Ricardo Ribalda <ricardo.ribalda@uam.es>
|
||||
@@ -34,5 +33,3 @@ Wolfgang Denk <wdenk>
|
||||
York Sun <yorksun@freescale.com>
|
||||
York Sun <york.sun@nxp.com>
|
||||
Łukasz Majewski <l.majewski@samsung.com>
|
||||
Lukasz Majewski <lukma@denx.de>
|
||||
Mirza <Taimoor_Mirza@mentor.com>
|
||||
|
||||
485
.travis.yml
485
.travis.yml
@@ -1,10 +1,9 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
# Copyright Roger Meier <r.meier@siemens.com>
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
# build U-Boot on Travis CI - https://travis-ci.org/
|
||||
|
||||
sudo: required
|
||||
dist: trusty
|
||||
sudo: true
|
||||
|
||||
language: c
|
||||
|
||||
@@ -19,408 +18,172 @@ addons:
|
||||
- libsdl1.2-dev
|
||||
- python
|
||||
- python-virtualenv
|
||||
- swig
|
||||
- libpython-dev
|
||||
- iasl
|
||||
- grub-efi-ia32-bin
|
||||
- rpm2cpio
|
||||
- wget
|
||||
- device-tree-compiler
|
||||
- lzop
|
||||
|
||||
before_install:
|
||||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
- sudo apt-get update -q
|
||||
- sudo apt-get install libisl15 -y
|
||||
cache:
|
||||
- apt
|
||||
|
||||
install:
|
||||
# Clone uboot-test-hooks
|
||||
- git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks
|
||||
- ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname`
|
||||
- ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname`
|
||||
# install latest device tree compiler
|
||||
- git clone --depth=1 https://git.kernel.org/pub/scm/utils/dtc/dtc.git /tmp/dtc
|
||||
- make -j4 -C /tmp/dtc
|
||||
# prepare buildman environment
|
||||
- echo -e "[toolchain]\nroot = /usr" > ~/.buildman
|
||||
- echo -e "arc = /tmp/arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman
|
||||
- echo -e "\n[toolchain-alias]\nsh = sh2\n" >> ~/.buildman
|
||||
- export BUILDMAN_ROOT="root:"
|
||||
- export BUILDMAN_PPC="ppc:"
|
||||
- export BUILDMAN_ARM="arm:"
|
||||
- export BUILDMAN_SANDBOX="sandbox:"
|
||||
- echo -e "[toolchain]\n${BUILDMAN_ROOT} /\n" > ~/.buildman
|
||||
- echo -e "${BUILDMAN_PPC} /opt/eldk-5.4/powerpc/sysroots/i686-eldk-linux/usr/bin/powerpc-linux/\n" >> ~/.buildman
|
||||
- echo -e "${BUILDMAN_ARM} /opt/eldk-5.4/armv5te/sysroots/i686-eldk-linux/usr/bin/armv5te-linux-gnueabi/\n" >> ~/.buildman
|
||||
- echo -e "${BUILDMAN_SANDBOX} /usr/bin/gcc\n" >> ~/.buildman
|
||||
- export BUILDMAN_ALIAS="x86:"
|
||||
- export BUILDMAN_ALIAS_ARM="arm:"
|
||||
- echo -e "\n\n[toolchain-alias]\n${BUILDMAN_ALIAS} i386\n" >> ~/.buildman
|
||||
- echo -e "${BUILDMAN_ALIAS_ARM} armv5te\n" >> ~/.buildman
|
||||
- cat ~/.buildman
|
||||
- virtualenv /tmp/venv
|
||||
- . /tmp/venv/bin/activate
|
||||
- pip install pytest
|
||||
- grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
|
||||
- mkdir ~/grub2-arm
|
||||
- ( cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di )
|
||||
- mkdir ~/grub2-arm64
|
||||
- ( cd ~/grub2-arm64; wget -O - http://download.opensuse.org/ports/aarch64/distribution/leap/42.2/repo/oss/suse/aarch64/grub2-arm64-efi-2.02~beta2-87.1.aarch64.rpm | rpm2cpio | cpio -di )
|
||||
|
||||
env:
|
||||
global:
|
||||
- PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin
|
||||
- PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci
|
||||
- PATH=/tmp/dtc:$PATH
|
||||
- BUILD_DIR=build
|
||||
- HOSTCC="cc"
|
||||
- HOSTCXX="c++"
|
||||
|
||||
before_script:
|
||||
# install toolchains based on TOOLCHAIN} variable
|
||||
- if [[ "${TOOLCHAIN}" == *aarch64* ]]; then ./tools/buildman/buildman --fetch-arch aarch64 ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *arm* ]]; then wget ftp://ftp.denx.de/pub/eldk/5.4/targets/armv5te/eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *arm* ]]; then sh eldk-eglibc-i686-arm-toolchain-gmae-5.4.sh -y ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *avr32* ]]; then ./tools/buildman/buildman --fetch-arch avr32 ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *i386* ]]; then ./tools/buildman/buildman sandbox --fetch-arch i386 ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *sh* ]]; then ./tools/buildman/buildman --fetch-arch sh2 ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *x86_64* ]]; then
|
||||
./tools/buildman/buildman --fetch-arch x86_64;
|
||||
echo -e "\n[toolchain-prefix]\nx86 = ${HOME}/.buildman-toolchains/gcc-7.3.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman;
|
||||
fi
|
||||
- if [[ "${TOOLCHAIN}" == arc ]]; then
|
||||
wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2017.09-release/arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install.tar.gz &&
|
||||
tar -C /tmp -xf arc_gnu_2017.09_prebuilt_uclibc_le_archs_linux_install.tar.gz;
|
||||
fi
|
||||
- if [[ "${TOOLCHAIN}" == *xtensa* ]]; then
|
||||
wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
|
||||
tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
|
||||
echo -e "\n[toolchain-prefix]\nxtensa = /tmp/2018.02/${TOOLCHAIN}/bin/${TOOLCHAIN}-" >> ~/.buildman;
|
||||
fi
|
||||
# If TOOLCHAIN is unset, we're on some flavour of ARM.
|
||||
- if [[ "${TOOLCHAIN}" == "" ]]; then
|
||||
./tools/buildman/buildman --fetch-arch arm &&
|
||||
./tools/buildman/buildman --fetch-arch aarch64;
|
||||
fi
|
||||
- if [[ "${TOOLCHAIN}" == "powerpc" ]]; then ./tools/buildman/buildman --fetch-arch powerpc; fi
|
||||
- if [[ "${TOOLCHAIN}" == "riscv" ]]; then
|
||||
./tools/buildman/buildman --fetch-arch riscv64;
|
||||
echo -e "\n[toolchain-alias]\nriscv = riscv64" >> ~/.buildman;
|
||||
fi
|
||||
- if [[ "${QEMU_TARGET}" != "" ]]; then
|
||||
git clone git://git.qemu.org/qemu.git /tmp/qemu;
|
||||
pushd /tmp/qemu;
|
||||
git submodule update --init dtc &&
|
||||
git checkout v2.8.0-rc3 &&
|
||||
./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} &&
|
||||
make -j4 all install;
|
||||
popd;
|
||||
fi
|
||||
- if [[ "${TOOLCHAIN}" == *ppc* ]]; then wget ftp://ftp.denx.de/pub/eldk/5.4/targets/powerpc/eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh ; fi
|
||||
- if [[ "${TOOLCHAIN}" == *ppc* ]]; then sh eldk-eglibc-i686-powerpc-toolchain-gmae-5.4.sh -y ; fi
|
||||
|
||||
script:
|
||||
# Comments must be outside the command strings below, or the Travis parser
|
||||
# will get confused.
|
||||
#
|
||||
# Exit code 129 means warnings only.
|
||||
- if [[ "${BUILDMAN}" != "" ]]; then
|
||||
ret=0;
|
||||
tools/buildman/buildman -P -E ${BUILDMAN} || ret=$?;
|
||||
if [[ $ret -ne 0 && $ret -ne 129 ]]; then
|
||||
tools/buildman/buildman -sdeP ${BUILDMAN};
|
||||
exit $ret;
|
||||
fi;
|
||||
# the execution sequence for each test
|
||||
- if [[ "${TEST_CMD}" != "" ]]; then
|
||||
${TEST_CMD};
|
||||
fi
|
||||
# "not a_test_which_does_not_exist" is a dummy -k parameter which will
|
||||
# never prevent any test from running. That way, we can always pass
|
||||
# "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom
|
||||
# value.
|
||||
- export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD};
|
||||
cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/;
|
||||
cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi;
|
||||
cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
|
||||
if [[ "${TEST_PY_BD}" != "" ]]; then
|
||||
./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID}
|
||||
-k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}"
|
||||
--build-dir "$UBOOT_TRAVIS_BUILD_DIR";
|
||||
ret=$?;
|
||||
if [[ $ret -ne 0 ]]; then
|
||||
exit $ret;
|
||||
fi;
|
||||
fi;
|
||||
if [[ -n "${TEST_PY_TOOLS}" ]]; then
|
||||
PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
|
||||
PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
|
||||
./tools/binman/binman -t &&
|
||||
./tools/patman/patman --test &&
|
||||
./tools/buildman/buildman -t &&
|
||||
PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
|
||||
PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
|
||||
./tools/dtoc/dtoc -t;
|
||||
- if [[ "${BUILDMAN}" != "" ]]; then
|
||||
tools/buildman/buildman ${BUILDMAN};
|
||||
fi
|
||||
|
||||
matrix:
|
||||
include:
|
||||
# we need to build by vendor due to 50min time limit for builds
|
||||
# each env setting here is a dedicated build
|
||||
- name: "buildman arc"
|
||||
env:
|
||||
- BUILDMAN="arc"
|
||||
TOOLCHAIN="arc"
|
||||
- name: "buildman arm11 arm7 arm920t arm946es"
|
||||
env:
|
||||
- BUILDMAN="arm11 arm7 arm920t arm946es"
|
||||
- name: "buildman arm926ejs (non-mx,siemens,atmel,kirkwood)"
|
||||
env:
|
||||
- JOB="arm926ejs"
|
||||
BUILDMAN="arm926ejs -x mx,siemens,atmel,kirkwood"
|
||||
- name: "buildman atmel"
|
||||
env:
|
||||
- BUILDMAN="atmel"
|
||||
- name: "buildman boundary engicam toradex"
|
||||
env:
|
||||
- BUILDMAN="boundary engicam toradex"
|
||||
- name: "buildman Freescale ARM32"
|
||||
env:
|
||||
- env:
|
||||
- BUILDMAN="arm1136"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="arm1136"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="arm1176"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="arm720t"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="arm920t"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="atmel -x avr32"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="avr32"
|
||||
TOOLCHAIN="avr32"
|
||||
- env:
|
||||
- BUILDMAN="davinci"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="denx"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="freescale -x powerpc,m68k,aarch64"
|
||||
- name: "buildman Freescale AArch64"
|
||||
env:
|
||||
- BUILDMAN="freescale&aarch64"
|
||||
- name: "buildman i.MX6 (non-Freescale)"
|
||||
env:
|
||||
- BUILDMAN="mx6 -x freescale,toradex,boundary,engicam"
|
||||
- name: "buildman i.MX (non-Freescale,i.MX6,toradex)"
|
||||
env:
|
||||
- BUILDMAN="mx -x freescale,mx6,toradex"
|
||||
- name: "buildman k2"
|
||||
env:
|
||||
- BUILDMAN="k2"
|
||||
- name: "buildman samsung socfpga"
|
||||
env:
|
||||
- BUILDMAN="samsung socfpga"
|
||||
- name: "buildman sun4i"
|
||||
env:
|
||||
- BUILDMAN="sun4i"
|
||||
- name: "buildman sun5i"
|
||||
env:
|
||||
- BUILDMAN="sun5i"
|
||||
- name: "buildman sun6i"
|
||||
env:
|
||||
- BUILDMAN="sun6i"
|
||||
- name: "buildman sun7i"
|
||||
env:
|
||||
- BUILDMAN="sun7i"
|
||||
- name: "buildman sun8i"
|
||||
env:
|
||||
- BUILDMAN="sun8i"
|
||||
- name: "buildman sun9i"
|
||||
env:
|
||||
- BUILDMAN="sun9i"
|
||||
- name: "buildman sun50i"
|
||||
env:
|
||||
- BUILDMAN="sun50i"
|
||||
- name: "buildman catch-all ARM"
|
||||
env:
|
||||
- BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,pxa,rockchip,toradex,socfpga,k2,xilinx"
|
||||
- name: "buildman sandbox x86"
|
||||
env:
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="sandbox x86"
|
||||
TOOLCHAIN="x86_64"
|
||||
- name: "buildman kirkwood (excluding openrd)"
|
||||
env:
|
||||
- BUILDMAN="kirkwood -x openrd"
|
||||
- name: "buildman mvebu"
|
||||
env:
|
||||
- BUILDMAN="mvebu"
|
||||
- name: "buildman PXA (non-toradex)"
|
||||
env:
|
||||
- BUILDMAN="pxa -x toradex"
|
||||
- name: "buildman m68k"
|
||||
env:
|
||||
TOOLCHAIN="i386"
|
||||
- env:
|
||||
- BUILDMAN="kirkwood"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="m68k"
|
||||
TOOLCHAIN="m68k"
|
||||
- name: "buildman microblaze"
|
||||
env:
|
||||
- BUILDMAN="microblaze"
|
||||
TOOLCHAIN="microblaze"
|
||||
- name: "buildman mips"
|
||||
env:
|
||||
- env:
|
||||
- BUILDMAN="mips"
|
||||
TOOLCHAIN="mips"
|
||||
- name: "buildman non-Freescale PowerPC"
|
||||
env:
|
||||
- BUILDMAN="powerpc -x freescale"
|
||||
TOOLCHAIN="powerpc"
|
||||
- name: "buildman mpc85xx&freescale (excluding many)"
|
||||
env:
|
||||
- BUILDMAN="mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
|
||||
TOOLCHAIN="powerpc"
|
||||
- name: "buildman t208xrdb corenet_ds"
|
||||
env:
|
||||
- BUILDMAN="t208xrdb corenet_ds"
|
||||
TOOLCHAIN="powerpc"
|
||||
- name: "buildman Freescale PowerPC"
|
||||
env:
|
||||
- BUILDMAN="t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
|
||||
TOOLCHAIN="powerpc"
|
||||
- name: "buildman t102*"
|
||||
env:
|
||||
- BUILDMAN="t102*"
|
||||
TOOLCHAIN="powerpc"
|
||||
- name: "buildman p1_p2_rdb_pc"
|
||||
env:
|
||||
- BUILDMAN="p1_p2_rdb_pc"
|
||||
TOOLCHAIN="powerpc"
|
||||
- name: "buildman p1010rdb bsc91"
|
||||
env:
|
||||
- BUILDMAN="p1010rdb bsc91"
|
||||
TOOLCHAIN="powerpc"
|
||||
- name: "buildman siemens"
|
||||
env:
|
||||
- env:
|
||||
- BUILDMAN="mpc512x"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="mpc5xx"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="mpc5xxx"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="mpc8260"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="mpc83xx"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="mpc85xx -x freescale"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="t208xrdb t4qds t102*"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="p1_p2_rdb_pc p1010rdb"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="mpc86xx"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="mpc8xx"
|
||||
TOOLCHAIN="ppc"
|
||||
- env:
|
||||
- BUILDMAN="siemens"
|
||||
- name: "buildman tegra"
|
||||
env:
|
||||
- BUILDMAN="tegra -x toradex"
|
||||
- name: "buildman am33xx (no siemens)"
|
||||
env:
|
||||
- BUILDMAN="am33xx -x siemens"
|
||||
- name: "buildman omap"
|
||||
env:
|
||||
- BUILDMAN="omap"
|
||||
- name: "buildman uniphier"
|
||||
env:
|
||||
- BUILDMAN="uniphier"
|
||||
- name: "buildman catch-all AArch64"
|
||||
env:
|
||||
- BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip,xilinx"
|
||||
- name: "buildman rockchip"
|
||||
env:
|
||||
- BUILDMAN="rockchip"
|
||||
- name: "buildman sh"
|
||||
env:
|
||||
- BUILDMAN="sh -x arm"
|
||||
TOOLCHAIN="sh"
|
||||
- name: "buildman Xilinx (ARM)"
|
||||
env:
|
||||
- BUILDMAN="xilinx -x microblaze"
|
||||
- name: "buildman xtensa"
|
||||
env:
|
||||
- BUILDMAN="xtensa"
|
||||
TOOLCHAIN="xtensa-dc233c-elf"
|
||||
- name: "buildman riscv"
|
||||
env:
|
||||
- BUILDMAN="riscv"
|
||||
TOOLCHAIN="riscv"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="ti"
|
||||
TOOLCHAIN="arm"
|
||||
- env:
|
||||
- BUILDMAN="aarch64"
|
||||
TOOLCHAIN="aarch64"
|
||||
|
||||
# QA jobs for code analytics
|
||||
# static code analysis with cppcheck (we can add --enable=all later)
|
||||
- name: "cppcheck"
|
||||
script:
|
||||
- cppcheck --force --quiet --inline-suppr .
|
||||
- env:
|
||||
- TEST_CMD="cppcheck --force --quiet --inline-suppr ."
|
||||
# search for TODO within source tree
|
||||
- name: "grep TODO"
|
||||
script:
|
||||
- grep -r TODO .
|
||||
- env:
|
||||
- TEST_CMD="grep -r TODO ."
|
||||
# search for FIXME within source tree
|
||||
- name: "grep FIXME HACK"
|
||||
script:
|
||||
- grep -r FIXME .
|
||||
- env:
|
||||
- TEST_CMD="grep -r FIXME ."
|
||||
# search for HACK within source tree and ignore HACKKIT board
|
||||
- env:
|
||||
- TEST_CMD="grep -r HACK . | grep -v HACKKIT"
|
||||
script:
|
||||
- grep -r HACK . | grep -v HACKKIT
|
||||
# some statistics about the code base
|
||||
- name: "sloccount"
|
||||
script:
|
||||
- sloccount .
|
||||
|
||||
- env:
|
||||
- TEST_CMD="sloccount ."
|
||||
# test/py
|
||||
- name: "test/py sandbox"
|
||||
env:
|
||||
- TEST_PY_BD="sandbox"
|
||||
BUILDMAN="^sandbox$"
|
||||
TOOLCHAIN="x86_64"
|
||||
- name: "test/py sandbox_spl"
|
||||
env:
|
||||
- TEST_PY_BD="sandbox_spl"
|
||||
TEST_PY_TEST_SPEC="test_ofplatdata"
|
||||
BUILDMAN="^sandbox$"
|
||||
TOOLCHAIN="x86_64"
|
||||
TEST_PY_TOOLS="yes"
|
||||
- name: "test/py sandbox_flattree"
|
||||
env:
|
||||
- TEST_PY_BD="sandbox_flattree"
|
||||
BUILDMAN="^sandbox_flattree$"
|
||||
TOOLCHAIN="x86_64"
|
||||
- name: "test/py vexpress_ca15_tc2"
|
||||
env:
|
||||
- TEST_PY_BD="vexpress_ca15_tc2"
|
||||
TEST_PY_ID="--id qemu"
|
||||
QEMU_TARGET="arm-softmmu"
|
||||
BUILDMAN="^vexpress_ca15_tc2$"
|
||||
- name: "test/py vexpress_ca9x4"
|
||||
env:
|
||||
- TEST_PY_BD="vexpress_ca9x4"
|
||||
TEST_PY_ID="--id qemu"
|
||||
QEMU_TARGET="arm-softmmu"
|
||||
BUILDMAN="^vexpress_ca9x4$"
|
||||
- name: "test/py integratorcp_cm926ejs"
|
||||
env:
|
||||
- TEST_PY_BD="integratorcp_cm926ejs"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
TEST_PY_ID="--id qemu"
|
||||
QEMU_TARGET="arm-softmmu"
|
||||
BUILDMAN="^integratorcp_cm926ejs$"
|
||||
- name: "test/py qemu_arm"
|
||||
env:
|
||||
- TEST_PY_BD="qemu_arm"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="arm-softmmu"
|
||||
BUILDMAN="^qemu_arm$"
|
||||
- name: "test/py qemu_arm64"
|
||||
env:
|
||||
- TEST_PY_BD="qemu_arm64"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="aarch64-softmmu"
|
||||
BUILDMAN="^qemu_arm64$"
|
||||
- name: "test/py qemu_mips"
|
||||
env:
|
||||
- TEST_PY_BD="qemu_mips"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="mips-softmmu"
|
||||
BUILDMAN="^qemu_mips$"
|
||||
TOOLCHAIN="mips"
|
||||
- name: "test/py qemu_mipsel"
|
||||
env:
|
||||
- TEST_PY_BD="qemu_mipsel"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="mipsel-softmmu"
|
||||
BUILDMAN="^qemu_mipsel$"
|
||||
TOOLCHAIN="mips"
|
||||
- name: "test/py qemu_mips64"
|
||||
env:
|
||||
- TEST_PY_BD="qemu_mips64"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="mips64-softmmu"
|
||||
BUILDMAN="^qemu_mips64$"
|
||||
TOOLCHAIN="mips"
|
||||
- name: "test/py qemu_mips64el"
|
||||
env:
|
||||
- TEST_PY_BD="qemu_mips64el"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="mips64el-softmmu"
|
||||
BUILDMAN="^qemu_mips64el$"
|
||||
TOOLCHAIN="mips"
|
||||
- name: "test/py qemu-ppce500"
|
||||
env:
|
||||
- TEST_PY_BD="qemu-ppce500"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="ppc-softmmu"
|
||||
BUILDMAN="^qemu-ppce500$"
|
||||
TOOLCHAIN="powerpc"
|
||||
- name: "test/py qemu-x86"
|
||||
env:
|
||||
- TEST_PY_BD="qemu-x86"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="i386-softmmu"
|
||||
BUILDMAN="^qemu-x86$"
|
||||
TOOLCHAIN="x86_64"
|
||||
BUILD_ROM="yes"
|
||||
- name: "test/py zynq_zc702"
|
||||
env:
|
||||
- TEST_PY_BD="zynq_zc702"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="arm-softmmu"
|
||||
TEST_PY_ID="--id qemu"
|
||||
BUILDMAN="^zynq_zc702$"
|
||||
- name: "test/py xtfpga"
|
||||
env:
|
||||
- TEST_PY_BD="xtfpga"
|
||||
TEST_PY_TEST_SPEC="not sleep"
|
||||
QEMU_TARGET="xtensa-softmmu"
|
||||
TEST_PY_ID="--id qemu"
|
||||
BUILDMAN="^xtfpga$"
|
||||
TOOLCHAIN="xtensa-dc233c-elf"
|
||||
- env:
|
||||
- TEST_CMD="./test/py/test.py --bd sandbox --build"
|
||||
|
||||
# TODO make it perfect ;-r
|
||||
|
||||
2
Documentation/.gitignore
vendored
2
Documentation/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
output
|
||||
*.pyc
|
||||
@@ -1,124 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
subdir-y :=
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXBUILD = sphinx-build
|
||||
SPHINXOPTS =
|
||||
SPHINXDIRS = .
|
||||
_SPHINXDIRS = $(patsubst $(srctree)/Documentation/%/conf.py,%,$(wildcard $(srctree)/Documentation/*/conf.py))
|
||||
SPHINX_CONF = conf.py
|
||||
PAPER =
|
||||
BUILDDIR = $(obj)/output
|
||||
PDFLATEX = xelatex
|
||||
LATEXOPTS = -interaction=batchmode
|
||||
|
||||
# User-friendly check for sphinx-build
|
||||
HAVE_SPHINX := $(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi)
|
||||
|
||||
ifeq ($(HAVE_SPHINX),0)
|
||||
|
||||
.DEFAULT:
|
||||
$(warning The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed and in PATH, or set the SPHINXBUILD make variable to point to the full path of the '$(SPHINXBUILD)' executable.)
|
||||
@echo
|
||||
@./scripts/sphinx-pre-install
|
||||
@echo " SKIP Sphinx $@ target."
|
||||
|
||||
else # HAVE_SPHINX
|
||||
|
||||
# User-friendly check for pdflatex
|
||||
HAVE_PDFLATEX := $(shell if which $(PDFLATEX) >/dev/null 2>&1; then echo 1; else echo 0; fi)
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
KERNELDOC = $(srctree)/scripts/kernel-doc
|
||||
KERNELDOC_CONF = -D kerneldoc_srctree=$(srctree) -D kerneldoc_bin=$(KERNELDOC)
|
||||
ALLSPHINXOPTS = $(KERNELDOC_CONF) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS)
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
# commands; the 'cmd' from scripts/Kbuild.include is not *loopable*
|
||||
loop_cmd = $(echo-cmd) $(cmd_$(1)) || exit;
|
||||
|
||||
# $2 sphinx builder e.g. "html"
|
||||
# $3 name of the build subfolder / e.g. "media", used as:
|
||||
# * dest folder relative to $(BUILDDIR) and
|
||||
# * cache folder relative to $(BUILDDIR)/.doctrees
|
||||
# $4 dest subfolder e.g. "man" for man pages at media/man
|
||||
# $5 reST source folder relative to $(srctree)/$(src),
|
||||
# e.g. "media" for the linux-tv book-set at ./Documentation/media
|
||||
|
||||
quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
|
||||
cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media $2 && \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
|
||||
$(SPHINXBUILD) \
|
||||
-b $2 \
|
||||
-c $(abspath $(srctree)/$(src)) \
|
||||
-d $(abspath $(BUILDDIR)/.doctrees/$3) \
|
||||
-D version=$(KERNELVERSION) -D release=$(KERNELRELEASE) \
|
||||
$(ALLSPHINXOPTS) \
|
||||
$(abspath $(srctree)/$(src)/$5) \
|
||||
$(abspath $(BUILDDIR)/$3/$4)
|
||||
|
||||
htmldocs:
|
||||
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
|
||||
|
||||
linkcheckdocs:
|
||||
@$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var)))
|
||||
|
||||
latexdocs:
|
||||
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,latex,$(var),latex,$(var)))
|
||||
|
||||
ifeq ($(HAVE_PDFLATEX),0)
|
||||
|
||||
pdfdocs:
|
||||
$(warning The '$(PDFLATEX)' command was not found. Make sure you have it installed and in PATH to produce PDF output.)
|
||||
@echo " SKIP Sphinx $@ target."
|
||||
|
||||
else # HAVE_PDFLATEX
|
||||
|
||||
pdfdocs: latexdocs
|
||||
$(foreach var,$(SPHINXDIRS), $(MAKE) PDFLATEX=$(PDFLATEX) LATEXOPTS="$(LATEXOPTS)" -C $(BUILDDIR)/$(var)/latex || exit;)
|
||||
|
||||
endif # HAVE_PDFLATEX
|
||||
|
||||
epubdocs:
|
||||
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,epub,$(var),epub,$(var)))
|
||||
|
||||
xmldocs:
|
||||
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,xml,$(var),xml,$(var)))
|
||||
|
||||
endif # HAVE_SPHINX
|
||||
|
||||
# The following targets are independent of HAVE_SPHINX, and the rules should
|
||||
# work or silently pass without Sphinx.
|
||||
|
||||
refcheckdocs:
|
||||
$(Q)cd $(srctree);scripts/documentation-file-ref-check
|
||||
|
||||
cleandocs:
|
||||
$(Q)rm -rf $(BUILDDIR)
|
||||
$(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media clean
|
||||
|
||||
dochelp:
|
||||
@echo ' Linux kernel internal documentation in different formats from ReST:'
|
||||
@echo ' htmldocs - HTML'
|
||||
@echo ' latexdocs - LaTeX'
|
||||
@echo ' pdfdocs - PDF'
|
||||
@echo ' epubdocs - EPUB'
|
||||
@echo ' xmldocs - XML'
|
||||
@echo ' linkcheckdocs - check for broken external links (will connect to external hosts)'
|
||||
@echo ' refcheckdocs - check for references to non-existing files under Documentation'
|
||||
@echo ' cleandocs - clean all generated files'
|
||||
@echo
|
||||
@echo ' make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2'
|
||||
@echo ' valid values for SPHINXDIRS are: $(_SPHINXDIRS)'
|
||||
@echo
|
||||
@echo ' make SPHINX_CONF={conf-file} [target] use *additional* sphinx-build'
|
||||
@echo ' configuration. This is e.g. useful to build with nit-picking config.'
|
||||
@echo
|
||||
@echo ' Default location for the generated documents is Documentation/output'
|
||||
@@ -1,528 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# The U-Boot documentation build configuration file, created by
|
||||
# sphinx-quickstart on Fri Feb 12 13:51:46 2016.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import sphinx
|
||||
|
||||
# Get Sphinx version
|
||||
major, minor, patch = sphinx.version_info[:3]
|
||||
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
sys.path.insert(0, os.path.abspath('sphinx'))
|
||||
from load_config import loadConfig
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
needs_sphinx = '1.3'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'cdomain', 'kfigure']
|
||||
|
||||
# The name of the math extension changed on Sphinx 1.4
|
||||
if major == 1 and minor > 3:
|
||||
extensions.append("sphinx.ext.imgmath")
|
||||
else:
|
||||
extensions.append("sphinx.ext.pngmath")
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = 'Das U-Boot'
|
||||
copyright = 'The U-Boot development community'
|
||||
author = 'The U-Boot development community'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# In a normal build, version and release are are set to KERNELVERSION and
|
||||
# KERNELRELEASE, respectively, from the Makefile via Sphinx command line
|
||||
# arguments.
|
||||
#
|
||||
# The following code tries to extract the information by reading the Makefile,
|
||||
# when Sphinx is run directly (e.g. by Read the Docs).
|
||||
try:
|
||||
makefile_version = None
|
||||
makefile_patchlevel = None
|
||||
for line in open('../Makefile'):
|
||||
key, val = [x.strip() for x in line.split('=', 2)]
|
||||
if key == 'VERSION':
|
||||
makefile_version = val
|
||||
elif key == 'PATCHLEVEL':
|
||||
makefile_patchlevel = val
|
||||
if makefile_version and makefile_patchlevel:
|
||||
break
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
if makefile_version and makefile_patchlevel:
|
||||
version = release = makefile_version + '.' + makefile_patchlevel
|
||||
else:
|
||||
version = release = "unknown version"
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['output']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
||||
primary_domain = 'c'
|
||||
highlight_language = 'none'
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
|
||||
# The Read the Docs theme is available from
|
||||
# - https://github.com/snide/sphinx_rtd_theme
|
||||
# - https://pypi.python.org/pypi/sphinx_rtd_theme
|
||||
# - python-sphinx-rtd-theme package (on Debian)
|
||||
try:
|
||||
import sphinx_rtd_theme
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
except ImportError:
|
||||
sys.stderr.write('Warning: The Sphinx \'sphinx_rtd_theme\' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.\n')
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
|
||||
html_static_path = ['sphinx-static']
|
||||
|
||||
html_context = {
|
||||
'css_files': [
|
||||
'_static/theme_overrides.css',
|
||||
],
|
||||
}
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Language to be used for generating the HTML full-text search index.
|
||||
# Sphinx supports the following languages:
|
||||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
|
||||
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
|
||||
#html_search_language = 'en'
|
||||
|
||||
# A dictionary with options for the search language support, empty by default.
|
||||
# Now only 'ja' uses this config value
|
||||
#html_search_options = {'type': 'default'}
|
||||
|
||||
# The name of a javascript file (relative to the configuration directory) that
|
||||
# implements a search results scorer. If empty, the default will be used.
|
||||
#html_search_scorer = 'scorer.js'
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'TheUBootdoc'
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
'papersize': 'a4paper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
'pointsize': '8pt',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
|
||||
# Don't mangle with UTF-8 chars
|
||||
'inputenc': '',
|
||||
'utf8extra': '',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
'preamble': '''
|
||||
% Use some font with UTF-8 support with XeLaTeX
|
||||
\\usepackage{fontspec}
|
||||
\\setsansfont{DejaVu Serif}
|
||||
\\setromanfont{DejaVu Sans}
|
||||
\\setmonofont{DejaVu Sans Mono}
|
||||
|
||||
'''
|
||||
}
|
||||
|
||||
# Fix reference escape troubles with Sphinx 1.4.x
|
||||
if major == 1 and minor > 3:
|
||||
latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n'
|
||||
|
||||
if major == 1 and minor <= 4:
|
||||
latex_elements['preamble'] += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}'
|
||||
elif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)):
|
||||
latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in'
|
||||
latex_elements['preamble'] += '\\fvset{fontsize=auto}\n'
|
||||
|
||||
# Customize notice background colors on Sphinx < 1.6:
|
||||
if major == 1 and minor < 6:
|
||||
latex_elements['preamble'] += '''
|
||||
\\usepackage{ifthen}
|
||||
|
||||
% Put notes in color and let them be inside a table
|
||||
\\definecolor{NoteColor}{RGB}{204,255,255}
|
||||
\\definecolor{WarningColor}{RGB}{255,204,204}
|
||||
\\definecolor{AttentionColor}{RGB}{255,255,204}
|
||||
\\definecolor{ImportantColor}{RGB}{192,255,204}
|
||||
\\definecolor{OtherColor}{RGB}{204,204,204}
|
||||
\\newlength{\\mynoticelength}
|
||||
\\makeatletter\\newenvironment{coloredbox}[1]{%
|
||||
\\setlength{\\fboxrule}{1pt}
|
||||
\\setlength{\\fboxsep}{7pt}
|
||||
\\setlength{\\mynoticelength}{\\linewidth}
|
||||
\\addtolength{\\mynoticelength}{-2\\fboxsep}
|
||||
\\addtolength{\\mynoticelength}{-2\\fboxrule}
|
||||
\\begin{lrbox}{\\@tempboxa}\\begin{minipage}{\\mynoticelength}}{\\end{minipage}\\end{lrbox}%
|
||||
\\ifthenelse%
|
||||
{\\equal{\\py@noticetype}{note}}%
|
||||
{\\colorbox{NoteColor}{\\usebox{\\@tempboxa}}}%
|
||||
{%
|
||||
\\ifthenelse%
|
||||
{\\equal{\\py@noticetype}{warning}}%
|
||||
{\\colorbox{WarningColor}{\\usebox{\\@tempboxa}}}%
|
||||
{%
|
||||
\\ifthenelse%
|
||||
{\\equal{\\py@noticetype}{attention}}%
|
||||
{\\colorbox{AttentionColor}{\\usebox{\\@tempboxa}}}%
|
||||
{%
|
||||
\\ifthenelse%
|
||||
{\\equal{\\py@noticetype}{important}}%
|
||||
{\\colorbox{ImportantColor}{\\usebox{\\@tempboxa}}}%
|
||||
{\\colorbox{OtherColor}{\\usebox{\\@tempboxa}}}%
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
}\\makeatother
|
||||
|
||||
\\makeatletter
|
||||
\\renewenvironment{notice}[2]{%
|
||||
\\def\\py@noticetype{#1}
|
||||
\\begin{coloredbox}{#1}
|
||||
\\bf\\it
|
||||
\\par\\strong{#2}
|
||||
\\csname py@noticestart@#1\\endcsname
|
||||
}
|
||||
{
|
||||
\\csname py@noticeend@\\py@noticetype\\endcsname
|
||||
\\end{coloredbox}
|
||||
}
|
||||
\\makeatother
|
||||
|
||||
'''
|
||||
|
||||
# With Sphinx 1.6, it is possible to change the Bg color directly
|
||||
# by using:
|
||||
# \definecolor{sphinxnoteBgColor}{RGB}{204,255,255}
|
||||
# \definecolor{sphinxwarningBgColor}{RGB}{255,204,204}
|
||||
# \definecolor{sphinxattentionBgColor}{RGB}{255,255,204}
|
||||
# \definecolor{sphinximportantBgColor}{RGB}{192,255,204}
|
||||
#
|
||||
# However, it require to use sphinx heavy box with:
|
||||
#
|
||||
# \renewenvironment{sphinxlightbox} {%
|
||||
# \\begin{sphinxheavybox}
|
||||
# }
|
||||
# \\end{sphinxheavybox}
|
||||
# }
|
||||
#
|
||||
# Unfortunately, the implementation is buggy: if a note is inside a
|
||||
# table, it isn't displayed well. So, for now, let's use boring
|
||||
# black and white notes.
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
# Sorted in alphabetical order
|
||||
latex_documents = [
|
||||
('index', 'u-boot-hacker-manual.tex', 'U-Boot Hacker Manual',
|
||||
'The U-Boot development community', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'dasuboot', 'The U-Boot Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'DasUBoot', 'The U-Boot Documentation',
|
||||
author, 'DasUBoot', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
|
||||
|
||||
# -- Options for Epub output ----------------------------------------------
|
||||
|
||||
# Bibliographic Dublin Core info.
|
||||
epub_title = project
|
||||
epub_author = author
|
||||
epub_publisher = author
|
||||
epub_copyright = copyright
|
||||
|
||||
# The basename for the epub file. It defaults to the project name.
|
||||
#epub_basename = project
|
||||
|
||||
# The HTML theme for the epub output. Since the default themes are not
|
||||
# optimized for small screen space, using the same theme for HTML and epub
|
||||
# output is usually not wise. This defaults to 'epub', a theme designed to save
|
||||
# visual space.
|
||||
#epub_theme = 'epub'
|
||||
|
||||
# The language of the text. It defaults to the language option
|
||||
# or 'en' if the language is not set.
|
||||
#epub_language = ''
|
||||
|
||||
# The scheme of the identifier. Typical schemes are ISBN or URL.
|
||||
#epub_scheme = ''
|
||||
|
||||
# The unique identifier of the text. This can be a ISBN number
|
||||
# or the project homepage.
|
||||
#epub_identifier = ''
|
||||
|
||||
# A unique identification for the text.
|
||||
#epub_uid = ''
|
||||
|
||||
# A tuple containing the cover image and cover page html template filenames.
|
||||
#epub_cover = ()
|
||||
|
||||
# A sequence of (type, uri, title) tuples for the guide element of content.opf.
|
||||
#epub_guide = ()
|
||||
|
||||
# HTML files that should be inserted before the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_pre_files = []
|
||||
|
||||
# HTML files that should be inserted after the pages created by sphinx.
|
||||
# The format is a list of tuples containing the path and title.
|
||||
#epub_post_files = []
|
||||
|
||||
# A list of files that should not be packed into the epub file.
|
||||
epub_exclude_files = ['search.html']
|
||||
|
||||
# The depth of the table of contents in toc.ncx.
|
||||
#epub_tocdepth = 3
|
||||
|
||||
# Allow duplicate toc entries.
|
||||
#epub_tocdup = True
|
||||
|
||||
# Choose between 'default' and 'includehidden'.
|
||||
#epub_tocscope = 'default'
|
||||
|
||||
# Fix unsupported image types using the Pillow.
|
||||
#epub_fix_images = False
|
||||
|
||||
# Scale large images.
|
||||
#epub_max_image_width = 0
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#epub_show_urls = 'inline'
|
||||
|
||||
# If false, no index is generated.
|
||||
#epub_use_index = True
|
||||
|
||||
#=======
|
||||
# rst2pdf
|
||||
#
|
||||
# Grouping the document tree into PDF files. List of tuples
|
||||
# (source start file, target name, title, author, options).
|
||||
#
|
||||
# See the Sphinx chapter of http://ralsina.me/static/manual.pdf
|
||||
#
|
||||
# FIXME: Do not add the index file here; the result will be too big. Adding
|
||||
# multiple PDF files here actually tries to get the cross-referencing right
|
||||
# *between* PDF files.
|
||||
pdf_documents = [
|
||||
('uboot-documentation', u'U-Boot', u'U-Boot', u'J. Random Bozo'),
|
||||
]
|
||||
|
||||
# kernel-doc extension configuration for running Sphinx directly (e.g. by Read
|
||||
# the Docs). In a normal build, these are supplied from the Makefile via command
|
||||
# line arguments.
|
||||
kerneldoc_bin = '../scripts/kernel-doc'
|
||||
kerneldoc_srctree = '..'
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Since loadConfig overwrites settings from the global namespace, it has to be
|
||||
# the last statement in the conf.py file
|
||||
# ------------------------------------------------------------------------------
|
||||
loadConfig(globals())
|
||||
@@ -1,22 +0,0 @@
|
||||
gdsys AXI busses of IHS FPGA devices
|
||||
|
||||
Certain gdsys IHS FPGAs offer a interface to their built-in AXI bus with which
|
||||
the connected devices (usually IP cores) can be controlled via software.
|
||||
|
||||
Required properties:
|
||||
- compatible: must be "gdsys,ihs_axi"
|
||||
- reg: describes the address and length of the AXI bus's register map (within
|
||||
the FPGA's register space)
|
||||
|
||||
Example:
|
||||
|
||||
fpga0_axi_video0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "gdsys,ihs_axi";
|
||||
reg = <0x170 0x10>;
|
||||
|
||||
axi_dev_1 {
|
||||
...
|
||||
};
|
||||
};
|
||||
@@ -1,20 +0,0 @@
|
||||
gdsys IO endpoint of IHS FPGA devices
|
||||
|
||||
The IO endpoint of IHS FPGA devices is a packet-based transmission interface
|
||||
that allows interconnected gdsys devices to send and receive data over the
|
||||
FPGA's main ethernet connection.
|
||||
|
||||
Required properties:
|
||||
- compatible: must be "gdsys,io-endpoint"
|
||||
- reg: describes the address and length of the endpoint's register map (within
|
||||
the FPGA's register space)
|
||||
|
||||
Example:
|
||||
|
||||
fpga0_ep0 {
|
||||
compatible = "gdsys,io-endpoint";
|
||||
reg = <0x020 0x10
|
||||
0x320 0x10
|
||||
0x340 0x10
|
||||
0x360 0x10>;
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
EFI subsystem
|
||||
=============
|
||||
|
||||
Boot services
|
||||
-------------
|
||||
|
||||
.. kernel-doc:: lib/efi_loader/efi_boottime.c
|
||||
:internal:
|
||||
|
||||
Runtime services
|
||||
----------------
|
||||
|
||||
.. kernel-doc:: lib/efi_loader/efi_runtime.c
|
||||
:internal:
|
||||
@@ -1,11 +0,0 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
#######################
|
||||
U-Boot Developer Manual
|
||||
#######################
|
||||
|
||||
.. toctree::
|
||||
|
||||
efi
|
||||
linker_lists
|
||||
serial
|
||||
@@ -1,100 +0,0 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
Linker-Generated Arrays
|
||||
=======================
|
||||
|
||||
A linker list is constructed by grouping together linker input
|
||||
sections, each containing one entry of the list. Each input section
|
||||
contains a constant initialized variable which holds the entry's
|
||||
content. Linker list input sections are constructed from the list
|
||||
and entry names, plus a prefix which allows grouping all lists
|
||||
together. Assuming _list and _entry are the list and entry names,
|
||||
then the corresponding input section name is
|
||||
|
||||
::
|
||||
|
||||
.u_boot_list_ + 2_ + @_list + _2_ + @_entry
|
||||
|
||||
and the C variable name is
|
||||
|
||||
::
|
||||
|
||||
_u_boot_list + _2_ + @_list + _2_ + @_entry
|
||||
|
||||
This ensures uniqueness for both input section and C variable name.
|
||||
|
||||
Note that the names differ only in the first character, "." for the
|
||||
section and "_" for the variable, so that the linker cannot confuse
|
||||
section and symbol names. From now on, both names will be referred
|
||||
to as
|
||||
|
||||
::
|
||||
|
||||
%u_boot_list_ + 2_ + @_list + _2_ + @_entry
|
||||
|
||||
Entry variables need never be referred to directly.
|
||||
|
||||
The naming scheme for input sections allows grouping all linker lists
|
||||
into a single linker output section and grouping all entries for a
|
||||
single list.
|
||||
|
||||
Note the two '_2_' constant components in the names: their presence
|
||||
allows putting a start and end symbols around a list, by mapping
|
||||
these symbols to sections names with components "1" (before) and
|
||||
"3" (after) instead of "2" (within).
|
||||
Start and end symbols for a list can generally be defined as
|
||||
|
||||
::
|
||||
|
||||
%u_boot_list_2_ + @_list + _1_...
|
||||
%u_boot_list_2_ + @_list + _3_...
|
||||
|
||||
Start and end symbols for the whole of the linker lists area can be
|
||||
defined as
|
||||
|
||||
::
|
||||
|
||||
%u_boot_list_1_...
|
||||
%u_boot_list_3_...
|
||||
|
||||
Here is an example of the sorted sections which result from a list
|
||||
"array" made up of three entries : "first", "second" and "third",
|
||||
iterated at least once.
|
||||
|
||||
::
|
||||
|
||||
.u_boot_list_2_array_1
|
||||
.u_boot_list_2_array_2_first
|
||||
.u_boot_list_2_array_2_second
|
||||
.u_boot_list_2_array_2_third
|
||||
.u_boot_list_2_array_3
|
||||
|
||||
If lists must be divided into sublists (e.g. for iterating only on
|
||||
part of a list), one can simply give the list a name of the form
|
||||
'outer_2_inner', where 'outer' is the global list name and 'inner'
|
||||
is the sub-list name. Iterators for the whole list should use the
|
||||
global list name ("outer"); iterators for only a sub-list should use
|
||||
the full sub-list name ("outer_2_inner").
|
||||
|
||||
Here is an example of the sections generated from a global list
|
||||
named "drivers", two sub-lists named "i2c" and "pci", and iterators
|
||||
defined for the whole list and each sub-list:
|
||||
|
||||
::
|
||||
|
||||
%u_boot_list_2_drivers_1
|
||||
%u_boot_list_2_drivers_2_i2c_1
|
||||
%u_boot_list_2_drivers_2_i2c_2_first
|
||||
%u_boot_list_2_drivers_2_i2c_2_first
|
||||
%u_boot_list_2_drivers_2_i2c_2_second
|
||||
%u_boot_list_2_drivers_2_i2c_2_third
|
||||
%u_boot_list_2_drivers_2_i2c_3
|
||||
%u_boot_list_2_drivers_2_pci_1
|
||||
%u_boot_list_2_drivers_2_pci_2_first
|
||||
%u_boot_list_2_drivers_2_pci_2_second
|
||||
%u_boot_list_2_drivers_2_pci_2_third
|
||||
%u_boot_list_2_drivers_2_pci_3
|
||||
%u_boot_list_2_drivers_3
|
||||
|
||||
.. kernel-doc:: include/linker_lists.h
|
||||
:internal:
|
||||
@@ -1,38 +0,0 @@
|
||||
# Rules to convert a .h file to inline RST documentation
|
||||
|
||||
SRC_DIR=$(srctree)/Documentation/media
|
||||
PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
|
||||
API = $(srctree)/include
|
||||
|
||||
FILES = linker_lists.h.rst
|
||||
|
||||
TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
|
||||
|
||||
gen_rst = \
|
||||
echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \
|
||||
${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
|
||||
|
||||
quiet_gen_rst = echo ' PARSE $(patsubst $(srctree)/%,%,$<)'; \
|
||||
${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
|
||||
|
||||
silent_gen_rst = ${gen_rst}
|
||||
|
||||
$(BUILDDIR)/linker_lists.h.rst: ${API}/linker_lists.h ${PARSER} $(SRC_DIR)/linker_lists.h.rst.exceptions
|
||||
@$($(quiet)gen_rst)
|
||||
|
||||
# Media build rules
|
||||
|
||||
.PHONY: all html epub xml latex
|
||||
|
||||
all: $(IMGDOT) $(BUILDDIR) ${TARGETS}
|
||||
html: all
|
||||
epub: all
|
||||
xml: all
|
||||
latex: $(IMGPDF) all
|
||||
linkcheck:
|
||||
|
||||
clean:
|
||||
-rm -f $(DOTTGT) $(IMGTGT) ${TARGETS} 2>/dev/null
|
||||
|
||||
$(BUILDDIR):
|
||||
$(Q)mkdir -p $@
|
||||
@@ -1,7 +0,0 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
Serial system
|
||||
=============
|
||||
|
||||
.. kernel-doc:: drivers/serial/serial.c
|
||||
:internal:
|
||||
@@ -1,89 +0,0 @@
|
||||
/* -*- coding: utf-8; mode: css -*-
|
||||
*
|
||||
* Sphinx HTML theme customization: read the doc
|
||||
*
|
||||
*/
|
||||
|
||||
/* Interim: Code-blocks with line nos - lines and line numbers don't line up.
|
||||
* see: https://github.com/rtfd/sphinx_rtd_theme/issues/419
|
||||
*/
|
||||
|
||||
div[class^="highlight"] pre {
|
||||
line-height: normal;
|
||||
}
|
||||
.rst-content .highlight > pre {
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
@media screen {
|
||||
|
||||
/* content column
|
||||
*
|
||||
* RTD theme's default is 800px as max width for the content, but we have
|
||||
* tables with tons of columns, which need the full width of the view-port.
|
||||
*/
|
||||
|
||||
.wy-nav-content{max-width: none; }
|
||||
|
||||
/* table:
|
||||
*
|
||||
* - Sequences of whitespace should collapse into a single whitespace.
|
||||
* - make the overflow auto (scrollbar if needed)
|
||||
* - align caption "left" ("center" is unsuitable on vast tables)
|
||||
*/
|
||||
|
||||
.wy-table-responsive table td { white-space: normal; }
|
||||
.wy-table-responsive { overflow: auto; }
|
||||
.rst-content table.docutils caption { text-align: left; font-size: 100%; }
|
||||
|
||||
/* captions:
|
||||
*
|
||||
* - captions should have 100% (not 85%) font size
|
||||
* - hide the permalink symbol as long as link is not hovered
|
||||
*/
|
||||
|
||||
.toc-title {
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
caption, .wy-table caption, .rst-content table.field-list caption {
|
||||
font-size: 100%;
|
||||
}
|
||||
caption a.headerlink { opacity: 0; }
|
||||
caption a.headerlink:hover { opacity: 1; }
|
||||
|
||||
/* Menu selection and keystrokes */
|
||||
|
||||
span.menuselection {
|
||||
color: blue;
|
||||
font-family: "Courier New", Courier, monospace
|
||||
}
|
||||
|
||||
code.kbd, code.kbd span {
|
||||
color: white;
|
||||
background-color: darkblue;
|
||||
font-weight: bold;
|
||||
font-family: "Courier New", Courier, monospace
|
||||
}
|
||||
|
||||
/* fix bottom margin of lists items */
|
||||
|
||||
.rst-content .section ul li:last-child, .rst-content .section ul li p:last-child {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
/* inline literal: drop the borderbox, padding and red color */
|
||||
|
||||
code, .rst-content tt, .rst-content code {
|
||||
color: inherit;
|
||||
border: none;
|
||||
padding: unset;
|
||||
background: inherit;
|
||||
font-size: 85%;
|
||||
}
|
||||
|
||||
.rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
@@ -1,165 +0,0 @@
|
||||
# -*- coding: utf-8; mode: python -*-
|
||||
# pylint: disable=W0141,C0113,C0103,C0325
|
||||
u"""
|
||||
cdomain
|
||||
~~~~~~~
|
||||
|
||||
Replacement for the sphinx c-domain.
|
||||
|
||||
:copyright: Copyright (C) 2016 Markus Heiser
|
||||
:license: GPL Version 2, June 1991 see Linux/COPYING for details.
|
||||
|
||||
List of customizations:
|
||||
|
||||
* Moved the *duplicate C object description* warnings for function
|
||||
declarations in the nitpicky mode. See Sphinx documentation for
|
||||
the config values for ``nitpick`` and ``nitpick_ignore``.
|
||||
|
||||
* Add option 'name' to the "c:function:" directive. With option 'name' the
|
||||
ref-name of a function can be modified. E.g.::
|
||||
|
||||
.. c:function:: int ioctl( int fd, int request )
|
||||
:name: VIDIOC_LOG_STATUS
|
||||
|
||||
The func-name (e.g. ioctl) remains in the output but the ref-name changed
|
||||
from 'ioctl' to 'VIDIOC_LOG_STATUS'. The function is referenced by::
|
||||
|
||||
* :c:func:`VIDIOC_LOG_STATUS` or
|
||||
* :any:`VIDIOC_LOG_STATUS` (``:any:`` needs sphinx 1.3)
|
||||
|
||||
* Handle signatures of function-like macros well. Don't try to deduce
|
||||
arguments types of function-like macros.
|
||||
|
||||
"""
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import directives
|
||||
|
||||
import sphinx
|
||||
from sphinx import addnodes
|
||||
from sphinx.domains.c import c_funcptr_sig_re, c_sig_re
|
||||
from sphinx.domains.c import CObject as Base_CObject
|
||||
from sphinx.domains.c import CDomain as Base_CDomain
|
||||
|
||||
__version__ = '1.0'
|
||||
|
||||
# Get Sphinx version
|
||||
major, minor, patch = sphinx.version_info[:3]
|
||||
|
||||
def setup(app):
|
||||
|
||||
app.override_domain(CDomain)
|
||||
|
||||
return dict(
|
||||
version = __version__,
|
||||
parallel_read_safe = True,
|
||||
parallel_write_safe = True
|
||||
)
|
||||
|
||||
class CObject(Base_CObject):
|
||||
|
||||
"""
|
||||
Description of a C language object.
|
||||
"""
|
||||
option_spec = {
|
||||
"name" : directives.unchanged
|
||||
}
|
||||
|
||||
def handle_func_like_macro(self, sig, signode):
|
||||
u"""Handles signatures of function-like macros.
|
||||
|
||||
If the objtype is 'function' and the the signature ``sig`` is a
|
||||
function-like macro, the name of the macro is returned. Otherwise
|
||||
``False`` is returned. """
|
||||
|
||||
if not self.objtype == 'function':
|
||||
return False
|
||||
|
||||
m = c_funcptr_sig_re.match(sig)
|
||||
if m is None:
|
||||
m = c_sig_re.match(sig)
|
||||
if m is None:
|
||||
raise ValueError('no match')
|
||||
|
||||
rettype, fullname, arglist, _const = m.groups()
|
||||
arglist = arglist.strip()
|
||||
if rettype or not arglist:
|
||||
return False
|
||||
|
||||
arglist = arglist.replace('`', '').replace('\\ ', '') # remove markup
|
||||
arglist = [a.strip() for a in arglist.split(",")]
|
||||
|
||||
# has the first argument a type?
|
||||
if len(arglist[0].split(" ")) > 1:
|
||||
return False
|
||||
|
||||
# This is a function-like macro, it's arguments are typeless!
|
||||
signode += addnodes.desc_name(fullname, fullname)
|
||||
paramlist = addnodes.desc_parameterlist()
|
||||
signode += paramlist
|
||||
|
||||
for argname in arglist:
|
||||
param = addnodes.desc_parameter('', '', noemph=True)
|
||||
# separate by non-breaking space in the output
|
||||
param += nodes.emphasis(argname, argname)
|
||||
paramlist += param
|
||||
|
||||
return fullname
|
||||
|
||||
def handle_signature(self, sig, signode):
|
||||
"""Transform a C signature into RST nodes."""
|
||||
|
||||
fullname = self.handle_func_like_macro(sig, signode)
|
||||
if not fullname:
|
||||
fullname = super(CObject, self).handle_signature(sig, signode)
|
||||
|
||||
if "name" in self.options:
|
||||
if self.objtype == 'function':
|
||||
fullname = self.options["name"]
|
||||
else:
|
||||
# FIXME: handle :name: value of other declaration types?
|
||||
pass
|
||||
return fullname
|
||||
|
||||
def add_target_and_index(self, name, sig, signode):
|
||||
# for C API items we add a prefix since names are usually not qualified
|
||||
# by a module name and so easily clash with e.g. section titles
|
||||
targetname = 'c.' + name
|
||||
if targetname not in self.state.document.ids:
|
||||
signode['names'].append(targetname)
|
||||
signode['ids'].append(targetname)
|
||||
signode['first'] = (not self.names)
|
||||
self.state.document.note_explicit_target(signode)
|
||||
inv = self.env.domaindata['c']['objects']
|
||||
if (name in inv and self.env.config.nitpicky):
|
||||
if self.objtype == 'function':
|
||||
if ('c:func', name) not in self.env.config.nitpick_ignore:
|
||||
self.state_machine.reporter.warning(
|
||||
'duplicate C object description of %s, ' % name +
|
||||
'other instance in ' + self.env.doc2path(inv[name][0]),
|
||||
line=self.lineno)
|
||||
inv[name] = (self.env.docname, self.objtype)
|
||||
|
||||
indextext = self.get_index_text(name)
|
||||
if indextext:
|
||||
if major == 1 and minor < 4:
|
||||
# indexnode's tuple changed in 1.4
|
||||
# https://github.com/sphinx-doc/sphinx/commit/e6a5a3a92e938fcd75866b4227db9e0524d58f7c
|
||||
self.indexnode['entries'].append(
|
||||
('single', indextext, targetname, ''))
|
||||
else:
|
||||
self.indexnode['entries'].append(
|
||||
('single', indextext, targetname, '', None))
|
||||
|
||||
class CDomain(Base_CDomain):
|
||||
|
||||
"""C language domain."""
|
||||
name = 'c'
|
||||
label = 'C'
|
||||
directives = {
|
||||
'function': CObject,
|
||||
'member': CObject,
|
||||
'macro': CObject,
|
||||
'type': CObject,
|
||||
'var': CObject,
|
||||
}
|
||||
@@ -1,190 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8; mode: python -*-
|
||||
# pylint: disable=R0903, C0330, R0914, R0912, E0401
|
||||
|
||||
u"""
|
||||
kernel-include
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Implementation of the ``kernel-include`` reST-directive.
|
||||
|
||||
:copyright: Copyright (C) 2016 Markus Heiser
|
||||
:license: GPL Version 2, June 1991 see linux/COPYING for details.
|
||||
|
||||
The ``kernel-include`` reST-directive is a replacement for the ``include``
|
||||
directive. The ``kernel-include`` directive expand environment variables in
|
||||
the path name and allows to include files from arbitrary locations.
|
||||
|
||||
.. hint::
|
||||
|
||||
Including files from arbitrary locations (e.g. from ``/etc``) is a
|
||||
security risk for builders. This is why the ``include`` directive from
|
||||
docutils *prohibit* pathnames pointing to locations *above* the filesystem
|
||||
tree where the reST document with the include directive is placed.
|
||||
|
||||
Substrings of the form $name or ${name} are replaced by the value of
|
||||
environment variable name. Malformed variable names and references to
|
||||
non-existing variables are left unchanged.
|
||||
"""
|
||||
|
||||
# ==============================================================================
|
||||
# imports
|
||||
# ==============================================================================
|
||||
|
||||
import os.path
|
||||
|
||||
from docutils import io, nodes, statemachine
|
||||
from docutils.utils.error_reporting import SafeString, ErrorString
|
||||
from docutils.parsers.rst import directives
|
||||
from docutils.parsers.rst.directives.body import CodeBlock, NumberLines
|
||||
from docutils.parsers.rst.directives.misc import Include
|
||||
|
||||
__version__ = '1.0'
|
||||
|
||||
# ==============================================================================
|
||||
def setup(app):
|
||||
# ==============================================================================
|
||||
|
||||
app.add_directive("kernel-include", KernelInclude)
|
||||
return dict(
|
||||
version = __version__,
|
||||
parallel_read_safe = True,
|
||||
parallel_write_safe = True
|
||||
)
|
||||
|
||||
# ==============================================================================
|
||||
class KernelInclude(Include):
|
||||
# ==============================================================================
|
||||
|
||||
u"""KernelInclude (``kernel-include``) directive"""
|
||||
|
||||
def run(self):
|
||||
path = os.path.realpath(
|
||||
os.path.expandvars(self.arguments[0]))
|
||||
|
||||
# to get a bit security back, prohibit /etc:
|
||||
if path.startswith(os.sep + "etc"):
|
||||
raise self.severe(
|
||||
'Problems with "%s" directive, prohibited path: %s'
|
||||
% (self.name, path))
|
||||
|
||||
self.arguments[0] = path
|
||||
|
||||
#return super(KernelInclude, self).run() # won't work, see HINTs in _run()
|
||||
return self._run()
|
||||
|
||||
def _run(self):
|
||||
"""Include a file as part of the content of this reST file."""
|
||||
|
||||
# HINT: I had to copy&paste the whole Include.run method. I'am not happy
|
||||
# with this, but due to security reasons, the Include.run method does
|
||||
# not allow absolute or relative pathnames pointing to locations *above*
|
||||
# the filesystem tree where the reST document is placed.
|
||||
|
||||
if not self.state.document.settings.file_insertion_enabled:
|
||||
raise self.warning('"%s" directive disabled.' % self.name)
|
||||
source = self.state_machine.input_lines.source(
|
||||
self.lineno - self.state_machine.input_offset - 1)
|
||||
source_dir = os.path.dirname(os.path.abspath(source))
|
||||
path = directives.path(self.arguments[0])
|
||||
if path.startswith('<') and path.endswith('>'):
|
||||
path = os.path.join(self.standard_include_path, path[1:-1])
|
||||
path = os.path.normpath(os.path.join(source_dir, path))
|
||||
|
||||
# HINT: this is the only line I had to change / commented out:
|
||||
#path = utils.relative_path(None, path)
|
||||
|
||||
path = nodes.reprunicode(path)
|
||||
encoding = self.options.get(
|
||||
'encoding', self.state.document.settings.input_encoding)
|
||||
e_handler=self.state.document.settings.input_encoding_error_handler
|
||||
tab_width = self.options.get(
|
||||
'tab-width', self.state.document.settings.tab_width)
|
||||
try:
|
||||
self.state.document.settings.record_dependencies.add(path)
|
||||
include_file = io.FileInput(source_path=path,
|
||||
encoding=encoding,
|
||||
error_handler=e_handler)
|
||||
except UnicodeEncodeError as error:
|
||||
raise self.severe('Problems with "%s" directive path:\n'
|
||||
'Cannot encode input file path "%s" '
|
||||
'(wrong locale?).' %
|
||||
(self.name, SafeString(path)))
|
||||
except IOError as error:
|
||||
raise self.severe('Problems with "%s" directive path:\n%s.' %
|
||||
(self.name, ErrorString(error)))
|
||||
startline = self.options.get('start-line', None)
|
||||
endline = self.options.get('end-line', None)
|
||||
try:
|
||||
if startline or (endline is not None):
|
||||
lines = include_file.readlines()
|
||||
rawtext = ''.join(lines[startline:endline])
|
||||
else:
|
||||
rawtext = include_file.read()
|
||||
except UnicodeError as error:
|
||||
raise self.severe('Problem with "%s" directive:\n%s' %
|
||||
(self.name, ErrorString(error)))
|
||||
# start-after/end-before: no restrictions on newlines in match-text,
|
||||
# and no restrictions on matching inside lines vs. line boundaries
|
||||
after_text = self.options.get('start-after', None)
|
||||
if after_text:
|
||||
# skip content in rawtext before *and incl.* a matching text
|
||||
after_index = rawtext.find(after_text)
|
||||
if after_index < 0:
|
||||
raise self.severe('Problem with "start-after" option of "%s" '
|
||||
'directive:\nText not found.' % self.name)
|
||||
rawtext = rawtext[after_index + len(after_text):]
|
||||
before_text = self.options.get('end-before', None)
|
||||
if before_text:
|
||||
# skip content in rawtext after *and incl.* a matching text
|
||||
before_index = rawtext.find(before_text)
|
||||
if before_index < 0:
|
||||
raise self.severe('Problem with "end-before" option of "%s" '
|
||||
'directive:\nText not found.' % self.name)
|
||||
rawtext = rawtext[:before_index]
|
||||
|
||||
include_lines = statemachine.string2lines(rawtext, tab_width,
|
||||
convert_whitespace=True)
|
||||
if 'literal' in self.options:
|
||||
# Convert tabs to spaces, if `tab_width` is positive.
|
||||
if tab_width >= 0:
|
||||
text = rawtext.expandtabs(tab_width)
|
||||
else:
|
||||
text = rawtext
|
||||
literal_block = nodes.literal_block(rawtext, source=path,
|
||||
classes=self.options.get('class', []))
|
||||
literal_block.line = 1
|
||||
self.add_name(literal_block)
|
||||
if 'number-lines' in self.options:
|
||||
try:
|
||||
startline = int(self.options['number-lines'] or 1)
|
||||
except ValueError:
|
||||
raise self.error(':number-lines: with non-integer '
|
||||
'start value')
|
||||
endline = startline + len(include_lines)
|
||||
if text.endswith('\n'):
|
||||
text = text[:-1]
|
||||
tokens = NumberLines([([], text)], startline, endline)
|
||||
for classes, value in tokens:
|
||||
if classes:
|
||||
literal_block += nodes.inline(value, value,
|
||||
classes=classes)
|
||||
else:
|
||||
literal_block += nodes.Text(value, value)
|
||||
else:
|
||||
literal_block += nodes.Text(text, text)
|
||||
return [literal_block]
|
||||
if 'code' in self.options:
|
||||
self.options['source'] = path
|
||||
codeblock = CodeBlock(self.name,
|
||||
[self.options.pop('code')], # arguments
|
||||
self.options,
|
||||
include_lines, # content
|
||||
self.lineno,
|
||||
self.content_offset,
|
||||
self.block_text,
|
||||
self.state,
|
||||
self.state_machine)
|
||||
return codeblock.run()
|
||||
self.state_machine.insert_input(include_lines, path)
|
||||
return []
|
||||
@@ -1,146 +0,0 @@
|
||||
# coding=utf-8
|
||||
#
|
||||
# Copyright © 2016 Intel Corporation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Jani Nikula <jani.nikula@intel.com>
|
||||
#
|
||||
# Please make sure this works on both python2 and python3.
|
||||
#
|
||||
|
||||
import codecs
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import re
|
||||
import glob
|
||||
|
||||
from docutils import nodes, statemachine
|
||||
from docutils.statemachine import ViewList
|
||||
from docutils.parsers.rst import directives, Directive
|
||||
from sphinx.ext.autodoc import AutodocReporter
|
||||
|
||||
__version__ = '1.0'
|
||||
|
||||
class KernelDocDirective(Directive):
|
||||
"""Extract kernel-doc comments from the specified file"""
|
||||
required_argument = 1
|
||||
optional_arguments = 4
|
||||
option_spec = {
|
||||
'doc': directives.unchanged_required,
|
||||
'functions': directives.unchanged_required,
|
||||
'export': directives.unchanged,
|
||||
'internal': directives.unchanged,
|
||||
}
|
||||
has_content = False
|
||||
|
||||
def run(self):
|
||||
env = self.state.document.settings.env
|
||||
cmd = [env.config.kerneldoc_bin, '-rst', '-enable-lineno']
|
||||
|
||||
filename = env.config.kerneldoc_srctree + '/' + self.arguments[0]
|
||||
export_file_patterns = []
|
||||
|
||||
# Tell sphinx of the dependency
|
||||
env.note_dependency(os.path.abspath(filename))
|
||||
|
||||
tab_width = self.options.get('tab-width', self.state.document.settings.tab_width)
|
||||
|
||||
# FIXME: make this nicer and more robust against errors
|
||||
if 'export' in self.options:
|
||||
cmd += ['-export']
|
||||
export_file_patterns = str(self.options.get('export')).split()
|
||||
elif 'internal' in self.options:
|
||||
cmd += ['-internal']
|
||||
export_file_patterns = str(self.options.get('internal')).split()
|
||||
elif 'doc' in self.options:
|
||||
cmd += ['-function', str(self.options.get('doc'))]
|
||||
elif 'functions' in self.options:
|
||||
for f in str(self.options.get('functions')).split():
|
||||
cmd += ['-function', f]
|
||||
|
||||
for pattern in export_file_patterns:
|
||||
for f in glob.glob(env.config.kerneldoc_srctree + '/' + pattern):
|
||||
env.note_dependency(os.path.abspath(f))
|
||||
cmd += ['-export-file', f]
|
||||
|
||||
cmd += [filename]
|
||||
|
||||
try:
|
||||
env.app.verbose('calling kernel-doc \'%s\'' % (" ".join(cmd)))
|
||||
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
out, err = p.communicate()
|
||||
|
||||
out, err = codecs.decode(out, 'utf-8'), codecs.decode(err, 'utf-8')
|
||||
|
||||
if p.returncode != 0:
|
||||
sys.stderr.write(err)
|
||||
|
||||
env.app.warn('kernel-doc \'%s\' failed with return code %d' % (" ".join(cmd), p.returncode))
|
||||
return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
|
||||
elif env.config.kerneldoc_verbosity > 0:
|
||||
sys.stderr.write(err)
|
||||
|
||||
lines = statemachine.string2lines(out, tab_width, convert_whitespace=True)
|
||||
result = ViewList()
|
||||
|
||||
lineoffset = 0;
|
||||
line_regex = re.compile("^#define LINENO ([0-9]+)$")
|
||||
for line in lines:
|
||||
match = line_regex.search(line)
|
||||
if match:
|
||||
# sphinx counts lines from 0
|
||||
lineoffset = int(match.group(1)) - 1
|
||||
# we must eat our comments since the upset the markup
|
||||
else:
|
||||
result.append(line, filename, lineoffset)
|
||||
lineoffset += 1
|
||||
|
||||
node = nodes.section()
|
||||
buf = self.state.memo.title_styles, self.state.memo.section_level, self.state.memo.reporter
|
||||
self.state.memo.reporter = AutodocReporter(result, self.state.memo.reporter)
|
||||
self.state.memo.title_styles, self.state.memo.section_level = [], 0
|
||||
try:
|
||||
self.state.nested_parse(result, 0, node, match_titles=1)
|
||||
finally:
|
||||
self.state.memo.title_styles, self.state.memo.section_level, self.state.memo.reporter = buf
|
||||
|
||||
return node.children
|
||||
|
||||
except Exception as e: # pylint: disable=W0703
|
||||
env.app.warn('kernel-doc \'%s\' processing failed with: %s' %
|
||||
(" ".join(cmd), str(e)))
|
||||
return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
|
||||
|
||||
def setup(app):
|
||||
app.add_config_value('kerneldoc_bin', None, 'env')
|
||||
app.add_config_value('kerneldoc_srctree', None, 'env')
|
||||
app.add_config_value('kerneldoc_verbosity', 1, 'env')
|
||||
|
||||
app.add_directive('kernel-doc', KernelDocDirective)
|
||||
|
||||
return dict(
|
||||
version = __version__,
|
||||
parallel_read_safe = True,
|
||||
parallel_write_safe = True
|
||||
)
|
||||
@@ -1,551 +0,0 @@
|
||||
# -*- coding: utf-8; mode: python -*-
|
||||
# pylint: disable=C0103, R0903, R0912, R0915
|
||||
u"""
|
||||
scalable figure and image handling
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sphinx extension which implements scalable image handling.
|
||||
|
||||
:copyright: Copyright (C) 2016 Markus Heiser
|
||||
:license: GPL Version 2, June 1991 see Linux/COPYING for details.
|
||||
|
||||
The build for image formats depend on image's source format and output's
|
||||
destination format. This extension implement methods to simplify image
|
||||
handling from the author's POV. Directives like ``kernel-figure`` implement
|
||||
methods *to* always get the best output-format even if some tools are not
|
||||
installed. For more details take a look at ``convert_image(...)`` which is
|
||||
the core of all conversions.
|
||||
|
||||
* ``.. kernel-image``: for image handling / a ``.. image::`` replacement
|
||||
|
||||
* ``.. kernel-figure``: for figure handling / a ``.. figure::`` replacement
|
||||
|
||||
* ``.. kernel-render``: for render markup / a concept to embed *render*
|
||||
markups (or languages). Supported markups (see ``RENDER_MARKUP_EXT``)
|
||||
|
||||
- ``DOT``: render embedded Graphviz's **DOC**
|
||||
- ``SVG``: render embedded Scalable Vector Graphics (**SVG**)
|
||||
- ... *developable*
|
||||
|
||||
Used tools:
|
||||
|
||||
* ``dot(1)``: Graphviz (http://www.graphviz.org). If Graphviz is not
|
||||
available, the DOT language is inserted as literal-block.
|
||||
|
||||
* SVG to PDF: To generate PDF, you need at least one of this tools:
|
||||
|
||||
- ``convert(1)``: ImageMagick (https://www.imagemagick.org)
|
||||
|
||||
List of customizations:
|
||||
|
||||
* generate PDF from SVG / used by PDF (LaTeX) builder
|
||||
|
||||
* generate SVG (html-builder) and PDF (latex-builder) from DOT files.
|
||||
DOT: see http://www.graphviz.org/content/dot-language
|
||||
|
||||
"""
|
||||
|
||||
import os
|
||||
from os import path
|
||||
import subprocess
|
||||
from hashlib import sha1
|
||||
import sys
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.statemachine import ViewList
|
||||
from docutils.parsers.rst import directives
|
||||
from docutils.parsers.rst.directives import images
|
||||
import sphinx
|
||||
|
||||
from sphinx.util.nodes import clean_astext
|
||||
from six import iteritems
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
if PY3:
|
||||
_unicode = str
|
||||
else:
|
||||
_unicode = unicode
|
||||
|
||||
# Get Sphinx version
|
||||
major, minor, patch = sphinx.version_info[:3]
|
||||
if major == 1 and minor > 3:
|
||||
# patches.Figure only landed in Sphinx 1.4
|
||||
from sphinx.directives.patches import Figure # pylint: disable=C0413
|
||||
else:
|
||||
Figure = images.Figure
|
||||
|
||||
__version__ = '1.0.0'
|
||||
|
||||
# simple helper
|
||||
# -------------
|
||||
|
||||
def which(cmd):
|
||||
"""Searches the ``cmd`` in the ``PATH`` environment.
|
||||
|
||||
This *which* searches the PATH for executable ``cmd`` . First match is
|
||||
returned, if nothing is found, ``None` is returned.
|
||||
"""
|
||||
envpath = os.environ.get('PATH', None) or os.defpath
|
||||
for folder in envpath.split(os.pathsep):
|
||||
fname = folder + os.sep + cmd
|
||||
if path.isfile(fname):
|
||||
return fname
|
||||
|
||||
def mkdir(folder, mode=0o775):
|
||||
if not path.isdir(folder):
|
||||
os.makedirs(folder, mode)
|
||||
|
||||
def file2literal(fname):
|
||||
with open(fname, "r") as src:
|
||||
data = src.read()
|
||||
node = nodes.literal_block(data, data)
|
||||
return node
|
||||
|
||||
def isNewer(path1, path2):
|
||||
"""Returns True if ``path1`` is newer than ``path2``
|
||||
|
||||
If ``path1`` exists and is newer than ``path2`` the function returns
|
||||
``True`` is returned otherwise ``False``
|
||||
"""
|
||||
return (path.exists(path1)
|
||||
and os.stat(path1).st_ctime > os.stat(path2).st_ctime)
|
||||
|
||||
def pass_handle(self, node): # pylint: disable=W0613
|
||||
pass
|
||||
|
||||
# setup conversion tools and sphinx extension
|
||||
# -------------------------------------------
|
||||
|
||||
# Graphviz's dot(1) support
|
||||
dot_cmd = None
|
||||
|
||||
# ImageMagick' convert(1) support
|
||||
convert_cmd = None
|
||||
|
||||
|
||||
def setup(app):
|
||||
# check toolchain first
|
||||
app.connect('builder-inited', setupTools)
|
||||
|
||||
# image handling
|
||||
app.add_directive("kernel-image", KernelImage)
|
||||
app.add_node(kernel_image,
|
||||
html = (visit_kernel_image, pass_handle),
|
||||
latex = (visit_kernel_image, pass_handle),
|
||||
texinfo = (visit_kernel_image, pass_handle),
|
||||
text = (visit_kernel_image, pass_handle),
|
||||
man = (visit_kernel_image, pass_handle), )
|
||||
|
||||
# figure handling
|
||||
app.add_directive("kernel-figure", KernelFigure)
|
||||
app.add_node(kernel_figure,
|
||||
html = (visit_kernel_figure, pass_handle),
|
||||
latex = (visit_kernel_figure, pass_handle),
|
||||
texinfo = (visit_kernel_figure, pass_handle),
|
||||
text = (visit_kernel_figure, pass_handle),
|
||||
man = (visit_kernel_figure, pass_handle), )
|
||||
|
||||
# render handling
|
||||
app.add_directive('kernel-render', KernelRender)
|
||||
app.add_node(kernel_render,
|
||||
html = (visit_kernel_render, pass_handle),
|
||||
latex = (visit_kernel_render, pass_handle),
|
||||
texinfo = (visit_kernel_render, pass_handle),
|
||||
text = (visit_kernel_render, pass_handle),
|
||||
man = (visit_kernel_render, pass_handle), )
|
||||
|
||||
app.connect('doctree-read', add_kernel_figure_to_std_domain)
|
||||
|
||||
return dict(
|
||||
version = __version__,
|
||||
parallel_read_safe = True,
|
||||
parallel_write_safe = True
|
||||
)
|
||||
|
||||
|
||||
def setupTools(app):
|
||||
u"""
|
||||
Check available build tools and log some *verbose* messages.
|
||||
|
||||
This function is called once, when the builder is initiated.
|
||||
"""
|
||||
global dot_cmd, convert_cmd # pylint: disable=W0603
|
||||
app.verbose("kfigure: check installed tools ...")
|
||||
|
||||
dot_cmd = which('dot')
|
||||
convert_cmd = which('convert')
|
||||
|
||||
if dot_cmd:
|
||||
app.verbose("use dot(1) from: " + dot_cmd)
|
||||
else:
|
||||
app.warn("dot(1) not found, for better output quality install "
|
||||
"graphviz from http://www.graphviz.org")
|
||||
if convert_cmd:
|
||||
app.verbose("use convert(1) from: " + convert_cmd)
|
||||
else:
|
||||
app.warn(
|
||||
"convert(1) not found, for SVG to PDF conversion install "
|
||||
"ImageMagick (https://www.imagemagick.org)")
|
||||
|
||||
|
||||
# integrate conversion tools
|
||||
# --------------------------
|
||||
|
||||
RENDER_MARKUP_EXT = {
|
||||
# The '.ext' must be handled by convert_image(..) function's *in_ext* input.
|
||||
# <name> : <.ext>
|
||||
'DOT' : '.dot',
|
||||
'SVG' : '.svg'
|
||||
}
|
||||
|
||||
def convert_image(img_node, translator, src_fname=None):
|
||||
"""Convert a image node for the builder.
|
||||
|
||||
Different builder prefer different image formats, e.g. *latex* builder
|
||||
prefer PDF while *html* builder prefer SVG format for images.
|
||||
|
||||
This function handles output image formats in dependence of source the
|
||||
format (of the image) and the translator's output format.
|
||||
"""
|
||||
app = translator.builder.app
|
||||
|
||||
fname, in_ext = path.splitext(path.basename(img_node['uri']))
|
||||
if src_fname is None:
|
||||
src_fname = path.join(translator.builder.srcdir, img_node['uri'])
|
||||
if not path.exists(src_fname):
|
||||
src_fname = path.join(translator.builder.outdir, img_node['uri'])
|
||||
|
||||
dst_fname = None
|
||||
|
||||
# in kernel builds, use 'make SPHINXOPTS=-v' to see verbose messages
|
||||
|
||||
app.verbose('assert best format for: ' + img_node['uri'])
|
||||
|
||||
if in_ext == '.dot':
|
||||
|
||||
if not dot_cmd:
|
||||
app.verbose("dot from graphviz not available / include DOT raw.")
|
||||
img_node.replace_self(file2literal(src_fname))
|
||||
|
||||
elif translator.builder.format == 'latex':
|
||||
dst_fname = path.join(translator.builder.outdir, fname + '.pdf')
|
||||
img_node['uri'] = fname + '.pdf'
|
||||
img_node['candidates'] = {'*': fname + '.pdf'}
|
||||
|
||||
|
||||
elif translator.builder.format == 'html':
|
||||
dst_fname = path.join(
|
||||
translator.builder.outdir,
|
||||
translator.builder.imagedir,
|
||||
fname + '.svg')
|
||||
img_node['uri'] = path.join(
|
||||
translator.builder.imgpath, fname + '.svg')
|
||||
img_node['candidates'] = {
|
||||
'*': path.join(translator.builder.imgpath, fname + '.svg')}
|
||||
|
||||
else:
|
||||
# all other builder formats will include DOT as raw
|
||||
img_node.replace_self(file2literal(src_fname))
|
||||
|
||||
elif in_ext == '.svg':
|
||||
|
||||
if translator.builder.format == 'latex':
|
||||
if convert_cmd is None:
|
||||
app.verbose("no SVG to PDF conversion available / include SVG raw.")
|
||||
img_node.replace_self(file2literal(src_fname))
|
||||
else:
|
||||
dst_fname = path.join(translator.builder.outdir, fname + '.pdf')
|
||||
img_node['uri'] = fname + '.pdf'
|
||||
img_node['candidates'] = {'*': fname + '.pdf'}
|
||||
|
||||
if dst_fname:
|
||||
# the builder needs not to copy one more time, so pop it if exists.
|
||||
translator.builder.images.pop(img_node['uri'], None)
|
||||
_name = dst_fname[len(translator.builder.outdir) + 1:]
|
||||
|
||||
if isNewer(dst_fname, src_fname):
|
||||
app.verbose("convert: {out}/%s already exists and is newer" % _name)
|
||||
|
||||
else:
|
||||
ok = False
|
||||
mkdir(path.dirname(dst_fname))
|
||||
|
||||
if in_ext == '.dot':
|
||||
app.verbose('convert DOT to: {out}/' + _name)
|
||||
ok = dot2format(app, src_fname, dst_fname)
|
||||
|
||||
elif in_ext == '.svg':
|
||||
app.verbose('convert SVG to: {out}/' + _name)
|
||||
ok = svg2pdf(app, src_fname, dst_fname)
|
||||
|
||||
if not ok:
|
||||
img_node.replace_self(file2literal(src_fname))
|
||||
|
||||
|
||||
def dot2format(app, dot_fname, out_fname):
|
||||
"""Converts DOT file to ``out_fname`` using ``dot(1)``.
|
||||
|
||||
* ``dot_fname`` pathname of the input DOT file, including extension ``.dot``
|
||||
* ``out_fname`` pathname of the output file, including format extension
|
||||
|
||||
The *format extension* depends on the ``dot`` command (see ``man dot``
|
||||
option ``-Txxx``). Normally you will use one of the following extensions:
|
||||
|
||||
- ``.ps`` for PostScript,
|
||||
- ``.svg`` or ``svgz`` for Structured Vector Graphics,
|
||||
- ``.fig`` for XFIG graphics and
|
||||
- ``.png`` or ``gif`` for common bitmap graphics.
|
||||
|
||||
"""
|
||||
out_format = path.splitext(out_fname)[1][1:]
|
||||
cmd = [dot_cmd, '-T%s' % out_format, dot_fname]
|
||||
exit_code = 42
|
||||
|
||||
with open(out_fname, "w") as out:
|
||||
exit_code = subprocess.call(cmd, stdout = out)
|
||||
if exit_code != 0:
|
||||
app.warn("Error #%d when calling: %s" % (exit_code, " ".join(cmd)))
|
||||
return bool(exit_code == 0)
|
||||
|
||||
def svg2pdf(app, svg_fname, pdf_fname):
|
||||
"""Converts SVG to PDF with ``convert(1)`` command.
|
||||
|
||||
Uses ``convert(1)`` from ImageMagick (https://www.imagemagick.org) for
|
||||
conversion. Returns ``True`` on success and ``False`` if an error occurred.
|
||||
|
||||
* ``svg_fname`` pathname of the input SVG file with extension (``.svg``)
|
||||
* ``pdf_name`` pathname of the output PDF file with extension (``.pdf``)
|
||||
|
||||
"""
|
||||
cmd = [convert_cmd, svg_fname, pdf_fname]
|
||||
# use stdout and stderr from parent
|
||||
exit_code = subprocess.call(cmd)
|
||||
if exit_code != 0:
|
||||
app.warn("Error #%d when calling: %s" % (exit_code, " ".join(cmd)))
|
||||
return bool(exit_code == 0)
|
||||
|
||||
|
||||
# image handling
|
||||
# ---------------------
|
||||
|
||||
def visit_kernel_image(self, node): # pylint: disable=W0613
|
||||
"""Visitor of the ``kernel_image`` Node.
|
||||
|
||||
Handles the ``image`` child-node with the ``convert_image(...)``.
|
||||
"""
|
||||
img_node = node[0]
|
||||
convert_image(img_node, self)
|
||||
|
||||
class kernel_image(nodes.image):
|
||||
"""Node for ``kernel-image`` directive."""
|
||||
pass
|
||||
|
||||
class KernelImage(images.Image):
|
||||
u"""KernelImage directive
|
||||
|
||||
Earns everything from ``.. image::`` directive, except *remote URI* and
|
||||
*glob* pattern. The KernelImage wraps a image node into a
|
||||
kernel_image node. See ``visit_kernel_image``.
|
||||
"""
|
||||
|
||||
def run(self):
|
||||
uri = self.arguments[0]
|
||||
if uri.endswith('.*') or uri.find('://') != -1:
|
||||
raise self.severe(
|
||||
'Error in "%s: %s": glob pattern and remote images are not allowed'
|
||||
% (self.name, uri))
|
||||
result = images.Image.run(self)
|
||||
if len(result) == 2 or isinstance(result[0], nodes.system_message):
|
||||
return result
|
||||
(image_node,) = result
|
||||
# wrap image node into a kernel_image node / see visitors
|
||||
node = kernel_image('', image_node)
|
||||
return [node]
|
||||
|
||||
# figure handling
|
||||
# ---------------------
|
||||
|
||||
def visit_kernel_figure(self, node): # pylint: disable=W0613
|
||||
"""Visitor of the ``kernel_figure`` Node.
|
||||
|
||||
Handles the ``image`` child-node with the ``convert_image(...)``.
|
||||
"""
|
||||
img_node = node[0][0]
|
||||
convert_image(img_node, self)
|
||||
|
||||
class kernel_figure(nodes.figure):
|
||||
"""Node for ``kernel-figure`` directive."""
|
||||
|
||||
class KernelFigure(Figure):
|
||||
u"""KernelImage directive
|
||||
|
||||
Earns everything from ``.. figure::`` directive, except *remote URI* and
|
||||
*glob* pattern. The KernelFigure wraps a figure node into a kernel_figure
|
||||
node. See ``visit_kernel_figure``.
|
||||
"""
|
||||
|
||||
def run(self):
|
||||
uri = self.arguments[0]
|
||||
if uri.endswith('.*') or uri.find('://') != -1:
|
||||
raise self.severe(
|
||||
'Error in "%s: %s":'
|
||||
' glob pattern and remote images are not allowed'
|
||||
% (self.name, uri))
|
||||
result = Figure.run(self)
|
||||
if len(result) == 2 or isinstance(result[0], nodes.system_message):
|
||||
return result
|
||||
(figure_node,) = result
|
||||
# wrap figure node into a kernel_figure node / see visitors
|
||||
node = kernel_figure('', figure_node)
|
||||
return [node]
|
||||
|
||||
|
||||
# render handling
|
||||
# ---------------------
|
||||
|
||||
def visit_kernel_render(self, node):
|
||||
"""Visitor of the ``kernel_render`` Node.
|
||||
|
||||
If rendering tools available, save the markup of the ``literal_block`` child
|
||||
node into a file and replace the ``literal_block`` node with a new created
|
||||
``image`` node, pointing to the saved markup file. Afterwards, handle the
|
||||
image child-node with the ``convert_image(...)``.
|
||||
"""
|
||||
app = self.builder.app
|
||||
srclang = node.get('srclang')
|
||||
|
||||
app.verbose('visit kernel-render node lang: "%s"' % (srclang))
|
||||
|
||||
tmp_ext = RENDER_MARKUP_EXT.get(srclang, None)
|
||||
if tmp_ext is None:
|
||||
app.warn('kernel-render: "%s" unknown / include raw.' % (srclang))
|
||||
return
|
||||
|
||||
if not dot_cmd and tmp_ext == '.dot':
|
||||
app.verbose("dot from graphviz not available / include raw.")
|
||||
return
|
||||
|
||||
literal_block = node[0]
|
||||
|
||||
code = literal_block.astext()
|
||||
hashobj = code.encode('utf-8') # str(node.attributes)
|
||||
fname = path.join('%s-%s' % (srclang, sha1(hashobj).hexdigest()))
|
||||
|
||||
tmp_fname = path.join(
|
||||
self.builder.outdir, self.builder.imagedir, fname + tmp_ext)
|
||||
|
||||
if not path.isfile(tmp_fname):
|
||||
mkdir(path.dirname(tmp_fname))
|
||||
with open(tmp_fname, "w") as out:
|
||||
out.write(code)
|
||||
|
||||
img_node = nodes.image(node.rawsource, **node.attributes)
|
||||
img_node['uri'] = path.join(self.builder.imgpath, fname + tmp_ext)
|
||||
img_node['candidates'] = {
|
||||
'*': path.join(self.builder.imgpath, fname + tmp_ext)}
|
||||
|
||||
literal_block.replace_self(img_node)
|
||||
convert_image(img_node, self, tmp_fname)
|
||||
|
||||
|
||||
class kernel_render(nodes.General, nodes.Inline, nodes.Element):
|
||||
"""Node for ``kernel-render`` directive."""
|
||||
pass
|
||||
|
||||
class KernelRender(Figure):
|
||||
u"""KernelRender directive
|
||||
|
||||
Render content by external tool. Has all the options known from the
|
||||
*figure* directive, plus option ``caption``. If ``caption`` has a
|
||||
value, a figure node with the *caption* is inserted. If not, a image node is
|
||||
inserted.
|
||||
|
||||
The KernelRender directive wraps the text of the directive into a
|
||||
literal_block node and wraps it into a kernel_render node. See
|
||||
``visit_kernel_render``.
|
||||
"""
|
||||
has_content = True
|
||||
required_arguments = 1
|
||||
optional_arguments = 0
|
||||
final_argument_whitespace = False
|
||||
|
||||
# earn options from 'figure'
|
||||
option_spec = Figure.option_spec.copy()
|
||||
option_spec['caption'] = directives.unchanged
|
||||
|
||||
def run(self):
|
||||
return [self.build_node()]
|
||||
|
||||
def build_node(self):
|
||||
|
||||
srclang = self.arguments[0].strip()
|
||||
if srclang not in RENDER_MARKUP_EXT.keys():
|
||||
return [self.state_machine.reporter.warning(
|
||||
'Unknown source language "%s", use one of: %s.' % (
|
||||
srclang, ",".join(RENDER_MARKUP_EXT.keys())),
|
||||
line=self.lineno)]
|
||||
|
||||
code = '\n'.join(self.content)
|
||||
if not code.strip():
|
||||
return [self.state_machine.reporter.warning(
|
||||
'Ignoring "%s" directive without content.' % (
|
||||
self.name),
|
||||
line=self.lineno)]
|
||||
|
||||
node = kernel_render()
|
||||
node['alt'] = self.options.get('alt','')
|
||||
node['srclang'] = srclang
|
||||
literal_node = nodes.literal_block(code, code)
|
||||
node += literal_node
|
||||
|
||||
caption = self.options.get('caption')
|
||||
if caption:
|
||||
# parse caption's content
|
||||
parsed = nodes.Element()
|
||||
self.state.nested_parse(
|
||||
ViewList([caption], source=''), self.content_offset, parsed)
|
||||
caption_node = nodes.caption(
|
||||
parsed[0].rawsource, '', *parsed[0].children)
|
||||
caption_node.source = parsed[0].source
|
||||
caption_node.line = parsed[0].line
|
||||
|
||||
figure_node = nodes.figure('', node)
|
||||
for k,v in self.options.items():
|
||||
figure_node[k] = v
|
||||
figure_node += caption_node
|
||||
|
||||
node = figure_node
|
||||
|
||||
return node
|
||||
|
||||
def add_kernel_figure_to_std_domain(app, doctree):
|
||||
"""Add kernel-figure anchors to 'std' domain.
|
||||
|
||||
The ``StandardDomain.process_doc(..)`` method does not know how to resolve
|
||||
the caption (label) of ``kernel-figure`` directive (it only knows about
|
||||
standard nodes, e.g. table, figure etc.). Without any additional handling
|
||||
this will result in a 'undefined label' for kernel-figures.
|
||||
|
||||
This handle adds labels of kernel-figure to the 'std' domain labels.
|
||||
"""
|
||||
|
||||
std = app.env.domains["std"]
|
||||
docname = app.env.docname
|
||||
labels = std.data["labels"]
|
||||
|
||||
for name, explicit in iteritems(doctree.nametypes):
|
||||
if not explicit:
|
||||
continue
|
||||
labelid = doctree.nameids[name]
|
||||
if labelid is None:
|
||||
continue
|
||||
node = doctree.ids[labelid]
|
||||
|
||||
if node.tagname == 'kernel_figure':
|
||||
for n in node.next_node():
|
||||
if n.tagname == 'caption':
|
||||
sectname = clean_astext(n)
|
||||
# add label to std domain
|
||||
labels[name] = docname, labelid, sectname
|
||||
break
|
||||
@@ -1,32 +0,0 @@
|
||||
# -*- coding: utf-8; mode: python -*-
|
||||
# pylint: disable=R0903, C0330, R0914, R0912, E0401
|
||||
|
||||
import os
|
||||
import sys
|
||||
from sphinx.util.pycompat import execfile_
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
def loadConfig(namespace):
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
u"""Load an additional configuration file into *namespace*.
|
||||
|
||||
The name of the configuration file is taken from the environment
|
||||
``SPHINX_CONF``. The external configuration file extends (or overwrites) the
|
||||
configuration values from the origin ``conf.py``. With this you are able to
|
||||
maintain *build themes*. """
|
||||
|
||||
config_file = os.environ.get("SPHINX_CONF", None)
|
||||
if (config_file is not None
|
||||
and os.path.normpath(namespace["__file__"]) != os.path.normpath(config_file) ):
|
||||
config_file = os.path.abspath(config_file)
|
||||
|
||||
if os.path.isfile(config_file):
|
||||
sys.stdout.write("load additional sphinx-config: %s\n" % config_file)
|
||||
config = namespace.copy()
|
||||
config['__file__'] = config_file
|
||||
execfile_(config_file, config)
|
||||
del config['__file__']
|
||||
namespace.update(config)
|
||||
else:
|
||||
sys.stderr.write("WARNING: additional sphinx-config not found: %s\n" % config_file)
|
||||
@@ -1,401 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use Text::Tabs;
|
||||
use Getopt::Long;
|
||||
use Pod::Usage;
|
||||
|
||||
my $debug;
|
||||
my $help;
|
||||
my $man;
|
||||
|
||||
GetOptions(
|
||||
"debug" => \$debug,
|
||||
'usage|?' => \$help,
|
||||
'help' => \$man
|
||||
) or pod2usage(2);
|
||||
|
||||
pod2usage(1) if $help;
|
||||
pod2usage(-exitstatus => 0, -verbose => 2) if $man;
|
||||
pod2usage(2) if (scalar @ARGV < 2 || scalar @ARGV > 3);
|
||||
|
||||
my ($file_in, $file_out, $file_exceptions) = @ARGV;
|
||||
|
||||
my $data;
|
||||
my %ioctls;
|
||||
my %defines;
|
||||
my %typedefs;
|
||||
my %enums;
|
||||
my %enum_symbols;
|
||||
my %structs;
|
||||
|
||||
require Data::Dumper if ($debug);
|
||||
|
||||
#
|
||||
# read the file and get identifiers
|
||||
#
|
||||
|
||||
my $is_enum = 0;
|
||||
my $is_comment = 0;
|
||||
open IN, $file_in or die "Can't open $file_in";
|
||||
while (<IN>) {
|
||||
$data .= $_;
|
||||
|
||||
my $ln = $_;
|
||||
if (!$is_comment) {
|
||||
$ln =~ s,/\*.*(\*/),,g;
|
||||
|
||||
$is_comment = 1 if ($ln =~ s,/\*.*,,);
|
||||
} else {
|
||||
if ($ln =~ s,^(.*\*/),,) {
|
||||
$is_comment = 0;
|
||||
} else {
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_enum && $ln =~ m/^\s*([_\w][\w\d_]+)\s*[\,=]?/) {
|
||||
my $s = $1;
|
||||
my $n = $1;
|
||||
$n =~ tr/A-Z/a-z/;
|
||||
$n =~ tr/_/-/;
|
||||
|
||||
$enum_symbols{$s} = "\\ :ref:`$s <$n>`\\ ";
|
||||
|
||||
$is_enum = 0 if ($is_enum && m/\}/);
|
||||
next;
|
||||
}
|
||||
$is_enum = 0 if ($is_enum && m/\}/);
|
||||
|
||||
if ($ln =~ m/^\s*#\s*define\s+([_\w][\w\d_]+)\s+_IO/) {
|
||||
my $s = $1;
|
||||
my $n = $1;
|
||||
$n =~ tr/A-Z/a-z/;
|
||||
|
||||
$ioctls{$s} = "\\ :ref:`$s <$n>`\\ ";
|
||||
next;
|
||||
}
|
||||
|
||||
if ($ln =~ m/^\s*#\s*define\s+([_\w][\w\d_]+)\s+/) {
|
||||
my $s = $1;
|
||||
my $n = $1;
|
||||
$n =~ tr/A-Z/a-z/;
|
||||
$n =~ tr/_/-/;
|
||||
|
||||
$defines{$s} = "\\ :ref:`$s <$n>`\\ ";
|
||||
next;
|
||||
}
|
||||
|
||||
if ($ln =~ m/^\s*typedef\s+([_\w][\w\d_]+)\s+(.*)\s+([_\w][\w\d_]+);/) {
|
||||
my $s = $2;
|
||||
my $n = $3;
|
||||
|
||||
$typedefs{$n} = "\\ :c:type:`$n <$s>`\\ ";
|
||||
next;
|
||||
}
|
||||
if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
|
||||
|| $ln =~ m/^\s*enum\s+([_\w][\w\d_]+)$/
|
||||
|| $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)\s+\{/
|
||||
|| $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)$/) {
|
||||
my $s = $1;
|
||||
|
||||
$enums{$s} = "enum :c:type:`$s`\\ ";
|
||||
|
||||
$is_enum = $1;
|
||||
next;
|
||||
}
|
||||
if ($ln =~ m/^\s*struct\s+([_\w][\w\d_]+)\s+\{/
|
||||
|| $ln =~ m/^\s*struct\s+([[_\w][\w\d_]+)$/
|
||||
|| $ln =~ m/^\s*typedef\s*struct\s+([_\w][\w\d_]+)\s+\{/
|
||||
|| $ln =~ m/^\s*typedef\s*struct\s+([[_\w][\w\d_]+)$/
|
||||
) {
|
||||
my $s = $1;
|
||||
|
||||
$structs{$s} = "struct :c:type:`$s`\\ ";
|
||||
next;
|
||||
}
|
||||
}
|
||||
close IN;
|
||||
|
||||
#
|
||||
# Handle multi-line typedefs
|
||||
#
|
||||
|
||||
my @matches = ($data =~ m/typedef\s+struct\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,
|
||||
$data =~ m/typedef\s+enum\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,);
|
||||
foreach my $m (@matches) {
|
||||
my $s = $m;
|
||||
|
||||
$typedefs{$s} = "\\ :c:type:`$s`\\ ";
|
||||
next;
|
||||
}
|
||||
|
||||
#
|
||||
# Handle exceptions, if any
|
||||
#
|
||||
|
||||
my %def_reftype = (
|
||||
"ioctl" => ":ref",
|
||||
"define" => ":ref",
|
||||
"symbol" => ":ref",
|
||||
"typedef" => ":c:type",
|
||||
"enum" => ":c:type",
|
||||
"struct" => ":c:type",
|
||||
);
|
||||
|
||||
if ($file_exceptions) {
|
||||
open IN, $file_exceptions or die "Can't read $file_exceptions";
|
||||
while (<IN>) {
|
||||
next if (m/^\s*$/ || m/^\s*#/);
|
||||
|
||||
# Parsers to ignore a symbol
|
||||
|
||||
if (m/^ignore\s+ioctl\s+(\S+)/) {
|
||||
delete $ioctls{$1} if (exists($ioctls{$1}));
|
||||
next;
|
||||
}
|
||||
if (m/^ignore\s+define\s+(\S+)/) {
|
||||
delete $defines{$1} if (exists($defines{$1}));
|
||||
next;
|
||||
}
|
||||
if (m/^ignore\s+typedef\s+(\S+)/) {
|
||||
delete $typedefs{$1} if (exists($typedefs{$1}));
|
||||
next;
|
||||
}
|
||||
if (m/^ignore\s+enum\s+(\S+)/) {
|
||||
delete $enums{$1} if (exists($enums{$1}));
|
||||
next;
|
||||
}
|
||||
if (m/^ignore\s+struct\s+(\S+)/) {
|
||||
delete $structs{$1} if (exists($structs{$1}));
|
||||
next;
|
||||
}
|
||||
if (m/^ignore\s+symbol\s+(\S+)/) {
|
||||
delete $enum_symbols{$1} if (exists($enum_symbols{$1}));
|
||||
next;
|
||||
}
|
||||
|
||||
# Parsers to replace a symbol
|
||||
my ($type, $old, $new, $reftype);
|
||||
|
||||
if (m/^replace\s+(\S+)\s+(\S+)\s+(\S+)/) {
|
||||
$type = $1;
|
||||
$old = $2;
|
||||
$new = $3;
|
||||
} else {
|
||||
die "Can't parse $file_exceptions: $_";
|
||||
}
|
||||
|
||||
if ($new =~ m/^\:c\:(data|func|macro|type)\:\`(.+)\`/) {
|
||||
$reftype = ":c:$1";
|
||||
$new = $2;
|
||||
} elsif ($new =~ m/\:ref\:\`(.+)\`/) {
|
||||
$reftype = ":ref";
|
||||
$new = $1;
|
||||
} else {
|
||||
$reftype = $def_reftype{$type};
|
||||
}
|
||||
$new = "$reftype:`$old <$new>`";
|
||||
|
||||
if ($type eq "ioctl") {
|
||||
$ioctls{$old} = $new if (exists($ioctls{$old}));
|
||||
next;
|
||||
}
|
||||
if ($type eq "define") {
|
||||
$defines{$old} = $new if (exists($defines{$old}));
|
||||
next;
|
||||
}
|
||||
if ($type eq "symbol") {
|
||||
$enum_symbols{$old} = $new if (exists($enum_symbols{$old}));
|
||||
next;
|
||||
}
|
||||
if ($type eq "typedef") {
|
||||
$typedefs{$old} = $new if (exists($typedefs{$old}));
|
||||
next;
|
||||
}
|
||||
if ($type eq "enum") {
|
||||
$enums{$old} = $new if (exists($enums{$old}));
|
||||
next;
|
||||
}
|
||||
if ($type eq "struct") {
|
||||
$structs{$old} = $new if (exists($structs{$old}));
|
||||
next;
|
||||
}
|
||||
|
||||
die "Can't parse $file_exceptions: $_";
|
||||
}
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
print Data::Dumper->Dump([\%ioctls], [qw(*ioctls)]) if (%ioctls);
|
||||
print Data::Dumper->Dump([\%typedefs], [qw(*typedefs)]) if (%typedefs);
|
||||
print Data::Dumper->Dump([\%enums], [qw(*enums)]) if (%enums);
|
||||
print Data::Dumper->Dump([\%structs], [qw(*structs)]) if (%structs);
|
||||
print Data::Dumper->Dump([\%defines], [qw(*defines)]) if (%defines);
|
||||
print Data::Dumper->Dump([\%enum_symbols], [qw(*enum_symbols)]) if (%enum_symbols);
|
||||
}
|
||||
|
||||
#
|
||||
# Align block
|
||||
#
|
||||
$data = expand($data);
|
||||
$data = " " . $data;
|
||||
$data =~ s/\n/\n /g;
|
||||
$data =~ s/\n\s+$/\n/g;
|
||||
$data =~ s/\n\s+\n/\n\n/g;
|
||||
|
||||
#
|
||||
# Add escape codes for special characters
|
||||
#
|
||||
$data =~ s,([\_\`\*\<\>\&\\\\:\/\|\%\$\#\{\}\~\^]),\\$1,g;
|
||||
|
||||
$data =~ s,DEPRECATED,**DEPRECATED**,g;
|
||||
|
||||
#
|
||||
# Add references
|
||||
#
|
||||
|
||||
my $start_delim = "[ \n\t\(\=\*\@]";
|
||||
my $end_delim = "(\\s|,|\\\\=|\\\\:|\\;|\\\)|\\}|\\{)";
|
||||
|
||||
foreach my $r (keys %ioctls) {
|
||||
my $s = $ioctls{$r};
|
||||
|
||||
$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
|
||||
|
||||
print "$r -> $s\n" if ($debug);
|
||||
|
||||
$data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
|
||||
}
|
||||
|
||||
foreach my $r (keys %defines) {
|
||||
my $s = $defines{$r};
|
||||
|
||||
$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
|
||||
|
||||
print "$r -> $s\n" if ($debug);
|
||||
|
||||
$data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
|
||||
}
|
||||
|
||||
foreach my $r (keys %enum_symbols) {
|
||||
my $s = $enum_symbols{$r};
|
||||
|
||||
$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
|
||||
|
||||
print "$r -> $s\n" if ($debug);
|
||||
|
||||
$data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
|
||||
}
|
||||
|
||||
foreach my $r (keys %enums) {
|
||||
my $s = $enums{$r};
|
||||
|
||||
$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
|
||||
|
||||
print "$r -> $s\n" if ($debug);
|
||||
|
||||
$data =~ s/enum\s+($r)$end_delim/$s$2/g;
|
||||
}
|
||||
|
||||
foreach my $r (keys %structs) {
|
||||
my $s = $structs{$r};
|
||||
|
||||
$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
|
||||
|
||||
print "$r -> $s\n" if ($debug);
|
||||
|
||||
$data =~ s/struct\s+($r)$end_delim/$s$2/g;
|
||||
}
|
||||
|
||||
foreach my $r (keys %typedefs) {
|
||||
my $s = $typedefs{$r};
|
||||
|
||||
$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
|
||||
|
||||
print "$r -> $s\n" if ($debug);
|
||||
$data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
|
||||
}
|
||||
|
||||
$data =~ s/\\ ([\n\s])/\1/g;
|
||||
|
||||
#
|
||||
# Generate output file
|
||||
#
|
||||
|
||||
my $title = $file_in;
|
||||
$title =~ s,.*/,,;
|
||||
|
||||
open OUT, "> $file_out" or die "Can't open $file_out";
|
||||
print OUT ".. -*- coding: utf-8; mode: rst -*-\n\n";
|
||||
print OUT "$title\n";
|
||||
print OUT "=" x length($title);
|
||||
print OUT "\n\n.. parsed-literal::\n\n";
|
||||
print OUT $data;
|
||||
close OUT;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
parse_headers.pl - parse a C file, in order to identify functions, structs,
|
||||
enums and defines and create cross-references to a Sphinx book.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<parse_headers.pl> [<options>] <C_FILE> <OUT_FILE> [<EXCEPTIONS_FILE>]
|
||||
|
||||
Where <options> can be: --debug, --help or --man.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 8
|
||||
|
||||
=item B<--debug>
|
||||
|
||||
Put the script in verbose mode, useful for debugging.
|
||||
|
||||
=item B<--usage>
|
||||
|
||||
Prints a brief help message and exits.
|
||||
|
||||
=item B<--help>
|
||||
|
||||
Prints a more detailed help message and exits.
|
||||
|
||||
=back
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Convert a C header or source file (C_FILE), into a ReStructured Text
|
||||
included via ..parsed-literal block with cross-references for the
|
||||
documentation files that describe the API. It accepts an optional
|
||||
EXCEPTIONS_FILE with describes what elements will be either ignored or
|
||||
be pointed to a non-default reference.
|
||||
|
||||
The output is written at the (OUT_FILE).
|
||||
|
||||
It is capable of identifying defines, functions, structs, typedefs,
|
||||
enums and enum symbols and create cross-references for all of them.
|
||||
It is also capable of distinguish #define used for specifying a Linux
|
||||
ioctl.
|
||||
|
||||
The EXCEPTIONS_FILE contain two rules to allow ignoring a symbol or
|
||||
to replace the default references by a custom one.
|
||||
|
||||
Please read Documentation/doc-guide/parse-headers.rst at the Kernel's
|
||||
tree for more details.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
Report bugs to Mauro Carvalho Chehab <mchehab@kernel.org>
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab+samsung@kernel.org>.
|
||||
|
||||
License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>.
|
||||
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
|
||||
=cut
|
||||
@@ -1,3 +0,0 @@
|
||||
docutils==0.12
|
||||
Sphinx==1.4.9
|
||||
sphinx_rtd_theme
|
||||
@@ -1,376 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8; mode: python -*-
|
||||
# pylint: disable=C0330, R0903, R0912
|
||||
|
||||
u"""
|
||||
flat-table
|
||||
~~~~~~~~~~
|
||||
|
||||
Implementation of the ``flat-table`` reST-directive.
|
||||
|
||||
:copyright: Copyright (C) 2016 Markus Heiser
|
||||
:license: GPL Version 2, June 1991 see linux/COPYING for details.
|
||||
|
||||
The ``flat-table`` (:py:class:`FlatTable`) is a double-stage list similar to
|
||||
the ``list-table`` with some additional features:
|
||||
|
||||
* *column-span*: with the role ``cspan`` a cell can be extended through
|
||||
additional columns
|
||||
|
||||
* *row-span*: with the role ``rspan`` a cell can be extended through
|
||||
additional rows
|
||||
|
||||
* *auto span* rightmost cell of a table row over the missing cells on the
|
||||
right side of that table-row. With Option ``:fill-cells:`` this behavior
|
||||
can changed from *auto span* to *auto fill*, which automaticly inserts
|
||||
(empty) cells instead of spanning the last cell.
|
||||
|
||||
Options:
|
||||
|
||||
* header-rows: [int] count of header rows
|
||||
* stub-columns: [int] count of stub columns
|
||||
* widths: [[int] [int] ... ] widths of columns
|
||||
* fill-cells: instead of autospann missing cells, insert missing cells
|
||||
|
||||
roles:
|
||||
|
||||
* cspan: [int] additionale columns (*morecols*)
|
||||
* rspan: [int] additionale rows (*morerows*)
|
||||
"""
|
||||
|
||||
# ==============================================================================
|
||||
# imports
|
||||
# ==============================================================================
|
||||
|
||||
import sys
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.parsers.rst import directives, roles
|
||||
from docutils.parsers.rst.directives.tables import Table
|
||||
from docutils.utils import SystemMessagePropagation
|
||||
|
||||
# ==============================================================================
|
||||
# common globals
|
||||
# ==============================================================================
|
||||
|
||||
# The version numbering follows numbering of the specification
|
||||
# (Documentation/books/kernel-doc-HOWTO).
|
||||
__version__ = '1.0'
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
PY2 = sys.version_info[0] == 2
|
||||
|
||||
if PY3:
|
||||
# pylint: disable=C0103, W0622
|
||||
unicode = str
|
||||
basestring = str
|
||||
|
||||
# ==============================================================================
|
||||
def setup(app):
|
||||
# ==============================================================================
|
||||
|
||||
app.add_directive("flat-table", FlatTable)
|
||||
roles.register_local_role('cspan', c_span)
|
||||
roles.register_local_role('rspan', r_span)
|
||||
|
||||
return dict(
|
||||
version = __version__,
|
||||
parallel_read_safe = True,
|
||||
parallel_write_safe = True
|
||||
)
|
||||
|
||||
# ==============================================================================
|
||||
def c_span(name, rawtext, text, lineno, inliner, options=None, content=None):
|
||||
# ==============================================================================
|
||||
# pylint: disable=W0613
|
||||
|
||||
options = options if options is not None else {}
|
||||
content = content if content is not None else []
|
||||
nodelist = [colSpan(span=int(text))]
|
||||
msglist = []
|
||||
return nodelist, msglist
|
||||
|
||||
# ==============================================================================
|
||||
def r_span(name, rawtext, text, lineno, inliner, options=None, content=None):
|
||||
# ==============================================================================
|
||||
# pylint: disable=W0613
|
||||
|
||||
options = options if options is not None else {}
|
||||
content = content if content is not None else []
|
||||
nodelist = [rowSpan(span=int(text))]
|
||||
msglist = []
|
||||
return nodelist, msglist
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
class rowSpan(nodes.General, nodes.Element): pass # pylint: disable=C0103,C0321
|
||||
class colSpan(nodes.General, nodes.Element): pass # pylint: disable=C0103,C0321
|
||||
# ==============================================================================
|
||||
|
||||
# ==============================================================================
|
||||
class FlatTable(Table):
|
||||
# ==============================================================================
|
||||
|
||||
u"""FlatTable (``flat-table``) directive"""
|
||||
|
||||
option_spec = {
|
||||
'name': directives.unchanged
|
||||
, 'class': directives.class_option
|
||||
, 'header-rows': directives.nonnegative_int
|
||||
, 'stub-columns': directives.nonnegative_int
|
||||
, 'widths': directives.positive_int_list
|
||||
, 'fill-cells' : directives.flag }
|
||||
|
||||
def run(self):
|
||||
|
||||
if not self.content:
|
||||
error = self.state_machine.reporter.error(
|
||||
'The "%s" directive is empty; content required.' % self.name,
|
||||
nodes.literal_block(self.block_text, self.block_text),
|
||||
line=self.lineno)
|
||||
return [error]
|
||||
|
||||
title, messages = self.make_title()
|
||||
node = nodes.Element() # anonymous container for parsing
|
||||
self.state.nested_parse(self.content, self.content_offset, node)
|
||||
|
||||
tableBuilder = ListTableBuilder(self)
|
||||
tableBuilder.parseFlatTableNode(node)
|
||||
tableNode = tableBuilder.buildTableNode()
|
||||
# SDK.CONSOLE() # print --> tableNode.asdom().toprettyxml()
|
||||
if title:
|
||||
tableNode.insert(0, title)
|
||||
return [tableNode] + messages
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
class ListTableBuilder(object):
|
||||
# ==============================================================================
|
||||
|
||||
u"""Builds a table from a double-stage list"""
|
||||
|
||||
def __init__(self, directive):
|
||||
self.directive = directive
|
||||
self.rows = []
|
||||
self.max_cols = 0
|
||||
|
||||
def buildTableNode(self):
|
||||
|
||||
colwidths = self.directive.get_column_widths(self.max_cols)
|
||||
if isinstance(colwidths, tuple):
|
||||
# Since docutils 0.13, get_column_widths returns a (widths,
|
||||
# colwidths) tuple, where widths is a string (i.e. 'auto').
|
||||
# See https://sourceforge.net/p/docutils/patches/120/.
|
||||
colwidths = colwidths[1]
|
||||
stub_columns = self.directive.options.get('stub-columns', 0)
|
||||
header_rows = self.directive.options.get('header-rows', 0)
|
||||
|
||||
table = nodes.table()
|
||||
tgroup = nodes.tgroup(cols=len(colwidths))
|
||||
table += tgroup
|
||||
|
||||
|
||||
for colwidth in colwidths:
|
||||
colspec = nodes.colspec(colwidth=colwidth)
|
||||
# FIXME: It seems, that the stub method only works well in the
|
||||
# absence of rowspan (observed by the html buidler, the docutils-xml
|
||||
# build seems OK). This is not extraordinary, because there exists
|
||||
# no table directive (except *this* flat-table) which allows to
|
||||
# define coexistent of rowspan and stubs (there was no use-case
|
||||
# before flat-table). This should be reviewed (later).
|
||||
if stub_columns:
|
||||
colspec.attributes['stub'] = 1
|
||||
stub_columns -= 1
|
||||
tgroup += colspec
|
||||
stub_columns = self.directive.options.get('stub-columns', 0)
|
||||
|
||||
if header_rows:
|
||||
thead = nodes.thead()
|
||||
tgroup += thead
|
||||
for row in self.rows[:header_rows]:
|
||||
thead += self.buildTableRowNode(row)
|
||||
|
||||
tbody = nodes.tbody()
|
||||
tgroup += tbody
|
||||
|
||||
for row in self.rows[header_rows:]:
|
||||
tbody += self.buildTableRowNode(row)
|
||||
return table
|
||||
|
||||
def buildTableRowNode(self, row_data, classes=None):
|
||||
classes = [] if classes is None else classes
|
||||
row = nodes.row()
|
||||
for cell in row_data:
|
||||
if cell is None:
|
||||
continue
|
||||
cspan, rspan, cellElements = cell
|
||||
|
||||
attributes = {"classes" : classes}
|
||||
if rspan:
|
||||
attributes['morerows'] = rspan
|
||||
if cspan:
|
||||
attributes['morecols'] = cspan
|
||||
entry = nodes.entry(**attributes)
|
||||
entry.extend(cellElements)
|
||||
row += entry
|
||||
return row
|
||||
|
||||
def raiseError(self, msg):
|
||||
error = self.directive.state_machine.reporter.error(
|
||||
msg
|
||||
, nodes.literal_block(self.directive.block_text
|
||||
, self.directive.block_text)
|
||||
, line = self.directive.lineno )
|
||||
raise SystemMessagePropagation(error)
|
||||
|
||||
def parseFlatTableNode(self, node):
|
||||
u"""parses the node from a :py:class:`FlatTable` directive's body"""
|
||||
|
||||
if len(node) != 1 or not isinstance(node[0], nodes.bullet_list):
|
||||
self.raiseError(
|
||||
'Error parsing content block for the "%s" directive: '
|
||||
'exactly one bullet list expected.' % self.directive.name )
|
||||
|
||||
for rowNum, rowItem in enumerate(node[0]):
|
||||
row = self.parseRowItem(rowItem, rowNum)
|
||||
self.rows.append(row)
|
||||
self.roundOffTableDefinition()
|
||||
|
||||
def roundOffTableDefinition(self):
|
||||
u"""Round off the table definition.
|
||||
|
||||
This method rounds off the table definition in :py:member:`rows`.
|
||||
|
||||
* This method inserts the needed ``None`` values for the missing cells
|
||||
arising from spanning cells over rows and/or columns.
|
||||
|
||||
* recount the :py:member:`max_cols`
|
||||
|
||||
* Autospan or fill (option ``fill-cells``) missing cells on the right
|
||||
side of the table-row
|
||||
"""
|
||||
|
||||
y = 0
|
||||
while y < len(self.rows):
|
||||
x = 0
|
||||
|
||||
while x < len(self.rows[y]):
|
||||
cell = self.rows[y][x]
|
||||
if cell is None:
|
||||
x += 1
|
||||
continue
|
||||
cspan, rspan = cell[:2]
|
||||
# handle colspan in current row
|
||||
for c in range(cspan):
|
||||
try:
|
||||
self.rows[y].insert(x+c+1, None)
|
||||
except: # pylint: disable=W0702
|
||||
# the user sets ambiguous rowspans
|
||||
pass # SDK.CONSOLE()
|
||||
# handle colspan in spanned rows
|
||||
for r in range(rspan):
|
||||
for c in range(cspan + 1):
|
||||
try:
|
||||
self.rows[y+r+1].insert(x+c, None)
|
||||
except: # pylint: disable=W0702
|
||||
# the user sets ambiguous rowspans
|
||||
pass # SDK.CONSOLE()
|
||||
x += 1
|
||||
y += 1
|
||||
|
||||
# Insert the missing cells on the right side. For this, first
|
||||
# re-calculate the max columns.
|
||||
|
||||
for row in self.rows:
|
||||
if self.max_cols < len(row):
|
||||
self.max_cols = len(row)
|
||||
|
||||
# fill with empty cells or cellspan?
|
||||
|
||||
fill_cells = False
|
||||
if 'fill-cells' in self.directive.options:
|
||||
fill_cells = True
|
||||
|
||||
for row in self.rows:
|
||||
x = self.max_cols - len(row)
|
||||
if x and not fill_cells:
|
||||
if row[-1] is None:
|
||||
row.append( ( x - 1, 0, []) )
|
||||
else:
|
||||
cspan, rspan, content = row[-1]
|
||||
row[-1] = (cspan + x, rspan, content)
|
||||
elif x and fill_cells:
|
||||
for i in range(x):
|
||||
row.append( (0, 0, nodes.comment()) )
|
||||
|
||||
def pprint(self):
|
||||
# for debugging
|
||||
retVal = "[ "
|
||||
for row in self.rows:
|
||||
retVal += "[ "
|
||||
for col in row:
|
||||
if col is None:
|
||||
retVal += ('%r' % col)
|
||||
retVal += "\n , "
|
||||
else:
|
||||
content = col[2][0].astext()
|
||||
if len (content) > 30:
|
||||
content = content[:30] + "..."
|
||||
retVal += ('(cspan=%s, rspan=%s, %r)'
|
||||
% (col[0], col[1], content))
|
||||
retVal += "]\n , "
|
||||
retVal = retVal[:-2]
|
||||
retVal += "]\n , "
|
||||
retVal = retVal[:-2]
|
||||
return retVal + "]"
|
||||
|
||||
def parseRowItem(self, rowItem, rowNum):
|
||||
row = []
|
||||
childNo = 0
|
||||
error = False
|
||||
cell = None
|
||||
target = None
|
||||
|
||||
for child in rowItem:
|
||||
if (isinstance(child , nodes.comment)
|
||||
or isinstance(child, nodes.system_message)):
|
||||
pass
|
||||
elif isinstance(child , nodes.target):
|
||||
target = child
|
||||
elif isinstance(child, nodes.bullet_list):
|
||||
childNo += 1
|
||||
cell = child
|
||||
else:
|
||||
error = True
|
||||
break
|
||||
|
||||
if childNo != 1 or error:
|
||||
self.raiseError(
|
||||
'Error parsing content block for the "%s" directive: '
|
||||
'two-level bullet list expected, but row %s does not '
|
||||
'contain a second-level bullet list.'
|
||||
% (self.directive.name, rowNum + 1))
|
||||
|
||||
for cellItem in cell:
|
||||
cspan, rspan, cellElements = self.parseCellItem(cellItem)
|
||||
if target is not None:
|
||||
cellElements.insert(0, target)
|
||||
row.append( (cspan, rspan, cellElements) )
|
||||
return row
|
||||
|
||||
def parseCellItem(self, cellItem):
|
||||
# search and remove cspan, rspan colspec from the first element in
|
||||
# this listItem (field).
|
||||
cspan = rspan = 0
|
||||
if not len(cellItem):
|
||||
return cspan, rspan, []
|
||||
for elem in cellItem[0]:
|
||||
if isinstance(elem, colSpan):
|
||||
cspan = elem.get("span")
|
||||
elem.parent.remove(elem)
|
||||
continue
|
||||
if isinstance(elem, rowSpan):
|
||||
rspan = elem.get("span")
|
||||
elem.parent.remove(elem)
|
||||
continue
|
||||
return cspan, rspan, cellItem[:]
|
||||
391
Kconfig
391
Kconfig
@@ -14,12 +14,6 @@ source "arch/Kconfig"
|
||||
|
||||
menu "General setup"
|
||||
|
||||
config BROKEN
|
||||
bool
|
||||
help
|
||||
This option cannot be enabled. It is used as dependency
|
||||
for broken and incomplete features.
|
||||
|
||||
config LOCALVERSION
|
||||
string "Local version - append to U-Boot release"
|
||||
help
|
||||
@@ -59,69 +53,24 @@ config CC_OPTIMIZE_FOR_SIZE
|
||||
|
||||
This option is enabled by default for U-Boot.
|
||||
|
||||
config CC_COVERAGE
|
||||
bool "Enable code coverage analysis"
|
||||
depends on SANDBOX
|
||||
help
|
||||
Enabling this option will pass "--coverage" to gcc to compile
|
||||
and link code instrumented for coverage analysis.
|
||||
|
||||
config DISTRO_DEFAULTS
|
||||
bool "Select defaults suitable for booting general purpose Linux distributions"
|
||||
select AUTO_COMPLETE
|
||||
select CMDLINE_EDITING
|
||||
select CMD_BOOTI if ARM64
|
||||
default y if ARCH_SUNXI
|
||||
default n
|
||||
select CMD_BOOTZ if ARM && !ARM64
|
||||
select CMD_DHCP if CMD_NET
|
||||
select CMD_ENV_EXISTS
|
||||
select CMD_BOOTI if ARM64
|
||||
select CMD_DHCP
|
||||
select CMD_EXT2
|
||||
select CMD_EXT4
|
||||
select CMD_FAT
|
||||
select CMD_FS_GENERIC
|
||||
select CMD_PART if PARTITIONS
|
||||
select CMD_PING if CMD_NET
|
||||
select CMD_PXE if NET
|
||||
select ENV_VARS_UBOOT_CONFIG
|
||||
select CMD_MII
|
||||
select CMD_PING
|
||||
select HUSH_PARSER
|
||||
select SUPPORT_RAW_INITRD
|
||||
select SYS_LONGHELP
|
||||
imply CMD_MII if NET
|
||||
imply USE_BOOTCOMMAND
|
||||
help
|
||||
Select this to enable various options and commands which are suitable
|
||||
for building u-boot for booting general purpose Linux distributions.
|
||||
|
||||
config ENV_VARS_UBOOT_CONFIG
|
||||
bool "Add arch, board, vendor and soc variables to default environment"
|
||||
help
|
||||
Define this in order to add variables describing the
|
||||
U-Boot build configuration to the default environment.
|
||||
These will be named arch, cpu, board, vendor, and soc.
|
||||
Enabling this option will cause the following to be defined:
|
||||
- CONFIG_SYS_ARCH
|
||||
- CONFIG_SYS_CPU
|
||||
- CONFIG_SYS_BOARD
|
||||
- CONFIG_SYS_VENDOR
|
||||
- CONFIG_SYS_SOC
|
||||
|
||||
config NR_DRAM_BANKS
|
||||
int "Number of DRAM banks"
|
||||
default 4
|
||||
help
|
||||
This defines the number of DRAM banks.
|
||||
|
||||
config SYS_BOOT_GET_CMDLINE
|
||||
bool "Enable kernel command line setup"
|
||||
help
|
||||
Enables allocating and saving kernel cmdline in space between
|
||||
"bootm_low" and "bootm_low" + BOOTMAPSZ.
|
||||
|
||||
config SYS_BOOT_GET_KBD
|
||||
bool "Enable kernel board information setup"
|
||||
help
|
||||
Enables allocating and saving a kernel copy of the bd_info in
|
||||
space between "bootm_low" and "bootm_low" + BOOTMAPSZ.
|
||||
|
||||
config SYS_MALLOC_F
|
||||
bool "Enable malloc() pool before relocation"
|
||||
default y if DM
|
||||
@@ -134,7 +83,6 @@ config SYS_MALLOC_F
|
||||
config SYS_MALLOC_F_LEN
|
||||
hex "Size of malloc() pool before relocation"
|
||||
depends on SYS_MALLOC_F
|
||||
default 0x1000 if AM33XX
|
||||
default 0x400
|
||||
help
|
||||
Before relocation, memory is very limited on many platforms. Still,
|
||||
@@ -142,33 +90,6 @@ config SYS_MALLOC_F_LEN
|
||||
particular needs this to operate, so that it can allocate the
|
||||
initial serial device and any others that are needed.
|
||||
|
||||
config SYS_MALLOC_LEN
|
||||
hex "Define memory for Dynamic allocation"
|
||||
depends on ARCH_ZYNQ
|
||||
help
|
||||
This defines memory to be allocated for Dynamic allocation
|
||||
TODO: Use for other architectures
|
||||
|
||||
config SPL_SYS_MALLOC_F_LEN
|
||||
hex "Size of malloc() pool in SPL before relocation"
|
||||
depends on SYS_MALLOC_F
|
||||
default SYS_MALLOC_F_LEN
|
||||
help
|
||||
Before relocation, memory is very limited on many platforms. Still,
|
||||
we can provide a small malloc() pool if needed. Driver model in
|
||||
particular needs this to operate, so that it can allocate the
|
||||
initial serial device and any others that are needed.
|
||||
|
||||
config TPL_SYS_MALLOC_F_LEN
|
||||
hex "Size of malloc() pool in TPL before relocation"
|
||||
depends on SYS_MALLOC_F
|
||||
default SYS_MALLOC_F_LEN
|
||||
help
|
||||
Before relocation, memory is very limited on many platforms. Still,
|
||||
we can provide a small malloc() pool if needed. Driver model in
|
||||
particular needs this to operate, so that it can allocate the
|
||||
initial serial device and any others that are needed.
|
||||
|
||||
menuconfig EXPERT
|
||||
bool "Configure standard U-Boot features (expert users)"
|
||||
default y
|
||||
@@ -203,7 +124,7 @@ config TOOLS_DEBUG
|
||||
it is possible to set breakpoints on particular lines, single-step
|
||||
debug through the source code, etc.
|
||||
|
||||
endif # EXPERT
|
||||
endif
|
||||
|
||||
config PHYS_64BIT
|
||||
bool "64bit physical address support"
|
||||
@@ -212,66 +133,110 @@ config PHYS_64BIT
|
||||
This can be used not only for 64bit SoCs, but also for
|
||||
large physical address extention on 32bit SoCs.
|
||||
|
||||
config BUILD_ROM
|
||||
bool "Build U-Boot as BIOS replacement"
|
||||
depends on X86
|
||||
help
|
||||
This option allows to build a ROM version of U-Boot.
|
||||
The build process generally requires several binary blobs
|
||||
which are not shipped in the U-Boot source tree.
|
||||
Please, see doc/README.x86 for details.
|
||||
|
||||
endmenu # General setup
|
||||
|
||||
menu "Boot images"
|
||||
|
||||
config ANDROID_BOOT_IMAGE
|
||||
bool "Enable support for Android Boot Images"
|
||||
default y if FASTBOOT
|
||||
config SUPPORT_SPL
|
||||
bool
|
||||
|
||||
config SUPPORT_TPL
|
||||
bool
|
||||
|
||||
config SPL
|
||||
bool
|
||||
depends on SUPPORT_SPL
|
||||
prompt "Enable SPL"
|
||||
help
|
||||
This enables support for booting images which use the Android
|
||||
image format header.
|
||||
If you want to build SPL as well as the normal image, say Y.
|
||||
|
||||
config SPL_SYS_MALLOC_SIMPLE
|
||||
bool
|
||||
depends on SPL
|
||||
prompt "Only use malloc_simple functions in the SPL"
|
||||
help
|
||||
Say Y here to only use the *_simple malloc functions from
|
||||
malloc_simple.c, rather then using the versions from dlmalloc.c;
|
||||
this will make the SPL binary smaller at the cost of more heap
|
||||
usage as the *_simple malloc functions do not re-use free-ed mem.
|
||||
|
||||
config SPL_STACK_R
|
||||
depends on SPL
|
||||
bool "Enable SDRAM location for SPL stack"
|
||||
help
|
||||
SPL starts off execution in SRAM and thus typically has only a small
|
||||
stack available. Since SPL sets up DRAM while in its board_init_f()
|
||||
function, it is possible for the stack to move there before
|
||||
board_init_r() is reached. This option enables a special SDRAM
|
||||
location for the SPL stack. U-Boot SPL switches to this after
|
||||
board_init_f() completes, and before board_init_r() starts.
|
||||
|
||||
config SPL_STACK_R_ADDR
|
||||
depends on SPL_STACK_R
|
||||
hex "SDRAM location for SPL stack"
|
||||
help
|
||||
Specify the address in SDRAM for the SPL stack. This will be set up
|
||||
before board_init_r() is called.
|
||||
|
||||
config SPL_STACK_R_MALLOC_SIMPLE_LEN
|
||||
depends on SPL_STACK_R && SPL_SYS_MALLOC_SIMPLE
|
||||
hex "Size of malloc_simple heap after switching to DRAM SPL stack"
|
||||
default 0x100000
|
||||
help
|
||||
Specify the amount of the stack to use as memory pool for
|
||||
malloc_simple after switching the stack to DRAM. This may be set
|
||||
to give board_init_r() a larger heap then the initial heap in
|
||||
SRAM which is limited to SYS_MALLOC_F_LEN bytes.
|
||||
|
||||
config SPL_SEPARATE_BSS
|
||||
depends on SPL
|
||||
bool "BSS section is in a different memory region from text"
|
||||
help
|
||||
Some platforms need a large BSS region in SPL and can provide this
|
||||
because RAM is already set up. In this case BSS can be moved to RAM.
|
||||
This option should then be enabled so that the correct device tree
|
||||
location is used. Normally we put the device tree at the end of BSS
|
||||
but with this option enabled, it goes at _image_binary_end.
|
||||
|
||||
config TPL
|
||||
bool
|
||||
depends on SPL && SUPPORT_TPL
|
||||
prompt "Enable TPL"
|
||||
help
|
||||
If you want to build TPL as well as the normal image and SPL, say Y.
|
||||
|
||||
config FIT
|
||||
bool "Support Flattened Image Tree"
|
||||
select MD5
|
||||
select SHA1
|
||||
help
|
||||
This option allows you to boot the new uImage structure,
|
||||
This option allows to boot the new uImage structrure,
|
||||
Flattened Image Tree. FIT is formally a FDT, which can include
|
||||
images of various types (kernel, FDT blob, ramdisk, etc.)
|
||||
in a single blob. To boot this new uImage structure,
|
||||
pass the address of the blob to the "bootm" command.
|
||||
FIT is very flexible, supporting compression, multiple images,
|
||||
multiple configurations, verification through hashing and also
|
||||
verified boot (secure boot using RSA).
|
||||
verified boot (secure boot using RSA). This option enables that
|
||||
feature.
|
||||
|
||||
if FIT
|
||||
config SPL_FIT
|
||||
bool "Support Flattened Image Tree within SPL"
|
||||
depends on FIT
|
||||
depends on SPL
|
||||
|
||||
config FIT_ENABLE_SHA256_SUPPORT
|
||||
bool "Support SHA256 checksum of FIT image contents"
|
||||
default y
|
||||
select SHA256
|
||||
help
|
||||
Enable this to support SHA256 checksum of FIT image contents. A
|
||||
SHA256 checksum is a 256-bit (32-byte) hash value used to check that
|
||||
the image contents have not been corrupted. SHA256 is recommended
|
||||
for use in secure applications since (as at 2016) there is no known
|
||||
feasible attack that could produce a 'collision' with differing
|
||||
input data. Use this for the highest security. Note that only the
|
||||
SHA256 variant is supported: SHA512 and others are not currently
|
||||
supported in U-Boot.
|
||||
config FIT_VERBOSE
|
||||
bool "Display verbose messages on FIT boot"
|
||||
depends on FIT
|
||||
|
||||
config FIT_SIGNATURE
|
||||
bool "Enable signature verification of FIT uImages"
|
||||
depends on FIT
|
||||
depends on DM
|
||||
select HASH
|
||||
select RSA
|
||||
help
|
||||
This option enables signature verification of FIT uImages,
|
||||
using a hash signed and verified using RSA. If
|
||||
CONFIG_SHA_PROG_HW_ACCEL is defined, i.e support for progressive
|
||||
hashing is available using hardware, then the RSA library will use
|
||||
hashing is available using hardware, then then RSA library will use
|
||||
it. See doc/uImage.FIT/signature.txt for more details.
|
||||
|
||||
WARNING: When relying on signed FIT images with a required signature
|
||||
@@ -280,26 +245,15 @@ config FIT_SIGNATURE
|
||||
format support in this case, enable it using
|
||||
CONFIG_IMAGE_FORMAT_LEGACY.
|
||||
|
||||
config FIT_SIGNATURE_MAX_SIZE
|
||||
hex "Max size of signed FIT structures"
|
||||
depends on FIT_SIGNATURE
|
||||
default 0x10000000
|
||||
help
|
||||
This option sets a max size in bytes for verified FIT uImages.
|
||||
A sane value of 256MB protects corrupted DTB structures from overlapping
|
||||
device memory. Assure this size does not extend past expected storage
|
||||
space.
|
||||
|
||||
config FIT_VERBOSE
|
||||
bool "Show verbose messages when FIT images fail"
|
||||
help
|
||||
Generally a system will have valid FIT images so debug messages
|
||||
are a waste of code space. If you are debugging your images then
|
||||
you can enable this option to get more verbose information about
|
||||
failures.
|
||||
config SPL_FIT_SIGNATURE
|
||||
bool "Enable signature verification of FIT firmware within SPL"
|
||||
depends on SPL_FIT
|
||||
depends on SPL_DM
|
||||
select SPL_RSA
|
||||
|
||||
config FIT_BEST_MATCH
|
||||
bool "Select the best match for the kernel device tree"
|
||||
depends on FIT
|
||||
help
|
||||
When no configuration is explicitly selected, default to the
|
||||
one whose fdt's compatibility field best matches that of
|
||||
@@ -307,106 +261,14 @@ config FIT_BEST_MATCH
|
||||
most specific compatibility entry of U-Boot's fdt's root node.
|
||||
The order of entries in the configuration's fdt is ignored.
|
||||
|
||||
config FIT_IMAGE_POST_PROCESS
|
||||
bool "Enable post-processing of FIT artifacts after loading by U-Boot"
|
||||
depends on TI_SECURE_DEVICE
|
||||
config FIT_VERBOSE
|
||||
bool "Show verbose messages when FIT images fails"
|
||||
depends on FIT
|
||||
help
|
||||
Allows doing any sort of manipulation to blobs after they got extracted
|
||||
from FIT images like stripping off headers or modifying the size of the
|
||||
blob, verification, authentication, decryption etc. in a platform or
|
||||
board specific way. In order to use this feature a platform or board-
|
||||
specific implementation of board_fit_image_post_process() must be
|
||||
provided. Also, anything done during this post-processing step would
|
||||
need to be comprehended in how the images were prepared before being
|
||||
injected into the FIT creation (i.e. the blobs would have been pre-
|
||||
processed before being added to the FIT image).
|
||||
|
||||
if SPL
|
||||
|
||||
config SPL_FIT
|
||||
bool "Support Flattened Image Tree within SPL"
|
||||
depends on SPL
|
||||
select SPL_OF_LIBFDT
|
||||
|
||||
config SPL_FIT_PRINT
|
||||
bool "Support FIT printing within SPL"
|
||||
depends on SPL_FIT
|
||||
help
|
||||
Support printing the content of the fitImage in a verbose manner in SPL.
|
||||
|
||||
config SPL_FIT_SIGNATURE
|
||||
bool "Enable signature verification of FIT firmware within SPL"
|
||||
depends on SPL_DM
|
||||
select SPL_FIT
|
||||
select SPL_RSA
|
||||
|
||||
config SPL_LOAD_FIT
|
||||
bool "Enable SPL loading U-Boot as a FIT"
|
||||
select SPL_FIT
|
||||
help
|
||||
Normally with the SPL framework a legacy image is generated as part
|
||||
of the build. This contains U-Boot along with information as to
|
||||
where it should be loaded. This option instead enables generation
|
||||
of a FIT (Flat Image Tree) which provides more flexibility. In
|
||||
particular it can handle selecting from multiple device tree
|
||||
and passing the correct one to U-Boot.
|
||||
|
||||
config SPL_LOAD_FIT_FULL
|
||||
bool "Enable SPL loading U-Boot as a FIT"
|
||||
select SPL_FIT
|
||||
help
|
||||
Normally with the SPL framework a legacy image is generated as part
|
||||
of the build. This contains U-Boot along with information as to
|
||||
where it should be loaded. This option instead enables generation
|
||||
of a FIT (Flat Image Tree) which provides more flexibility. In
|
||||
particular it can handle selecting from multiple device tree
|
||||
and passing the correct one to U-Boot.
|
||||
|
||||
config SPL_FIT_IMAGE_POST_PROCESS
|
||||
bool "Enable post-processing of FIT artifacts after loading by the SPL"
|
||||
depends on SPL_LOAD_FIT
|
||||
help
|
||||
Allows doing any sort of manipulation to blobs after they got extracted
|
||||
from the U-Boot FIT image like stripping off headers or modifying the
|
||||
size of the blob, verification, authentication, decryption etc. in a
|
||||
platform or board specific way. In order to use this feature a platform
|
||||
or board-specific implementation of board_fit_image_post_process() must
|
||||
be provided. Also, anything done during this post-processing step would
|
||||
need to be comprehended in how the images were prepared before being
|
||||
injected into the FIT creation (i.e. the blobs would have been pre-
|
||||
processed before being added to the FIT image).
|
||||
|
||||
config SPL_FIT_SOURCE
|
||||
string ".its source file for U-Boot FIT image"
|
||||
depends on SPL_FIT
|
||||
help
|
||||
Specifies a (platform specific) FIT source file to generate the
|
||||
U-Boot FIT image. This could specify further image to load and/or
|
||||
execute.
|
||||
|
||||
config SPL_FIT_GENERATOR
|
||||
string ".its file generator script for U-Boot FIT image"
|
||||
depends on SPL_FIT
|
||||
default "board/sunxi/mksunxi_fit_atf.sh" if SPL_LOAD_FIT && ARCH_SUNXI
|
||||
help
|
||||
Specifies a (platform specific) script file to generate the FIT
|
||||
source file used to build the U-Boot FIT image file. This gets
|
||||
passed a list of supported device tree file stub names to
|
||||
include in the generated image.
|
||||
|
||||
endif # SPL
|
||||
|
||||
endif # FIT
|
||||
|
||||
config IMAGE_FORMAT_LEGACY
|
||||
bool "Enable support for the legacy image format"
|
||||
default y if !FIT_SIGNATURE
|
||||
help
|
||||
This option enables the legacy image format. It is enabled by
|
||||
default for backward compatibility, unless FIT_SIGNATURE is
|
||||
set where it is disabled so that unsigned images cannot be
|
||||
loaded. If a board needs the legacy image format support in this
|
||||
case, enable it here.
|
||||
Generally a system will have valid FIT images so debug messages
|
||||
are a waste of code space. If you are debugging your images then
|
||||
you can enable this option to get more verbose information about
|
||||
failures.
|
||||
|
||||
config OF_BOARD_SETUP
|
||||
bool "Set up board-specific details in device tree before boot"
|
||||
@@ -451,17 +313,51 @@ config SYS_EXTRA_OPTIONS
|
||||
new boards should not use this option.
|
||||
|
||||
config SYS_TEXT_BASE
|
||||
depends on !NIOS2 && !XTENSA
|
||||
depends on SPARC || ARC || X86 || ARCH_UNIPHIER || ARCH_ZYNQMP || \
|
||||
(M68K && !TARGET_ASTRO_MCF5373L) || MICROBLAZE || MIPS
|
||||
depends on !EFI_APP
|
||||
default 0x80800000 if ARCH_OMAP2PLUS
|
||||
default 0x4a000000 if ARCH_SUNXI && !MACH_SUN9I && !MACH_SUN8I_V3S
|
||||
default 0x2a000000 if ARCH_SUNXI && MACH_SUN9I
|
||||
default 0x42e00000 if ARCH_SUNXI && MACH_SUN8I_V3S
|
||||
hex "Text Base"
|
||||
help
|
||||
The address in memory that U-Boot will be running from, initially.
|
||||
TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture
|
||||
|
||||
config SPL_LOAD_FIT
|
||||
bool "Enable SPL loading U-Boot as a FIT"
|
||||
depends on FIT
|
||||
help
|
||||
Normally with the SPL framework a legacy image is generated as part
|
||||
of the build. This contains U-Boot along with information as to
|
||||
where it should be loaded. This option instead enables generation
|
||||
of a FIT (Flat Image Tree) which provides more flexibility. In
|
||||
particular it can handle selecting from multiple device tree
|
||||
and passing the correct one to U-Boot.
|
||||
|
||||
config SPL_FIT_IMAGE_POST_PROCESS
|
||||
bool "Enable post-processing of FIT artifacts after loading by the SPL"
|
||||
depends on SPL_LOAD_FIT && TI_SECURE_DEVICE
|
||||
help
|
||||
Allows doing any sort of manipulation to blobs after they got extracted
|
||||
from the U-Boot FIT image like stripping off headers or modifying the
|
||||
size of the blob, verification, authentication, decryption etc. in a
|
||||
platform or board specific way. In order to use this feature a platform
|
||||
or board-specific implementation of board_fit_image_post_process() must
|
||||
be provided. Also, anything done during this post-processing step would
|
||||
need to be comprehended in how the images were prepared before being
|
||||
injected into the FIT creation (i.e. the blobs would have been pre-
|
||||
processed before being added to the FIT image).
|
||||
|
||||
config FIT_IMAGE_POST_PROCESS
|
||||
bool "Enable post-processing of FIT artifacts after loading by U-Boot"
|
||||
depends on FIT && TI_SECURE_DEVICE
|
||||
help
|
||||
Allows doing any sort of manipulation to blobs after they got extracted
|
||||
from FIT images like stripping off headers or modifying the size of the
|
||||
blob, verification, authentication, decryption etc. in a platform or
|
||||
board specific way. In order to use this feature a platform or board-
|
||||
specific implementation of board_fit_image_post_process() must be
|
||||
provided. Also, anything done during this post-processing step would
|
||||
need to be comprehended in how the images were prepared before being
|
||||
injected into the FIT creation (i.e. the blobs would have been pre-
|
||||
processed before being added to the FIT image).
|
||||
|
||||
config SYS_CLK_FREQ
|
||||
depends on ARC || ARCH_SUNXI
|
||||
@@ -469,8 +365,9 @@ config SYS_CLK_FREQ
|
||||
help
|
||||
TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture
|
||||
|
||||
config ARCH_FIXUP_FDT_MEMORY
|
||||
bool "Enable arch_fixup_memory_banks() call"
|
||||
config ARCH_FIXUP_FDT
|
||||
bool "Enable arch_fixup_fdt() call"
|
||||
depends on ARM || MIPS
|
||||
default y
|
||||
help
|
||||
Enable FDT memory map syncup before OS boot. This feature can be
|
||||
@@ -479,18 +376,12 @@ config ARCH_FIXUP_FDT_MEMORY
|
||||
|
||||
endmenu # Boot images
|
||||
|
||||
source "api/Kconfig"
|
||||
|
||||
source "common/Kconfig"
|
||||
|
||||
source "cmd/Kconfig"
|
||||
|
||||
source "disk/Kconfig"
|
||||
|
||||
source "dts/Kconfig"
|
||||
|
||||
source "env/Kconfig"
|
||||
|
||||
source "net/Kconfig"
|
||||
|
||||
source "drivers/Kconfig"
|
||||
|
||||
102
Licenses/README
102
Licenses/README
@@ -1,5 +1,3 @@
|
||||
SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
U-Boot is Free Software. It is copyrighted by Wolfgang Denk and
|
||||
many others who contributed code (see the actual source code and the
|
||||
git commit messages for details). You can redistribute U-Boot and/or
|
||||
@@ -33,107 +31,27 @@ information, ...) which makes automatic processing a nightmare.
|
||||
|
||||
To make this easier, such license headers in the source files will be
|
||||
replaced with a single line reference to Unique License Identifiers
|
||||
as defined by the Linux Foundation's SPDX project [1].
|
||||
as defined by the Linux Foundation's SPDX project [1]. For example,
|
||||
in a source file the full "GPL v2.0 or later" header text will be
|
||||
replaced by a single line:
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
Ideally, the license terms of all files in the source tree should be
|
||||
defined by such License Identifiers; in no case a file can contain
|
||||
more than one such License Identifier list.
|
||||
|
||||
If a "SPDX-License-Identifier:" line references more than one Unique
|
||||
License Identifier, then this means that the respective file can be
|
||||
used under the terms of either of these licenses, i. e. with
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
SPDX-License-Identifier: GPL-2.0+ BSD-3-Clause
|
||||
|
||||
you can choose between GPL-2.0+ and BSD-3-Clause licensing.
|
||||
|
||||
We use the SPDX Unique License Identifiers here; these are available
|
||||
at [2].
|
||||
|
||||
License identifier syntax
|
||||
-------------------------
|
||||
|
||||
1. Placement:
|
||||
|
||||
The SPDX license identifier in U-Boot files shall be added at the first
|
||||
possible line in a file which can contain a comment. For the majority
|
||||
or files this is the first line, except for scripts which require the
|
||||
'#!PATH_TO_INTERPRETER' in the first line. For those scripts the SPDX
|
||||
identifier goes into the second line.
|
||||
|
||||
|
|
||||
|
||||
2. Style:
|
||||
|
||||
The SPDX license identifier is added in form of a comment. The comment
|
||||
style depends on the file type::
|
||||
|
||||
C source: // SPDX-License-Identifier: <SPDX License Expression>
|
||||
C header: /* SPDX-License-Identifier: <SPDX License Expression> */
|
||||
ASM: /* SPDX-License-Identifier: <SPDX License Expression> */
|
||||
scripts: # SPDX-License-Identifier: <SPDX License Expression>
|
||||
.rst: .. SPDX-License-Identifier: <SPDX License Expression>
|
||||
.dts{i}: // SPDX-License-Identifier: <SPDX License Expression>
|
||||
|
||||
If a specific tool cannot handle the standard comment style, then the
|
||||
appropriate comment mechanism which the tool accepts shall be used. This
|
||||
is the reason for having the "/\* \*/" style comment in C header
|
||||
files. There was build breakage observed with generated .lds files where
|
||||
'ld' failed to parse the C++ comment. This has been fixed by now, but
|
||||
there are still older assembler tools which cannot handle C++ style
|
||||
comments.
|
||||
|
||||
|
|
||||
|
||||
3. Syntax:
|
||||
|
||||
A <SPDX License Expression> is either an SPDX short form license
|
||||
identifier found on the SPDX License List, or the combination of two
|
||||
SPDX short form license identifiers separated by "WITH" when a license
|
||||
exception applies. When multiple licenses apply, an expression consists
|
||||
of keywords "AND", "OR" separating sub-expressions and surrounded by
|
||||
"(", ")" .
|
||||
|
||||
License identifiers for licenses like [L]GPL with the 'or later' option
|
||||
are constructed by using a "+" for indicating the 'or later' option.::
|
||||
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
// SPDX-License-Identifier: LGPL-2.1+
|
||||
|
||||
WITH should be used when there is a modifier to a license needed.
|
||||
For example, the linux kernel UAPI files use the expression::
|
||||
|
||||
// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
|
||||
// SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note
|
||||
|
||||
Other examples using WITH exceptions found in the linux kernel are::
|
||||
|
||||
// SPDX-License-Identifier: GPL-2.0 WITH mif-exception
|
||||
// SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0
|
||||
|
||||
Exceptions can only be used with particular License identifiers. The
|
||||
valid License identifiers are listed in the tags of the exception text
|
||||
file.
|
||||
|
||||
OR should be used if the file is dual licensed and only one license is
|
||||
to be selected. For example, some dtsi files are available under dual
|
||||
licenses::
|
||||
|
||||
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
||||
|
||||
Examples from U-Boot for license expressions in dual licensed files::
|
||||
|
||||
// SPDX-License-Identifier: GPL-2.0 OR MIT
|
||||
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
||||
|
||||
AND should be used if the file has multiple licenses whose terms all
|
||||
apply to use the file. For example, if code is inherited from another
|
||||
project and permission has been given to put it in U-Boot, but the
|
||||
original license terms need to remain in effect::
|
||||
|
||||
// SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) AND MIT
|
||||
|
||||
Another other example where both sets of license terms need to be
|
||||
adhered to is::
|
||||
|
||||
// SPDX-License-Identifier: GPL-1.0+ AND LGPL-2.1+
|
||||
|
||||
[1] http://spdx.org/
|
||||
[2] http://spdx.org/licenses/
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 2014, Renesas Electronics Corporation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in binary form, without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
1. Redistribution in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
2. The name of Renesas Electronics Corporation may not be used to endorse or
|
||||
promote products derived from this software without specific prior written
|
||||
permission.
|
||||
3. Reverse engineering, decompilation, or disassembly of this software is
|
||||
not permitted.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS ELECTRONICS CORPORATION DISCLAIMS
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND
|
||||
NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL RENESAS ELECTRONICS
|
||||
CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
343
MAINTAINERS
343
MAINTAINERS
@@ -55,27 +55,9 @@ Maintainers List (try to look for most precise areas first)
|
||||
-----------------------------------
|
||||
ARC
|
||||
M: Alexey Brodkin <alexey.brodkin@synopsys.com>
|
||||
M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
|
||||
S: Maintained
|
||||
L: uboot-snps-arc@synopsys.com
|
||||
T: git git://git.denx.de/u-boot-arc.git
|
||||
F: arch/arc/
|
||||
F: board/synopsys/
|
||||
|
||||
ARC HSDK CGU CLOCK
|
||||
M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
|
||||
S: Maintained
|
||||
L: uboot-snps-arc@synopsys.com
|
||||
F: drivers/clk/clk-hsdk-cgu.c
|
||||
F: include/dt-bindings/clock/snps,hsdk-cgu.h
|
||||
F: doc/device-tree-bindings/clock/snps,hsdk-cgu.txt
|
||||
|
||||
ARC HSDK CREG GPIO
|
||||
M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
|
||||
S: Maintained
|
||||
L: uboot-snps-arc@synopsys.com
|
||||
F: doc/device-tree-bindings/gpio/snps,creg-gpio.txt
|
||||
F: drivers/gpio/hsdk-creg-gpio.c
|
||||
|
||||
ARM
|
||||
M: Albert Aribaud <albert.u.boot@aribaud.net>
|
||||
@@ -87,7 +69,8 @@ ARM ALTERA SOCFPGA
|
||||
M: Marek Vasut <marex@denx.de>
|
||||
S: Maintainted
|
||||
T: git git://git.denx.de/u-boot-socfpga.git
|
||||
F: arch/arm/mach-socfpga/
|
||||
F: arch/arm/cpu/armv7/socfpga/
|
||||
F: board/altera/socfpga/
|
||||
|
||||
ARM ATMEL AT91
|
||||
M: Andreas Bießmann <andreas@biessmann.org>
|
||||
@@ -96,48 +79,36 @@ T: git git://git.denx.de/u-boot-atmel.git
|
||||
F: arch/arm/mach-at91/
|
||||
|
||||
ARM BROADCOM BCM283X
|
||||
M: Alexander Graf <agraf@suse.de>
|
||||
M: Stephen Warren <swarren@wwwdotorg.org>
|
||||
S: Maintained
|
||||
F: arch/arm/mach-bcm283x/
|
||||
F: drivers/gpio/bcm2835_gpio.c
|
||||
F: drivers/mmc/bcm2835_sdhci.c
|
||||
F: drivers/mmc/bcm2835_sdhost.c
|
||||
F: drivers/serial/serial_bcm283x_mu.c
|
||||
F: drivers/serial/serial_bcm283x_pl011.c
|
||||
F: drivers/video/bcm2835.c
|
||||
F: include/dm/platform_data/serial_bcm283x_mu.h
|
||||
F: drivers/pinctrl/broadcom/
|
||||
|
||||
ARM BROADCOM BCMSTB
|
||||
M: Thomas Fitzsimmons <fitzsim@fitzsim.org>
|
||||
S: Maintained
|
||||
F: arch/arm/mach-bcmstb/
|
||||
F: board/broadcom/bcmstb/
|
||||
F: configs/bcm7445_defconfig
|
||||
F: doc/README.bcm7xxx
|
||||
F: drivers/mmc/bcmstb_sdhci.c
|
||||
F: drivers/spi/bcmstb_spi.c
|
||||
|
||||
ARM FREESCALE IMX
|
||||
M: Stefano Babic <sbabic@denx.de>
|
||||
M: Fabio Estevam <fabio.estevam@nxp.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-imx.git
|
||||
F: arch/arm/cpu/arm1136/mx*/
|
||||
F: arch/arm/cpu/arm926ejs/mx*/
|
||||
F: arch/arm/cpu/arm926ejs/imx/
|
||||
F: arch/arm/cpu/armv7/mx*/
|
||||
F: arch/arm/cpu/armv7/vf610/
|
||||
F: arch/arm/mach-imx/
|
||||
F: arch/arm/cpu/imx-common/
|
||||
F: arch/arm/include/asm/arch-imx/
|
||||
F: arch/arm/include/asm/arch-mx*/
|
||||
F: arch/arm/include/asm/arch-vf610/
|
||||
F: arch/arm/include/asm/mach-imx/
|
||||
F: arch/arm/include/asm/imx-common/
|
||||
F: board/freescale/*mx*/
|
||||
|
||||
ARM HISILICON
|
||||
M: Peter Griffin <peter.griffin@linaro.org>
|
||||
S: Maintained
|
||||
F: arch/arm/cpu/armv8/hisilicon
|
||||
F: arch/arm/include/asm/arch-hi6220/
|
||||
F: arm/include/asm/arch-hi6220/
|
||||
|
||||
ARM MARVELL KIRKWOOD ARMADA-XP ARMADA-38X
|
||||
M: Prafulla Wadaskar <prafulla@marvell.com>
|
||||
@@ -147,7 +118,6 @@ S: Maintained
|
||||
T: git git://git.denx.de/u-boot-marvell.git
|
||||
F: arch/arm/mach-kirkwood/
|
||||
F: arch/arm/mach-mvebu/
|
||||
F: drivers/ata/ahci_mvebu.c
|
||||
|
||||
ARM MARVELL PXA
|
||||
M: Marek Vasut <marex@denx.de>
|
||||
@@ -156,68 +126,32 @@ T: git git://git.denx.de/u-boot-pxa.git
|
||||
F: arch/arm/cpu/pxa/
|
||||
F: arch/arm/include/asm/arch-pxa/
|
||||
|
||||
ARM OWL
|
||||
M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
|
||||
S: Maintained
|
||||
F: arch/arm/include/asm/arch-owl/
|
||||
F: arch/arm/mach-owl/
|
||||
F: board/ucRobotics/
|
||||
F: drivers/clk/owl/
|
||||
F: drivers/serial/serial_owl.c
|
||||
|
||||
ARM RENESAS RMOBILE/R-CAR
|
||||
M: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
|
||||
M: Marek Vasut <marek.vasut+renesas@gmail.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-sh.git
|
||||
F: arch/arm/mach-rmobile/
|
||||
|
||||
ARM ROCKCHIP
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
M: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-rockchip.git
|
||||
F: arch/arm/include/asm/arch-rockchip/
|
||||
F: arch/arm/mach-rockchip/
|
||||
F: board/rockchip/
|
||||
F: drivers/clk/rockchip/
|
||||
F: drivers/gpio/rk_gpio.c
|
||||
F: drivers/misc/rockchip-efuse.c
|
||||
F: drivers/mmc/rockchip_sdhci.c
|
||||
F: drivers/mmc/rockchip_dw_mmc.c
|
||||
F: drivers/pinctrl/rockchip/
|
||||
F: drivers/ram/rockchip/
|
||||
F: drivers/sysreset/sysreset_rockchip.c
|
||||
F: drivers/video/rockchip/
|
||||
F: tools/rkcommon.c
|
||||
F: tools/rkcommon.h
|
||||
F: tools/rkimage.c
|
||||
F: tools/rksd.c
|
||||
F: tools/rkspi.c
|
||||
|
||||
ARM SAMSUNG
|
||||
M: Minkyu Kang <mk7.kang@samsung.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-samsung.git
|
||||
F: arch/arm/cpu/arm920t/s3c24x0/
|
||||
F: arch/arm/mach-exynos/
|
||||
F: arch/arm/mach-s5pc1xx/
|
||||
F: arch/arm/cpu/armv7/s5p-common/
|
||||
F: arch/arm/include/asm/arch-s3c24x0/
|
||||
|
||||
ARM SNAPDRAGON
|
||||
M: Ramon Fried <ramon.fried@gmail.com>
|
||||
M: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
|
||||
S: Maintained
|
||||
F: arch/arm/mach-snapdragon/
|
||||
F: drivers/gpio/msm_gpio.c
|
||||
F: drivers/mmc/msm_sdhci.c
|
||||
F: drivers/serial/serial_msm.c
|
||||
F: drivers/smem/msm_smem.c
|
||||
F: drivers/usb/host/ehci-msm.c
|
||||
|
||||
ARM STI
|
||||
M: Patrice Chotard <patrice.chotard@st.com>
|
||||
S: Maintained
|
||||
F: arch/arm/mach-sti/
|
||||
F: arch/arm/include/asm/arch-sti*/
|
||||
|
||||
ARM STM SPEAR
|
||||
#M: Vipin Kumar <vipin.kumar@st.com>
|
||||
@@ -226,24 +160,6 @@ T: git git://git.denx.de/u-boot-stm.git
|
||||
F: arch/arm/cpu/arm926ejs/spear/
|
||||
F: arch/arm/include/asm/arch-spear/
|
||||
|
||||
ARM STM STM32MP
|
||||
M: Patrick Delaunay <patrick.delaunay@st.com>
|
||||
M: Christophe Kerello <christophe.kerello@st.com>
|
||||
M: Patrice Chotard <patrice.chotard@st.com>
|
||||
S: Maintained
|
||||
F: arch/arm/mach-stm32mp
|
||||
F: drivers/clk/clk_stm32mp1.c
|
||||
F: drivers/i2c/stm32f7_i2c.c
|
||||
F: drivers/misc/stm32mp_fuse.c
|
||||
F: drivers/mmc/stm32_sdmmc2.c
|
||||
F: drivers/phy/phy-stm32-usbphyc.c
|
||||
F: drivers/pinctrl/pinctrl_stm32.c
|
||||
F: drivers/power/regulator/stm32-vrefbuf.c
|
||||
F: drivers/ram/stm32mp1/
|
||||
F: drivers/misc/stm32_rcc.c
|
||||
F: drivers/reset/stm32-reset.c
|
||||
F: drivers/spi/stm32_qspi.c
|
||||
|
||||
ARM STM STV0991
|
||||
M: Vikas Manocha <vikas.manocha@st.com>
|
||||
S: Maintained
|
||||
@@ -251,14 +167,12 @@ F: arch/arm/cpu/armv7/stv0991/
|
||||
F: arch/arm/include/asm/arch-stv0991/
|
||||
|
||||
ARM SUNXI
|
||||
M: Jagan Teki <jagan@openedev.com>
|
||||
M: Maxime Ripard <maxime.ripard@bootlin.com>
|
||||
M: Ian Campbell <ijc@hellion.org.uk>
|
||||
M: Hans De Goede <hdegoede@redhat.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-sunxi.git
|
||||
F: arch/arm/cpu/armv7/sunxi/
|
||||
F: arch/arm/include/asm/arch-sunxi/
|
||||
F: arch/arm/mach-sunxi/
|
||||
F: board/sunxi/
|
||||
|
||||
ARM TEGRA
|
||||
M: Tom Warren <twarren@nvidia.com>
|
||||
@@ -273,6 +187,8 @@ S: Maintained
|
||||
T: git git://git.denx.de/u-boot-ti.git
|
||||
F: arch/arm/mach-davinci/
|
||||
F: arch/arm/mach-keystone/
|
||||
F: arch/arm/cpu/arm926ejs/omap/
|
||||
F: arch/arm/cpu/armv7/omap*/
|
||||
F: arch/arm/include/asm/arch-omap*/
|
||||
F: arch/arm/include/asm/ti-common/
|
||||
|
||||
@@ -287,58 +203,26 @@ N: uniphier
|
||||
ARM ZYNQ
|
||||
M: Michal Simek <monstr@monstr.eu>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-microblaze.git
|
||||
F: arch/arm/mach-zynq/
|
||||
F: drivers/clk/clk_zynq.c
|
||||
F: drivers/fpga/zynqpl.c
|
||||
F: drivers/gpio/zynq_gpio.c
|
||||
F: drivers/i2c/i2c-cdns.c
|
||||
F: drivers/i2c/muxes/pca954x.c
|
||||
F: drivers/i2c/zynq_i2c.c
|
||||
F: drivers/mmc/zynq_sdhci.c
|
||||
F: drivers/mtd/nand/zynq_nand.c
|
||||
F: drivers/net/phy/xilinx_phy.c
|
||||
F: drivers/net/zynq_gem.c
|
||||
F: drivers/serial/serial_zynq.c
|
||||
F: drivers/spi/zynq_qspi.c
|
||||
F: drivers/spi/zynq_spi.c
|
||||
F: drivers/usb/host/ehci-zynq.c
|
||||
F: drivers/watchdog/cdns_wdt.c
|
||||
F: include/zynqpl.h
|
||||
F: tools/zynqimage.c
|
||||
N: zynq
|
||||
F: arch/arm/cpu/armv7/zynq/
|
||||
F: arch/arm/include/asm/arch-zynq/
|
||||
|
||||
ARM ZYNQMP
|
||||
M: Michal Simek <michal.simek@xilinx.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-microblaze.git
|
||||
F: arch/arm/cpu/armv8/zynqmp/
|
||||
F: drivers/clk/clk_zynqmp.c
|
||||
F: drivers/fpga/zynqpl.c
|
||||
F: drivers/gpio/zynq_gpio.c
|
||||
F: drivers/i2c/i2c-cdns.c
|
||||
F: drivers/i2c/muxes/pca954x.c
|
||||
F: drivers/i2c/zynq_i2c.c
|
||||
F: drivers/mmc/zynq_sdhci.c
|
||||
F: drivers/mtd/nand/zynq_nand.c
|
||||
F: drivers/net/phy/xilinx_phy.c
|
||||
F: drivers/net/zynq_gem.c
|
||||
F: drivers/serial/serial_zynq.c
|
||||
F: drivers/spi/zynq_qspi.c
|
||||
F: drivers/spi/zynq_spi.c
|
||||
F: drivers/timer/cadence-ttc.c
|
||||
F: drivers/usb/host/ehci-zynq.c
|
||||
F: drivers/watchdog/cdns_wdt.c
|
||||
F: include/zynqmppl.h
|
||||
F: tools/zynqmp*
|
||||
N: ultra96
|
||||
N: zynqmp
|
||||
F: arch/arm/include/asm/arch-zynqmp/
|
||||
|
||||
ARM ZYNQMP R5
|
||||
M: Michal Simek <michal.simek@xilinx.com>
|
||||
AVR32
|
||||
M: Andreas Bießmann <andreas@biessmann.org>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-microblaze.git
|
||||
F: arch/arm/mach-zynqmp-r5/
|
||||
T: git git://git.denx.de/u-boot-avr32.git
|
||||
F: arch/avr32/
|
||||
|
||||
BLACKFIN
|
||||
M: Sonic Zhang <sonic.adi@gmail.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-blackfin.git
|
||||
F: arch/blackfin/
|
||||
|
||||
BUILDMAN
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
@@ -353,14 +237,14 @@ F: drivers/mtd/cfi_flash.c
|
||||
F: drivers/mtd/jedec_flash.c
|
||||
|
||||
COLDFIRE
|
||||
M: Huan Wang <alison.wang@nxp.com>
|
||||
M: Huan Wang <alison.wang@freescale.com>
|
||||
M: Angelo Dureghello <angelo@sysam.it>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-coldfire.git
|
||||
F: arch/m68k/
|
||||
|
||||
DFU
|
||||
M: Lukasz Majewski <lukma@denx.de>
|
||||
M: Lukasz Majewski <l.majewski@samsung.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-dfu.git
|
||||
F: drivers/dfu/
|
||||
@@ -377,18 +261,9 @@ F: test/dm/
|
||||
EFI PAYLOAD
|
||||
M: Alexander Graf <agraf@suse.de>
|
||||
S: Maintained
|
||||
T: git git://github.com/agraf/u-boot.git
|
||||
F: doc/README.uefi
|
||||
F: doc/README.iscsi
|
||||
F: Documentation/efi.rst
|
||||
F: include/efi*
|
||||
F: include/pe.h
|
||||
F: include/asm-generic/pe.h
|
||||
F: lib/charset.c
|
||||
F: lib/efi*/
|
||||
F: test/py/tests/test_efi*
|
||||
F: include/efi_loader.h
|
||||
F: lib/efi_loader/
|
||||
F: cmd/bootefi.c
|
||||
F: tools/file2include.c
|
||||
|
||||
FLATTENED DEVICE TREE
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
@@ -397,8 +272,8 @@ T: git git://git.denx.de/u-boot-fdt.git
|
||||
F: lib/fdtdec*
|
||||
F: lib/libfdt/
|
||||
F: include/fdt*
|
||||
F: include/linux/libfdt*
|
||||
F: cmd/fdt.c
|
||||
F: include/libfdt*
|
||||
F. common/cmd_fdt.c
|
||||
F: common/fdt_support.c
|
||||
|
||||
FREEBSD
|
||||
@@ -417,29 +292,11 @@ S: Maintained
|
||||
T: git git://git.denx.de/u-boot-i2c.git
|
||||
F: drivers/i2c/
|
||||
|
||||
LOGGING
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot.git
|
||||
F: common/log.c
|
||||
F: cmd/log.c
|
||||
F: test/log/log_test.c
|
||||
F: test/py/tests/test_log.py
|
||||
|
||||
MICROBLAZE
|
||||
M: Michal Simek <monstr@monstr.eu>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-microblaze.git
|
||||
F: arch/microblaze/
|
||||
F: cmd/mfsl.c
|
||||
F: drivers/gpio/xilinx_gpio.c
|
||||
F: drivers/net/xilinx_axi_emac.c
|
||||
F: drivers/net/xilinx_emaclite.c
|
||||
F: drivers/serial/serial_xuartlite.c
|
||||
F: drivers/spi/xilinx_spi.c
|
||||
F: drivers/sysreset/sysreset_gpio.c
|
||||
F: drivers/watchdog/xilinx_tb_wdt.c
|
||||
N: xilinx
|
||||
|
||||
MIPS
|
||||
M: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
|
||||
@@ -453,62 +310,42 @@ S: Maintained
|
||||
T: git git://git.denx.de/u-boot-mmc.git
|
||||
F: drivers/mmc/
|
||||
|
||||
NAND FLASH
|
||||
#M: Scott Wood <oss@buserror.net>
|
||||
S: Orphaned (Since 2018-07)
|
||||
T: git git://git.denx.de/u-boot-nand-flash.git
|
||||
F: drivers/mtd/nand/
|
||||
|
||||
NDS32
|
||||
M: Macpaul Lin <macpaul@andestech.com>
|
||||
OPENRISC
|
||||
M: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-nds32.git
|
||||
F: arch/nds32/
|
||||
|
||||
NETWORK
|
||||
M: Joe Hershberger <joe.hershberger@ni.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-net.git
|
||||
F: drivers/net/
|
||||
F: net/
|
||||
|
||||
NIOS
|
||||
M: Thomas Chou <thomas@wytron.com.tw>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-nios.git
|
||||
F: arch/nios2/
|
||||
|
||||
ONENAND
|
||||
#M: Lukasz Majewski <l.majewski@majess.pl>
|
||||
S: Orphaned (Since 2017-01)
|
||||
T: git git://git.denx.de/u-boot-onenand.git
|
||||
F: drivers/mtd/onenand/
|
||||
F: arch/openrisc/
|
||||
|
||||
PATMAN
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
F: tools/patman/
|
||||
|
||||
POWER
|
||||
M: Jaehoon Chung <jh80.chung@samsung.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-pmic.git
|
||||
F: drivers/power/
|
||||
|
||||
POWERPC
|
||||
M: Wolfgang Denk <wd@denx.de>
|
||||
S: Maintained
|
||||
F: arch/powerpc/
|
||||
|
||||
POWERPC MPC5XXX
|
||||
M: Wolfgang Denk <wd@denx.de>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-mpc5xxx.git
|
||||
F: arch/powerpc/cpu/mpc5*/
|
||||
|
||||
POWERPC MPC8XX
|
||||
M: Christophe Leroy <christophe.leroy@c-s.fr>
|
||||
M: Wolfgang Denk <wd@denx.de>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-mpc8xx.git
|
||||
F: arch/powerpc/cpu/mpc8xx/
|
||||
|
||||
POWERPC MPC83XX
|
||||
M: Mario Six <mario.six@gdsys.cc>
|
||||
POWERPC MPC82XX
|
||||
M: Wolfgang Denk <wd@denx.de>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-mpc82xx.git
|
||||
F: arch/powerpc/cpu/mpc82*/
|
||||
|
||||
POWERPC MPC83XX
|
||||
#M: Kim Phillips <kim.phillips@freescale.com>
|
||||
S: Orphaned (Since 2016-02)
|
||||
T: git git://git.denx.de/u-boot-mpc83xx.git
|
||||
F: arch/powerpc/cpu/mpc83xx/
|
||||
F: arch/powerpc/include/asm/arch-mpc83xx/
|
||||
@@ -525,19 +362,42 @@ S: Maintained
|
||||
T: git git://git.denx.de/u-boot-mpc86xx.git
|
||||
F: arch/powerpc/cpu/mpc86xx/
|
||||
|
||||
RISC-V
|
||||
M: Rick Chen <rick@andestech.com>
|
||||
POWERPC PPC4XX
|
||||
M: Stefan Roese <sr@denx.de>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-riscv.git
|
||||
F: arch/riscv/
|
||||
F: tools/prelink-riscv.c
|
||||
T: git git://git.denx.de/u-boot-ppc4xx.git
|
||||
F: arch/powerpc/cpu/ppc4xx/
|
||||
|
||||
ROCKUSB
|
||||
M: Eddie Cai <eddie.cai.linux@gmail.com>
|
||||
NETWORK
|
||||
M: Joe Hershberger <joe.hershberger@ni.com>
|
||||
S: Maintained
|
||||
F: drivers/usb/gadget/f_rockusb.c
|
||||
F: cmd/rockusb.c
|
||||
F: doc/README.rockusb
|
||||
T: git git://git.denx.de/u-boot-net.git
|
||||
F: drivers/net/
|
||||
F: net/
|
||||
|
||||
NAND FLASH
|
||||
M: Scott Wood <oss@buserror.net>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-nand-flash.git
|
||||
F: drivers/mtd/nand/
|
||||
|
||||
NDS32
|
||||
M: Macpaul Lin <macpaul@andestech.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-nds32.git
|
||||
F: arch/nds32/
|
||||
|
||||
NIOS
|
||||
M: Thomas Chou <thomas@wytron.com.tw>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-nios.git
|
||||
F: arch/nios2/
|
||||
|
||||
ONENAND
|
||||
M: Lukasz Majewski <l.majewski@samsung.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-onenand.git
|
||||
F: drivers/mtd/onenand/
|
||||
|
||||
SANDBOX
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
@@ -550,8 +410,14 @@ S: Maintained
|
||||
T: git git://git.denx.de/u-boot-sh.git
|
||||
F: arch/sh/
|
||||
|
||||
SPARC
|
||||
#M: Francois Retief <fgretief@spaceteq.co.za>
|
||||
S: Orphaned (Since 2016-02)
|
||||
T: git git://git.denx.de/u-boot-sparc.git
|
||||
F: arch/sparc/
|
||||
|
||||
SPI
|
||||
M: Jagan Teki <jagan@openedev.com>
|
||||
M: Jagan Teki <jteki@openedev.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-spi.git
|
||||
F: drivers/mtd/spi/
|
||||
@@ -564,22 +430,6 @@ S: Maintained
|
||||
F: drivers/spmi/
|
||||
F: include/spmi/
|
||||
|
||||
TI SYSTEM SECURITY
|
||||
M: Andrew F. Davis <afd@ti.com>
|
||||
S: Supported
|
||||
F: arch/arm/mach-omap2/omap5/sec_entry_cpu1.S
|
||||
F: arch/arm/mach-omap2/sec-common.c
|
||||
F: arch/arm/mach-omap2/config_secure.mk
|
||||
F: configs/am335x_hs_evm_defconfig
|
||||
F: configs/am335x_hs_evm_uart_defconfig
|
||||
F: configs/am43xx_hs_evm_defconfig
|
||||
F: configs/am57xx_hs_evm_defconfig
|
||||
F: configs/dra7xx_hs_evm_defconfig
|
||||
F: configs/k2hk_hs_evm_defconfig
|
||||
F: configs/k2e_hs_evm_defconfig
|
||||
F: configs/k2g_hs_evm_defconfig
|
||||
F: configs/k2l_hs_evm_defconfig
|
||||
|
||||
TQ GROUP
|
||||
#M: Martin Krause <martin.krause@tq-systems.de>
|
||||
S: Orphaned (Since 2016-02)
|
||||
@@ -598,23 +448,14 @@ S: Maintained
|
||||
T: git git://git.denx.de/u-boot-usb.git
|
||||
F: drivers/usb/
|
||||
|
||||
USB xHCI
|
||||
M: Bin Meng <bmeng.cn@gmail.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-usb.git topic-xhci
|
||||
F: drivers/usb/host/xhci*
|
||||
|
||||
VIDEO
|
||||
M: Anatolij Gustschin <agust@denx.de>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-video.git
|
||||
F: drivers/video/
|
||||
F: common/lcd*.c
|
||||
F: include/lcd*.h
|
||||
|
||||
X86
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
M: Bin Meng <bmeng.cn@gmail.com>
|
||||
S: Maintained
|
||||
T: git git://git.denx.de/u-boot-x86.git
|
||||
F: arch/x86/
|
||||
|
||||
429
Makefile
429
Makefile
@@ -1,8 +1,10 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
VERSION = 2018
|
||||
VERSION = 2016
|
||||
PATCHLEVEL = 09
|
||||
SUBLEVEL =
|
||||
SUBLEVEL = 01
|
||||
EXTRAVERSION =
|
||||
NAME =
|
||||
|
||||
@@ -258,16 +260,6 @@ HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
|
||||
$(if $(CONFIG_TOOLS_DEBUG),-g)
|
||||
HOSTCXXFLAGS = -O2
|
||||
|
||||
# With the move to GCC 6, we have implicitly upgraded our language
|
||||
# standard to GNU11 (see https://gcc.gnu.org/gcc-5/porting_to.html).
|
||||
# Some Linux distributions (including RHEL7, SLES13, Debian 8) still
|
||||
# have older compilers as their default, so we make it explicit for
|
||||
# these that our host tools are GNU11 (i.e. C11 w/ GNU extensions).
|
||||
CSTD_FLAG := -std=gnu11
|
||||
ifeq ($(HOSTOS),linux)
|
||||
HOSTCFLAGS += $(CSTD_FLAG)
|
||||
endif
|
||||
|
||||
ifeq ($(HOSTOS),cygwin)
|
||||
HOSTCFLAGS += -ansi
|
||||
endif
|
||||
@@ -354,14 +346,10 @@ LDR = $(CROSS_COMPILE)ldr
|
||||
STRIP = $(CROSS_COMPILE)strip
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
OBJDUMP = $(CROSS_COMPILE)objdump
|
||||
LEX = flex
|
||||
YACC = bison
|
||||
AWK = awk
|
||||
PERL = perl
|
||||
PYTHON ?= python
|
||||
PYTHON2 = python2
|
||||
PYTHON3 = python3
|
||||
DTC ?= $(objtree)/scripts/dtc/dtc
|
||||
PYTHON = python
|
||||
DTC = dtc
|
||||
CHECK = sparse
|
||||
|
||||
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
|
||||
@@ -371,14 +359,9 @@ KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
|
||||
|
||||
KBUILD_CFLAGS := -Wall -Wstrict-prototypes \
|
||||
-Wno-format-security \
|
||||
-fno-builtin -ffreestanding $(CSTD_FLAG)
|
||||
KBUILD_CFLAGS += -fshort-wchar
|
||||
-fno-builtin -ffreestanding
|
||||
KBUILD_AFLAGS := -D__ASSEMBLY__
|
||||
|
||||
# Don't generate position independent code
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
|
||||
KBUILD_AFLAGS += $(call cc-option,-fno-PIE)
|
||||
|
||||
# Read UBOOTRELEASE from include/config/uboot.release (if it exists)
|
||||
UBOOTRELEASE = $(shell cat include/config/uboot.release 2> /dev/null)
|
||||
UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
|
||||
@@ -387,8 +370,8 @@ export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION
|
||||
export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR
|
||||
export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
|
||||
export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
|
||||
export MAKE LEX YACC AWK PERL PYTHON PYTHON2 PYTHON3
|
||||
export HOSTCXX HOSTCXXFLAGS CHECK CHECKFLAGS DTC DTC_FLAGS
|
||||
export MAKE AWK PERL PYTHON
|
||||
export HOSTCXX HOSTCXXFLAGS DTC CHECK CHECKFLAGS
|
||||
|
||||
export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE OBJCOPYFLAGS LDFLAGS
|
||||
export KBUILD_CFLAGS KBUILD_AFLAGS
|
||||
@@ -439,7 +422,6 @@ endif
|
||||
|
||||
version_h := include/generated/version_autogenerated.h
|
||||
timestamp_h := include/generated/timestamp_autogenerated.h
|
||||
defaultenv_h := include/generated/defaultenv_autogenerated.h
|
||||
|
||||
no-dot-config-targets := clean clobber mrproper distclean \
|
||||
help %docs check% coccicheck \
|
||||
@@ -500,13 +482,6 @@ else
|
||||
# Build targets only - this includes vmlinux, arch specific targets, clean
|
||||
# targets and others. In general all targets except *config targets.
|
||||
|
||||
# Additional helpers built in scripts/
|
||||
# Carefully list dependencies so we do not try to build scripts twice
|
||||
# in parallel
|
||||
PHONY += scripts
|
||||
scripts: scripts_basic include/config/auto.conf
|
||||
$(Q)$(MAKE) $(build)=$(@)
|
||||
|
||||
ifeq ($(dot-config),1)
|
||||
# Read in config
|
||||
-include include/config/auto.conf
|
||||
@@ -523,7 +498,7 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
|
||||
# if auto.conf.cmd is missing then we are probably in a cleaned tree so
|
||||
# we execute the config step to be sure to catch updated Kconfig files
|
||||
include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
|
||||
$(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
|
||||
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
|
||||
@# If the following part fails, include/config/auto.conf should be
|
||||
@# deleted so "make silentoldconfig" will be re-run on the next build.
|
||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.autoconf || \
|
||||
@@ -534,9 +509,6 @@ include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
|
||||
@# Otherwise, 'make silentoldconfig' would be invoked twice.
|
||||
$(Q)touch include/config/auto.conf
|
||||
|
||||
u-boot.cfg spl/u-boot.cfg tpl/u-boot.cfg: include/config.h FORCE
|
||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.autoconf $(@)
|
||||
|
||||
-include include/autoconf.mk
|
||||
-include include/autoconf.mk.dep
|
||||
|
||||
@@ -555,15 +527,6 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# These are set by the arch-specific config.mk. Make sure they are exported
|
||||
# so they can be used when building an EFI application.
|
||||
export EFI_LDS # Filename of EFI link script in arch/$(ARCH)/lib
|
||||
export EFI_CRT0 # Filename of EFI CRT0 in arch/$(ARCH)/lib
|
||||
export EFI_RELOC # Filename of EFU relocation code in arch/$(ARCH)/lib
|
||||
export CFLAGS_EFI # Compiler flags to add when building EFI app
|
||||
export CFLAGS_NON_EFI # Compiler flags to remove when building EFI app
|
||||
export EFI_TARGET # binutils target if EFI is natively supported
|
||||
|
||||
# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
|
||||
# that (or fail if absent). Otherwise, search for a linker script in a
|
||||
# standard location.
|
||||
@@ -611,31 +574,17 @@ endif
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
|
||||
|
||||
# change __FILE__ to the relative path from the srctree
|
||||
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
||||
|
||||
KBUILD_CFLAGS += -g
|
||||
# $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g<format>
|
||||
# option to the assembler.
|
||||
KBUILD_AFLAGS += -g
|
||||
|
||||
# Report stack usage if supported
|
||||
# ARC tools based on GCC 7.1 has an issue with stack usage
|
||||
# with naked functions, see commit message for more details
|
||||
ifndef CONFIG_ARC
|
||||
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-stack-usage.sh $(CC)),y)
|
||||
KBUILD_CFLAGS += -fstack-usage
|
||||
endif
|
||||
endif
|
||||
|
||||
KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)
|
||||
ifeq ($(cc-name),clang)
|
||||
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
|
||||
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
|
||||
endif
|
||||
|
||||
# turn jbsr into jsr for m68k
|
||||
ifeq ($(ARCH),m68k)
|
||||
@@ -659,9 +608,8 @@ KBUILD_CFLAGS += $(KCFLAGS)
|
||||
UBOOTINCLUDE := \
|
||||
-Iinclude \
|
||||
$(if $(KBUILD_SRC), -I$(srctree)/include) \
|
||||
$(if $(CONFIG_$(SPL_)SYS_THUMB_BUILD), \
|
||||
$(if $(CONFIG_HAS_THUMB2),, \
|
||||
-I$(srctree)/arch/$(ARCH)/thumb1/include),) \
|
||||
$(if $(CONFIG_SYS_THUMB_BUILD), $(if $(CONFIG_HAS_THUMB2),, \
|
||||
-I$(srctree)/arch/$(ARCH)/thumb1/include),) \
|
||||
-I$(srctree)/arch/$(ARCH)/include \
|
||||
-include $(srctree)/include/linux/kconfig.h
|
||||
|
||||
@@ -688,6 +636,7 @@ libs-y += drivers/
|
||||
libs-y += drivers/dma/
|
||||
libs-y += drivers/gpio/
|
||||
libs-y += drivers/i2c/
|
||||
libs-y += drivers/mmc/
|
||||
libs-y += drivers/mtd/
|
||||
libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/
|
||||
libs-y += drivers/mtd/onenand/
|
||||
@@ -706,7 +655,6 @@ libs-y += drivers/power/ \
|
||||
libs-y += drivers/spi/
|
||||
libs-$(CONFIG_FMAN_ENET) += drivers/net/fm/
|
||||
libs-$(CONFIG_SYS_FSL_DDR) += drivers/ddr/fsl/
|
||||
libs-$(CONFIG_SYS_FSL_MMDC) += drivers/ddr/fsl/
|
||||
libs-$(CONFIG_ALTERA_SDRAM) += drivers/ddr/altera/
|
||||
libs-y += drivers/serial/
|
||||
libs-y += drivers/usb/dwc3/
|
||||
@@ -722,7 +670,6 @@ libs-y += drivers/usb/phy/
|
||||
libs-y += drivers/usb/ulpi/
|
||||
libs-y += cmd/
|
||||
libs-y += common/
|
||||
libs-y += env/
|
||||
libs-$(CONFIG_API) += api/
|
||||
libs-$(CONFIG_HAS_POST) += post/
|
||||
libs-y += test/
|
||||
@@ -751,12 +698,6 @@ else
|
||||
PLATFORM_LIBGCC := -L $(shell dirname `$(CC) $(c_flags) -print-libgcc-file-name`) -lgcc
|
||||
endif
|
||||
PLATFORM_LIBS += $(PLATFORM_LIBGCC)
|
||||
|
||||
ifdef CONFIG_CC_COVERAGE
|
||||
KBUILD_CFLAGS += --coverage
|
||||
PLATFORM_LIBGCC += -lgcov
|
||||
endif
|
||||
|
||||
export PLATFORM_LIBS
|
||||
export PLATFORM_LIBGCC
|
||||
|
||||
@@ -788,9 +729,6 @@ BOARD_SIZE_CHECK =
|
||||
endif
|
||||
|
||||
# Statically apply RELA-style relocations (currently arm64 only)
|
||||
# This is useful for arm64 where static relocation needs to be performed on
|
||||
# the raw binary, but certain simulators only accept an ELF file (but don't
|
||||
# do the relocation).
|
||||
ifneq ($(CONFIG_STATIC_RELA),)
|
||||
# $(1) is u-boot ELF, $(2) is u-boot bin, $(3) is text base
|
||||
DO_STATIC_RELA = \
|
||||
@@ -802,7 +740,7 @@ DO_STATIC_RELA =
|
||||
endif
|
||||
|
||||
# Always append ALL so that arch config.mk's can add custom ones
|
||||
ALL-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check
|
||||
ALL-y += u-boot.srec u-boot.bin u-boot.sym System.map u-boot.cfg binary_size_check
|
||||
|
||||
ALL-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
|
||||
ifeq ($(CONFIG_SPL_FSL_PBL),y)
|
||||
@@ -815,15 +753,7 @@ ALL-$(CONFIG_RAMBOOT_PBL) += u-boot.pbl
|
||||
endif
|
||||
endif
|
||||
ALL-$(CONFIG_SPL) += spl/u-boot-spl.bin
|
||||
ifeq ($(CONFIG_MX6)$(CONFIG_SECURE_BOOT), yy)
|
||||
ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img
|
||||
else
|
||||
ifeq ($(CONFIG_MX7)$(CONFIG_SECURE_BOOT), yy)
|
||||
ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot-ivt.img
|
||||
else
|
||||
ALL-$(CONFIG_SPL_FRAMEWORK) += u-boot.img
|
||||
endif
|
||||
endif
|
||||
ALL-$(CONFIG_TPL) += tpl/u-boot-tpl.bin
|
||||
ALL-$(CONFIG_OF_SEPARATE) += u-boot.dtb
|
||||
ifeq ($(CONFIG_SPL_FRAMEWORK),y)
|
||||
@@ -837,15 +767,10 @@ ALL-$(CONFIG_REMAKE_ELF) += u-boot.elf
|
||||
ALL-$(CONFIG_EFI_APP) += u-boot-app.efi
|
||||
ALL-$(CONFIG_EFI_STUB) += u-boot-payload.efi
|
||||
|
||||
ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),)
|
||||
ifneq ($(BUILD_ROM),)
|
||||
ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
|
||||
endif
|
||||
|
||||
# Build a combined spl + u-boot image for sunxi
|
||||
ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy)
|
||||
ALL-y += u-boot-sunxi-with-spl.bin
|
||||
endif
|
||||
|
||||
# enable combined SPL/u-boot/dtb rules for tegra
|
||||
ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
|
||||
ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
|
||||
@@ -857,16 +782,8 @@ ifneq ($(CONFIG_BUILD_TARGET),)
|
||||
ALL-y += $(CONFIG_BUILD_TARGET:"%"=%)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_SYS_INIT_SP_BSS_OFFSET),)
|
||||
ALL-y += init_sp_bss_offset_check
|
||||
endif
|
||||
|
||||
LDFLAGS_u-boot += $(LDFLAGS_FINAL)
|
||||
|
||||
# Avoid 'Not enough room for program headers' error on binutils 2.28 onwards.
|
||||
LDFLAGS_u-boot += $(call ld-option, --no-dynamic-linker)
|
||||
|
||||
ifeq ($(CONFIG_ARC)$(CONFIG_NIOS2)$(CONFIG_X86)$(CONFIG_XTENSA),)
|
||||
ifneq ($(CONFIG_SYS_TEXT_BASE),)
|
||||
LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
|
||||
endif
|
||||
|
||||
@@ -882,15 +799,9 @@ cmd_zobjcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
|
||||
quiet_cmd_efipayload = OBJCOPY $@
|
||||
cmd_efipayload = $(OBJCOPY) -I binary -O $(EFIPAYLOAD_BFDTARGET) -B $(EFIPAYLOAD_BFDARCH) $< $@
|
||||
|
||||
MKIMAGEOUTPUT ?= /dev/null
|
||||
|
||||
quiet_cmd_mkimage = MKIMAGE $@
|
||||
cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \
|
||||
>$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
|
||||
|
||||
quiet_cmd_mkfitimage = MKIMAGE $@
|
||||
cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(U_BOOT_ITS) -E $@ \
|
||||
>$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
|
||||
$(if $(KBUILD_VERBOSE:1=), >/dev/null)
|
||||
|
||||
quiet_cmd_cat = CAT $@
|
||||
cmd_cat = cat $(filter-out $(PHONY), $^) > $@
|
||||
@@ -900,13 +811,7 @@ append = cat $(filter-out $< $(PHONY), $^) >> $@
|
||||
quiet_cmd_pad_cat = CAT $@
|
||||
cmd_pad_cat = $(cmd_objcopy) && $(append) || rm -f $@
|
||||
|
||||
cfg: u-boot.cfg
|
||||
|
||||
quiet_cmd_cfgcheck = CFGCHK $2
|
||||
cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \
|
||||
$(srctree)/scripts/config_whitelist.txt $(srctree)
|
||||
|
||||
all: $(ALL-y) cfg
|
||||
all: $(ALL-y)
|
||||
ifeq ($(CONFIG_DM_I2C_COMPAT)$(CONFIG_SANDBOX),y)
|
||||
@echo "===================== WARNING ======================"
|
||||
@echo "This board uses CONFIG_DM_I2C_COMPAT. Please remove"
|
||||
@@ -914,35 +819,17 @@ ifeq ($(CONFIG_DM_I2C_COMPAT)$(CONFIG_SANDBOX),y)
|
||||
@echo "before sending patches to the mailing list."
|
||||
@echo "===================================================="
|
||||
endif
|
||||
@# Check that this build does not use CONFIG options that we do not
|
||||
@# know about unless they are in Kconfig. All the existing CONFIG
|
||||
@# options are whitelisted, so new ones should not be added.
|
||||
$(call cmd,cfgcheck,u-boot.cfg)
|
||||
|
||||
PHONY += dtbs
|
||||
dtbs: dts/dt.dtb
|
||||
@:
|
||||
dts/dt.dtb: u-boot
|
||||
dts/dt.dtb: checkdtc u-boot
|
||||
$(Q)$(MAKE) $(build)=dts dtbs
|
||||
|
||||
quiet_cmd_copy = COPY $@
|
||||
cmd_copy = cp $< $@
|
||||
|
||||
ifeq ($(CONFIG_MULTI_DTB_FIT),y)
|
||||
|
||||
fit-dtb.blob: dts/dt.dtb FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
|
||||
-a 0 -e 0 -E \
|
||||
$(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -d /dev/null
|
||||
|
||||
u-boot-fit-dtb.bin: u-boot-nodtb.bin fit-dtb.blob
|
||||
$(call if_changed,cat)
|
||||
|
||||
u-boot.bin: u-boot-fit-dtb.bin FORCE
|
||||
$(call if_changed,copy)
|
||||
else ifeq ($(CONFIG_OF_SEPARATE),y)
|
||||
ifeq ($(CONFIG_OF_SEPARATE),y)
|
||||
u-boot-dtb.bin: u-boot-nodtb.bin dts/dt.dtb FORCE
|
||||
$(call if_changed,cat)
|
||||
|
||||
@@ -954,13 +841,7 @@ u-boot.bin: u-boot-nodtb.bin FORCE
|
||||
endif
|
||||
|
||||
%.imx: %.bin
|
||||
$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
|
||||
|
||||
%.vyb: %.imx
|
||||
$(Q)$(MAKE) $(build)=arch/arm/cpu/armv7/vf610 $@
|
||||
|
||||
quiet_cmd_copy = COPY $@
|
||||
cmd_copy = cp $< $@
|
||||
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
|
||||
|
||||
u-boot.dtb: dts/dt.dtb
|
||||
$(call cmd,copy)
|
||||
@@ -972,18 +853,8 @@ OBJCOPYFLAGS_u-boot.srec := -O srec
|
||||
u-boot.hex u-boot.srec: u-boot FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
OBJCOPYFLAGS_u-boot-elf.srec := $(OBJCOPYFLAGS_u-boot.srec)
|
||||
|
||||
u-boot-elf.srec: u-boot.elf FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
OBJCOPYFLAGS_u-boot-spl.srec = $(OBJCOPYFLAGS_u-boot.srec)
|
||||
|
||||
spl/u-boot-spl.srec: spl/u-boot-spl FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
|
||||
$(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec)
|
||||
$(if $(CONFIG_X86_RESET_VECTOR),-R .start16 -R .resetvec)
|
||||
|
||||
binary_size_check: u-boot-nodtb.bin FORCE
|
||||
@file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
|
||||
@@ -999,33 +870,6 @@ binary_size_check: u-boot-nodtb.bin FORCE
|
||||
fi \
|
||||
fi
|
||||
|
||||
ifneq ($(CONFIG_SYS_INIT_SP_BSS_OFFSET),)
|
||||
ifneq ($(CONFIG_SYS_MALLOC_F_LEN),)
|
||||
subtract_sys_malloc_f_len = space=$$(($${space} - $(CONFIG_SYS_MALLOC_F_LEN)))
|
||||
else
|
||||
subtract_sys_malloc_f_len = true
|
||||
endif
|
||||
# The 1/4 margin below is somewhat arbitrary. The likely initial SP usage is
|
||||
# so low that the DTB could probably use 90%+ of the available space, for
|
||||
# current values of CONFIG_SYS_INIT_SP_BSS_OFFSET at least. However, let's be
|
||||
# safe for now and tweak this later if space becomes tight.
|
||||
# A rejected alternative would be to check that some absolute minimum stack
|
||||
# space was available. However, since CONFIG_SYS_INIT_SP_BSS_OFFSET is
|
||||
# deliberately build-specific, to take account of build-to-build stack usage
|
||||
# differences due to different feature sets, there is no common absolute value
|
||||
# to check against.
|
||||
init_sp_bss_offset_check: u-boot.dtb FORCE
|
||||
@dtb_size=$(shell wc -c u-boot.dtb | awk '{print $$1}') ; \
|
||||
space=$(CONFIG_SYS_INIT_SP_BSS_OFFSET) ; \
|
||||
$(subtract_sys_malloc_f_len) ; \
|
||||
quarter_space=$$(($${space} / 4)) ; \
|
||||
if [ $${dtb_size} -gt $${quarter_space} ]; then \
|
||||
echo "u-boot.dtb is larger than 1 quarter of " >&2 ; \
|
||||
echo "(CONFIG_SYS_INIT_SP_BSS_OFFSET - CONFIG_SYS_MALLOC_F_LEN)" >&2 ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
endif
|
||||
|
||||
u-boot-nodtb.bin: u-boot FORCE
|
||||
$(call if_changed,objcopy)
|
||||
$(call DO_STATIC_RELA,$<,$@,$(CONFIG_SYS_TEXT_BASE))
|
||||
@@ -1036,12 +880,6 @@ u-boot.ldr: u-boot
|
||||
$(LDR) -T $(CONFIG_CPU) -c $@ $< $(LDR_FLAGS)
|
||||
$(BOARD_SIZE_CHECK)
|
||||
|
||||
# binman
|
||||
# ---------------------------------------------------------------------------
|
||||
quiet_cmd_binman = BINMAN $@
|
||||
cmd_binman = $(srctree)/tools/binman/binman -d u-boot.dtb -O . \
|
||||
-I . -I $(srctree)/board/$(BOARDDIR) $<
|
||||
|
||||
OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex
|
||||
|
||||
OBJCOPYFLAGS_u-boot.ldr.srec := -I binary -O srec
|
||||
@@ -1057,18 +895,10 @@ ifndef CONFIG_SYS_UBOOT_START
|
||||
CONFIG_SYS_UBOOT_START := 0
|
||||
endif
|
||||
|
||||
# Boards with more complex image requirments can provide an .its source file
|
||||
# or a generator script
|
||||
ifneq ($(CONFIG_SPL_FIT_SOURCE),"")
|
||||
U_BOOT_ITS = $(subst ",,$(CONFIG_SPL_FIT_SOURCE))
|
||||
else
|
||||
ifneq ($(CONFIG_SPL_FIT_GENERATOR),"")
|
||||
U_BOOT_ITS := u-boot.its
|
||||
$(U_BOOT_ITS): FORCE
|
||||
$(srctree)/$(CONFIG_SPL_FIT_GENERATOR) \
|
||||
$(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) > $@
|
||||
endif
|
||||
endif
|
||||
# Create a file containing the configuration options the image was built with
|
||||
quiet_cmd_cpp_cfg = CFG $@
|
||||
cmd_cpp_cfg = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) -ansi \
|
||||
-DDO_DEPS_ONLY -D__ASSEMBLY__ -x assembler-with-cpp -P -dM -E -o $@ $<
|
||||
|
||||
ifdef CONFIG_SPL_LOAD_FIT
|
||||
MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
|
||||
@@ -1079,11 +909,6 @@ else
|
||||
MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
|
||||
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
|
||||
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
|
||||
MKIMAGEFLAGS_u-boot-ivt.img = -A $(ARCH) -T firmware_ivt -C none -O u-boot \
|
||||
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
|
||||
-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
|
||||
u-boot-ivt.img: MKIMAGEOUTPUT = u-boot-ivt.img.log
|
||||
CLEAN_FILES += u-boot-ivt.img.log u-boot-dtb.imx.log SPL.log u-boot.imx.log
|
||||
endif
|
||||
|
||||
MKIMAGEFLAGS_u-boot-dtb.img = $(MKIMAGEFLAGS_u-boot.img)
|
||||
@@ -1092,20 +917,15 @@ MKIMAGEFLAGS_u-boot.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
|
||||
-T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
|
||||
|
||||
MKIMAGEFLAGS_u-boot-spl.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \
|
||||
-T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) \
|
||||
$(if $(KEYDIR),-k $(KEYDIR))
|
||||
-T kwbimage -a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE)
|
||||
|
||||
MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
|
||||
-R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage
|
||||
|
||||
u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \
|
||||
u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl: \
|
||||
$(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin dts/dt.dtb,u-boot.bin) FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
u-boot.itb: u-boot-nodtb.bin dts/dt.dtb $(U_BOOT_ITS) FORCE
|
||||
$(call if_changed,mkfitimage)
|
||||
$(BOARD_SIZE_CHECK)
|
||||
|
||||
u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE
|
||||
$(call if_changed,mkimage)
|
||||
|
||||
@@ -1115,8 +935,11 @@ u-boot.sha1: u-boot.bin
|
||||
u-boot.dis: u-boot
|
||||
$(OBJDUMP) -d $< > $@
|
||||
|
||||
ifneq ($(CONFIG_SPL_PAYLOAD),)
|
||||
SPL_PAYLOAD := $(CONFIG_SPL_PAYLOAD:"%"=%)
|
||||
u-boot.cfg: include/config.h FORCE
|
||||
$(call if_changed,cpp_cfg)
|
||||
|
||||
ifdef CONFIG_TPL
|
||||
SPL_PAYLOAD := tpl/u-boot-with-tpl.bin
|
||||
else
|
||||
SPL_PAYLOAD := u-boot.bin
|
||||
endif
|
||||
@@ -1152,10 +975,10 @@ tpl/u-boot-with-tpl.bin: tpl/u-boot-tpl.bin u-boot.bin FORCE
|
||||
$(call if_changed,pad_cat)
|
||||
|
||||
SPL: spl/u-boot-spl.bin FORCE
|
||||
$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
|
||||
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
|
||||
|
||||
u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE
|
||||
$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
|
||||
$(Q)$(MAKE) $(build)=arch/arm/imx-common $@
|
||||
|
||||
MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_SYS_TEXT_BASE)
|
||||
|
||||
@@ -1204,11 +1027,50 @@ endif
|
||||
|
||||
# x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
|
||||
# reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in
|
||||
# the middle. This is handled by binman based on an image description in the
|
||||
# board's device tree.
|
||||
# the middle.
|
||||
ifneq ($(CONFIG_X86_RESET_VECTOR),)
|
||||
rom: u-boot.rom FORCE
|
||||
|
||||
IFDTOOL=$(objtree)/tools/ifdtool
|
||||
IFDTOOL_FLAGS = -f 0:$(objtree)/u-boot.dtb
|
||||
IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' ' -f1)
|
||||
IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin
|
||||
IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin
|
||||
IFDTOOL_FLAGS += -C
|
||||
|
||||
ifneq ($(CONFIG_HAVE_INTEL_ME),)
|
||||
IFDTOOL_ME_FLAGS = -D $(srctree)/board/$(BOARDDIR)/descriptor.bin
|
||||
IFDTOOL_ME_FLAGS += -i ME:$(srctree)/board/$(BOARDDIR)/me.bin
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_HAVE_MRC),)
|
||||
IFDTOOL_FLAGS += -w $(CONFIG_X86_MRC_ADDR):$(srctree)/board/$(BOARDDIR)/mrc.bin
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_HAVE_FSP),)
|
||||
IFDTOOL_FLAGS += -w $(CONFIG_FSP_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_FSP_FILE)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_HAVE_CMC),)
|
||||
IFDTOOL_FLAGS += -w $(CONFIG_CMC_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_CMC_FILE)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_HAVE_VGA_BIOS),)
|
||||
IFDTOOL_FLAGS += -w $(CONFIG_VGA_BIOS_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_VGA_BIOS_FILE)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_HAVE_REFCODE),)
|
||||
IFDTOOL_FLAGS += -w $(CONFIG_X86_REFCODE_ADDR):refcode.bin
|
||||
endif
|
||||
|
||||
quiet_cmd_ifdtool = IFDTOOL $@
|
||||
cmd_ifdtool = $(IFDTOOL) -c -r $(CONFIG_ROM_SIZE) u-boot.tmp;
|
||||
ifneq ($(CONFIG_HAVE_INTEL_ME),)
|
||||
cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_ME_FLAGS) u-boot.tmp;
|
||||
endif
|
||||
cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp;
|
||||
cmd_ifdtool += mv u-boot.tmp $@
|
||||
|
||||
refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE
|
||||
$(call if_changed,copy)
|
||||
|
||||
@@ -1216,33 +1078,23 @@ quiet_cmd_ldr = LD $@
|
||||
cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \
|
||||
$(filter-out FORCE,$^) -o $@
|
||||
|
||||
u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \
|
||||
$(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \
|
||||
$(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE
|
||||
$(call if_changed,binman)
|
||||
u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE \
|
||||
$(if $(CONFIG_HAVE_REFCODE),refcode.bin)
|
||||
$(call if_changed,ifdtool)
|
||||
|
||||
OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
|
||||
u-boot-x86-16bit.bin: u-boot FORCE
|
||||
$(call if_changed,objcopy)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_ARCH_SUNXI),)
|
||||
ifeq ($(CONFIG_ARM64),)
|
||||
u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
|
||||
$(call if_changed,binman)
|
||||
else
|
||||
u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE
|
||||
$(call if_changed,cat)
|
||||
endif
|
||||
ifneq ($(CONFIG_SUNXI),)
|
||||
OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
|
||||
--pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
|
||||
u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
|
||||
$(call if_changed,pad_cat)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_TEGRA),)
|
||||
ifneq ($(CONFIG_BINMAN),)
|
||||
# Makes u-boot-dtb-tegra.bin u-boot-tegra.bin u-boot-nodtb-tegra.bin
|
||||
%-dtb-tegra.bin %-tegra.bin %-nodtb-tegra.bin: \
|
||||
spl/%-spl %.bin FORCE
|
||||
$(call if_changed,binman)
|
||||
else
|
||||
OBJCOPYFLAGS_u-boot-nodtb-tegra.bin = -O binary --pad-to=$(CONFIG_SYS_TEXT_BASE)
|
||||
u-boot-nodtb-tegra.bin: spl/u-boot-spl u-boot-nodtb.bin FORCE
|
||||
$(call if_changed,pad_cat)
|
||||
@@ -1253,7 +1105,6 @@ u-boot-tegra.bin: spl/u-boot-spl u-boot.bin FORCE
|
||||
|
||||
u-boot-dtb-tegra.bin: u-boot-tegra.bin FORCE
|
||||
$(call if_changed,copy)
|
||||
endif # binman
|
||||
endif
|
||||
|
||||
OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
|
||||
@@ -1271,7 +1122,7 @@ quiet_cmd_u-boot_payload ?= LD $@
|
||||
cmd_u-boot_payload ?= $(LD) $(LDFLAGS_EFI_PAYLOAD) -o $@ \
|
||||
-T u-boot-payload.lds arch/x86/cpu/call32.o \
|
||||
lib/efi/efi.o lib/efi/efi_stub.o u-boot.bin.o \
|
||||
$(addprefix arch/$(ARCH)/lib/,$(EFISTUB))
|
||||
$(addprefix arch/$(ARCH)/lib/efi/,$(EFISTUB))
|
||||
|
||||
u-boot-payload: u-boot.bin.o u-boot-payload.lds FORCE
|
||||
$(call if_changed,u-boot_payload)
|
||||
@@ -1316,19 +1167,17 @@ OBJCOPYFLAGS_u-boot-img-spl-at-end.bin := -I binary -O binary \
|
||||
u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE
|
||||
$(call if_changed,pad_cat)
|
||||
|
||||
# Create a new ELF from a raw binary file.
|
||||
ifndef PLATFORM_ELFENTRY
|
||||
PLATFORM_ELFENTRY = "_start"
|
||||
endif
|
||||
quiet_cmd_u-boot-elf ?= LD $@
|
||||
cmd_u-boot-elf ?= $(LD) u-boot-elf.o -o $@ \
|
||||
--defsym=$(PLATFORM_ELFENTRY)=$(CONFIG_SYS_TEXT_BASE) \
|
||||
-Ttext=$(CONFIG_SYS_TEXT_BASE)
|
||||
# Create a new ELF from a raw binary file. This is useful for arm64
|
||||
# where static relocation needs to be performed on the raw binary,
|
||||
# but certain simulators only accept an ELF file (but don't do the
|
||||
# relocation).
|
||||
# FIXME refactor dts/Makefile to share target/arch detection
|
||||
u-boot.elf: u-boot.bin
|
||||
$(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o
|
||||
$(call if_changed,u-boot-elf)
|
||||
|
||||
ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(ARCH)/Makefile.postlink)
|
||||
@$(OBJCOPY) -B aarch64 -I binary -O elf64-littleaarch64 \
|
||||
$< u-boot-elf.o
|
||||
@$(LD) u-boot-elf.o -o $@ \
|
||||
--defsym=_start=$(CONFIG_SYS_TEXT_BASE) \
|
||||
-Ttext=$(CONFIG_SYS_TEXT_BASE)
|
||||
|
||||
# Rule to link u-boot
|
||||
# May be overridden by arch/$(ARCH)/config.mk
|
||||
@@ -1336,8 +1185,7 @@ quiet_cmd_u-boot__ ?= LD $@
|
||||
cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@ \
|
||||
-T u-boot.lds $(u-boot-init) \
|
||||
--start-group $(u-boot-main) --end-group \
|
||||
$(PLATFORM_LIBS) -Map u-boot.map; \
|
||||
$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
|
||||
$(PLATFORM_LIBS) -Map u-boot.map
|
||||
|
||||
quiet_cmd_smap = GEN common/system_map.o
|
||||
cmd_smap = \
|
||||
@@ -1347,16 +1195,12 @@ cmd_smap = \
|
||||
-c $(srctree)/common/system_map.c -o common/system_map.o
|
||||
|
||||
u-boot: $(u-boot-init) $(u-boot-main) u-boot.lds FORCE
|
||||
+$(call if_changed,u-boot__)
|
||||
$(call if_changed,u-boot__)
|
||||
ifeq ($(CONFIG_KALLSYMS),y)
|
||||
$(call cmd,smap)
|
||||
$(call cmd,u-boot__) common/system_map.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RISCV),y)
|
||||
@tools/prelink-riscv $@ 0
|
||||
endif
|
||||
|
||||
quiet_cmd_sym ?= SYM $@
|
||||
cmd_sym ?= $(OBJDUMP) -t $< > $@
|
||||
u-boot.sym: u-boot FORCE
|
||||
@@ -1424,10 +1268,6 @@ ifeq ($(wildcard $(LDSCRIPT)),)
|
||||
@/bin/false
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_USE_DEFAULT_ENV_FILE),y)
|
||||
prepare1: $(defaultenv_h)
|
||||
endif
|
||||
|
||||
archprepare: prepare1 scripts_basic
|
||||
|
||||
prepare0: archprepare FORCE
|
||||
@@ -1462,7 +1302,6 @@ define filechk_timestamp.h
|
||||
LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TIME "%T"'; \
|
||||
LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_TZ "%z"'; \
|
||||
LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
|
||||
LC_ALL=C $${DATE} -u -d "$${SOURCE_DATE}" +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \
|
||||
else \
|
||||
return 42; \
|
||||
fi; \
|
||||
@@ -1471,27 +1310,15 @@ define filechk_timestamp.h
|
||||
LC_ALL=C date +'#define U_BOOT_TIME "%T"'; \
|
||||
LC_ALL=C date +'#define U_BOOT_TZ "%z"'; \
|
||||
LC_ALL=C date +'#define U_BOOT_DMI_DATE "%m/%d/%Y"'; \
|
||||
LC_ALL=C date +'#define U_BOOT_BUILD_DATE 0x%Y%m%d'; \
|
||||
fi)
|
||||
endef
|
||||
|
||||
define filechk_defaultenv.h
|
||||
(grep -v '^#' | \
|
||||
grep -v '^$$' | \
|
||||
tr '\n' '\0' | \
|
||||
sed -e 's/\\\x0/\n/' | \
|
||||
xxd -i ; echo ", 0x00" ; )
|
||||
endef
|
||||
|
||||
$(version_h): include/config/uboot.release FORCE
|
||||
$(call filechk,version.h)
|
||||
|
||||
$(timestamp_h): $(srctree)/Makefile FORCE
|
||||
$(call filechk,timestamp.h)
|
||||
|
||||
$(defaultenv_h): $(CONFIG_DEFAULT_ENV_FILE:"%"=%) FORCE
|
||||
$(call filechk,defaultenv.h)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
quiet_cmd_cpp_lds = LDS $@
|
||||
cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \
|
||||
@@ -1503,24 +1330,19 @@ u-boot.lds: $(LDSCRIPT) prepare FORCE
|
||||
spl/u-boot-spl.bin: spl/u-boot-spl
|
||||
@:
|
||||
spl/u-boot-spl: tools prepare \
|
||||
$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb) \
|
||||
$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_TPL_OF_PLATDATA),dts/dt.dtb)
|
||||
$(if $(CONFIG_OF_SEPARATE)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb)
|
||||
$(Q)$(MAKE) obj=spl -f $(srctree)/scripts/Makefile.spl all
|
||||
|
||||
spl/sunxi-spl.bin: spl/u-boot-spl
|
||||
@:
|
||||
|
||||
spl/sunxi-spl-with-ecc.bin: spl/sunxi-spl.bin
|
||||
@:
|
||||
|
||||
spl/u-boot-spl.sfp: spl/u-boot-spl
|
||||
@:
|
||||
|
||||
spl/boot.bin: spl/u-boot-spl
|
||||
@:
|
||||
|
||||
tpl/u-boot-tpl.bin: tools prepare \
|
||||
$(if $(CONFIG_OF_SEPARATE)$(CONFIG_OF_EMBED)$(CONFIG_SPL_OF_PLATDATA),dts/dt.dtb)
|
||||
tpl/u-boot-tpl.bin: tools prepare
|
||||
$(Q)$(MAKE) obj=tpl -f $(srctree)/scripts/Makefile.spl all
|
||||
|
||||
TAG_SUBDIRS := $(patsubst %,$(srctree)/%,$(u-boot-dirs) include)
|
||||
@@ -1548,6 +1370,12 @@ SYSTEM_MAP = \
|
||||
System.map: u-boot
|
||||
@$(call SYSTEM_MAP,$<) > $@
|
||||
|
||||
checkdtc:
|
||||
@if test $(call dtc-version) -lt 0104; then \
|
||||
echo '*** Your dtc is too old, please upgrade to dtc 1.4 or newer'; \
|
||||
false; \
|
||||
fi
|
||||
|
||||
#########################################################################
|
||||
|
||||
# ARM relocations should all be R_ARM_RELATIVE (32-bit) or
|
||||
@@ -1561,14 +1389,14 @@ checkarmreloc: u-boot
|
||||
false; \
|
||||
fi
|
||||
|
||||
envtools: scripts_basic $(version_h) $(timestamp_h)
|
||||
$(Q)$(MAKE) $(build)=tools/env
|
||||
env: scripts_basic
|
||||
$(Q)$(MAKE) $(build)=tools/$@
|
||||
|
||||
tools-only: scripts_basic $(version_h) $(timestamp_h)
|
||||
$(Q)$(MAKE) $(build)=tools
|
||||
|
||||
tools-all: export HOST_TOOLS_ALL=y
|
||||
tools-all: envtools tools ;
|
||||
tools-all: env tools ;
|
||||
|
||||
cross_tools: export CROSS_BUILD_TOOLS=y
|
||||
cross_tools: tools ;
|
||||
@@ -1592,8 +1420,8 @@ CLEAN_DIRS += $(MODVERDIR) \
|
||||
$(foreach d, spl tpl, $(patsubst %,$d/%, \
|
||||
$(filter-out include, $(shell ls -1 $d 2>/dev/null))))
|
||||
|
||||
CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \
|
||||
boot* u-boot* MLO* SPL System.map fit-dtb.blob
|
||||
CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h include/license.h \
|
||||
boot* u-boot* MLO* SPL System.map
|
||||
|
||||
# Directories & files removed with 'make mrproper'
|
||||
MRPROPER_DIRS += include/config include/generated spl tpl \
|
||||
@@ -1608,25 +1436,24 @@ clean: rm-files := $(CLEAN_FILES)
|
||||
|
||||
clean-dirs := $(foreach f,$(u-boot-alldirs),$(if $(wildcard $(srctree)/$f/Makefile),$f))
|
||||
|
||||
clean-dirs := $(addprefix _clean_, $(clean-dirs))
|
||||
clean-dirs := $(addprefix _clean_, $(clean-dirs) doc/DocBook)
|
||||
|
||||
PHONY += $(clean-dirs) clean archclean
|
||||
$(clean-dirs):
|
||||
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
|
||||
|
||||
# TODO: Do not use *.cfgtmp
|
||||
clean: $(clean-dirs)
|
||||
$(call cmd,rmdirs)
|
||||
$(call cmd,rmfiles)
|
||||
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
|
||||
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
|
||||
-o -name '*.ko.*' -o -name '*.su' \
|
||||
-o -name '*.ko.*' -o -name '*.su' -o -name '*.cfgtmp' \
|
||||
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
|
||||
-o -name '*.lex.c' -o -name '*.tab.[ch]' \
|
||||
-o -name '*.symtypes' -o -name 'modules.order' \
|
||||
-o -name modules.builtin -o -name '.tmp_*.o.*' \
|
||||
-o -name 'dsdt.aml' -o -name 'dsdt.asl.tmp' -o -name 'dsdt.c' \
|
||||
-o -name '*.efi' -o -name '*.gcno' -o -name '*.so' \) \
|
||||
-type f -print | xargs rm -f
|
||||
-o -name '*.gcno' \) -type f -print | xargs rm -f
|
||||
|
||||
# mrproper - Delete all generated files, including .config
|
||||
#
|
||||
@@ -1682,15 +1509,12 @@ help:
|
||||
@echo ' cscope - Generate cscope index'
|
||||
@echo ' ubootrelease - Output the release version string (use with make -s)'
|
||||
@echo ' ubootversion - Output the version stored in Makefile (use with make -s)'
|
||||
@echo " cfg - Don't build, just create the .cfg files"
|
||||
@echo " envtools - Build only the target-side environment tools"
|
||||
@echo ''
|
||||
@echo 'Static analysers'
|
||||
@echo ' checkstack - Generate a list of stack hogs'
|
||||
@echo ' coccicheck - Execute static code analysis with Coccinelle'
|
||||
@echo ''
|
||||
@echo 'Documentation targets:'
|
||||
@$(MAKE) -f $(srctree)/Documentation/Makefile dochelp
|
||||
@$(MAKE) -f $(srctree)/doc/DocBook/Makefile dochelp
|
||||
@echo ''
|
||||
@echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
|
||||
@echo ' make V=2 [targets] 2 => give reason for rebuild of target'
|
||||
@@ -1712,11 +1536,14 @@ tests:
|
||||
|
||||
# Documentation targets
|
||||
# ---------------------------------------------------------------------------
|
||||
DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
|
||||
linkcheckdocs dochelp refcheckdocs
|
||||
PHONY += $(DOC_TARGETS)
|
||||
$(DOC_TARGETS): scripts_basic FORCE
|
||||
$(Q)$(MAKE) $(build)=Documentation $@
|
||||
%docs: scripts_basic FORCE
|
||||
$(Q)$(MAKE) $(build)=scripts build_docproc
|
||||
$(Q)$(MAKE) $(build)=doc/DocBook $@
|
||||
|
||||
# Dummies...
|
||||
PHONY += prepare scripts
|
||||
prepare: ;
|
||||
scripts: ;
|
||||
|
||||
endif #ifeq ($(config-targets),1)
|
||||
endif #ifeq ($(mixed-targets),1)
|
||||
@@ -1782,14 +1609,6 @@ endif
|
||||
$(build)=$(build-dir) $(@:.ko=.o)
|
||||
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
|
||||
|
||||
# Consistency checks
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
PHONY += coccicheck
|
||||
|
||||
coccicheck:
|
||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/$@
|
||||
|
||||
# FIXME Should go into a make.lib or something
|
||||
# ===========================================================================
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
menu "API"
|
||||
|
||||
config API
|
||||
bool "Enable U-Boot API"
|
||||
default n
|
||||
help
|
||||
This option enables the U-Boot API. See api/README for more information.
|
||||
|
||||
endmenu
|
||||
@@ -1,6 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# (C) Copyright 2007 Semihalf
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += api.o api_display.o api_net.o api_storage.o
|
||||
obj-$(CONFIG_ARM) += api_platform-arm.o
|
||||
|
||||
71
api/api.c
71
api/api.c
@@ -1,8 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2007 Semihalf
|
||||
*
|
||||
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -457,7 +458,7 @@ static int API_env_get(va_list ap)
|
||||
if ((value = (char **)va_arg(ap, uintptr_t)) == NULL)
|
||||
return API_EINVAL;
|
||||
|
||||
*value = env_get(name);
|
||||
*value = getenv(name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -480,7 +481,7 @@ static int API_env_set(va_list ap)
|
||||
if ((value = (char *)va_arg(ap, uintptr_t)) == NULL)
|
||||
return API_EINVAL;
|
||||
|
||||
env_set(name, value);
|
||||
setenv(name, value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -494,47 +495,45 @@ static int API_env_set(va_list ap)
|
||||
*/
|
||||
static int API_env_enum(va_list ap)
|
||||
{
|
||||
int i, buflen;
|
||||
char *last, **next, *s;
|
||||
ENTRY *match, search;
|
||||
static char *var;
|
||||
int i, n;
|
||||
char *last, **next;
|
||||
|
||||
last = (char *)va_arg(ap, unsigned long);
|
||||
|
||||
if ((next = (char **)va_arg(ap, uintptr_t)) == NULL)
|
||||
return API_EINVAL;
|
||||
|
||||
if (last == NULL) {
|
||||
var = NULL;
|
||||
i = 0;
|
||||
} else {
|
||||
var = strdup(last);
|
||||
s = strchr(var, '=');
|
||||
if (s != NULL)
|
||||
*s = 0;
|
||||
search.key = var;
|
||||
i = hsearch_r(search, FIND, &match, &env_htab, 0);
|
||||
if (i == 0) {
|
||||
i = API_EINVAL;
|
||||
goto done;
|
||||
if (last == NULL)
|
||||
/* start over */
|
||||
*next = ((char *)env_get_addr(0));
|
||||
else {
|
||||
*next = last;
|
||||
|
||||
for (i = 0; env_get_char(i) != '\0'; i = n + 1) {
|
||||
for (n = i; env_get_char(n) != '\0'; ++n) {
|
||||
if (n >= CONFIG_ENV_SIZE) {
|
||||
/* XXX shouldn't we set *next = NULL?? */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (envmatch((uchar *)last, i) < 0)
|
||||
continue;
|
||||
|
||||
/* try to get next name */
|
||||
i = n + 1;
|
||||
if (env_get_char(i) == '\0') {
|
||||
/* no more left */
|
||||
*next = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*next = ((char *)env_get_addr(i));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* match the next entry after i */
|
||||
i = hmatch_r("", i, &match, &env_htab);
|
||||
if (i == 0)
|
||||
goto done;
|
||||
buflen = strlen(match->key) + strlen(match->data) + 2;
|
||||
var = realloc(var, buflen);
|
||||
snprintf(var, buflen, "%s=%s", match->key, match->data);
|
||||
*next = var;
|
||||
return 0;
|
||||
|
||||
done:
|
||||
free(var);
|
||||
var = NULL;
|
||||
*next = NULL;
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -624,7 +623,7 @@ int syscall(int call, int *retval, ...)
|
||||
|
||||
void api_init(void)
|
||||
{
|
||||
struct api_signature *sig;
|
||||
struct api_signature *sig = NULL;
|
||||
|
||||
/* TODO put this into linker set one day... */
|
||||
calls_table[API_RSVD] = NULL;
|
||||
@@ -662,7 +661,7 @@ void api_init(void)
|
||||
return;
|
||||
}
|
||||
|
||||
env_set_hex("api_address", (unsigned long)sig);
|
||||
setenv_hex("api_address", (unsigned long)sig);
|
||||
debugf("API sig @ 0x%lX\n", (unsigned long)sig);
|
||||
memcpy(sig->magic, API_SIG_MAGIC, 8);
|
||||
sig->version = API_SIG_VERSION;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (c) 2011 The Chromium OS Authors.
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2007 Semihalf
|
||||
*
|
||||
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -11,6 +12,8 @@
|
||||
#include <linux/types.h>
|
||||
#include <api_public.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#define DEBUG
|
||||
#undef DEBUG
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2007 Semihalf
|
||||
*
|
||||
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* This file contains routines that fetch data from ARM-dependent sources
|
||||
* (bd_info etc.)
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2007 Stanislav Galabov <sgalabov@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* This file contains routines that fetch data from bd_info sources
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2007 Semihalf
|
||||
*
|
||||
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* This file contains routines that fetch data from PowerPC-dependent sources
|
||||
* (bd_info etc.)
|
||||
*/
|
||||
@@ -29,8 +30,11 @@ int platform_sys_info(struct sys_info *si)
|
||||
si->clk_bus = gd->bus_clk;
|
||||
si->clk_cpu = gd->cpu_clk;
|
||||
|
||||
#if defined(CONFIG_MPC8xx) || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
|
||||
#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_MPC8260) || \
|
||||
defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
|
||||
#define bi_bar bi_immr_base
|
||||
#elif defined(CONFIG_MPC5xxx)
|
||||
#define bi_bar bi_mbar_base
|
||||
#elif defined(CONFIG_MPC83xx)
|
||||
#define bi_bar bi_immrbar
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* (C) Copyright 2007 Semihalf
|
||||
*
|
||||
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _API_PRIVATE_H_
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2007-2008 Semihalf
|
||||
*
|
||||
* Written by: Rafal Jaworowski <raj@semihalf.com>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
@@ -36,19 +37,16 @@ struct stor_spec {
|
||||
int max_dev;
|
||||
int enum_started;
|
||||
int enum_ended;
|
||||
int type; /* "external" type: DT_STOR_{IDE,USB,etc} */
|
||||
int type; /* "external" type: DT_STOR_{IDE,USB,etc} */
|
||||
char *name;
|
||||
};
|
||||
|
||||
static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, NULL }, };
|
||||
static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, "" }, };
|
||||
|
||||
#ifndef CONFIG_SYS_MMC_MAX_DEVICE
|
||||
#define CONFIG_SYS_MMC_MAX_DEVICE 1
|
||||
#endif
|
||||
|
||||
void dev_stor_init(void)
|
||||
{
|
||||
#if defined(CONFIG_IDE)
|
||||
#if defined(CONFIG_CMD_IDE)
|
||||
specs[ENUM_IDE].max_dev = CONFIG_SYS_IDE_MAXDEVICE;
|
||||
specs[ENUM_IDE].enum_started = 0;
|
||||
specs[ENUM_IDE].enum_ended = 0;
|
||||
@@ -62,7 +60,7 @@ void dev_stor_init(void)
|
||||
specs[ENUM_MMC].type = DEV_TYP_STOR | DT_STOR_MMC;
|
||||
specs[ENUM_MMC].name = "mmc";
|
||||
#endif
|
||||
#if defined(CONFIG_SATA)
|
||||
#if defined(CONFIG_CMD_SATA)
|
||||
specs[ENUM_SATA].max_dev = CONFIG_SYS_SATA_MAX_DEVICE;
|
||||
specs[ENUM_SATA].enum_started = 0;
|
||||
specs[ENUM_SATA].enum_ended = 0;
|
||||
@@ -90,67 +88,88 @@ void dev_stor_init(void)
|
||||
*
|
||||
* type: storage group type - ENUM_IDE, ENUM_SCSI etc.
|
||||
*
|
||||
* first: if 1 the first device in the storage group is returned (if
|
||||
* exists), if 0 the next available device is searched
|
||||
*
|
||||
* more: returns 0/1 depending if there are more devices in this group
|
||||
* available (for future iterations)
|
||||
*
|
||||
* returns: 0/1 depending if device found in this iteration
|
||||
*/
|
||||
static int dev_stor_get(int type, int *more, struct device_info *di)
|
||||
static int dev_stor_get(int type, int first, int *more, struct device_info *di)
|
||||
{
|
||||
struct blk_desc *dd;
|
||||
int found = 0;
|
||||
int i = 0;
|
||||
*more = 0;
|
||||
|
||||
/* Wasn't configured for this type, return 0 directly */
|
||||
if (specs[type].name == NULL)
|
||||
return 0;
|
||||
int i;
|
||||
|
||||
if (di->cookie != NULL) {
|
||||
/* Find the last device we've returned */
|
||||
for (i = 0; i < specs[type].max_dev; i++) {
|
||||
struct blk_desc *dd;
|
||||
|
||||
if (first) {
|
||||
di->cookie = (void *)blk_get_dev(specs[type].name, 0);
|
||||
if (di->cookie == NULL)
|
||||
return 0;
|
||||
else
|
||||
found = 1;
|
||||
|
||||
/* provide hint if there are more devices in
|
||||
* this group to enumerate */
|
||||
if (1 < specs[type].max_dev)
|
||||
*more = 1;
|
||||
|
||||
} else {
|
||||
for (i = 0; i < specs[type].max_dev; i++)
|
||||
if (di->cookie ==
|
||||
(void *)blk_get_dev(specs[type].name, i)) {
|
||||
i += 1;
|
||||
/* previous cookie found -- advance to the
|
||||
* next device, if possible */
|
||||
|
||||
if (++i >= specs[type].max_dev) {
|
||||
/* out of range, no more to enum */
|
||||
di->cookie = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
di->cookie = (void *)blk_get_dev(
|
||||
specs[type].name, i);
|
||||
if (di->cookie == NULL)
|
||||
return 0;
|
||||
else
|
||||
found = 1;
|
||||
|
||||
/* provide hint if there are more devices in
|
||||
* this group to enumerate */
|
||||
if ((i + 1) < specs[type].max_dev)
|
||||
*more = 1;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < specs[type].max_dev; i++) {
|
||||
di->cookie = (void *)blk_get_dev(specs[type].name, i);
|
||||
|
||||
if (di->cookie != NULL) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == specs[type].max_dev)
|
||||
*more = 0;
|
||||
else
|
||||
*more = 1;
|
||||
|
||||
if (found) {
|
||||
di->type = specs[type].type;
|
||||
|
||||
dd = (struct blk_desc *)di->cookie;
|
||||
if (dd->type == DEV_TYPE_UNKNOWN) {
|
||||
debugf("device instance exists, but is not active..");
|
||||
found = 0;
|
||||
} else {
|
||||
di->di_stor.block_count = dd->lba;
|
||||
di->di_stor.block_size = dd->blksz;
|
||||
if (di->cookie != NULL) {
|
||||
dd = (struct blk_desc *)di->cookie;
|
||||
if (dd->type == DEV_TYPE_UNKNOWN) {
|
||||
debugf("device instance exists, but is not active..");
|
||||
found = 0;
|
||||
} else {
|
||||
di->di_stor.block_count = dd->lba;
|
||||
di->di_stor.block_size = dd->blksz;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
} else
|
||||
di->cookie = NULL;
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
/* returns: ENUM_IDE, ENUM_USB etc. based on struct blk_desc */
|
||||
|
||||
/*
|
||||
* returns: ENUM_IDE, ENUM_USB etc. based on struct blk_desc
|
||||
*/
|
||||
static int dev_stor_type(struct blk_desc *dd)
|
||||
{
|
||||
int i, j;
|
||||
@@ -164,8 +183,9 @@ static int dev_stor_type(struct blk_desc *dd)
|
||||
}
|
||||
|
||||
|
||||
/* returns: 0/1 whether cookie points to some device in this group */
|
||||
|
||||
/*
|
||||
* returns: 0/1 whether cookie points to some device in this group
|
||||
*/
|
||||
static int dev_is_stor(int type, struct device_info *di)
|
||||
{
|
||||
return (dev_stor_type(di->cookie) == type) ? 1 : 0;
|
||||
@@ -196,16 +216,18 @@ static int dev_enum_stor(int type, struct device_info *di)
|
||||
*/
|
||||
|
||||
if (di->cookie == NULL) {
|
||||
|
||||
debugf("group%d - enum restart\n", type);
|
||||
|
||||
/*
|
||||
* 1. Enumeration (re-)started: take the first available
|
||||
* device, if exists
|
||||
*/
|
||||
found = dev_stor_get(type, &more, di);
|
||||
found = dev_stor_get(type, 1, &more, di);
|
||||
specs[type].enum_started = 1;
|
||||
|
||||
} else if (dev_is_stor(type, di)) {
|
||||
|
||||
debugf("group%d - enum continued for the next device\n", type);
|
||||
|
||||
if (specs[type].enum_ended) {
|
||||
@@ -214,9 +236,10 @@ static int dev_enum_stor(int type, struct device_info *di)
|
||||
}
|
||||
|
||||
/* 2a. Attempt to take a next available device in the group */
|
||||
found = dev_stor_get(type, &more, di);
|
||||
found = dev_stor_get(type, 0, &more, di);
|
||||
|
||||
} else {
|
||||
|
||||
if (specs[type].enum_ended) {
|
||||
debugf("group %d - already enumerated, skipping\n", type);
|
||||
return 0;
|
||||
@@ -228,7 +251,7 @@ static int dev_enum_stor(int type, struct device_info *di)
|
||||
/*
|
||||
* 2b. If enumerating devices in this group did not
|
||||
* happen before, it means the cookie pointed to a
|
||||
* device from some other group (another storage
|
||||
* device frome some other group (another storage
|
||||
* group, or network); in this case try to take the
|
||||
* first available device from our group
|
||||
*/
|
||||
@@ -238,7 +261,7 @@ static int dev_enum_stor(int type, struct device_info *di)
|
||||
* Attempt to take the first device in this group:
|
||||
*'first element' flag is set
|
||||
*/
|
||||
found = dev_stor_get(type, &more, di);
|
||||
found = dev_stor_get(type, 1, &more, di);
|
||||
|
||||
} else {
|
||||
errf("group%d - out of order iteration\n", type);
|
||||
@@ -255,7 +278,7 @@ static int dev_enum_stor(int type, struct device_info *di)
|
||||
|
||||
if (found)
|
||||
debugf("device found, returning cookie 0x%08x\n",
|
||||
(u_int32_t)di->cookie);
|
||||
(u_int32_t)di->cookie);
|
||||
else
|
||||
debugf("no device found\n");
|
||||
|
||||
@@ -276,7 +299,9 @@ int dev_enum_storage(struct device_info *di)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* check: ide, usb, scsi, mmc */
|
||||
/*
|
||||
* check: ide, usb, scsi, mmc
|
||||
*/
|
||||
for (i = ENUM_IDE; i < ENUM_MAX; i ++) {
|
||||
if (dev_enum_stor(i, di))
|
||||
return 1;
|
||||
@@ -333,14 +358,10 @@ lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start
|
||||
if (!dev_stor_is_valid(type, dd))
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_BLK
|
||||
return blk_dread(dd, start, len, buf);
|
||||
#else
|
||||
if ((dd->block_read) == NULL) {
|
||||
debugf("no block_read() for device 0x%08x\n", cookie);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return dd->block_read(dd, start, len, buf);
|
||||
#endif /* defined(CONFIG_BLK) */
|
||||
}
|
||||
|
||||
109
arch/Kconfig
109
arch/Kconfig
@@ -10,12 +10,8 @@ choice
|
||||
|
||||
config ARC
|
||||
bool "ARC architecture"
|
||||
select ARCH_EARLY_INIT_R
|
||||
select ARC_TIMER
|
||||
select CLK
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
select SUPPORT_OF_CONTROL
|
||||
select TIMER
|
||||
|
||||
config ARM
|
||||
bool "ARM architecture"
|
||||
@@ -23,16 +19,20 @@ config ARM
|
||||
select HAVE_PRIVATE_LIBGCC if !ARM64
|
||||
select SUPPORT_OF_CONTROL
|
||||
|
||||
config AVR32
|
||||
bool "AVR32 architecture"
|
||||
select CREATE_ARCH_SYMLINK
|
||||
|
||||
config BLACKFIN
|
||||
bool "Blackfin architecture"
|
||||
|
||||
config M68K
|
||||
bool "M68000 architecture"
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
select SYS_BOOT_GET_CMDLINE
|
||||
select SYS_BOOT_GET_KBD
|
||||
|
||||
config MICROBLAZE
|
||||
bool "MicroBlaze architecture"
|
||||
select SUPPORT_OF_CONTROL
|
||||
imply CMD_IRQ
|
||||
|
||||
config MIPS
|
||||
bool "MIPS architecture"
|
||||
@@ -42,97 +42,51 @@ config MIPS
|
||||
|
||||
config NDS32
|
||||
bool "NDS32 architecture"
|
||||
select SUPPORT_OF_CONTROL
|
||||
|
||||
config NIOS2
|
||||
bool "Nios II architecture"
|
||||
select CPU
|
||||
select DM
|
||||
select OF_CONTROL
|
||||
select SUPPORT_OF_CONTROL
|
||||
imply CMD_DM
|
||||
select OF_CONTROL
|
||||
select DM
|
||||
select CPU
|
||||
|
||||
config OPENRISC
|
||||
bool "OpenRISC architecture"
|
||||
|
||||
config PPC
|
||||
bool "PowerPC architecture"
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
select SUPPORT_OF_CONTROL
|
||||
select SYS_BOOT_GET_CMDLINE
|
||||
select SYS_BOOT_GET_KBD
|
||||
|
||||
config RISCV
|
||||
bool "riscv architecture"
|
||||
select SUPPORT_OF_CONTROL
|
||||
|
||||
config SANDBOX
|
||||
bool "Sandbox"
|
||||
select BOARD_LATE_INIT
|
||||
select DM
|
||||
select DM_GPIO
|
||||
select DM_I2C
|
||||
select DM_KEYBOARD
|
||||
select DM_MMC
|
||||
select DM_SERIAL
|
||||
select DM_SPI
|
||||
select DM_SPI_FLASH
|
||||
select HAVE_BLOCK_DEVICE
|
||||
select LZO
|
||||
select SPI
|
||||
select SUPPORT_OF_CONTROL
|
||||
imply CMD_DM
|
||||
imply CMD_GETTIME
|
||||
imply CMD_HASH
|
||||
imply CMD_IO
|
||||
imply CMD_IOTRACE
|
||||
imply CMD_LZMADEC
|
||||
imply CMD_SATA
|
||||
imply CMD_SF_TEST
|
||||
imply CRC32_VERIFY
|
||||
imply FAT_WRITE
|
||||
imply HASH_VERIFY
|
||||
imply LZMA
|
||||
imply SCSI
|
||||
select DM
|
||||
select DM_SPI_FLASH
|
||||
select DM_SERIAL
|
||||
select DM_I2C
|
||||
select DM_SPI
|
||||
select DM_GPIO
|
||||
select DM_MMC
|
||||
|
||||
config SH
|
||||
bool "SuperH architecture"
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
|
||||
config SPARC
|
||||
bool "SPARC architecture"
|
||||
select CREATE_ARCH_SYMLINK
|
||||
|
||||
config X86
|
||||
bool "x86 architecture"
|
||||
select CREATE_ARCH_SYMLINK
|
||||
select DM
|
||||
select DM_PCI
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
select OF_CONTROL
|
||||
select PCI
|
||||
select SUPPORT_OF_CONTROL
|
||||
select TIMER
|
||||
select USE_PRIVATE_LIBGCC
|
||||
select X86_TSC_TIMER
|
||||
imply BLK
|
||||
imply CMD_DM
|
||||
imply CMD_FPGA_LOADMK
|
||||
imply CMD_GETTIME
|
||||
imply CMD_IO
|
||||
imply CMD_IRQ
|
||||
imply CMD_PCI
|
||||
imply CMD_SF_TEST
|
||||
imply CMD_ZBOOT
|
||||
imply DM_ETH
|
||||
imply DM_GPIO
|
||||
imply DM_KEYBOARD
|
||||
imply DM_MMC
|
||||
imply DM_RTC
|
||||
imply DM_SCSI
|
||||
imply DM_SERIAL
|
||||
imply DM_SPI
|
||||
imply DM_SPI_FLASH
|
||||
imply DM_USB
|
||||
imply DM_VIDEO
|
||||
imply SYSRESET
|
||||
imply SYSRESET_X86
|
||||
imply USB_ETHER_ASIX
|
||||
imply USB_ETHER_SMSC95XX
|
||||
imply USB_HOST_ETHER
|
||||
select DM
|
||||
select DM_SERIAL
|
||||
select DM_GPIO
|
||||
select DM_SPI
|
||||
select DM_SPI_FLASH
|
||||
|
||||
config XTENSA
|
||||
bool "Xtensa architecture"
|
||||
@@ -199,14 +153,17 @@ config SYS_CONFIG_NAME
|
||||
|
||||
source "arch/arc/Kconfig"
|
||||
source "arch/arm/Kconfig"
|
||||
source "arch/avr32/Kconfig"
|
||||
source "arch/blackfin/Kconfig"
|
||||
source "arch/m68k/Kconfig"
|
||||
source "arch/microblaze/Kconfig"
|
||||
source "arch/mips/Kconfig"
|
||||
source "arch/nds32/Kconfig"
|
||||
source "arch/nios2/Kconfig"
|
||||
source "arch/openrisc/Kconfig"
|
||||
source "arch/powerpc/Kconfig"
|
||||
source "arch/sandbox/Kconfig"
|
||||
source "arch/sh/Kconfig"
|
||||
source "arch/sparc/Kconfig"
|
||||
source "arch/x86/Kconfig"
|
||||
source "arch/xtensa/Kconfig"
|
||||
source "arch/riscv/Kconfig"
|
||||
|
||||
@@ -31,36 +31,36 @@ choice
|
||||
|
||||
config CPU_ARC750D
|
||||
bool "ARC 750D"
|
||||
depends on ISA_ARCOMPACT
|
||||
select ARC_MMU_V2
|
||||
depends on ISA_ARCOMPACT
|
||||
help
|
||||
Choose this option to build an U-Boot for ARC750D CPU.
|
||||
|
||||
config CPU_ARC770D
|
||||
bool "ARC 770D"
|
||||
depends on ISA_ARCOMPACT
|
||||
select ARC_MMU_V3
|
||||
depends on ISA_ARCOMPACT
|
||||
help
|
||||
Choose this option to build an U-Boot for ARC770D CPU.
|
||||
|
||||
config CPU_ARCEM6
|
||||
bool "ARC EM6"
|
||||
depends on ISA_ARCV2
|
||||
select ARC_MMU_ABSENT
|
||||
depends on ISA_ARCV2
|
||||
help
|
||||
Next Generation ARC Core based on ISA-v2 ISA without MMU.
|
||||
|
||||
config CPU_ARCHS36
|
||||
bool "ARC HS36"
|
||||
depends on ISA_ARCV2
|
||||
select ARC_MMU_ABSENT
|
||||
depends on ISA_ARCV2
|
||||
help
|
||||
Next Generation ARC Core based on ISA-v2 ISA without MMU.
|
||||
|
||||
config CPU_ARCHS38
|
||||
bool "ARC HS38"
|
||||
depends on ISA_ARCV2
|
||||
select ARC_MMU_V4
|
||||
depends on ISA_ARCV2
|
||||
help
|
||||
Next Generation ARC Core based on ISA-v2 ISA with MMU.
|
||||
|
||||
@@ -116,27 +116,9 @@ config SYS_DCACHE_OFF
|
||||
bool "Do not use Data Cache"
|
||||
default n
|
||||
|
||||
menuconfig ARC_DBG
|
||||
bool "ARC debugging"
|
||||
default n
|
||||
|
||||
if ARC_DBG
|
||||
|
||||
config ARC_DBG_IOC_ENABLE
|
||||
bool "Enable IO coherency unit"
|
||||
depends on CPU_ARCHS38
|
||||
default n
|
||||
help
|
||||
Enable IO coherency unit to debug problems with caches and
|
||||
DMA peripherals.
|
||||
NOTE: as of today linux will not work properly if this option
|
||||
is enabled in u-boot!
|
||||
|
||||
endif
|
||||
|
||||
choice
|
||||
prompt "Target select"
|
||||
default TARGET_AXS103
|
||||
default TARGET_AXS10X
|
||||
|
||||
config TARGET_TB100
|
||||
bool "Support tb100"
|
||||
@@ -144,25 +126,13 @@ config TARGET_TB100
|
||||
config TARGET_NSIM
|
||||
bool "Support standalone nSIM & Free nSIM"
|
||||
|
||||
config TARGET_AXS101
|
||||
bool "Support Synopsys Designware SDP board AXS101"
|
||||
|
||||
config TARGET_AXS103
|
||||
bool "Support Synopsys Designware SDP board AXS103"
|
||||
|
||||
config TARGET_EMDK
|
||||
bool "Synopsys EM Development kit"
|
||||
select CPU_ARCEM6
|
||||
|
||||
config TARGET_HSDK
|
||||
bool "Support Synpsys HS DevelopmentKit board"
|
||||
config TARGET_AXS10X
|
||||
bool "Support Synopsys Designware SDP board (AXS101 & AXS103)"
|
||||
|
||||
endchoice
|
||||
|
||||
source "board/abilis/tb100/Kconfig"
|
||||
source "board/synopsys/Kconfig"
|
||||
source "board/synopsys/axs10x/Kconfig"
|
||||
source "board/synopsys/emdk/Kconfig"
|
||||
source "board/synopsys/hsdk/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
libs-y += arch/arc/cpu/$(CPU)/
|
||||
libs-y += arch/arc/lib/
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
ifndef CONFIG_CPU_BIG_ENDIAN
|
||||
CONFIG_SYS_LITTLE_ENDIAN = 1
|
||||
@@ -29,15 +31,15 @@ CONFIG_MMU = 1
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CPU_ARC750D
|
||||
PLATFORM_CPPFLAGS += -mcpu=arc700
|
||||
PLATFORM_CPPFLAGS += -marc700
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CPU_ARC770D
|
||||
PLATFORM_CPPFLAGS += -mcpu=arc700 -mlock -mswape
|
||||
PLATFORM_CPPFLAGS += -marc700 -mlock -mswape
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CPU_ARCEM6
|
||||
PLATFORM_CPPFLAGS += -mcpu=arcem
|
||||
PLATFORM_CPPFLAGS += -marcem
|
||||
endif
|
||||
|
||||
ifdef CONFIG_CPU_ARCHS34
|
||||
@@ -48,11 +50,10 @@ ifdef CONFIG_CPU_ARCHS38
|
||||
PLATFORM_CPPFLAGS += -mcpu=archs
|
||||
endif
|
||||
|
||||
PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2 -mno-sdata
|
||||
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
|
||||
PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2
|
||||
|
||||
# Needed for relocation
|
||||
LDFLAGS_FINAL += -pie --gc-sections
|
||||
LDFLAGS_FINAL += -pie
|
||||
|
||||
# Load address for standalone apps
|
||||
CONFIG_STANDALONE_LOAD_ADDR ?= 0x82000000
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += ivt.o
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
.section .ivt, "ax",@progbits
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
obj-y += ivt.o
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
.section .ivt, "a",@progbits
|
||||
|
||||
@@ -1,26 +1,18 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearc", "elf32-bigarc", "elf32-littlearc")
|
||||
OUTPUT_FORMAT("elf32-littlearc", "elf32-littlearc", "elf32-littlearc")
|
||||
OUTPUT_ARCH(arc)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
. = CONFIG_SYS_TEXT_BASE;
|
||||
__image_copy_start = .;
|
||||
. = ALIGN(1024);
|
||||
__ivt_start = .;
|
||||
.ivt :
|
||||
{
|
||||
KEEP(*(.ivt))
|
||||
}
|
||||
__ivt_end = .;
|
||||
|
||||
. = ALIGN(1024);
|
||||
__text_start = .;
|
||||
.text : {
|
||||
arch/arc/lib/start.o (.text*)
|
||||
@@ -28,6 +20,14 @@ SECTIONS
|
||||
}
|
||||
__text_end = .;
|
||||
|
||||
. = ALIGN(1024);
|
||||
__ivt_start = .;
|
||||
.ivt :
|
||||
{
|
||||
*(.ivt)
|
||||
}
|
||||
__ivt_end = .;
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : {
|
||||
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
|
||||
|
||||
1
arch/arc/dts/.gitignore
vendored
Normal file
1
arch/arc/dts/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.dtb
|
||||
@@ -1,11 +1,10 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
dtb-$(CONFIG_TARGET_AXS101) += axs101.dtb
|
||||
dtb-$(CONFIG_TARGET_AXS103) += axs103.dtb
|
||||
dtb-$(CONFIG_TARGET_AXS10X) += axs10x.dtb
|
||||
dtb-$(CONFIG_TARGET_NSIM) += nsim.dtb
|
||||
dtb-$(CONFIG_TARGET_TB100) += abilis_tb100.dtb
|
||||
dtb-$(CONFIG_TARGET_EMDK) += emdk.dtb
|
||||
dtb-$(CONFIG_TARGET_HSDK) += hsdk.dtb
|
||||
|
||||
targets += $(dtb-y)
|
||||
|
||||
|
||||
@@ -1,25 +1,20 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2015 Synopsys, Inc. (www.synopsys.com)
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
aliases {
|
||||
console = &uart0;
|
||||
};
|
||||
|
||||
cpu_card {
|
||||
core_clk: core_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <500000000>;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
uart0: serial@ff100000 {
|
||||
compatible = "snps,dw-apb-uart";
|
||||
reg = <0xff100000 0x1000>;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2017 Synopsys, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/include/ "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
cpu_card {
|
||||
core_clk: core_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <750000000>;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2017 Synopsys, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/include/ "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
cpu_card {
|
||||
core_clk: core_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <100000000>;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2017 Synopsys, Inc. All rights reserved.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
/include/ "axc001.dtsi"
|
||||
/include/ "axs10x_mb.dtsi"
|
||||
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
stdout-path = &uart0;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2017 Synopsys, Inc. All rights reserved.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
/include/ "axc003.dtsi"
|
||||
/include/ "axs10x_mb.dtsi"
|
||||
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
stdout-path = &uart0;
|
||||
};
|
||||
};
|
||||
|
||||
57
arch/arc/dts/axs10x.dts
Normal file
57
arch/arc/dts/axs10x.dts
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
aliases {
|
||||
console = &uart0;
|
||||
};
|
||||
|
||||
clocks {
|
||||
apbclk: apbclk {
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <50000000>;
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
uart0: serial0@e0022000 {
|
||||
compatible = "snps,dw-apb-uart";
|
||||
reg = <0xe0022000 0x1000>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <4>;
|
||||
};
|
||||
|
||||
ethernet@e0018000 {
|
||||
#interrupt-cells = <1>;
|
||||
compatible = "altr,socfpga-stmmac";
|
||||
reg = < 0xe0018000 0x2000 >;
|
||||
interrupts = < 25 >;
|
||||
interrupt-names = "macirq";
|
||||
phy-mode = "gmii";
|
||||
snps,pbl = < 32 >;
|
||||
clocks = <&apbclk>;
|
||||
clock-names = "stmmaceth";
|
||||
max-speed = <100>;
|
||||
};
|
||||
|
||||
ehci@0xe0040000 {
|
||||
compatible = "generic-ehci";
|
||||
reg = < 0xe0040000 0x100 >;
|
||||
interrupts = < 8 >;
|
||||
};
|
||||
|
||||
ohci@0xe0060000 {
|
||||
compatible = "generic-ohci";
|
||||
reg = < 0xe0060000 0x100 >;
|
||||
interrupts = < 8 >;
|
||||
};
|
||||
};
|
||||
@@ -1,94 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2017 Synopsys, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
spi0 = &spi0;
|
||||
};
|
||||
|
||||
axs10x_mb@e0000000 {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges = <0x00000000 0xe0000000 0x10000000>;
|
||||
u-boot,dm-pre-reloc;
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
u-boot,dm-pre-reloc;
|
||||
|
||||
apbclk: apbclk {
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <50000000>;
|
||||
#clock-cells = <0>;
|
||||
};
|
||||
|
||||
uartclk: uartclk {
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <33333333>;
|
||||
#clock-cells = <0>;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
ethernet@18000 {
|
||||
compatible = "altr,socfpga-stmmac";
|
||||
reg = < 0x18000 0x2000 >;
|
||||
phy-mode = "gmii";
|
||||
snps,pbl = < 32 >;
|
||||
clocks = <&apbclk>;
|
||||
clock-names = "stmmaceth";
|
||||
max-speed = <100>;
|
||||
};
|
||||
|
||||
ehci@0x40000 {
|
||||
compatible = "generic-ehci";
|
||||
reg = < 0x40000 0x100 >;
|
||||
};
|
||||
|
||||
ohci@0x60000 {
|
||||
compatible = "generic-ohci";
|
||||
reg = < 0x60000 0x100 >;
|
||||
};
|
||||
|
||||
uart0: serial0@22000 {
|
||||
compatible = "snps,dw-apb-uart";
|
||||
reg = <0x22000 0x100>;
|
||||
clocks = <&uartclk>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <4>;
|
||||
};
|
||||
|
||||
spi0: spi@0 {
|
||||
compatible = "snps,dw-apb-ssi";
|
||||
reg = <0x0 0x100>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-max-frequency = <4000000>;
|
||||
clocks = <&apbclk>;
|
||||
clock-names = "spi_clk";
|
||||
cs-gpio = <&cs_gpio 0>;
|
||||
spi_flash@0 {
|
||||
compatible = "spi-flash";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <4000000>;
|
||||
};
|
||||
};
|
||||
|
||||
cs_gpio: gpio@11218 {
|
||||
compatible = "snps,creg-gpio";
|
||||
reg = <0x11218 0x4>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <1>;
|
||||
gpio-bank-name = "axs-spi-cs";
|
||||
gpio-count = <1>;
|
||||
gpio-first-shift = <0>;
|
||||
gpio-bit-per-line = <2>;
|
||||
gpio-activate-val = <1>;
|
||||
gpio-deactivate-val = <3>;
|
||||
gpio-default-val = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -1,33 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2018 Synopsys, Inc. All rights reserved.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
aliases {
|
||||
console = &uart0;
|
||||
};
|
||||
|
||||
cpu_card {
|
||||
core_clk: core_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <40000000>;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
uart0: serial0@f0004000 {
|
||||
compatible = "snps,dw-apb-uart";
|
||||
clock-frequency = <100000000>;
|
||||
reg = <0xf0004000 0x1000>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <4>;
|
||||
};
|
||||
};
|
||||
@@ -1,116 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2017 Synopsys, Inc. All rights reserved.
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
#include "dt-bindings/clock/snps,hsdk-cgu.h"
|
||||
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
aliases {
|
||||
console = &uart0;
|
||||
spi0 = &spi0;
|
||||
};
|
||||
|
||||
cpu_card {
|
||||
core_clk: core_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <500000000>;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
clk-fmeas {
|
||||
clocks = <&cgu_clk CLK_ARC_PLL>, <&cgu_clk CLK_SYS_PLL>,
|
||||
<&cgu_clk CLK_TUN_PLL>, <&cgu_clk CLK_DDR_PLL>,
|
||||
<&cgu_clk CLK_ARC>, <&cgu_clk CLK_HDMI_PLL>,
|
||||
<&cgu_clk CLK_TUN_TUN>, <&cgu_clk CLK_HDMI>,
|
||||
<&cgu_clk CLK_SYS_APB>, <&cgu_clk CLK_SYS_AXI>,
|
||||
<&cgu_clk CLK_SYS_ETH>, <&cgu_clk CLK_SYS_USB>,
|
||||
<&cgu_clk CLK_SYS_SDIO>, <&cgu_clk CLK_SYS_HDMI>,
|
||||
<&cgu_clk CLK_SYS_GFX_CORE>, <&cgu_clk CLK_SYS_GFX_DMA>,
|
||||
<&cgu_clk CLK_SYS_GFX_CFG>, <&cgu_clk CLK_SYS_DMAC_CORE>,
|
||||
<&cgu_clk CLK_SYS_DMAC_CFG>, <&cgu_clk CLK_SYS_SDIO_REF>,
|
||||
<&cgu_clk CLK_SYS_SPI_REF>, <&cgu_clk CLK_SYS_I2C_REF>,
|
||||
<&cgu_clk CLK_SYS_UART_REF>, <&cgu_clk CLK_SYS_EBI_REF>,
|
||||
<&cgu_clk CLK_TUN_ROM>, <&cgu_clk CLK_TUN_PWM>;
|
||||
clock-names = "cpu-pll", "sys-pll",
|
||||
"tun-pll", "ddr-clk",
|
||||
"cpu-clk", "hdmi-pll",
|
||||
"tun-clk", "hdmi-clk",
|
||||
"apb-clk", "axi-clk",
|
||||
"eth-clk", "usb-clk",
|
||||
"sdio-clk", "hdmi-sys-clk",
|
||||
"gfx-core-clk", "gfx-dma-clk",
|
||||
"gfx-cfg-clk", "dmac-core-clk",
|
||||
"dmac-cfg-clk", "sdio-ref-clk",
|
||||
"spi-clk", "i2c-clk",
|
||||
"uart-clk", "ebi-clk",
|
||||
"rom-clk", "pwm-clk";
|
||||
};
|
||||
|
||||
cgu_clk: cgu-clk@f0000000 {
|
||||
compatible = "snps,hsdk-cgu-clock";
|
||||
reg = <0xf0000000 0x10>, <0xf00014B8 0x4>;
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
|
||||
uart0: serial0@f0005000 {
|
||||
compatible = "snps,dw-apb-uart";
|
||||
reg = <0xf0005000 0x1000>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <4>;
|
||||
};
|
||||
|
||||
ethernet@f0008000 {
|
||||
#interrupt-cells = <1>;
|
||||
compatible = "altr,socfpga-stmmac";
|
||||
reg = <0xf0008000 0x2000>;
|
||||
phy-mode = "gmii";
|
||||
};
|
||||
|
||||
ehci@0xf0040000 {
|
||||
compatible = "generic-ehci";
|
||||
reg = <0xf0040000 0x100>;
|
||||
};
|
||||
|
||||
ohci@0xf0060000 {
|
||||
compatible = "generic-ohci";
|
||||
reg = <0xf0060000 0x100>;
|
||||
};
|
||||
|
||||
spi0: spi@f0020000 {
|
||||
compatible = "snps,dw-apb-ssi";
|
||||
reg = <0xf0020000 0x1000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
spi-max-frequency = <4000000>;
|
||||
clocks = <&cgu_clk CLK_SYS_SPI_REF>;
|
||||
clock-names = "spi_clk";
|
||||
cs-gpio = <&cs_gpio 0>;
|
||||
spi_flash@0 {
|
||||
compatible = "spi-flash";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <4000000>;
|
||||
};
|
||||
};
|
||||
|
||||
cs_gpio: gpio@f00014b0 {
|
||||
compatible = "snps,creg-gpio";
|
||||
reg = <0xf00014b0 0x4>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <1>;
|
||||
gpio-bank-name = "hsdk-spi-cs";
|
||||
gpio-count = <1>;
|
||||
gpio-first-shift = <0>;
|
||||
gpio-bit-per-line = <2>;
|
||||
gpio-activate-val = <2>;
|
||||
gpio-deactivate-val = <3>;
|
||||
gpio-default-val = <1>;
|
||||
};
|
||||
};
|
||||
@@ -1,29 +1,24 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2015-2016 Synopsys, Inc. (www.synopsys.com)
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
/dts-v1/;
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
aliases {
|
||||
console = &arcuart0;
|
||||
};
|
||||
|
||||
cpu_card {
|
||||
core_clk: core_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <70000000>;
|
||||
u-boot,dm-pre-reloc;
|
||||
};
|
||||
};
|
||||
|
||||
arcuart0: serial@0xc0fc1000 {
|
||||
compatible = "snps,arc-uart";
|
||||
reg = <0xc0fc1000 0x100>;
|
||||
clock-frequency = <70000000>;
|
||||
clock-frequency = <80000000>;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -9,22 +9,5 @@
|
||||
#size-cells = <1>;
|
||||
chosen { };
|
||||
aliases { };
|
||||
|
||||
cpu_card {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
u-boot,dm-pre-reloc;
|
||||
|
||||
timer@0 {
|
||||
compatible = "snps,arc-timer";
|
||||
clocks = <&core_clk>;
|
||||
reg = <0 1>;
|
||||
};
|
||||
};
|
||||
|
||||
memory@80000000 {
|
||||
device_type = "memory";
|
||||
reg = <0x80000000 0x10000000>; /* 256M */
|
||||
};
|
||||
memory { device_type = "memory"; reg = <0 0>; };
|
||||
};
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* ARC Build Configuration Registers, with encoded hardware config
|
||||
*
|
||||
* Copyright (C) 2018 Synopsys
|
||||
* Author: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
|
||||
*
|
||||
* This file is licensed under the terms of the GNU General Public
|
||||
* License version 2. This program is licensed "as is" without any
|
||||
* warranty of any kind, whether express or implied.
|
||||
*/
|
||||
|
||||
#ifndef __ARC_BCR_H
|
||||
#define __ARC_BCR_H
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <config.h>
|
||||
|
||||
union bcr_di_cache {
|
||||
struct {
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
unsigned int pad:12, line_len:4, sz:4, config:4, ver:8;
|
||||
#else
|
||||
unsigned int ver:8, config:4, sz:4, line_len:4, pad:12;
|
||||
#endif
|
||||
} fields;
|
||||
unsigned int word;
|
||||
};
|
||||
|
||||
union bcr_slc_cfg {
|
||||
struct {
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
unsigned int pad:24, way:2, lsz:2, sz:4;
|
||||
#else
|
||||
unsigned int sz:4, lsz:2, way:2, pad:24;
|
||||
#endif
|
||||
} fields;
|
||||
unsigned int word;
|
||||
};
|
||||
|
||||
union bcr_generic {
|
||||
struct {
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
unsigned int pad:24, ver:8;
|
||||
#else
|
||||
unsigned int ver:8, pad:24;
|
||||
#endif
|
||||
} fields;
|
||||
unsigned int word;
|
||||
};
|
||||
|
||||
union bcr_clust_cfg {
|
||||
struct {
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
unsigned int pad:7, c:1, num_entries:8, num_cores:8, ver:8;
|
||||
#else
|
||||
unsigned int ver:8, num_cores:8, num_entries:8, c:1, pad:7;
|
||||
#endif
|
||||
} fields;
|
||||
unsigned int word;
|
||||
};
|
||||
|
||||
union bcr_mmu_4 {
|
||||
struct {
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
unsigned int ver:8, sasid:1, sz1:4, sz0:4, res:2, pae:1,
|
||||
n_ways:2, n_entry:2, n_super:2, u_itlb:3, u_dtlb:3;
|
||||
#else
|
||||
/* DTLB ITLB JES JE JA */
|
||||
unsigned int u_dtlb:3, u_itlb:3, n_super:2, n_entry:2, n_ways:2,
|
||||
pae:1, res:2, sz0:4, sz1:4, sasid:1, ver:8;
|
||||
#endif
|
||||
} fields;
|
||||
unsigned int word;
|
||||
};
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARC_BCR_H */
|
||||
@@ -1,13 +1,13 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _ASM_ARC_ARCREGS_H
|
||||
#define _ASM_ARC_ARCREGS_H
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <config.h>
|
||||
|
||||
/*
|
||||
* ARC architecture has additional address space - auxiliary registers.
|
||||
@@ -19,9 +19,6 @@
|
||||
#define ARC_AUX_IDENTITY 0x04
|
||||
#define ARC_AUX_STATUS32 0x0a
|
||||
|
||||
/* STATUS32 Bits Positions */
|
||||
#define STATUS_AD_BIT 19 /* Enable unaligned access */
|
||||
|
||||
/* Instruction cache related auxiliary registers */
|
||||
#define ARC_AUX_IC_IVIC 0x10
|
||||
#define ARC_AUX_IC_CTRL 0x11
|
||||
@@ -30,22 +27,12 @@
|
||||
#define ARC_AUX_IC_PTAG 0x1E
|
||||
#endif
|
||||
#define ARC_BCR_IC_BUILD 0x77
|
||||
#define AUX_AUX_CACHE_LIMIT 0x5D
|
||||
#define ARC_AUX_NON_VOLATILE_LIMIT 0x5E
|
||||
|
||||
/* ICCM and DCCM auxiliary registers */
|
||||
#define ARC_AUX_DCCM_BASE 0x18 /* DCCM Base Addr ARCv2 */
|
||||
#define ARC_AUX_ICCM_BASE 0x208 /* ICCM Base Addr ARCv2 */
|
||||
|
||||
/* Timer related auxiliary registers */
|
||||
#define ARC_AUX_TIMER0_CNT 0x21 /* Timer 0 count */
|
||||
#define ARC_AUX_TIMER0_CTRL 0x22 /* Timer 0 control */
|
||||
#define ARC_AUX_TIMER0_LIMIT 0x23 /* Timer 0 limit */
|
||||
|
||||
#define ARC_AUX_TIMER1_CNT 0x100 /* Timer 1 count */
|
||||
#define ARC_AUX_TIMER1_CTRL 0x101 /* Timer 1 control */
|
||||
#define ARC_AUX_TIMER1_LIMIT 0x102 /* Timer 1 limit */
|
||||
|
||||
#define ARC_AUX_INTR_VEC_BASE 0x25
|
||||
|
||||
/* Data cache related auxiliary registers */
|
||||
@@ -66,15 +53,8 @@
|
||||
#define ARC_AUX_SLC_INVALIDATE 0x905
|
||||
#define ARC_AUX_SLC_IVDL 0x910
|
||||
#define ARC_AUX_SLC_FLDL 0x912
|
||||
#define ARC_AUX_SLC_RGN_START 0x914
|
||||
#define ARC_AUX_SLC_RGN_START1 0x915
|
||||
#define ARC_AUX_SLC_RGN_END 0x916
|
||||
#define ARC_AUX_SLC_RGN_END1 0x917
|
||||
#define ARC_BCR_CLUSTER 0xcf
|
||||
|
||||
/* MMU Management regs */
|
||||
#define ARC_AUX_MMU_BCR 0x06f
|
||||
|
||||
/* IO coherency related auxiliary registers */
|
||||
#define ARC_AUX_IO_COH_ENABLE 0x500
|
||||
#define ARC_AUX_IO_COH_PARTIAL 0x501
|
||||
@@ -88,19 +68,6 @@
|
||||
/* gcc builtin sr needs reg param to be long immediate */
|
||||
#define write_aux_reg(reg_immed, val) \
|
||||
__builtin_arc_sr((unsigned int)val, reg_immed)
|
||||
|
||||
/* ARCNUM [15:8] - field to identify each core in a multi-core system */
|
||||
#define CPU_ID_GET() ((read_aux_reg(ARC_AUX_IDENTITY) & 0xFF00) >> 8)
|
||||
|
||||
static const inline int is_isa_arcv2(void)
|
||||
{
|
||||
return IS_ENABLED(CONFIG_ISA_ARCV2);
|
||||
}
|
||||
|
||||
static const inline int is_isa_arcompact(void)
|
||||
{
|
||||
return IS_ENABLED(CONFIG_ISA_ARCOMPACT);
|
||||
}
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* _ASM_ARC_ARCREGS_H */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_BITOPS_H
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_BYTEORDER_H
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_CACHE_H
|
||||
@@ -29,13 +30,6 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
void cache_init(void);
|
||||
void flush_n_invalidate_dcache_all(void);
|
||||
void sync_n_cleanup_cache_all(void);
|
||||
|
||||
static const inline int is_ioc_enabled(void)
|
||||
{
|
||||
return IS_ENABLED(CONFIG_ARC_DBG_IOC_ENABLE);
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_CONFIG_H_
|
||||
#define __ASM_ARC_CONFIG_H_
|
||||
|
||||
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
|
||||
#define CONFIG_ARCH_EARLY_INIT_R
|
||||
|
||||
#define CONFIG_LMB
|
||||
|
||||
|
||||
1
arch/arc/include/asm/errno.h
Normal file
1
arch/arc/include/asm/errno.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <asm-generic/errno.h>
|
||||
@@ -1,20 +1,15 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_GLOBAL_DATA_H
|
||||
#define __ASM_ARC_GLOBAL_DATA_H
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
/* Architecture-specific global data */
|
||||
struct arch_global_data {
|
||||
int l1_line_sz;
|
||||
#if defined(CONFIG_ISA_ARCV2)
|
||||
int slc_line_sz;
|
||||
#endif
|
||||
};
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include <asm-generic/gpio.h>
|
||||
12
arch/arc/include/asm/init_helpers.h
Normal file
12
arch/arc/include/asm/init_helpers.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _ASM_ARC_INIT_HELPERS_H
|
||||
#define _ASM_ARC_INIT_HELPERS_H
|
||||
|
||||
int init_cache_f_r(void);
|
||||
|
||||
#endif /* _ASM_ARC_INIT_HELPERS_H */
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_IO_H
|
||||
@@ -9,7 +10,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
#ifdef __ARCHS__
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
|
||||
/*
|
||||
* ARCv2 based HS38 cores are in-order issue, but still weakly ordered
|
||||
@@ -41,14 +42,38 @@
|
||||
#define mb() asm volatile("sync\n" : : : "memory")
|
||||
#endif
|
||||
|
||||
#ifdef __ARCHS__
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
#define __iormb() rmb()
|
||||
#define __iowmb() wmb()
|
||||
#else
|
||||
#define __iormb() asm volatile("" : : : "memory")
|
||||
#define __iowmb() asm volatile("" : : : "memory")
|
||||
#define __iormb() do { } while (0)
|
||||
#define __iowmb() do { } while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Given a physical address and a length, return a virtual address
|
||||
* that can be used to access the memory range with the caching
|
||||
* properties specified by "flags".
|
||||
*/
|
||||
#define MAP_NOCACHE (0)
|
||||
#define MAP_WRCOMBINE (0)
|
||||
#define MAP_WRBACK (0)
|
||||
#define MAP_WRTHROUGH (0)
|
||||
|
||||
static inline void *
|
||||
map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
|
||||
{
|
||||
return (void *)((unsigned long)paddr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Take down a mapping set up by map_physmem().
|
||||
*/
|
||||
static inline void unmap_physmem(void *vaddr, unsigned long flags)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static inline void sync(void)
|
||||
{
|
||||
/* Not yet implemented */
|
||||
@@ -277,6 +302,9 @@ static inline int __raw_writesl(unsigned int addr, void *data, int longlen)
|
||||
#define setbits_8(addr, set) setbits(8, addr, set)
|
||||
#define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set)
|
||||
|
||||
#include <asm-generic/io.h>
|
||||
static inline phys_addr_t virt_to_phys(void *vaddr)
|
||||
{
|
||||
return (phys_addr_t)((unsigned long)vaddr);
|
||||
}
|
||||
|
||||
#endif /* __ASM_ARC_IO_H */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2015 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_LINKAGE_H
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_POSIX_TYPES_H
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2015 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _ASM_ARC_PROCESSOR_H
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_PTRACE_H
|
||||
|
||||
16
arch/arc/include/asm/relocate.h
Normal file
16
arch/arc/include/asm/relocate.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef _ASM_ARC_RELOCATE_H
|
||||
#define _ASM_ARC_RELOCATE_H
|
||||
|
||||
#include <common.h>
|
||||
|
||||
int copy_uboot_to_ram(void);
|
||||
int clear_bss(void);
|
||||
int do_elf_reloc_fixups(void);
|
||||
|
||||
#endif /* _ASM_ARC_RELOCATE_H */
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_SECTIONS_H
|
||||
|
||||
@@ -1 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_STRING_H
|
||||
#define __ASM_ARC_STRING_H
|
||||
|
||||
#define __HAVE_ARCH_MEMSET
|
||||
#define __HAVE_ARCH_MEMCPY
|
||||
#define __HAVE_ARCH_MEMCMP
|
||||
#define __HAVE_ARCH_STRCHR
|
||||
#define __HAVE_ARCH_STRCPY
|
||||
#define __HAVE_ARCH_STRCMP
|
||||
#define __HAVE_ARCH_STRLEN
|
||||
|
||||
extern void *memset(void *ptr, int, __kernel_size_t);
|
||||
extern void *memcpy(void *, const void *, __kernel_size_t);
|
||||
extern void memzero(void *ptr, __kernel_size_t n);
|
||||
extern int memcmp(const void *, const void *, __kernel_size_t);
|
||||
extern char *strchr(const char *s, int c);
|
||||
extern char *strcpy(char *dest, const char *src);
|
||||
extern int strcmp(const char *cs, const char *ct);
|
||||
extern __kernel_size_t strlen(const char *);
|
||||
|
||||
#endif /* __ASM_ARC_STRING_H */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_TYPES_H
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_U_BOOT_ARC_H__
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARC_U_BOOT_H__
|
||||
#define __ASM_ARC_U_BOOT_H__
|
||||
|
||||
#include <asm-generic/u-boot.h>
|
||||
#include <asm/u-boot-arc.h>
|
||||
|
||||
/* For image.h:image_check_target_arch() */
|
||||
#define IH_ARCH_DEFAULT IH_ARCH_ARC
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
|
||||
extra-y = start.o
|
||||
head-y := start.o
|
||||
@@ -8,7 +10,15 @@ obj-y += cache.o
|
||||
obj-y += cpu.o
|
||||
obj-y += interrupts.o
|
||||
obj-y += relocate.o
|
||||
obj-y += strchr-700.o
|
||||
obj-y += strcmp.o
|
||||
obj-y += strcpy-700.o
|
||||
obj-y += strlen.o
|
||||
obj-y += memcmp.o
|
||||
obj-y += memcpy-700.o
|
||||
obj-y += memset.o
|
||||
obj-y += reset.o
|
||||
obj-y += timer.o
|
||||
obj-y += ints_low.o
|
||||
obj-y += init_helpers.o
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 1995, 1997, 2007-2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/* ANSI concatenation macros. */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <common.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
@@ -40,64 +40,54 @@ void arch_lmb_reserve(struct lmb *lmb)
|
||||
static int cleanup_before_linux(void)
|
||||
{
|
||||
disable_interrupts();
|
||||
sync_n_cleanup_cache_all();
|
||||
flush_dcache_all();
|
||||
invalidate_icache_all();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__weak int board_prep_linux(bootm_headers_t *images) { return 0; }
|
||||
|
||||
/* Subcommand: PREP */
|
||||
static int boot_prep_linux(bootm_headers_t *images)
|
||||
static void boot_prep_linux(bootm_headers_t *images)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = image_setup_linux(images);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return board_prep_linux(images);
|
||||
if (image_setup_linux(images))
|
||||
hang();
|
||||
}
|
||||
|
||||
/* Generic implementation for single core CPU */
|
||||
__weak void board_jump_and_run(ulong entry, int zero, int arch, uint params)
|
||||
{
|
||||
void (*kernel_entry)(int zero, int arch, uint params);
|
||||
|
||||
kernel_entry = (void (*)(int, int, uint))entry;
|
||||
|
||||
kernel_entry(zero, arch, params);
|
||||
}
|
||||
__weak void smp_set_core_boot_addr(unsigned long addr, int corenr) {}
|
||||
__weak void smp_kick_all_cpus(void) {}
|
||||
|
||||
/* Subcommand: GO */
|
||||
static void boot_jump_linux(bootm_headers_t *images, int flag)
|
||||
{
|
||||
ulong kernel_entry;
|
||||
void (*kernel_entry)(int zero, int arch, uint params);
|
||||
unsigned int r0, r2;
|
||||
int fake = (flag & BOOTM_STATE_OS_FAKE_GO);
|
||||
|
||||
kernel_entry = images->ep;
|
||||
kernel_entry = (void (*)(int, int, uint))images->ep;
|
||||
|
||||
debug("## Transferring control to Linux (at address %08lx)...\n",
|
||||
kernel_entry);
|
||||
(ulong) kernel_entry);
|
||||
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
|
||||
|
||||
printf("\nStarting kernel ...%s\n\n", fake ?
|
||||
"(fake run for tracing)" : "");
|
||||
bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
|
||||
|
||||
cleanup_before_linux();
|
||||
|
||||
if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len) {
|
||||
r0 = 2;
|
||||
r2 = (unsigned int)images->ft_addr;
|
||||
} else {
|
||||
r0 = 1;
|
||||
r2 = (unsigned int)env_get("bootargs");
|
||||
r2 = (unsigned int)getenv("bootargs");
|
||||
}
|
||||
|
||||
cleanup_before_linux();
|
||||
smp_set_core_boot_addr((unsigned long)kernel_entry, -1);
|
||||
smp_kick_all_cpus();
|
||||
|
||||
if (!fake)
|
||||
board_jump_and_run(kernel_entry, r0, 0, r2);
|
||||
kernel_entry(r0, 0, r2);
|
||||
}
|
||||
|
||||
int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
|
||||
@@ -106,13 +96,17 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
|
||||
if ((flag & BOOTM_STATE_OS_BD_T) || (flag & BOOTM_STATE_OS_CMDLINE))
|
||||
return -1;
|
||||
|
||||
if (flag & BOOTM_STATE_OS_PREP)
|
||||
return boot_prep_linux(images);
|
||||
if (flag & BOOTM_STATE_OS_PREP) {
|
||||
boot_prep_linux(images);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {
|
||||
boot_jump_linux(images, flag);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
boot_prep_linux(images);
|
||||
boot_jump_linux(images, flag);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,536 +1,283 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <common.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/log2.h>
|
||||
#include <asm/arcregs.h>
|
||||
#include <asm/arc-bcr.h>
|
||||
#include <asm/cache.h>
|
||||
|
||||
/*
|
||||
* [ NOTE 1 ]:
|
||||
* Data cache (L1 D$ or SL$) entire invalidate operation or data cache disable
|
||||
* operation may result in unexpected behavior and data loss even if we flush
|
||||
* data cache right before invalidation. That may happens if we store any context
|
||||
* on stack (like we store BLINK register on stack before function call).
|
||||
* BLINK register is the register where return address is automatically saved
|
||||
* when we do function call with instructions like 'bl'.
|
||||
*
|
||||
* There is the real example:
|
||||
* We may hang in the next code as we store any BLINK register on stack in
|
||||
* invalidate_dcache_all() function.
|
||||
*
|
||||
* void flush_dcache_all() {
|
||||
* __dc_entire_op(OP_FLUSH);
|
||||
* // Other code //
|
||||
* }
|
||||
*
|
||||
* void invalidate_dcache_all() {
|
||||
* __dc_entire_op(OP_INV);
|
||||
* // Other code //
|
||||
* }
|
||||
*
|
||||
* void foo(void) {
|
||||
* flush_dcache_all();
|
||||
* invalidate_dcache_all();
|
||||
* }
|
||||
*
|
||||
* Now let's see what really happens during that code execution:
|
||||
*
|
||||
* foo()
|
||||
* |->> call flush_dcache_all
|
||||
* [return address is saved to BLINK register]
|
||||
* [push BLINK] (save to stack) ![point 1]
|
||||
* |->> call __dc_entire_op(OP_FLUSH)
|
||||
* [return address is saved to BLINK register]
|
||||
* [flush L1 D$]
|
||||
* return [jump to BLINK]
|
||||
* <<------
|
||||
* [other flush_dcache_all code]
|
||||
* [pop BLINK] (get from stack)
|
||||
* return [jump to BLINK]
|
||||
* <<------
|
||||
* |->> call invalidate_dcache_all
|
||||
* [return address is saved to BLINK register]
|
||||
* [push BLINK] (save to stack) ![point 2]
|
||||
* |->> call __dc_entire_op(OP_FLUSH)
|
||||
* [return address is saved to BLINK register]
|
||||
* [invalidate L1 D$] ![point 3]
|
||||
* // Oops!!!
|
||||
* // We lose return address from invalidate_dcache_all function:
|
||||
* // we save it to stack and invalidate L1 D$ after that!
|
||||
* return [jump to BLINK]
|
||||
* <<------
|
||||
* [other invalidate_dcache_all code]
|
||||
* [pop BLINK] (get from stack)
|
||||
* // we don't have this data in L1 dcache as we invalidated it in [point 3]
|
||||
* // so we get it from next memory level (for example DDR memory)
|
||||
* // but in the memory we have value which we save in [point 1], which
|
||||
* // is return address from flush_dcache_all function (instead of
|
||||
* // address from current invalidate_dcache_all function which we
|
||||
* // saved in [point 2] !)
|
||||
* return [jump to BLINK]
|
||||
* <<------
|
||||
* // As BLINK points to invalidate_dcache_all, we call it again and
|
||||
* // loop forever.
|
||||
*
|
||||
* Fortunately we may fix that by using flush & invalidation of D$ with a single
|
||||
* one instruction (instead of flush and invalidation instructions pair) and
|
||||
* enabling force function inline with '__attribute__((always_inline))' gcc
|
||||
* attribute to avoid any function call (and BLINK store) between cache flush
|
||||
* and disable.
|
||||
*
|
||||
*
|
||||
* [ NOTE 2 ]:
|
||||
* As of today we only support the following cache configurations on ARC.
|
||||
* Other configurations may exist in HW (for example, since version 3.0 HS
|
||||
* supports SL$ (L2 system level cache) disable) but we don't support it in SW.
|
||||
* Configuration 1:
|
||||
* ______________________
|
||||
* | |
|
||||
* | ARC CPU |
|
||||
* |______________________|
|
||||
* ___|___ ___|___
|
||||
* | | | |
|
||||
* | L1 I$ | | L1 D$ |
|
||||
* |_______| |_______|
|
||||
* on/off on/off
|
||||
* ___|______________|____
|
||||
* | |
|
||||
* | main memory |
|
||||
* |______________________|
|
||||
*
|
||||
* Configuration 2:
|
||||
* ______________________
|
||||
* | |
|
||||
* | ARC CPU |
|
||||
* |______________________|
|
||||
* ___|___ ___|___
|
||||
* | | | |
|
||||
* | L1 I$ | | L1 D$ |
|
||||
* |_______| |_______|
|
||||
* on/off on/off
|
||||
* ___|______________|____
|
||||
* | |
|
||||
* | L2 (SL$) |
|
||||
* |______________________|
|
||||
* always must be on
|
||||
* ___|______________|____
|
||||
* | |
|
||||
* | main memory |
|
||||
* |______________________|
|
||||
*
|
||||
* Configuration 3:
|
||||
* ______________________
|
||||
* | |
|
||||
* | ARC CPU |
|
||||
* |______________________|
|
||||
* ___|___ ___|___
|
||||
* | | | |
|
||||
* | L1 I$ | | L1 D$ |
|
||||
* |_______| |_______|
|
||||
* on/off must be on
|
||||
* ___|______________|____ _______
|
||||
* | | | |
|
||||
* | L2 (SL$) |-----| IOC |
|
||||
* |______________________| |_______|
|
||||
* always must be on on/off
|
||||
* ___|______________|____
|
||||
* | |
|
||||
* | main memory |
|
||||
* |______________________|
|
||||
*/
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/* Bit values in IC_CTRL */
|
||||
#define IC_CTRL_CACHE_DISABLE BIT(0)
|
||||
#define IC_CTRL_CACHE_DISABLE (1 << 0)
|
||||
|
||||
/* Bit values in DC_CTRL */
|
||||
#define DC_CTRL_CACHE_DISABLE BIT(0)
|
||||
#define DC_CTRL_INV_MODE_FLUSH BIT(6)
|
||||
#define DC_CTRL_FLUSH_STATUS BIT(8)
|
||||
#define DC_CTRL_CACHE_DISABLE (1 << 0)
|
||||
#define DC_CTRL_INV_MODE_FLUSH (1 << 6)
|
||||
#define DC_CTRL_FLUSH_STATUS (1 << 8)
|
||||
#define CACHE_VER_NUM_MASK 0xF
|
||||
#define SLC_CTRL_SB (1 << 2)
|
||||
|
||||
#define OP_INV BIT(0)
|
||||
#define OP_FLUSH BIT(1)
|
||||
#define OP_FLUSH_N_INV (OP_FLUSH | OP_INV)
|
||||
|
||||
/* Bit val in SLC_CONTROL */
|
||||
#define SLC_CTRL_DIS 0x001
|
||||
#define SLC_CTRL_IM 0x040
|
||||
#define SLC_CTRL_BUSY 0x100
|
||||
#define SLC_CTRL_RGN_OP_INV 0x200
|
||||
|
||||
#define CACHE_LINE_MASK (~(gd->arch.l1_line_sz - 1))
|
||||
#define OP_INV 0x1
|
||||
#define OP_FLUSH 0x2
|
||||
#define OP_INV_IC 0x3
|
||||
|
||||
/*
|
||||
* We don't want to use '__always_inline' macro here as it can be redefined
|
||||
* to simple 'inline' in some cases which breaks stuff. See [ NOTE 1 ] for more
|
||||
* details about the reasons we need to use always_inline functions.
|
||||
* By default that variable will fall into .bss section.
|
||||
* But .bss section is not relocated and so it will be initilized before
|
||||
* relocation but will be used after being zeroed.
|
||||
*/
|
||||
#define inlined_cachefunc inline __attribute__((always_inline))
|
||||
int l1_line_sz __section(".data");
|
||||
int dcache_exists __section(".data");
|
||||
int icache_exists __section(".data");
|
||||
|
||||
static inlined_cachefunc void __ic_entire_invalidate(void);
|
||||
static inlined_cachefunc void __dc_entire_op(const int cacheop);
|
||||
#define CACHE_LINE_MASK (~(l1_line_sz - 1))
|
||||
|
||||
static inline bool pae_exists(void)
|
||||
{
|
||||
/* TODO: should we compare mmu version from BCR and from CONFIG? */
|
||||
#if (CONFIG_ARC_MMU_VER >= 4)
|
||||
union bcr_mmu_4 mmu4;
|
||||
|
||||
mmu4.word = read_aux_reg(ARC_AUX_MMU_BCR);
|
||||
|
||||
if (mmu4.fields.pae)
|
||||
return true;
|
||||
#endif /* (CONFIG_ARC_MMU_VER >= 4) */
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static inlined_cachefunc bool icache_exists(void)
|
||||
{
|
||||
union bcr_di_cache ibcr;
|
||||
|
||||
ibcr.word = read_aux_reg(ARC_BCR_IC_BUILD);
|
||||
return !!ibcr.fields.ver;
|
||||
}
|
||||
|
||||
static inlined_cachefunc bool icache_enabled(void)
|
||||
{
|
||||
if (!icache_exists())
|
||||
return false;
|
||||
|
||||
return !(read_aux_reg(ARC_AUX_IC_CTRL) & IC_CTRL_CACHE_DISABLE);
|
||||
}
|
||||
|
||||
static inlined_cachefunc bool dcache_exists(void)
|
||||
{
|
||||
union bcr_di_cache dbcr;
|
||||
|
||||
dbcr.word = read_aux_reg(ARC_BCR_DC_BUILD);
|
||||
return !!dbcr.fields.ver;
|
||||
}
|
||||
|
||||
static inlined_cachefunc bool dcache_enabled(void)
|
||||
{
|
||||
if (!dcache_exists())
|
||||
return false;
|
||||
|
||||
return !(read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_CACHE_DISABLE);
|
||||
}
|
||||
|
||||
static inlined_cachefunc bool slc_exists(void)
|
||||
{
|
||||
if (is_isa_arcv2()) {
|
||||
union bcr_generic sbcr;
|
||||
|
||||
sbcr.word = read_aux_reg(ARC_BCR_SLC);
|
||||
return !!sbcr.fields.ver;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static inlined_cachefunc bool slc_data_bypass(void)
|
||||
{
|
||||
/*
|
||||
* If L1 data cache is disabled SL$ is bypassed and all load/store
|
||||
* requests are sent directly to main memory.
|
||||
*/
|
||||
return !dcache_enabled();
|
||||
}
|
||||
|
||||
static inline bool ioc_exists(void)
|
||||
{
|
||||
if (is_isa_arcv2()) {
|
||||
union bcr_clust_cfg cbcr;
|
||||
|
||||
cbcr.word = read_aux_reg(ARC_BCR_CLUSTER);
|
||||
return cbcr.fields.c;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool ioc_enabled(void)
|
||||
{
|
||||
/*
|
||||
* We check only CONFIG option instead of IOC HW state check as IOC
|
||||
* must be disabled by default.
|
||||
*/
|
||||
if (is_ioc_enabled())
|
||||
return ioc_exists();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static inlined_cachefunc void __slc_entire_op(const int op)
|
||||
{
|
||||
unsigned int ctrl;
|
||||
|
||||
if (!slc_exists())
|
||||
return;
|
||||
|
||||
ctrl = read_aux_reg(ARC_AUX_SLC_CTRL);
|
||||
|
||||
if (!(op & OP_FLUSH)) /* i.e. OP_INV */
|
||||
ctrl &= ~SLC_CTRL_IM; /* clear IM: Disable flush before Inv */
|
||||
else
|
||||
ctrl |= SLC_CTRL_IM;
|
||||
|
||||
write_aux_reg(ARC_AUX_SLC_CTRL, ctrl);
|
||||
|
||||
if (op & OP_INV) /* Inv or flush-n-inv use same cmd reg */
|
||||
write_aux_reg(ARC_AUX_SLC_INVALIDATE, 0x1);
|
||||
else
|
||||
write_aux_reg(ARC_AUX_SLC_FLUSH, 0x1);
|
||||
|
||||
/* Make sure "busy" bit reports correct stataus, see STAR 9001165532 */
|
||||
read_aux_reg(ARC_AUX_SLC_CTRL);
|
||||
|
||||
/* Important to wait for flush to complete */
|
||||
while (read_aux_reg(ARC_AUX_SLC_CTRL) & SLC_CTRL_BUSY);
|
||||
}
|
||||
|
||||
static void slc_upper_region_init(void)
|
||||
{
|
||||
/*
|
||||
* ARC_AUX_SLC_RGN_START1 and ARC_AUX_SLC_RGN_END1 register exist
|
||||
* only if PAE exists in current HW. So we had to check pae_exist
|
||||
* before using them.
|
||||
*/
|
||||
if (!pae_exists())
|
||||
return;
|
||||
|
||||
/*
|
||||
* ARC_AUX_SLC_RGN_END1 and ARC_AUX_SLC_RGN_START1 are always == 0
|
||||
* as we don't use PAE40.
|
||||
*/
|
||||
write_aux_reg(ARC_AUX_SLC_RGN_END1, 0);
|
||||
write_aux_reg(ARC_AUX_SLC_RGN_START1, 0);
|
||||
}
|
||||
|
||||
static void __slc_rgn_op(unsigned long paddr, unsigned long sz, const int op)
|
||||
{
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
int slc_line_sz __section(".data");
|
||||
int slc_exists __section(".data");
|
||||
int ioc_exists __section(".data");
|
||||
|
||||
unsigned int ctrl;
|
||||
unsigned long end;
|
||||
|
||||
if (!slc_exists())
|
||||
return;
|
||||
|
||||
/*
|
||||
* The Region Flush operation is specified by CTRL.RGN_OP[11..9]
|
||||
* - b'000 (default) is Flush,
|
||||
* - b'001 is Invalidate if CTRL.IM == 0
|
||||
* - b'001 is Flush-n-Invalidate if CTRL.IM == 1
|
||||
*/
|
||||
ctrl = read_aux_reg(ARC_AUX_SLC_CTRL);
|
||||
|
||||
/* Don't rely on default value of IM bit */
|
||||
if (!(op & OP_FLUSH)) /* i.e. OP_INV */
|
||||
ctrl &= ~SLC_CTRL_IM; /* clear IM: Disable flush before Inv */
|
||||
else
|
||||
ctrl |= SLC_CTRL_IM;
|
||||
|
||||
if (op & OP_INV)
|
||||
ctrl |= SLC_CTRL_RGN_OP_INV; /* Inv or flush-n-inv */
|
||||
else
|
||||
ctrl &= ~SLC_CTRL_RGN_OP_INV;
|
||||
|
||||
write_aux_reg(ARC_AUX_SLC_CTRL, ctrl);
|
||||
|
||||
/*
|
||||
* Lower bits are ignored, no need to clip
|
||||
* END needs to be setup before START (latter triggers the operation)
|
||||
* END can't be same as START, so add (l2_line_sz - 1) to sz
|
||||
*/
|
||||
end = paddr + sz + gd->arch.slc_line_sz - 1;
|
||||
|
||||
/*
|
||||
* Upper addresses (ARC_AUX_SLC_RGN_END1 and ARC_AUX_SLC_RGN_START1)
|
||||
* are always == 0 as we don't use PAE40, so we only setup lower ones
|
||||
* (ARC_AUX_SLC_RGN_END and ARC_AUX_SLC_RGN_START)
|
||||
*/
|
||||
write_aux_reg(ARC_AUX_SLC_RGN_END, end);
|
||||
write_aux_reg(ARC_AUX_SLC_RGN_START, paddr);
|
||||
|
||||
/* Make sure "busy" bit reports correct stataus, see STAR 9001165532 */
|
||||
read_aux_reg(ARC_AUX_SLC_CTRL);
|
||||
|
||||
while (read_aux_reg(ARC_AUX_SLC_CTRL) & SLC_CTRL_BUSY);
|
||||
|
||||
#endif /* CONFIG_ISA_ARCV2 */
|
||||
}
|
||||
|
||||
static void arc_ioc_setup(void)
|
||||
static unsigned int __before_slc_op(const int op)
|
||||
{
|
||||
/* IOC Aperture start is equal to DDR start */
|
||||
unsigned int ap_base = CONFIG_SYS_SDRAM_BASE;
|
||||
/* IOC Aperture size is equal to DDR size */
|
||||
long ap_size = CONFIG_SYS_SDRAM_SIZE;
|
||||
unsigned int reg = reg;
|
||||
|
||||
/* Unsupported configuration. See [ NOTE 2 ] for more details. */
|
||||
if (!slc_exists())
|
||||
panic("Try to enable IOC but SLC is not present");
|
||||
if (op == OP_INV) {
|
||||
/*
|
||||
* IM is set by default and implies Flush-n-inv
|
||||
* Clear it here for vanilla inv
|
||||
*/
|
||||
reg = read_aux_reg(ARC_AUX_SLC_CTRL);
|
||||
write_aux_reg(ARC_AUX_SLC_CTRL, reg & ~DC_CTRL_INV_MODE_FLUSH);
|
||||
}
|
||||
|
||||
/* Unsupported configuration. See [ NOTE 2 ] for more details. */
|
||||
if (!dcache_enabled())
|
||||
panic("Try to enable IOC but L1 D$ is disabled");
|
||||
|
||||
if (!is_power_of_2(ap_size) || ap_size < 4096)
|
||||
panic("IOC Aperture size must be power of 2 and bigger 4Kib");
|
||||
|
||||
/* IOC Aperture start must be aligned to the size of the aperture */
|
||||
if (ap_base % ap_size != 0)
|
||||
panic("IOC Aperture start must be aligned to the size of the aperture");
|
||||
|
||||
flush_n_invalidate_dcache_all();
|
||||
|
||||
/*
|
||||
* IOC Aperture size decoded as 2 ^ (SIZE + 2) KB,
|
||||
* so setting 0x11 implies 512M, 0x12 implies 1G...
|
||||
*/
|
||||
write_aux_reg(ARC_AUX_IO_COH_AP0_SIZE,
|
||||
order_base_2(ap_size / 1024) - 2);
|
||||
|
||||
write_aux_reg(ARC_AUX_IO_COH_AP0_BASE, ap_base >> 12);
|
||||
write_aux_reg(ARC_AUX_IO_COH_PARTIAL, 1);
|
||||
write_aux_reg(ARC_AUX_IO_COH_ENABLE, 1);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static void __after_slc_op(const int op, unsigned int reg)
|
||||
{
|
||||
if (op & OP_FLUSH) /* flush / flush-n-inv both wait */
|
||||
while (read_aux_reg(ARC_AUX_SLC_CTRL) &
|
||||
DC_CTRL_FLUSH_STATUS)
|
||||
;
|
||||
|
||||
/* Switch back to default Invalidate mode */
|
||||
if (op == OP_INV)
|
||||
write_aux_reg(ARC_AUX_SLC_CTRL, reg | DC_CTRL_INV_MODE_FLUSH);
|
||||
}
|
||||
|
||||
static inline void __slc_line_loop(unsigned long paddr, unsigned long sz,
|
||||
const int op)
|
||||
{
|
||||
unsigned int aux_cmd;
|
||||
int num_lines;
|
||||
|
||||
#define SLC_LINE_MASK (~(slc_line_sz - 1))
|
||||
|
||||
aux_cmd = op & OP_INV ? ARC_AUX_SLC_IVDL : ARC_AUX_SLC_FLDL;
|
||||
|
||||
sz += paddr & ~SLC_LINE_MASK;
|
||||
paddr &= SLC_LINE_MASK;
|
||||
|
||||
num_lines = DIV_ROUND_UP(sz, slc_line_sz);
|
||||
|
||||
while (num_lines-- > 0) {
|
||||
write_aux_reg(aux_cmd, paddr);
|
||||
paddr += slc_line_sz;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void __slc_entire_op(const int cacheop)
|
||||
{
|
||||
int aux;
|
||||
unsigned int ctrl_reg = __before_slc_op(cacheop);
|
||||
|
||||
if (cacheop & OP_INV) /* Inv or flush-n-inv use same cmd reg */
|
||||
aux = ARC_AUX_SLC_INVALIDATE;
|
||||
else
|
||||
aux = ARC_AUX_SLC_FLUSH;
|
||||
|
||||
write_aux_reg(aux, 0x1);
|
||||
|
||||
__after_slc_op(cacheop, ctrl_reg);
|
||||
}
|
||||
|
||||
static inline void __slc_line_op(unsigned long paddr, unsigned long sz,
|
||||
const int cacheop)
|
||||
{
|
||||
unsigned int ctrl_reg = __before_slc_op(cacheop);
|
||||
__slc_line_loop(paddr, sz, cacheop);
|
||||
__after_slc_op(cacheop, ctrl_reg);
|
||||
}
|
||||
#else
|
||||
#define __slc_entire_op(cacheop)
|
||||
#define __slc_line_op(paddr, sz, cacheop)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
static void read_decode_cache_bcr_arcv2(void)
|
||||
{
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
union {
|
||||
struct {
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
unsigned int pad:24, way:2, lsz:2, sz:4;
|
||||
#else
|
||||
unsigned int sz:4, lsz:2, way:2, pad:24;
|
||||
#endif
|
||||
} fields;
|
||||
unsigned int word;
|
||||
} slc_cfg;
|
||||
|
||||
union bcr_slc_cfg slc_cfg;
|
||||
union {
|
||||
struct {
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
unsigned int pad:24, ver:8;
|
||||
#else
|
||||
unsigned int ver:8, pad:24;
|
||||
#endif
|
||||
} fields;
|
||||
unsigned int word;
|
||||
} sbcr;
|
||||
|
||||
if (slc_exists()) {
|
||||
sbcr.word = read_aux_reg(ARC_BCR_SLC);
|
||||
if (sbcr.fields.ver) {
|
||||
slc_cfg.word = read_aux_reg(ARC_AUX_SLC_CONFIG);
|
||||
gd->arch.slc_line_sz = (slc_cfg.fields.lsz == 0) ? 128 : 64;
|
||||
|
||||
/*
|
||||
* We don't support configuration where L1 I$ or L1 D$ is
|
||||
* absent but SL$ exists. See [ NOTE 2 ] for more details.
|
||||
*/
|
||||
if (!icache_exists() || !dcache_exists())
|
||||
panic("Unsupported cache configuration: SLC exists but one of L1 caches is absent");
|
||||
slc_exists = 1;
|
||||
slc_line_sz = (slc_cfg.fields.lsz == 0) ? 128 : 64;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ISA_ARCV2 */
|
||||
union {
|
||||
struct bcr_clust_cfg {
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
unsigned int pad:7, c:1, num_entries:8, num_cores:8, ver:8;
|
||||
#else
|
||||
unsigned int ver:8, num_cores:8, num_entries:8, c:1, pad:7;
|
||||
#endif
|
||||
} fields;
|
||||
unsigned int word;
|
||||
} cbcr;
|
||||
|
||||
cbcr.word = read_aux_reg(ARC_BCR_CLUSTER);
|
||||
if (cbcr.fields.c)
|
||||
ioc_exists = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
void read_decode_cache_bcr(void)
|
||||
{
|
||||
int dc_line_sz = 0, ic_line_sz = 0;
|
||||
union bcr_di_cache ibcr, dbcr;
|
||||
|
||||
/*
|
||||
* We don't care much about I$ line length really as there're
|
||||
* no per-line ops on I$ instead we only do full invalidation of it
|
||||
* on occasion of relocation and right before jumping to the OS.
|
||||
* Still we check insane config with zero-encoded line length in
|
||||
* presense of version field in I$ BCR. Just in case.
|
||||
*/
|
||||
union {
|
||||
struct {
|
||||
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||
unsigned int pad:12, line_len:4, sz:4, config:4, ver:8;
|
||||
#else
|
||||
unsigned int ver:8, config:4, sz:4, line_len:4, pad:12;
|
||||
#endif
|
||||
} fields;
|
||||
unsigned int word;
|
||||
} ibcr, dbcr;
|
||||
|
||||
ibcr.word = read_aux_reg(ARC_BCR_IC_BUILD);
|
||||
if (ibcr.fields.ver) {
|
||||
ic_line_sz = 8 << ibcr.fields.line_len;
|
||||
icache_exists = 1;
|
||||
l1_line_sz = ic_line_sz = 8 << ibcr.fields.line_len;
|
||||
if (!ic_line_sz)
|
||||
panic("Instruction exists but line length is 0\n");
|
||||
}
|
||||
|
||||
dbcr.word = read_aux_reg(ARC_BCR_DC_BUILD);
|
||||
if (dbcr.fields.ver) {
|
||||
gd->arch.l1_line_sz = dc_line_sz = 16 << dbcr.fields.line_len;
|
||||
if (dbcr.fields.ver){
|
||||
dcache_exists = 1;
|
||||
l1_line_sz = dc_line_sz = 16 << dbcr.fields.line_len;
|
||||
if (!dc_line_sz)
|
||||
panic("Data cache exists but line length is 0\n");
|
||||
}
|
||||
|
||||
if (ic_line_sz && dc_line_sz && (ic_line_sz != dc_line_sz))
|
||||
panic("Instruction and data cache line lengths differ\n");
|
||||
}
|
||||
|
||||
void cache_init(void)
|
||||
{
|
||||
read_decode_cache_bcr();
|
||||
|
||||
if (is_isa_arcv2())
|
||||
read_decode_cache_bcr_arcv2();
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
read_decode_cache_bcr_arcv2();
|
||||
|
||||
if (is_isa_arcv2() && ioc_enabled())
|
||||
arc_ioc_setup();
|
||||
if (ioc_exists) {
|
||||
flush_dcache_all();
|
||||
invalidate_dcache_all();
|
||||
|
||||
if (is_isa_arcv2() && slc_exists())
|
||||
slc_upper_region_init();
|
||||
/* IO coherency base - 0x8z */
|
||||
write_aux_reg(ARC_AUX_IO_COH_AP0_BASE, 0x80000);
|
||||
/* IO coherency aperture size - 512Mb: 0x8z-0xAz */
|
||||
write_aux_reg(ARC_AUX_IO_COH_AP0_SIZE, 0x11);
|
||||
/* Enable partial writes */
|
||||
write_aux_reg(ARC_AUX_IO_COH_PARTIAL, 1);
|
||||
/* Enable IO coherency */
|
||||
write_aux_reg(ARC_AUX_IO_COH_ENABLE, 1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int icache_status(void)
|
||||
{
|
||||
return icache_enabled();
|
||||
if (!icache_exists)
|
||||
return 0;
|
||||
|
||||
if (read_aux_reg(ARC_AUX_IC_CTRL) & IC_CTRL_CACHE_DISABLE)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
void icache_enable(void)
|
||||
{
|
||||
if (icache_exists())
|
||||
if (icache_exists)
|
||||
write_aux_reg(ARC_AUX_IC_CTRL, read_aux_reg(ARC_AUX_IC_CTRL) &
|
||||
~IC_CTRL_CACHE_DISABLE);
|
||||
}
|
||||
|
||||
void icache_disable(void)
|
||||
{
|
||||
if (!icache_exists())
|
||||
return;
|
||||
|
||||
__ic_entire_invalidate();
|
||||
|
||||
write_aux_reg(ARC_AUX_IC_CTRL, read_aux_reg(ARC_AUX_IC_CTRL) |
|
||||
IC_CTRL_CACHE_DISABLE);
|
||||
}
|
||||
|
||||
/* IC supports only invalidation */
|
||||
static inlined_cachefunc void __ic_entire_invalidate(void)
|
||||
{
|
||||
if (!icache_enabled())
|
||||
return;
|
||||
|
||||
/* Any write to IC_IVIC register triggers invalidation of entire I$ */
|
||||
write_aux_reg(ARC_AUX_IC_IVIC, 1);
|
||||
/*
|
||||
* As per ARC HS databook (see chapter 5.3.3.2)
|
||||
* it is required to add 3 NOPs after each write to IC_IVIC.
|
||||
*/
|
||||
__builtin_arc_nop();
|
||||
__builtin_arc_nop();
|
||||
__builtin_arc_nop();
|
||||
read_aux_reg(ARC_AUX_IC_CTRL); /* blocks */
|
||||
if (icache_exists)
|
||||
write_aux_reg(ARC_AUX_IC_CTRL, read_aux_reg(ARC_AUX_IC_CTRL) |
|
||||
IC_CTRL_CACHE_DISABLE);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
void invalidate_icache_all(void)
|
||||
{
|
||||
__ic_entire_invalidate();
|
||||
|
||||
/*
|
||||
* If SL$ is bypassed for data it is used only for instructions,
|
||||
* so we need to invalidate it too.
|
||||
* TODO: HS 3.0 supports SLC disable so we need to check slc
|
||||
* enable/disable status here.
|
||||
*/
|
||||
if (is_isa_arcv2() && slc_data_bypass())
|
||||
__slc_entire_op(OP_INV);
|
||||
/* Any write to IC_IVIC register triggers invalidation of entire I$ */
|
||||
if (icache_status()) {
|
||||
write_aux_reg(ARC_AUX_IC_IVIC, 1);
|
||||
read_aux_reg(ARC_AUX_IC_CTRL); /* blocks */
|
||||
}
|
||||
}
|
||||
#else
|
||||
void invalidate_icache_all(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
int dcache_status(void)
|
||||
{
|
||||
return dcache_enabled();
|
||||
if (!dcache_exists)
|
||||
return 0;
|
||||
|
||||
if (read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_CACHE_DISABLE)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
void dcache_enable(void)
|
||||
{
|
||||
if (!dcache_exists())
|
||||
if (!dcache_exists)
|
||||
return;
|
||||
|
||||
write_aux_reg(ARC_AUX_DC_CTRL, read_aux_reg(ARC_AUX_DC_CTRL) &
|
||||
@@ -539,77 +286,84 @@ void dcache_enable(void)
|
||||
|
||||
void dcache_disable(void)
|
||||
{
|
||||
if (!dcache_exists())
|
||||
if (!dcache_exists)
|
||||
return;
|
||||
|
||||
__dc_entire_op(OP_FLUSH_N_INV);
|
||||
|
||||
/*
|
||||
* As SLC will be bypassed for data after L1 D$ disable we need to
|
||||
* flush it first before L1 D$ disable. Also we invalidate SLC to
|
||||
* avoid any inconsistent data problems after enabling L1 D$ again with
|
||||
* dcache_enable function.
|
||||
*/
|
||||
if (is_isa_arcv2())
|
||||
__slc_entire_op(OP_FLUSH_N_INV);
|
||||
|
||||
write_aux_reg(ARC_AUX_DC_CTRL, read_aux_reg(ARC_AUX_DC_CTRL) |
|
||||
DC_CTRL_CACHE_DISABLE);
|
||||
}
|
||||
|
||||
/* Common Helper for Line Operations on D-cache */
|
||||
static inline void __dcache_line_loop(unsigned long paddr, unsigned long sz,
|
||||
const int cacheop)
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
/*
|
||||
* Common Helper for Line Operations on {I,D}-Cache
|
||||
*/
|
||||
static inline void __cache_line_loop(unsigned long paddr, unsigned long sz,
|
||||
const int cacheop)
|
||||
{
|
||||
unsigned int aux_cmd;
|
||||
#if (CONFIG_ARC_MMU_VER == 3)
|
||||
unsigned int aux_tag;
|
||||
#endif
|
||||
int num_lines;
|
||||
|
||||
/* d$ cmd: INV (discard or wback-n-discard) OR FLUSH (wback) */
|
||||
aux_cmd = cacheop & OP_INV ? ARC_AUX_DC_IVDL : ARC_AUX_DC_FLDL;
|
||||
if (cacheop == OP_INV_IC) {
|
||||
aux_cmd = ARC_AUX_IC_IVIL;
|
||||
#if (CONFIG_ARC_MMU_VER == 3)
|
||||
aux_tag = ARC_AUX_IC_PTAG;
|
||||
#endif
|
||||
} else {
|
||||
/* d$ cmd: INV (discard or wback-n-discard) OR FLUSH (wback) */
|
||||
aux_cmd = cacheop & OP_INV ? ARC_AUX_DC_IVDL : ARC_AUX_DC_FLDL;
|
||||
#if (CONFIG_ARC_MMU_VER == 3)
|
||||
aux_tag = ARC_AUX_DC_PTAG;
|
||||
#endif
|
||||
}
|
||||
|
||||
sz += paddr & ~CACHE_LINE_MASK;
|
||||
paddr &= CACHE_LINE_MASK;
|
||||
|
||||
num_lines = DIV_ROUND_UP(sz, gd->arch.l1_line_sz);
|
||||
num_lines = DIV_ROUND_UP(sz, l1_line_sz);
|
||||
|
||||
while (num_lines-- > 0) {
|
||||
#if (CONFIG_ARC_MMU_VER == 3)
|
||||
write_aux_reg(ARC_AUX_DC_PTAG, paddr);
|
||||
write_aux_reg(aux_tag, paddr);
|
||||
#endif
|
||||
write_aux_reg(aux_cmd, paddr);
|
||||
paddr += gd->arch.l1_line_sz;
|
||||
paddr += l1_line_sz;
|
||||
}
|
||||
}
|
||||
|
||||
static inlined_cachefunc void __before_dc_op(const int op)
|
||||
static unsigned int __before_dc_op(const int op)
|
||||
{
|
||||
unsigned int ctrl;
|
||||
unsigned int reg;
|
||||
|
||||
ctrl = read_aux_reg(ARC_AUX_DC_CTRL);
|
||||
if (op == OP_INV) {
|
||||
/*
|
||||
* IM is set by default and implies Flush-n-inv
|
||||
* Clear it here for vanilla inv
|
||||
*/
|
||||
reg = read_aux_reg(ARC_AUX_DC_CTRL);
|
||||
write_aux_reg(ARC_AUX_DC_CTRL, reg & ~DC_CTRL_INV_MODE_FLUSH);
|
||||
}
|
||||
|
||||
/* IM bit implies flush-n-inv, instead of vanilla inv */
|
||||
if (op == OP_INV)
|
||||
ctrl &= ~DC_CTRL_INV_MODE_FLUSH;
|
||||
else
|
||||
ctrl |= DC_CTRL_INV_MODE_FLUSH;
|
||||
|
||||
write_aux_reg(ARC_AUX_DC_CTRL, ctrl);
|
||||
return reg;
|
||||
}
|
||||
|
||||
static inlined_cachefunc void __after_dc_op(const int op)
|
||||
static void __after_dc_op(const int op, unsigned int reg)
|
||||
{
|
||||
if (op & OP_FLUSH) /* flush / flush-n-inv both wait */
|
||||
while (read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_FLUSH_STATUS);
|
||||
while (read_aux_reg(ARC_AUX_DC_CTRL) & DC_CTRL_FLUSH_STATUS)
|
||||
;
|
||||
|
||||
/* Switch back to default Invalidate mode */
|
||||
if (op == OP_INV)
|
||||
write_aux_reg(ARC_AUX_DC_CTRL, reg | DC_CTRL_INV_MODE_FLUSH);
|
||||
}
|
||||
|
||||
static inlined_cachefunc void __dc_entire_op(const int cacheop)
|
||||
static inline void __dc_entire_op(const int cacheop)
|
||||
{
|
||||
int aux;
|
||||
|
||||
if (!dcache_enabled())
|
||||
return;
|
||||
|
||||
__before_dc_op(cacheop);
|
||||
unsigned int ctrl_reg = __before_dc_op(cacheop);
|
||||
|
||||
if (cacheop & OP_INV) /* Inv or flush-n-inv use same cmd reg */
|
||||
aux = ARC_AUX_DC_IVDC;
|
||||
@@ -618,54 +372,45 @@ static inlined_cachefunc void __dc_entire_op(const int cacheop)
|
||||
|
||||
write_aux_reg(aux, 0x1);
|
||||
|
||||
__after_dc_op(cacheop);
|
||||
__after_dc_op(cacheop, ctrl_reg);
|
||||
}
|
||||
|
||||
static inline void __dc_line_op(unsigned long paddr, unsigned long sz,
|
||||
const int cacheop)
|
||||
{
|
||||
if (!dcache_enabled())
|
||||
return;
|
||||
|
||||
__before_dc_op(cacheop);
|
||||
__dcache_line_loop(paddr, sz, cacheop);
|
||||
__after_dc_op(cacheop);
|
||||
unsigned int ctrl_reg = __before_dc_op(cacheop);
|
||||
__cache_line_loop(paddr, sz, cacheop);
|
||||
__after_dc_op(cacheop, ctrl_reg);
|
||||
}
|
||||
#else
|
||||
#define __dc_entire_op(cacheop)
|
||||
#define __dc_line_op(paddr, sz, cacheop)
|
||||
#endif /* !CONFIG_SYS_DCACHE_OFF */
|
||||
|
||||
void invalidate_dcache_range(unsigned long start, unsigned long end)
|
||||
{
|
||||
if (start >= end)
|
||||
return;
|
||||
|
||||
/*
|
||||
* ARCv1 -> call __dc_line_op
|
||||
* ARCv2 && L1 D$ disabled -> nothing
|
||||
* ARCv2 && L1 D$ enabled && IOC enabled -> nothing
|
||||
* ARCv2 && L1 D$ enabled && no IOC -> call __dc_line_op; call __slc_rgn_op
|
||||
*/
|
||||
if (!is_isa_arcv2() || !ioc_enabled())
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
if (!ioc_exists)
|
||||
#endif
|
||||
__dc_line_op(start, end - start, OP_INV);
|
||||
|
||||
if (is_isa_arcv2() && !ioc_enabled() && !slc_data_bypass())
|
||||
__slc_rgn_op(start, end - start, OP_INV);
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
if (slc_exists && !ioc_exists)
|
||||
__slc_line_op(start, end - start, OP_INV);
|
||||
#endif
|
||||
}
|
||||
|
||||
void flush_dcache_range(unsigned long start, unsigned long end)
|
||||
{
|
||||
if (start >= end)
|
||||
return;
|
||||
|
||||
/*
|
||||
* ARCv1 -> call __dc_line_op
|
||||
* ARCv2 && L1 D$ disabled -> nothing
|
||||
* ARCv2 && L1 D$ enabled && IOC enabled -> nothing
|
||||
* ARCv2 && L1 D$ enabled && no IOC -> call __dc_line_op; call __slc_rgn_op
|
||||
*/
|
||||
if (!is_isa_arcv2() || !ioc_enabled())
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
if (!ioc_exists)
|
||||
#endif
|
||||
__dc_line_op(start, end - start, OP_FLUSH);
|
||||
|
||||
if (is_isa_arcv2() && !ioc_enabled() && !slc_data_bypass())
|
||||
__slc_rgn_op(start, end - start, OP_FLUSH);
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
if (slc_exists && !ioc_exists)
|
||||
__slc_line_op(start, end - start, OP_FLUSH);
|
||||
#endif
|
||||
}
|
||||
|
||||
void flush_cache(unsigned long start, unsigned long size)
|
||||
@@ -673,47 +418,22 @@ void flush_cache(unsigned long start, unsigned long size)
|
||||
flush_dcache_range(start, start + size);
|
||||
}
|
||||
|
||||
/*
|
||||
* As invalidate_dcache_all() is not used in generic U-Boot code and as we
|
||||
* don't need it in arch/arc code alone (invalidate without flush) we implement
|
||||
* flush_n_invalidate_dcache_all (flush and invalidate in 1 operation) because
|
||||
* it's much safer. See [ NOTE 1 ] for more details.
|
||||
*/
|
||||
void flush_n_invalidate_dcache_all(void)
|
||||
void invalidate_dcache_all(void)
|
||||
{
|
||||
__dc_entire_op(OP_FLUSH_N_INV);
|
||||
__dc_entire_op(OP_INV);
|
||||
|
||||
if (is_isa_arcv2() && !slc_data_bypass())
|
||||
__slc_entire_op(OP_FLUSH_N_INV);
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
if (slc_exists)
|
||||
__slc_entire_op(OP_INV);
|
||||
#endif
|
||||
}
|
||||
|
||||
void flush_dcache_all(void)
|
||||
{
|
||||
__dc_entire_op(OP_FLUSH);
|
||||
|
||||
if (is_isa_arcv2() && !slc_data_bypass())
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
if (slc_exists)
|
||||
__slc_entire_op(OP_FLUSH);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is function to cleanup all caches (and therefore sync I/D caches) which
|
||||
* can be used for cleanup before linux launch or to sync caches during
|
||||
* relocation.
|
||||
*/
|
||||
void sync_n_cleanup_cache_all(void)
|
||||
{
|
||||
__dc_entire_op(OP_FLUSH_N_INV);
|
||||
|
||||
/*
|
||||
* If SL$ is bypassed for data it is used only for instructions,
|
||||
* and we shouldn't flush it. So invalidate it instead of flush_n_inv.
|
||||
*/
|
||||
if (is_isa_arcv2()) {
|
||||
if (slc_data_bypass())
|
||||
__slc_entire_op(OP_INV);
|
||||
else
|
||||
__slc_entire_op(OP_FLUSH_N_INV);
|
||||
}
|
||||
|
||||
__ic_entire_invalidate();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
@@ -27,9 +28,3 @@ int arch_early_init_r(void)
|
||||
gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This is a dummy function on arc */
|
||||
int dram_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <asm/cache.h>
|
||||
#include <common.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
int init_cache_f_r(void)
|
||||
{
|
||||
sync_n_cleanup_cache_all();
|
||||
|
||||
#ifndef CONFIG_SYS_DCACHE_OFF
|
||||
flush_dcache_all();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <linux/linkage.h>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 1989-2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include "libgcc2.h"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 1989-2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __ASM_LIBGCC_H
|
||||
|
||||
123
arch/arc/lib/memcmp.S
Normal file
123
arch/arc/lib/memcmp.S
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define WORD2 r2
|
||||
#define SHIFT r3
|
||||
#else /* __BIG_ENDIAN__ */
|
||||
#define WORD2 r3
|
||||
#define SHIFT r2
|
||||
#endif /* _ENDIAN__ */
|
||||
|
||||
.global memcmp
|
||||
.align 4
|
||||
memcmp:
|
||||
or %r12, %r0, %r1
|
||||
asl_s %r12, %r12, 30
|
||||
sub %r3, %r2, 1
|
||||
brls %r2, %r12, .Lbytewise
|
||||
ld %r4, [%r0, 0]
|
||||
ld %r5, [%r1, 0]
|
||||
lsr.f %lp_count, %r3, 3
|
||||
lpne .Loop_end
|
||||
ld_s WORD2, [%r0, 4]
|
||||
ld_s %r12, [%r1, 4]
|
||||
brne %r4, %r5, .Leven
|
||||
ld.a %r4, [%r0, 8]
|
||||
ld.a %r5, [%r1, 8]
|
||||
brne WORD2, %r12, .Lodd
|
||||
nop
|
||||
.Loop_end:
|
||||
asl_s SHIFT, SHIFT, 3
|
||||
bhs_s .Last_cmp
|
||||
brne %r4, %r5, .Leven
|
||||
ld %r4, [%r0, 4]
|
||||
ld %r5, [%r1, 4]
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
nop_s
|
||||
/* one more load latency cycle */
|
||||
.Last_cmp:
|
||||
xor %r0, %r4, %r5
|
||||
bset %r0, %r0, SHIFT
|
||||
sub_s %r1, %r0, 1
|
||||
bic_s %r1, %r1, %r0
|
||||
norm %r1, %r1
|
||||
b.d .Leven_cmp
|
||||
and %r1, %r1, 24
|
||||
.Leven:
|
||||
xor %r0, %r4, %r5
|
||||
sub_s %r1, %r0, 1
|
||||
bic_s %r1, %r1, %r0
|
||||
norm %r1, %r1
|
||||
/* slow track insn */
|
||||
and %r1, %r1, 24
|
||||
.Leven_cmp:
|
||||
asl %r2, %r4, %r1
|
||||
asl %r12, %r5, %r1
|
||||
lsr_s %r2, %r2, 1
|
||||
lsr_s %r12, %r12, 1
|
||||
j_s.d [%blink]
|
||||
sub %r0, %r2, %r12
|
||||
.balign 4
|
||||
.Lodd:
|
||||
xor %r0, WORD2, %r12
|
||||
sub_s %r1, %r0, 1
|
||||
bic_s %r1, %r1, %r0
|
||||
norm %r1, %r1
|
||||
/* slow track insn */
|
||||
and %r1, %r1, 24
|
||||
asl_s %r2, %r2, %r1
|
||||
asl_s %r12, %r12, %r1
|
||||
lsr_s %r2, %r2, 1
|
||||
lsr_s %r12, %r12, 1
|
||||
j_s.d [%blink]
|
||||
sub %r0, %r2, %r12
|
||||
#else /* __BIG_ENDIAN__ */
|
||||
.Last_cmp:
|
||||
neg_s SHIFT, SHIFT
|
||||
lsr %r4, %r4, SHIFT
|
||||
lsr %r5, %r5, SHIFT
|
||||
/* slow track insn */
|
||||
.Leven:
|
||||
sub.f %r0, %r4, %r5
|
||||
mov.ne %r0, 1
|
||||
j_s.d [%blink]
|
||||
bset.cs %r0, %r0, 31
|
||||
.Lodd:
|
||||
cmp_s WORD2, %r12
|
||||
|
||||
mov_s %r0, 1
|
||||
j_s.d [%blink]
|
||||
bset.cs %r0, %r0, 31
|
||||
#endif /* _ENDIAN__ */
|
||||
.balign 4
|
||||
.Lbytewise:
|
||||
breq %r2, 0, .Lnil
|
||||
ldb %r4, [%r0, 0]
|
||||
ldb %r5, [%r1, 0]
|
||||
lsr.f %lp_count, %r3
|
||||
lpne .Lbyte_end
|
||||
ldb_s %r3, [%r0, 1]
|
||||
ldb %r12, [%r1, 1]
|
||||
brne %r4, %r5, .Lbyte_even
|
||||
ldb.a %r4, [%r0, 2]
|
||||
ldb.a %r5, [%r1, 2]
|
||||
brne %r3, %r12, .Lbyte_odd
|
||||
nop
|
||||
.Lbyte_end:
|
||||
bcc .Lbyte_even
|
||||
brne %r4, %r5, .Lbyte_even
|
||||
ldb_s %r3, [%r0, 1]
|
||||
ldb_s %r12, [%r1, 1]
|
||||
.Lbyte_odd:
|
||||
j_s.d [%blink]
|
||||
sub %r0, %r3, %r12
|
||||
.Lbyte_even:
|
||||
j_s.d [%blink]
|
||||
sub %r0, %r4, %r5
|
||||
.Lnil:
|
||||
j_s.d [%blink]
|
||||
mov %r0, 0
|
||||
63
arch/arc/lib/memcpy-700.S
Normal file
63
arch/arc/lib/memcpy-700.S
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
.global memcpy
|
||||
.align 4
|
||||
memcpy:
|
||||
or %r3, %r0, %r1
|
||||
asl_s %r3, %r3, 30
|
||||
mov_s %r5, %r0
|
||||
brls.d %r2, %r3, .Lcopy_bytewise
|
||||
sub.f %r3, %r2, 1
|
||||
ld_s %r12, [%r1, 0]
|
||||
asr.f %lp_count, %r3, 3
|
||||
bbit0.d %r3, 2, .Lnox4
|
||||
bmsk_s %r2, %r2, 1
|
||||
st.ab %r12, [%r5, 4]
|
||||
ld.a %r12, [%r1, 4]
|
||||
.Lnox4:
|
||||
lppnz .Lendloop
|
||||
ld_s %r3, [%r1, 4]
|
||||
st.ab %r12, [%r5, 4]
|
||||
ld.a %r12, [%r1, 8]
|
||||
st.ab %r3, [%r5, 4]
|
||||
.Lendloop:
|
||||
breq %r2, 0, .Last_store
|
||||
ld %r3, [%r5, 0]
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
add3 %r2, -1, %r2
|
||||
/* uses long immediate */
|
||||
xor_s %r12, %r12, %r3
|
||||
bmsk %r12, %r12, %r2
|
||||
xor_s %r12, %r12, %r3
|
||||
#else /* __BIG_ENDIAN__ */
|
||||
sub3 %r2, 31, %r2
|
||||
/* uses long immediate */
|
||||
xor_s %r3, %r3, %r12
|
||||
bmsk %r3, %r3, %r2
|
||||
xor_s %r12, %r12, %r3
|
||||
#endif /* _ENDIAN__ */
|
||||
.Last_store:
|
||||
j_s.d [%blink]
|
||||
st %r12, [%r5, 0]
|
||||
|
||||
.balign 4
|
||||
.Lcopy_bytewise:
|
||||
jcs [%blink]
|
||||
ldb_s %r12, [%r1, 0]
|
||||
lsr.f %lp_count, %r3
|
||||
bhs_s .Lnox1
|
||||
stb.ab %r12, [%r5, 1]
|
||||
ldb.a %r12, [%r1, 1]
|
||||
.Lnox1:
|
||||
lppnz .Lendbloop
|
||||
ldb_s %r3, [%r1, 1]
|
||||
stb.ab %r12, [%r5, 1]
|
||||
ldb.a %r12, [%r1, 2]
|
||||
stb.ab %r3, [%r5, 1]
|
||||
.Lendbloop:
|
||||
j_s.d [%blink]
|
||||
stb %r12, [%r5, 0]
|
||||
62
arch/arc/lib/memset.S
Normal file
62
arch/arc/lib/memset.S
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#define SMALL 7 /* Must be at least 6 to deal with alignment/loop issues. */
|
||||
|
||||
.global memset
|
||||
.align 4
|
||||
memset:
|
||||
mov_s %r4, %r0
|
||||
or %r12, %r0, %r2
|
||||
bmsk.f %r12, %r12, 1
|
||||
extb_s %r1, %r1
|
||||
asl %r3, %r1, 8
|
||||
beq.d .Laligned
|
||||
or_s %r1, %r1, %r3
|
||||
brls %r2, SMALL, .Ltiny
|
||||
add %r3, %r2, %r0
|
||||
stb %r1, [%r3, -1]
|
||||
bclr_s %r3, %r3, 0
|
||||
stw %r1, [%r3, -2]
|
||||
bmsk.f %r12, %r0, 1
|
||||
add_s %r2, %r2, %r12
|
||||
sub.ne %r2, %r2, 4
|
||||
stb.ab %r1, [%r4, 1]
|
||||
and %r4, %r4, -2
|
||||
stw.ab %r1, [%r4, 2]
|
||||
and %r4, %r4, -4
|
||||
|
||||
.balign 4
|
||||
.Laligned:
|
||||
asl %r3, %r1, 16
|
||||
lsr.f %lp_count, %r2, 2
|
||||
or_s %r1, %r1, %r3
|
||||
lpne .Loop_end
|
||||
st.ab %r1, [%r4, 4]
|
||||
.Loop_end:
|
||||
j_s [%blink]
|
||||
|
||||
.balign 4
|
||||
.Ltiny:
|
||||
mov.f %lp_count, %r2
|
||||
lpne .Ltiny_end
|
||||
stb.ab %r1, [%r4, 1]
|
||||
.Ltiny_end:
|
||||
j_s [%blink]
|
||||
|
||||
/*
|
||||
* memzero: @r0 = mem, @r1 = size_t
|
||||
* memset: @r0 = mem, @r1 = char, @r2 = size_t
|
||||
*/
|
||||
|
||||
.global memzero
|
||||
.align 4
|
||||
memzero:
|
||||
/* adjust bzero args to memset args */
|
||||
mov %r2, %r1
|
||||
mov %r1, 0
|
||||
/* tail call so need to tinker with blink */
|
||||
b memset
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
@@ -8,9 +9,7 @@
|
||||
#include <asm-generic/sections.h>
|
||||
|
||||
extern ulong __image_copy_start;
|
||||
extern ulong __ivt_start;
|
||||
extern ulong __ivt_end;
|
||||
extern ulong __text_end;
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
@@ -18,9 +17,6 @@ int copy_uboot_to_ram(void)
|
||||
{
|
||||
size_t len = (size_t)&__image_copy_end - (size_t)&__image_copy_start;
|
||||
|
||||
if (gd->flags & GD_FLG_SKIP_RELOC)
|
||||
return 0;
|
||||
|
||||
memcpy((void *)gd->relocaddr, (void *)&__image_copy_start, len);
|
||||
|
||||
return 0;
|
||||
@@ -44,13 +40,10 @@ int do_elf_reloc_fixups(void)
|
||||
Elf32_Rela *re_src = (Elf32_Rela *)(&__rel_dyn_start);
|
||||
Elf32_Rela *re_end = (Elf32_Rela *)(&__rel_dyn_end);
|
||||
|
||||
if (gd->flags & GD_FLG_SKIP_RELOC)
|
||||
return 0;
|
||||
|
||||
debug("Section .rela.dyn is located at %08x-%08x\n",
|
||||
(unsigned int)re_src, (unsigned int)re_end);
|
||||
|
||||
Elf32_Addr *offset_ptr_rom;
|
||||
Elf32_Addr *offset_ptr_rom, *last_offset = NULL;
|
||||
Elf32_Addr *offset_ptr_ram;
|
||||
|
||||
do {
|
||||
@@ -59,28 +52,15 @@ int do_elf_reloc_fixups(void)
|
||||
|
||||
/* Check that the location of the relocation is in .text */
|
||||
if (offset_ptr_rom >= (Elf32_Addr *)&__image_copy_start &&
|
||||
offset_ptr_rom < (Elf32_Addr *)&__image_copy_end) {
|
||||
unsigned int val, do_swap = 0;
|
||||
offset_ptr_rom > last_offset) {
|
||||
unsigned int val;
|
||||
/* Switch to the in-RAM version */
|
||||
offset_ptr_ram = (Elf32_Addr *)((ulong)offset_ptr_rom +
|
||||
gd->reloc_off);
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
/* If location in ".text" section swap value */
|
||||
if (((u32)offset_ptr_rom >= (u32)&__text_start &&
|
||||
(u32)offset_ptr_rom <= (u32)&__text_end)
|
||||
#if defined(__ARC700__) || defined(__ARC600__)
|
||||
|| ((u32)offset_ptr_rom >= (u32)&__ivt_start &&
|
||||
(u32)offset_ptr_rom <= (u32)&__ivt_end)
|
||||
#endif
|
||||
)
|
||||
do_swap = 1;
|
||||
#endif
|
||||
|
||||
debug("Patching value @ %08x (relocated to %08x)%s\n",
|
||||
debug("Patching value @ %08x (relocated to %08x)\n",
|
||||
(unsigned int)offset_ptr_rom,
|
||||
(unsigned int)offset_ptr_ram,
|
||||
do_swap ? ", middle-endian encoded" : "");
|
||||
(unsigned int)offset_ptr_ram);
|
||||
|
||||
/*
|
||||
* Use "memcpy" because target location might be
|
||||
@@ -90,45 +70,28 @@ int do_elf_reloc_fixups(void)
|
||||
*/
|
||||
memcpy(&val, offset_ptr_ram, sizeof(int));
|
||||
|
||||
if (do_swap)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
/* If location in ".text" section swap value */
|
||||
if ((unsigned int)offset_ptr_rom <
|
||||
(unsigned int)&__ivt_end)
|
||||
val = (val << 16) | (val >> 16);
|
||||
#endif
|
||||
|
||||
/* Check that the target points into executable */
|
||||
if (val < (unsigned int)&__image_copy_start ||
|
||||
val > (unsigned int)&__image_copy_end) {
|
||||
/* TODO: Use panic() instead of debug()
|
||||
*
|
||||
* For some reason GCC might generate
|
||||
* fake relocation even for LD/SC of constant
|
||||
* inderectly. See an example below:
|
||||
* ----------------------->8--------------------
|
||||
* static int setup_mon_len(void)
|
||||
* {
|
||||
* gd->mon_len = (ulong)&__bss_end - CONFIG_SYS_MONITOR_BASE;
|
||||
* return 0;
|
||||
* }
|
||||
* ----------------------->8--------------------
|
||||
*
|
||||
* And that's what we get in the binary:
|
||||
* ----------------------->8--------------------
|
||||
* 10005cb4 <setup_mon_len>:
|
||||
* 10005cb4: 193c 3f80 0003 2f80 st 0x32f80,[r25,60]
|
||||
* 10005cb8: R_ARC_RELATIVE *ABS*-0x10000000
|
||||
* 10005cbc: 7fe0 j_s.d [blink]
|
||||
* 10005cbe: 700c mov_s r0,0
|
||||
* ----------------------->8--------------------
|
||||
*/
|
||||
debug("Relocation target %08x points outside of image\n",
|
||||
val);
|
||||
if (val >= (unsigned int)&__image_copy_start && val <=
|
||||
(unsigned int)&__image_copy_end) {
|
||||
val += gd->reloc_off;
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
/* If location in ".text" section swap value */
|
||||
if ((unsigned int)offset_ptr_rom <
|
||||
(unsigned int)&__ivt_end)
|
||||
val = (val << 16) | (val >> 16);
|
||||
#endif
|
||||
memcpy(offset_ptr_ram, &val, sizeof(int));
|
||||
}
|
||||
|
||||
val += gd->reloc_off;
|
||||
|
||||
if (do_swap)
|
||||
val = (val << 16) | (val >> 16);
|
||||
|
||||
memcpy(offset_ptr_ram, &val, sizeof(int));
|
||||
}
|
||||
last_offset = offset_ptr_rom;
|
||||
|
||||
} while (++re_src < re_end);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <command.h>
|
||||
#include <common.h>
|
||||
|
||||
__weak void reset_cpu(ulong addr)
|
||||
{
|
||||
/* Stop debug session here */
|
||||
__builtin_arc_brk();
|
||||
}
|
||||
|
||||
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
|
||||
{
|
||||
printf("Resetting the board...\n");
|
||||
|
||||
reset_cpu(0);
|
||||
printf("Put your restart handler here\n");
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Stop debug session here */
|
||||
__asm__("brk");
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#include <asm-offsets.h>
|
||||
@@ -23,14 +24,6 @@ ENTRY(_start)
|
||||
#endif
|
||||
sr r5, [ARC_AUX_IC_CTRL]
|
||||
|
||||
mov r5, 1
|
||||
sr r5, [ARC_AUX_IC_IVIC]
|
||||
; As per ARC HS databook (see chapter 5.3.3.2)
|
||||
; it is required to add 3 NOPs after each write to IC_IVIC.
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
1:
|
||||
; Disable/enable D-cache according to configuration
|
||||
lr r5, [ARC_BCR_DC_BUILD]
|
||||
@@ -44,10 +37,6 @@ ENTRY(_start)
|
||||
#endif
|
||||
sr r5, [ARC_AUX_DC_CTRL]
|
||||
|
||||
mov r5, 1
|
||||
sr r5, [ARC_AUX_DC_IVDC]
|
||||
|
||||
|
||||
1:
|
||||
#ifdef CONFIG_ISA_ARCV2
|
||||
; Disable System-Level Cache (SLC)
|
||||
@@ -61,15 +50,6 @@ ENTRY(_start)
|
||||
1:
|
||||
#endif
|
||||
|
||||
#ifdef __ARC_UNALIGNED__
|
||||
/*
|
||||
* Enable handling of unaligned access in the CPU as by default
|
||||
* this HW feature is disabled while GCC starting from 8.1.0
|
||||
* unconditionally uses it for ARC HS cores.
|
||||
*/
|
||||
flag 1 << STATUS_AD_BIT
|
||||
#endif
|
||||
|
||||
/* Establish C runtime stack and frame */
|
||||
mov %sp, CONFIG_SYS_INIT_SP_ADDR
|
||||
mov %fp, %sp
|
||||
@@ -84,20 +64,9 @@ ENTRY(_start)
|
||||
/* Initialize reserved area - note: r0 already contains address */
|
||||
bl board_init_f_init_reserve
|
||||
|
||||
#ifdef CONFIG_DEBUG_UART
|
||||
/* Earliest point to set up early debug uart */
|
||||
bl debug_uart_init
|
||||
#endif
|
||||
|
||||
/* Zero the one and only argument of "board_init_f" */
|
||||
mov_s %r0, 0
|
||||
bl board_init_f
|
||||
|
||||
/* We only get here if relocation is disabled by GD_FLG_SKIP_RELOC */
|
||||
/* Make sure we don't lose GD overwritten by zero new GD */
|
||||
mov %r0, %r25
|
||||
mov %r1, 0
|
||||
bl board_init_r
|
||||
j board_init_f
|
||||
ENDPROC(_start)
|
||||
|
||||
/*
|
||||
|
||||
141
arch/arc/lib/strchr-700.S
Normal file
141
arch/arc/lib/strchr-700.S
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/*
|
||||
* ARC700 has a relatively long pipeline and branch prediction, so we want
|
||||
* to avoid branches that are hard to predict. On the other hand, the
|
||||
* presence of the norm instruction makes it easier to operate on whole
|
||||
* words branch-free.
|
||||
*/
|
||||
|
||||
.global strchr
|
||||
.align 4
|
||||
strchr:
|
||||
extb_s %r1, %r1
|
||||
asl %r5, %r1, 8
|
||||
bmsk %r2, %r0, 1
|
||||
or %r5, %r5, %r1
|
||||
mov_s %r3, 0x01010101
|
||||
breq.d %r2, %r0, .Laligned
|
||||
asl %r4, %r5, 16
|
||||
sub_s %r0, %r0, %r2
|
||||
asl %r7, %r2, 3
|
||||
ld_s %r2, [%r0]
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
asl %r7, %r3, %r7
|
||||
#else /* __BIG_ENDIAN__ */
|
||||
lsr %r7, %r3, %r7
|
||||
#endif /* _ENDIAN__ */
|
||||
or %r5, %r5, %r4
|
||||
ror %r4, %r3
|
||||
sub %r12, %r2, %r7
|
||||
bic_s %r12, %r12, %r2
|
||||
and %r12, %r12, %r4
|
||||
brne.d %r12, 0, .Lfound0_ua
|
||||
xor %r6, %r2, %r5
|
||||
ld.a %r2, [%r0, 4]
|
||||
sub %r12, %r6, %r7
|
||||
bic %r12, %r12, %r6
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
and %r7, %r12, %r4
|
||||
/* For speed, we want this branch to be unaligned. */
|
||||
breq %r7, 0, .Loop
|
||||
/* Likewise this one */
|
||||
b .Lfound_char
|
||||
#else /* __BIG_ENDIAN__ */
|
||||
and %r12, %r12, %r4
|
||||
/* For speed, we want this branch to be unaligned. */
|
||||
breq %r12, 0, .Loop
|
||||
lsr_s %r12, %r12, 7
|
||||
bic %r2, %r7, %r6
|
||||
b.d .Lfound_char_b
|
||||
and_s %r2, %r2, %r12
|
||||
#endif /* _ENDIAN__ */
|
||||
/* We require this code address to be unaligned for speed... */
|
||||
.Laligned:
|
||||
ld_s %r2, [%r0]
|
||||
or %r5, %r5, %r4
|
||||
ror %r4, %r3
|
||||
/* ... so that this code address is aligned, for itself and ... */
|
||||
.Loop:
|
||||
sub %r12, %r2, %r3
|
||||
bic_s %r12, %r12, %r2
|
||||
and %r12, %r12, %r4
|
||||
brne.d %r12, 0, .Lfound0
|
||||
xor %r6, %r2, %r5
|
||||
ld.a %r2, [%r0, 4]
|
||||
sub %r12, %r6, %r3
|
||||
bic %r12, %r12, %r6
|
||||
and %r7, %r12, %r4
|
||||
breq %r7, 0, .Loop
|
||||
/*
|
||||
*... so that this branch is unaligned.
|
||||
* Found searched-for character.
|
||||
* r0 has already advanced to next word.
|
||||
*/
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
/*
|
||||
* We only need the information about the first matching byte
|
||||
* (i.e. the least significant matching byte) to be exact,
|
||||
* hence there is no problem with carry effects.
|
||||
*/
|
||||
.Lfound_char:
|
||||
sub %r3, %r7, 1
|
||||
bic %r3, %r3, %r7
|
||||
norm %r2, %r3
|
||||
sub_s %r0, %r0, 1
|
||||
asr_s %r2, %r2, 3
|
||||
j.d [%blink]
|
||||
sub_s %r0, %r0, %r2
|
||||
|
||||
.balign 4
|
||||
.Lfound0_ua:
|
||||
mov %r3, %r7
|
||||
.Lfound0:
|
||||
sub %r3, %r6, %r3
|
||||
bic %r3, %r3, %r6
|
||||
and %r2, %r3, %r4
|
||||
or_s %r12, %r12, %r2
|
||||
sub_s %r3, %r12, 1
|
||||
bic_s %r3, %r3, %r12
|
||||
norm %r3, %r3
|
||||
add_s %r0, %r0, 3
|
||||
asr_s %r12, %r3, 3
|
||||
asl.f 0, %r2, %r3
|
||||
sub_s %r0, %r0, %r12
|
||||
j_s.d [%blink]
|
||||
mov.pl %r0, 0
|
||||
#else /* __BIG_ENDIAN__ */
|
||||
.Lfound_char:
|
||||
lsr %r7, %r7, 7
|
||||
|
||||
bic %r2, %r7, %r6
|
||||
.Lfound_char_b:
|
||||
norm %r2, %r2
|
||||
sub_s %r0, %r0, 4
|
||||
asr_s %r2, %r2, 3
|
||||
j.d [%blink]
|
||||
add_s %r0, %r0, %r2
|
||||
|
||||
.Lfound0_ua:
|
||||
mov_s %r3, %r7
|
||||
.Lfound0:
|
||||
asl_s %r2, %r2, 7
|
||||
or %r7, %r6, %r4
|
||||
bic_s %r12, %r12, %r2
|
||||
sub %r2, %r7, %r3
|
||||
or %r2, %r2, %r6
|
||||
bic %r12, %r2, %r12
|
||||
bic.f %r3, %r4, %r12
|
||||
norm %r3, %r3
|
||||
|
||||
add.pl %r3, %r3, 1
|
||||
asr_s %r12, %r3, 3
|
||||
asl.f 0, %r2, %r3
|
||||
add_s %r0, %r0, %r12
|
||||
j_s.d [%blink]
|
||||
mov.mi %r0, 0
|
||||
#endif /* _ENDIAN__ */
|
||||
97
arch/arc/lib/strcmp.S
Normal file
97
arch/arc/lib/strcmp.S
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2014 Synopsys, Inc. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is optimized primarily for the ARC700.
|
||||
* It would be possible to speed up the loops by one cycle / word
|
||||
* respective one cycle / byte by forcing double source 1 alignment, unrolling
|
||||
* by a factor of two, and speculatively loading the second word / byte of
|
||||
* source 1; however, that would increase the overhead for loop setup / finish,
|
||||
* and strcmp might often terminate early.
|
||||
*/
|
||||
|
||||
.global strcmp
|
||||
.align 4
|
||||
strcmp:
|
||||
or %r2, %r0, %r1
|
||||
bmsk_s %r2, %r2, 1
|
||||
brne %r2, 0, .Lcharloop
|
||||
mov_s %r12, 0x01010101
|
||||
ror %r5, %r12
|
||||
.Lwordloop:
|
||||
ld.ab %r2, [%r0, 4]
|
||||
ld.ab %r3, [%r1, 4]
|
||||
nop_s
|
||||
sub %r4, %r2, %r12
|
||||
bic %r4, %r4, %r2
|
||||
and %r4, %r4, %r5
|
||||
brne %r4, 0, .Lfound0
|
||||
breq %r2 ,%r3, .Lwordloop
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
xor %r0, %r2, %r3 /* mask for difference */
|
||||
sub_s %r1, %r0, 1
|
||||
bic_s %r0, %r0, %r1 /* mask for least significant difference bit */
|
||||
sub %r1, %r5, %r0
|
||||
xor %r0, %r5, %r1 /* mask for least significant difference byte */
|
||||
and_s %r2, %r2, %r0
|
||||
and_s %r3, %r3, %r0
|
||||
#endif /* _ENDIAN__ */
|
||||
cmp_s %r2, %r3
|
||||
mov_s %r0, 1
|
||||
j_s.d [%blink]
|
||||
bset.lo %r0, %r0, 31
|
||||
|
||||
.balign 4
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
.Lfound0:
|
||||
xor %r0, %r2, %r3 /* mask for difference */
|
||||
or %r0, %r0, %r4 /* or in zero indicator */
|
||||
sub_s %r1, %r0, 1
|
||||
bic_s %r0, %r0, %r1 /* mask for least significant difference bit */
|
||||
sub %r1, %r5, %r0
|
||||
xor %r0, %r5, %r1 /* mask for least significant difference byte */
|
||||
and_s %r2, %r2, %r0
|
||||
and_s %r3, %r3, %r0
|
||||
sub.f %r0, %r2, %r3
|
||||
mov.hi %r0, 1
|
||||
j_s.d [%blink]
|
||||
bset.lo %r0, %r0, 31
|
||||
#else /* __BIG_ENDIAN__ */
|
||||
/*
|
||||
* The zero-detection above can mis-detect 0x01 bytes as zeroes
|
||||
* because of carry-propagateion from a lower significant zero byte.
|
||||
* We can compensate for this by checking that bit0 is zero.
|
||||
* This compensation is not necessary in the step where we
|
||||
* get a low estimate for r2, because in any affected bytes
|
||||
* we already have 0x00 or 0x01, which will remain unchanged
|
||||
* when bit 7 is cleared.
|
||||
*/
|
||||
.balign 4
|
||||
.Lfound0:
|
||||
lsr %r0, %r4, 8
|
||||
lsr_s %r1, %r2
|
||||
bic_s %r2, %r2, %r0 /* get low estimate for r2 and get ... */
|
||||
bic_s %r0, %r0, %r1 /* <this is the adjusted mask for zeros> */
|
||||
or_s %r3, %r3, %r0 /* ... high estimate r3 so that r2 > r3 will */
|
||||
cmp_s %r3, %r2 /* ... be independent of trailing garbage */
|
||||
or_s %r2, %r2, %r0 /* likewise for r3 > r2 */
|
||||
bic_s %r3, %r3, %r0
|
||||
rlc %r0, 0 /* r0 := r2 > r3 ? 1 : 0 */
|
||||
cmp_s %r2, %r3
|
||||
j_s.d [%blink]
|
||||
bset.lo %r0, %r0, 31
|
||||
#endif /* _ENDIAN__ */
|
||||
|
||||
.balign 4
|
||||
.Lcharloop:
|
||||
ldb.ab %r2,[%r0,1]
|
||||
ldb.ab %r3,[%r1,1]
|
||||
nop_s
|
||||
breq %r2, 0, .Lcmpend
|
||||
breq %r2, %r3, .Lcharloop
|
||||
.Lcmpend:
|
||||
j_s.d [%blink]
|
||||
sub %r0, %r2, %r3
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user