forked from leandrof/u-boot
Compare commits
4 Commits
v2022.07
...
WIP/25Feb2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b73d114213 | ||
|
|
c0b354ed02 | ||
|
|
01585fbf6b | ||
|
|
4e238b7c1a |
@@ -1,33 +1,29 @@
|
||||
variables:
|
||||
windows_vm: windows-2019
|
||||
windows_vm: vs2017-win2016
|
||||
ubuntu_vm: ubuntu-18.04
|
||||
macos_vm: macOS-10.15
|
||||
ci_runner_image: trini/u-boot-gitlab-ci-runner:focal-20220302-15Mar2022
|
||||
ci_runner_image: trini/u-boot-gitlab-ci-runner:bionic-20200807-02Sep2020
|
||||
# Add '-u 0' options for Azure pipelines, otherwise we get "permission
|
||||
# denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer",
|
||||
# since our $(ci_runner_image) user is not root.
|
||||
container_option: -u 0
|
||||
work_dir: /u
|
||||
|
||||
stages:
|
||||
- stage: testsuites
|
||||
jobs:
|
||||
jobs:
|
||||
- job: tools_only_windows
|
||||
displayName: 'Ensure host tools build for Windows'
|
||||
pool:
|
||||
vmImage: $(windows_vm)
|
||||
steps:
|
||||
- powershell: |
|
||||
(New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2021-06-04/msys2-base-x86_64-20210604.sfx.exe", "sfx.exe")
|
||||
(New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2020-07-20/msys2-base-x86_64-20200720.sfx.exe", "sfx.exe")
|
||||
displayName: 'Install MSYS2'
|
||||
- script: |
|
||||
sfx.exe -y -o%CD:~0,2%\
|
||||
%CD:~0,2%\msys64\usr\bin\bash -lc " "
|
||||
%CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu"
|
||||
%CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu"
|
||||
%CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syyuu"
|
||||
displayName: 'Update MSYS2'
|
||||
- script: |
|
||||
%CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -Sy make gcc bison flex diffutils openssl-devel libgnutls-devel libutil-linux-devel"
|
||||
%CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -S make gcc bison flex diffutils openssl-devel"
|
||||
displayName: 'Install Toolchain'
|
||||
- script: |
|
||||
echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh
|
||||
@@ -44,7 +40,7 @@ stages:
|
||||
pool:
|
||||
vmImage: $(macos_vm)
|
||||
steps:
|
||||
- script: brew install make ossp-uuid
|
||||
- script: brew install make
|
||||
displayName: Brew install dependencies
|
||||
- script: |
|
||||
gmake tools-only_config tools-only NO_SDL=1 \
|
||||
@@ -53,38 +49,6 @@ stages:
|
||||
-j$(sysctl -n hw.logicalcpu)
|
||||
displayName: 'Perform tools-only build'
|
||||
|
||||
- job: check_for_migrated_symbols_in_board_header
|
||||
displayName: 'Check for migrated symbols in board header'
|
||||
pool:
|
||||
vmImage: $(ubuntu_vm)
|
||||
container:
|
||||
image: $(ci_runner_image)
|
||||
options: $(container_option)
|
||||
steps:
|
||||
- script: |
|
||||
KSYMLST=`mktemp`
|
||||
KUSEDLST=`mktemp`
|
||||
RET=0
|
||||
cat `find . -name "Kconfig*"` | \
|
||||
sed -n -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
|
||||
-e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
|
||||
| sort -u > $KSYMLST
|
||||
for CFG in `find include/configs -name "*.h"`; do
|
||||
(grep '#define[[:blank:]]CONFIG_' $CFG | \
|
||||
sed -n 's/#define.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' ; \
|
||||
grep '#undef[[:blank:]]CONFIG_' $CFG | \
|
||||
sed -n 's/#undef.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p') | \
|
||||
sort -u > ${KUSEDLST} || true
|
||||
NUM=`comm -123 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} | \
|
||||
cut -d , -f 3`
|
||||
if [[ $NUM -ne 0 ]]; then
|
||||
echo "Unmigrated symbols found in $CFG:"
|
||||
comm -12 ${KSYMLST} ${KUSEDLST}
|
||||
RET=1
|
||||
fi
|
||||
done
|
||||
exit $RET
|
||||
|
||||
- job: cppcheck
|
||||
displayName: 'Static code analysis with cppcheck'
|
||||
pool:
|
||||
@@ -184,7 +148,7 @@ stages:
|
||||
export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
|
||||
export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
|
||||
export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}
|
||||
./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl
|
||||
./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl
|
||||
./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test
|
||||
./tools/buildman/buildman -t
|
||||
./tools/dtoc/dtoc -t
|
||||
@@ -205,33 +169,10 @@ stages:
|
||||
options: $(container_option)
|
||||
steps:
|
||||
- script: |
|
||||
export PATH=/opt/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin:$PATH
|
||||
./tools/buildman/buildman --fetch-arch arm
|
||||
export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH
|
||||
test/nokia_rx51_test.sh
|
||||
|
||||
- job: pylint
|
||||
displayName: Check for any pylint regressions
|
||||
pool:
|
||||
vmImage: $(ubuntu_vm)
|
||||
container:
|
||||
image: $(ci_runner_image)
|
||||
options: $(container_option)
|
||||
steps:
|
||||
- script: |
|
||||
cd ${WORK_DIR}
|
||||
export USER=azure
|
||||
pip install -r test/py/requirements.txt
|
||||
pip install asteval pylint==2.12.2 pyopenssl
|
||||
export PATH=${PATH}:~/.local/bin
|
||||
echo "[MASTER]" >> .pylintrc
|
||||
echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
|
||||
export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
|
||||
./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl
|
||||
pylint --version
|
||||
export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt
|
||||
make pylint_err
|
||||
|
||||
- stage: test_py
|
||||
jobs:
|
||||
- job: test_py
|
||||
displayName: 'test.py'
|
||||
pool:
|
||||
@@ -242,25 +183,18 @@ stages:
|
||||
TEST_PY_BD: "sandbox"
|
||||
sandbox_clang:
|
||||
TEST_PY_BD: "sandbox"
|
||||
OVERRIDE: "-O clang-13"
|
||||
OVERRIDE: "-O clang-10"
|
||||
sandbox_spl:
|
||||
TEST_PY_BD: "sandbox_spl"
|
||||
TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
|
||||
sandbox_vpl:
|
||||
TEST_PY_BD: "sandbox_vpl"
|
||||
TEST_PY_TEST_SPEC: "test_vpl_help or test_spl"
|
||||
sandbox_noinst:
|
||||
TEST_PY_BD: "sandbox_noinst"
|
||||
TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
|
||||
sandbox_flattree:
|
||||
TEST_PY_BD: "sandbox_flattree"
|
||||
coreboot:
|
||||
TEST_PY_BD: "coreboot"
|
||||
TEST_PY_ID: "--id qemu"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
evb_ast2500:
|
||||
TEST_PY_BD: "evb-ast2500"
|
||||
TEST_PY_ID: "--id qemu"
|
||||
vexpress_ca15_tc2:
|
||||
TEST_PY_BD: "vexpress_ca15_tc2"
|
||||
TEST_PY_ID: "--id qemu"
|
||||
vexpress_ca9x4:
|
||||
TEST_PY_BD: "vexpress_ca9x4"
|
||||
TEST_PY_ID: "--id qemu"
|
||||
@@ -274,6 +208,18 @@ stages:
|
||||
qemu_arm64:
|
||||
TEST_PY_BD: "qemu_arm64"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
qemu_mips:
|
||||
TEST_PY_BD: "qemu_mips"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
qemu_mipsel:
|
||||
TEST_PY_BD: "qemu_mipsel"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
qemu_mips64:
|
||||
TEST_PY_BD: "qemu_mips64"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
qemu_mips64el:
|
||||
TEST_PY_BD: "qemu_mips64el"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
qemu_malta:
|
||||
TEST_PY_BD: "malta"
|
||||
TEST_PY_ID: "--id qemu"
|
||||
@@ -323,12 +269,6 @@ stages:
|
||||
r2dplus_tulip:
|
||||
TEST_PY_BD: "r2dplus"
|
||||
TEST_PY_ID: "--id tulip_qemu"
|
||||
sifive_unleashed_sdcard:
|
||||
TEST_PY_BD: "sifive_unleashed"
|
||||
TEST_PY_ID: "--id sdcard_qemu"
|
||||
sifive_unleashed_spi-nor:
|
||||
TEST_PY_BD: "sifive_unleashed"
|
||||
TEST_PY_ID: "--id spi-nor_qemu"
|
||||
xilinx_zynq_virt:
|
||||
TEST_PY_BD: "xilinx_zynq_virt"
|
||||
TEST_PY_ID: "--id qemu"
|
||||
@@ -355,18 +295,18 @@ stages:
|
||||
cat << "EOF" >> test.sh
|
||||
# the below corresponds to .gitlab-ci.yml "before_script"
|
||||
cd ${WORK_DIR}
|
||||
git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/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`
|
||||
grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
|
||||
grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
|
||||
if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
|
||||
wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
|
||||
export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
|
||||
wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
|
||||
export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
|
||||
fi
|
||||
if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
|
||||
wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
|
||||
export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
|
||||
if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
|
||||
wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
|
||||
export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
|
||||
fi
|
||||
# the below corresponds to .gitlab-ci.yml "script"
|
||||
cd ${WORK_DIR}
|
||||
@@ -375,26 +315,9 @@ stages:
|
||||
cp ~/grub_x86.efi ${UBOOT_TRAVIS_BUILD_DIR}/
|
||||
cp ~/grub_x64.efi ${UBOOT_TRAVIS_BUILD_DIR}/
|
||||
cp /opt/grub/grubriscv64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv64.efi
|
||||
cp /opt/grub/grubriscv32.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv32.efi
|
||||
cp /opt/grub/grubaa64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm64.efi
|
||||
cp /opt/grub/grubarm.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm.efi
|
||||
# create sdcard / spi-nor images for sifive unleashed using genimage
|
||||
if [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
|
||||
mkdir -p root;
|
||||
cp ${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .;
|
||||
cp ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .;
|
||||
rm -rf tmp;
|
||||
genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg;
|
||||
cp images/sdcard.img ${UBOOT_TRAVIS_BUILD_DIR}/;
|
||||
rm -rf tmp;
|
||||
genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg;
|
||||
cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/;
|
||||
fi
|
||||
if [[ "${TEST_PY_BD}" == "coreboot" ]]; then
|
||||
wget -O - "https://drive.google.com/uc?id=1x6nrtWIyIRPLS2cQBwYTnT2TbOI8UjmM&export=download" |xz -dc >${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom;
|
||||
wget -O - "https://drive.google.com/uc?id=149Cz-5SZXHNKpi9xg6R_5XITWohu348y&export=download" >cbfstool;
|
||||
chmod a+x cbfstool;
|
||||
./cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000;
|
||||
fi
|
||||
virtualenv -p /usr/bin/python3 /tmp/venv
|
||||
. /tmp/venv/bin/activate
|
||||
pip install -r test/py/requirements.txt
|
||||
@@ -410,39 +333,22 @@ stages:
|
||||
# as sandbox testing need create files like spi flash images, etc.
|
||||
# (TODO: clean up this in the future)
|
||||
chmod 777 .
|
||||
# Filesystem tests need extra docker args to run
|
||||
set --
|
||||
if [[ "${TEST_PY_BD}" == "sandbox" ]]; then
|
||||
# mount -o loop needs the loop devices
|
||||
if modprobe loop; then
|
||||
for d in $(find /dev -maxdepth 1 -name 'loop*'); do
|
||||
set -- "$@" --device $d:$d
|
||||
done
|
||||
fi
|
||||
# Needed for mount syscall (for guestmount as well)
|
||||
set -- "$@" --cap-add SYS_ADMIN
|
||||
# Default apparmor profile denies mounts
|
||||
set -- "$@" --security-opt apparmor=unconfined
|
||||
fi
|
||||
# Some tests using libguestfs-tools need the fuse device to run
|
||||
docker run "$@" --device /dev/fuse:/dev/fuse -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
|
||||
docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh
|
||||
|
||||
- stage: world_build
|
||||
jobs:
|
||||
- job: build_the_world
|
||||
displayName: 'Build the World'
|
||||
pool:
|
||||
vmImage: $(ubuntu_vm)
|
||||
strategy:
|
||||
# Use almost the same target division in .travis.yml, only merged
|
||||
# 3 small build jobs (arc/microblaze/xtensa) into one.
|
||||
# 4 small build jobs (arc/microblaze/nds32/xtensa) into one.
|
||||
matrix:
|
||||
arc_microblaze_xtensa:
|
||||
BUILDMAN: "arc microblaze xtensa"
|
||||
arc_microblaze_nds32_xtensa:
|
||||
BUILDMAN: "arc microblaze nds32 xtensa"
|
||||
arm11_arm7_arm920t_arm946es:
|
||||
BUILDMAN: "arm11 arm7 arm920t arm946es"
|
||||
arm926ejs:
|
||||
BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,omap"
|
||||
BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,spear,omap"
|
||||
at91_non_armv7:
|
||||
BUILDMAN: "at91 -x armv7"
|
||||
at91_non_arm926ejs:
|
||||
@@ -469,12 +375,12 @@ stages:
|
||||
BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex"
|
||||
imx:
|
||||
BUILDMAN: "mx -x mx6,freescale,technexion,toradex"
|
||||
imx8:
|
||||
BUILDMAN: "imx8"
|
||||
keystone2_keystone3:
|
||||
BUILDMAN: "k2 k3"
|
||||
samsung_socfpga:
|
||||
BUILDMAN: "samsung socfpga"
|
||||
spear:
|
||||
BUILDMAN: "spear"
|
||||
sun4i:
|
||||
BUILDMAN: "sun4i"
|
||||
sun5i:
|
||||
@@ -492,7 +398,7 @@ stages:
|
||||
sun50i:
|
||||
BUILDMAN: "sun50i"
|
||||
arm_catch_all:
|
||||
BUILDMAN: "arm -x arm11,arm7,arm9,aarch64,at91,bcm,freescale,kirkwood,mvebu,renesas,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,rk,toradex,socfpga,k2,k3,zynq"
|
||||
BUILDMAN: "arm -x arm11,arm7,arm9,aarch64,at91,bcm,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,rk,toradex,socfpga,k2,k3,zynq"
|
||||
sandbox_x86:
|
||||
BUILDMAN: "sandbox x86"
|
||||
technexion:
|
||||
@@ -508,11 +414,11 @@ stages:
|
||||
non_fsl_ppc:
|
||||
BUILDMAN: "powerpc -x freescale"
|
||||
mpc85xx_freescale:
|
||||
BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x bsc91*"
|
||||
BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x bsc91*"
|
||||
t208xrdb_corenet_ds:
|
||||
BUILDMAN: "t208xrdb corenet_ds"
|
||||
fsl_ppc:
|
||||
BUILDMAN: "mpc83xx&freescale"
|
||||
BUILDMAN: "t4qds b4860qds mpc83xx&freescale mpc86xx&freescale"
|
||||
t102x:
|
||||
BUILDMAN: "t102*"
|
||||
p1_p2_rdb_pc:
|
||||
@@ -530,11 +436,11 @@ stages:
|
||||
uniphier:
|
||||
BUILDMAN: "uniphier"
|
||||
aarch64_catch_all:
|
||||
BUILDMAN: "aarch64 -x bcm,imx8,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,renesas,sunxi,samsung,socfpga,rk,versal,zynq"
|
||||
BUILDMAN: "aarch64 -x bcm,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,sunxi,samsung,socfpga,rk,versal,zynq"
|
||||
rockchip:
|
||||
BUILDMAN: "rk"
|
||||
renesas:
|
||||
BUILDMAN: "renesas"
|
||||
sh:
|
||||
BUILDMAN: "sh -x arm"
|
||||
zynq:
|
||||
BUILDMAN: "zynq&armv7"
|
||||
zynqmp_versal:
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
# addresses are __aligned(2)".
|
||||
--ignore PREFER_ETHER_ADDR_COPY
|
||||
|
||||
# ENOSYS is a conventionally used error, even though U-Boot lacks system calls.
|
||||
--ignore ENOSYS
|
||||
|
||||
# A bit shorter of a description is OK with us.
|
||||
--min-conf-desc-length=2
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
--find-maintainer-files --maintainer-path=.
|
||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -3,4 +3,3 @@
|
||||
# Denote all files that are truly binary and should not be modified
|
||||
*.bmp binary
|
||||
*.ttf binary
|
||||
*.gz binary
|
||||
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -10,7 +10,6 @@
|
||||
*.asn1.[ch]
|
||||
*.bin
|
||||
*.cfgout
|
||||
*.cover
|
||||
*.dtb
|
||||
*.dtbo
|
||||
*.dtb.S
|
||||
@@ -23,7 +22,6 @@
|
||||
*.lex.c
|
||||
*.lst
|
||||
*.mod.c
|
||||
*.mbx
|
||||
*.o
|
||||
*.o.*
|
||||
*.order
|
||||
@@ -97,10 +95,3 @@ GTAGS
|
||||
|
||||
# Python cache
|
||||
__pycache__
|
||||
|
||||
# Python code coverage output (python3-coverage html)
|
||||
/htmlcov/
|
||||
|
||||
# pylint files
|
||||
/pylint.cur
|
||||
/pylint.out/
|
||||
|
||||
159
.gitlab-ci.yml
159
.gitlab-ci.yml
@@ -1,8 +1,8 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
# Grab our configured image. The source for this is found at:
|
||||
# https://source.denx.de/u-boot/gitlab-ci-runner
|
||||
image: trini/u-boot-gitlab-ci-runner:focal-20220302-15Mar2022
|
||||
# https://gitlab.denx.de/u-boot/gitlab-ci-runner
|
||||
image: trini/u-boot-gitlab-ci-runner:bionic-20200807-02Sep2020
|
||||
|
||||
# We run some tests in different order, to catch some failures quicker.
|
||||
stages:
|
||||
@@ -14,18 +14,18 @@ stages:
|
||||
stage: test.py
|
||||
before_script:
|
||||
# Clone uboot-test-hooks
|
||||
- git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/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`
|
||||
- grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
|
||||
- grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
|
||||
- if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then
|
||||
wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
|
||||
export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
|
||||
wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
|
||||
export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;
|
||||
fi
|
||||
- if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
|
||||
wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ;
|
||||
export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
|
||||
- if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]]; then
|
||||
wget -O - https://github.com/riscv/opensbi/releases/download/v0.8/opensbi-0.8-rv-bin.tar.xz | tar -C /tmp -xJ;
|
||||
export OPENSBI=/tmp/opensbi-0.8-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin;
|
||||
fi
|
||||
|
||||
after_script:
|
||||
@@ -38,30 +38,9 @@ stages:
|
||||
- cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/
|
||||
- cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/
|
||||
- cp /opt/grub/grubriscv64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv64.efi
|
||||
- cp /opt/grub/grubriscv32.efi $UBOOT_TRAVIS_BUILD_DIR/grub_riscv32.efi
|
||||
- cp /opt/grub/grubaa64.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi
|
||||
- cp /opt/grub/grubarm.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi
|
||||
# create sdcard / spi-nor images for sifive unleashed using genimage
|
||||
- if [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then
|
||||
mkdir -p root;
|
||||
cp ${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .;
|
||||
cp ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .;
|
||||
rm -rf tmp;
|
||||
genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg;
|
||||
cp images/sdcard.img ${UBOOT_TRAVIS_BUILD_DIR}/;
|
||||
rm -rf tmp;
|
||||
genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg;
|
||||
cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/;
|
||||
fi
|
||||
- if [[ "${TEST_PY_BD}" == "coreboot" ]]; then
|
||||
wget -O -
|
||||
"https://drive.google.com/uc?id=1x6nrtWIyIRPLS2cQBwYTnT2TbOI8UjmM&export=download" |
|
||||
xz -dc >${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom;
|
||||
wget -O -
|
||||
"https://drive.google.com/uc?id=149Cz-5SZXHNKpi9xg6R_5XITWohu348y&export=download" >
|
||||
cbfstool;
|
||||
chmod a+x cbfstool;
|
||||
./cbfstool ${UBOOT_TRAVIS_BUILD_DIR}/coreboot.rom add-flat-binary -f ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.bin -n fallback/payload -c LZMA -l 0x1110000 -e 0x1110000;
|
||||
fi
|
||||
- virtualenv -p /usr/bin/python3 /tmp/venv
|
||||
- . /tmp/venv/bin/activate
|
||||
- pip install -r test/py/requirements.txt
|
||||
@@ -71,10 +50,6 @@ stages:
|
||||
./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID}
|
||||
${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"}
|
||||
--build-dir "$UBOOT_TRAVIS_BUILD_DIR"
|
||||
# It seems that the files in /tmp go away, so copy out what we need
|
||||
- if [[ "${TEST_PY_BD}" == "coreboot" ]]; then
|
||||
cp -v /tmp/coreboot/*.{html,css} .;
|
||||
fi
|
||||
|
||||
build all 32bit ARM platforms:
|
||||
stage: world build
|
||||
@@ -119,32 +94,6 @@ build all other platforms:
|
||||
exit $ret;
|
||||
fi;
|
||||
|
||||
check for migrated symbols in board header:
|
||||
stage: testsuites
|
||||
script:
|
||||
- KSYMLST=`mktemp`;
|
||||
KUSEDLST=`mktemp`;
|
||||
RET=0;
|
||||
cat `find . -name "Kconfig*"` |
|
||||
sed -n -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p'
|
||||
-e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p'
|
||||
| sort -u > $KSYMLST;
|
||||
for CFG in `find include/configs -name "*.h"`; do
|
||||
(grep '#define[[:blank:]]CONFIG_' $CFG |
|
||||
sed -n 's/#define.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' ;
|
||||
grep '#undef[[:blank:]]CONFIG_' $CFG |
|
||||
sed -n 's/#undef.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p') |
|
||||
sort -u > ${KUSEDLST} || true;
|
||||
NUM=`comm -123 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} |
|
||||
cut -d , -f 3`;
|
||||
if [[ $NUM -ne 0 ]]; then
|
||||
echo "Unmigrated symbols found in $CFG:";
|
||||
comm -12 ${KSYMLST} ${KUSEDLST};
|
||||
RET=1;
|
||||
fi;
|
||||
done;
|
||||
exit $RET
|
||||
|
||||
# QA jobs for code analytics
|
||||
# static code analysis with cppcheck (we can add --enable=all later)
|
||||
cppcheck:
|
||||
@@ -206,8 +155,7 @@ Run binman, buildman, dtoc, Kconfig and patman testsuites:
|
||||
export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl;
|
||||
export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
|
||||
export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
|
||||
./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
|
||||
--board sandbox_spl;
|
||||
./tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w sandbox_spl;
|
||||
./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test;
|
||||
./tools/buildman/buildman -t;
|
||||
./tools/dtoc/dtoc -t;
|
||||
@@ -217,25 +165,10 @@ Run binman, buildman, dtoc, Kconfig and patman testsuites:
|
||||
Run tests for Nokia RX-51 (aka N900):
|
||||
stage: testsuites
|
||||
script:
|
||||
- export PATH=/opt/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin:$PATH;
|
||||
- ./tools/buildman/buildman --fetch-arch arm;
|
||||
export PATH=~/.buildman-toolchains/gcc-9.2.0-nolibc/arm-linux-gnueabi/bin/:$PATH;
|
||||
test/nokia_rx51_test.sh
|
||||
|
||||
# Check for any pylint regressions
|
||||
Run pylint:
|
||||
stage: testsuites
|
||||
script:
|
||||
- pip install -r test/py/requirements.txt
|
||||
- pip install asteval pylint==2.12.2 pyopenssl
|
||||
- export PATH=${PATH}:~/.local/bin
|
||||
- echo "[MASTER]" >> .pylintrc
|
||||
- echo "load-plugins=pylint.extensions.docparams" >> .pylintrc
|
||||
- export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl
|
||||
- ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w
|
||||
--board sandbox_spl
|
||||
- pylint --version
|
||||
- export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
|
||||
- make pylint_err
|
||||
|
||||
# Test sandbox with test.py
|
||||
sandbox test.py:
|
||||
variables:
|
||||
@@ -245,7 +178,7 @@ sandbox test.py:
|
||||
sandbox with clang test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "sandbox"
|
||||
OVERRIDE: "-O clang-13"
|
||||
OVERRIDE: "-O clang-10"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
sandbox_spl test.py:
|
||||
@@ -254,18 +187,6 @@ sandbox_spl test.py:
|
||||
TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
sandbox_noinst_test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "sandbox_noinst"
|
||||
TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
sandbox_vpl test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "sandbox_vpl"
|
||||
TEST_PY_TEST_SPEC: "test_vpl_help or test_spl"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
evb-ast2500 test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "evb-ast2500"
|
||||
@@ -277,6 +198,12 @@ sandbox_flattree test.py:
|
||||
TEST_PY_BD: "sandbox_flattree"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
vexpress_ca15_tc2 test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "vexpress_ca15_tc2"
|
||||
TEST_PY_ID: "--id qemu"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
vexpress_ca9x4 test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "vexpress_ca9x4"
|
||||
@@ -302,6 +229,30 @@ qemu_arm64 test.py:
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
qemu_mips test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "qemu_mips"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
qemu_mipsel test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "qemu_mipsel"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
qemu_mips64 test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "qemu_mips64"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
qemu_mips64el test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "qemu_mips64el"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
qemu_malta test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "malta"
|
||||
@@ -396,18 +347,6 @@ r2dplus_tulip test.py:
|
||||
TEST_PY_ID: "--id tulip_qemu"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
sifive_unleashed_sdcard test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "sifive_unleashed"
|
||||
TEST_PY_ID: "--id sdcard_qemu"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
sifive_unleashed_spi-nor test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "sifive_unleashed"
|
||||
TEST_PY_ID: "--id spi-nor_qemu"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
xilinx_zynq_virt test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "xilinx_zynq_virt"
|
||||
@@ -428,15 +367,3 @@ xtfpga test.py:
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
TEST_PY_ID: "--id qemu"
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
coreboot test.py:
|
||||
variables:
|
||||
TEST_PY_BD: "coreboot"
|
||||
TEST_PY_TEST_SPEC: "not sleep"
|
||||
TEST_PY_ID: "--id qemu"
|
||||
artifacts:
|
||||
paths:
|
||||
- "*.html"
|
||||
- "*.css"
|
||||
expire_in: 1 week
|
||||
<<: *buildman_and_testpy_dfn
|
||||
|
||||
29
.mailmap
29
.mailmap
@@ -20,34 +20,18 @@ Allen Martin <amartin@nvidia.com>
|
||||
Andreas Bießmann <andreas.devel@googlemail.com>
|
||||
Andreas Bießmann <andreas@biessmann.org>
|
||||
Aneesh V <aneesh@ti.com>
|
||||
Anup Patel <anup@brainfault.org> <anup.patel@wdc.com>
|
||||
Atish Patra <atishp@atishpatra.org> <atish.patra@wdc.com>
|
||||
Bin Meng <bmeng.cn@gmail.com> <bin.meng@windriver.com>
|
||||
Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@bootlin.com>
|
||||
Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@free-electrons.com>
|
||||
Dirk Behme <dirk.behme@googlemail.com>
|
||||
Fabio Estevam <fabio.estevam@nxp.com>
|
||||
Heinrich Schuchardt <xypron.glpk@gmx.de> <heinrich.schuchardt@canonical.com>
|
||||
Heinrich Schuchardt <xypron.glpk@gmx.de> xypron.glpk@gmx.de <xypron.glpk@gmx.de>
|
||||
Jagan Teki <402jagan@gmail.com>
|
||||
Jagan Teki <jaganna@gmail.com>
|
||||
Jagan Teki <jaganna@xilinx.com>
|
||||
Jagan Teki <jagannadh.teki@gmail.com>
|
||||
Jagan Teki <jagannadha.sutradharudu-teki@xilinx.com>
|
||||
Jernej Skrabec <jernej.skrabec@gmail.com> <jernej.skrabec@siol.net>
|
||||
Igor Opaniuk <igor.opaniuk@gmail.com> <igor.opaniuk@linaro.org>
|
||||
Igor Opaniuk <igor.opaniuk@gmail.com> <igor.opaniuk@toradex.com>
|
||||
Marek Vasut <marex@denx.de> <marek.vasut+renesas@gmail.com>
|
||||
Marek Vasut <marex@denx.de> <marek.vasut@gmail.com>
|
||||
Marek Vasut <marex@denx.de> <marex at denx.de>
|
||||
Markus Klotzbuecher <mk@denx.de>
|
||||
Masahiro Yamada <yamada.masahiro@socionext.com> <yamada.m@jp.panasonic.com>
|
||||
Masahiro Yamada <yamada.masahiro@socionext.com> <masahiroy@kernel.org>
|
||||
Michal Simek <michal.simek@amd.com> <michal.simek@xilinx.com>
|
||||
Michal Simek <michal.simek@xilinx.com> <monstr@monstr.eu>
|
||||
Michal Simek <michal.simek@xilinx.com> <Monstr@seznam.cz>
|
||||
Michal Simek <michal.simek@xilinx.com> <root@monstr.eu>
|
||||
Nicolas Saenz Julienne <nsaenz@kernel.org> <nsaenzjulienne@suse.de>
|
||||
Patrice Chotard <patrice.chotard@foss.st.com> <patrice.chotard@st.com>
|
||||
Patrick Delaunay <patrick.delaunay@foss.st.com> <patrick.delaunay@st.com>
|
||||
Paul Burton <paul.burton@mips.com> <paul.burton@imgtec.com>
|
||||
@@ -58,19 +42,10 @@ Ricardo Ribalda <ricardo@ribalda.com> <ricardo.ribalda@gmail.com>
|
||||
Ruchika Gupta <ruchika.gupta@nxp.com> <ruchika.gupta@freescale.com>
|
||||
Sandeep Paulraj <s-paulraj@ti.com>
|
||||
Shaohui Xie <Shaohui.Xie@freescale.com>
|
||||
Stefan Roese <sr@denx.de> <stroese>
|
||||
Stefan Roese <stroese>
|
||||
Stefano Babic <sbabic@denx.de>
|
||||
Tom Rini <trini@konsulko.com> <trini@ti.com>
|
||||
TsiChung Liew <Tsi-Chung.Liew@freescale.com>
|
||||
Wolfgang Denk <wd@denx.de> <wdenk>
|
||||
Wolfgang Denk <wd@denx.de> <wd@pollux.denx.de>
|
||||
Wolfgang Denk <wd@denx.de> <wd@pollux.(none)>
|
||||
Wolfgang Denk <wd@denx.de> <wd@fifi.denx.de>
|
||||
Wolfgang Denk <wd@denx.de> <wd@nyx.denx.de>
|
||||
Wolfgang Denk <wd@denx.de> <wd@atlas.denx.de>
|
||||
Wolfgang Denk <wd@denx.de> <wd@castor.denx.de>
|
||||
Wolfgang Denk <wd@denx.de> <wd@xpert.denx.de>
|
||||
Wolfgang Denk <wd@denx.de> <wd@nyx.(none)>
|
||||
Wolfgang Denk <wdenk>
|
||||
York Sun <yorksun@freescale.com>
|
||||
York Sun <york.sun@nxp.com>
|
||||
Łukasz Majewski <l.majewski@samsung.com>
|
||||
|
||||
@@ -5,13 +5,6 @@
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: "ubuntu-20.04"
|
||||
apt_packages:
|
||||
- python3-six
|
||||
tools:
|
||||
python: "3.9"
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
configuration: doc/conf.py
|
||||
@@ -19,6 +12,8 @@ sphinx:
|
||||
# Optionally build your docs in additional formats such as PDF and ePub
|
||||
formats: []
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: doc/sphinx/requirements.txt
|
||||
# Optionally set the version of Python and requirements required to build your docs
|
||||
# python:
|
||||
# version: 3.7
|
||||
# install:
|
||||
# - requirements: docs/requirements.txt
|
||||
|
||||
2
Kbuild
2
Kbuild
@@ -10,8 +10,6 @@ generic-offsets-file := include/generated/generic-asm-offsets.h
|
||||
always := $(generic-offsets-file)
|
||||
targets := lib/asm-offsets.s
|
||||
|
||||
CFLAGS_REMOVE_asm-offsets.o := $(LTO_CFLAGS)
|
||||
|
||||
$(obj)/$(generic-offsets-file): $(obj)/lib/asm-offsets.s FORCE
|
||||
$(call filechk,offsets,__GENERIC_ASM_OFFSETS_H__)
|
||||
|
||||
|
||||
199
Kconfig
199
Kconfig
@@ -57,49 +57,18 @@ config LOCALVERSION_AUTO
|
||||
|
||||
which is done within the script "scripts/setlocalversion".)
|
||||
|
||||
config CC_IS_GCC
|
||||
def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
|
||||
|
||||
config GCC_VERSION
|
||||
int
|
||||
default $(shell,$(srctree)/scripts/gcc-version.sh -p $(CC) | sed 's/^0*//') if CC_IS_GCC
|
||||
default 0
|
||||
|
||||
config CC_IS_CLANG
|
||||
def_bool $(success,$(CC) --version | head -n 1 | grep -q clang)
|
||||
|
||||
config CLANG_VERSION
|
||||
int
|
||||
default $(shell,$(srctree)/scripts/clang-version.sh $(CC))
|
||||
|
||||
choice
|
||||
prompt "Optimization level"
|
||||
default CC_OPTIMIZE_FOR_SIZE
|
||||
|
||||
config CC_OPTIMIZE_FOR_SIZE
|
||||
bool "Optimize for size"
|
||||
default y
|
||||
help
|
||||
Enabling this option will pass "-Os" to gcc, resulting in a smaller
|
||||
U-Boot image.
|
||||
Enabling this option will pass "-Os" instead of "-O2" to gcc
|
||||
resulting in a smaller U-Boot image.
|
||||
|
||||
This option is enabled by default for U-Boot.
|
||||
|
||||
config CC_OPTIMIZE_FOR_SPEED
|
||||
bool "Optimize for speed"
|
||||
help
|
||||
Enabling this option will pass "-O2" to gcc, resulting in a faster
|
||||
U-Boot image.
|
||||
|
||||
config CC_OPTIMIZE_FOR_DEBUG
|
||||
bool "Optimize for debugging"
|
||||
help
|
||||
Enabling this option will pass "-Og" to gcc, enabling optimizations
|
||||
which don't interfere with debugging.
|
||||
|
||||
endchoice
|
||||
|
||||
config OPTIMIZE_INLINING
|
||||
bool "Allow compiler to uninline functions marked 'inline' in full U-Boot"
|
||||
default n
|
||||
help
|
||||
This option determines if U-Boot forces gcc to inline the functions
|
||||
developers have marked 'inline'. Doing so takes away freedom from gcc to
|
||||
@@ -109,38 +78,17 @@ config OPTIMIZE_INLINING
|
||||
config SPL_OPTIMIZE_INLINING
|
||||
bool "Allow compiler to uninline functions marked 'inline' in SPL"
|
||||
depends on SPL
|
||||
default n
|
||||
help
|
||||
This option determines if U-Boot forces gcc to inline the functions
|
||||
developers have marked 'inline'. Doing so takes away freedom from gcc to
|
||||
do what it thinks is best, which is desirable in some cases for size
|
||||
reasons.
|
||||
|
||||
config ARCH_SUPPORTS_LTO
|
||||
bool
|
||||
|
||||
config LTO
|
||||
bool "Enable Link Time Optimizations"
|
||||
depends on ARCH_SUPPORTS_LTO
|
||||
help
|
||||
This option enables Link Time Optimization (LTO), a mechanism which
|
||||
allows the compiler to optimize between different compilation units.
|
||||
|
||||
This can optimize away dead code paths, resulting in smaller binary
|
||||
size (if CC_OPTIMIZE_FOR_SIZE is enabled).
|
||||
|
||||
This option is not available for every architecture and may
|
||||
introduce bugs.
|
||||
|
||||
Currently, when compiling with GCC, due to a weird bug regarding
|
||||
jobserver, the final linking will not respect make's --jobs argument.
|
||||
Instead all available processors will be used (as reported by the
|
||||
nproc command).
|
||||
|
||||
If unsure, say n.
|
||||
|
||||
config TPL_OPTIMIZE_INLINING
|
||||
bool "Allow compiler to uninline functions marked 'inline' in TPL"
|
||||
depends on TPL
|
||||
default n
|
||||
help
|
||||
This option determines if U-Boot forces gcc to inline the functions
|
||||
developers have marked 'inline'. Doing so takes away freedom from gcc to
|
||||
@@ -247,18 +195,13 @@ config SYS_MALLOC_F
|
||||
config SYS_MALLOC_F_LEN
|
||||
hex "Size of malloc() pool before relocation"
|
||||
depends on SYS_MALLOC_F
|
||||
default 0x400 if M68K || PPC || ROCKCHIP_PX30 || ROCKCHIP_RK3036 || \
|
||||
ROCKCHIP_RK3308 || ROCKCHIP_RV1108
|
||||
default 0x600 if ARCH_ZYNQMP_R5 || ARCH_ZYNQMP
|
||||
default 0x800 if ARCH_ZYNQ || ROCKCHIP_RK3128 || ROCKCHIP_RK3188 || \
|
||||
ROCKCHIP_RK322X || X86
|
||||
default 0x1000 if ARCH_MESON || ARCH_BMIPS || ARCH_MTMIPS
|
||||
default 0x1800 if ARCH_TEGRA
|
||||
default 0x4000 if SANDBOX || RISCV || ARCH_APPLE || ROCKCHIP_RK3368 || \
|
||||
ROCKCHIP_RK3399
|
||||
default 0x8000 if RCAR_GEN3
|
||||
default 0x10000 if ARCH_IMX8 || (ARCH_IMX8M && !IMX8MQ)
|
||||
default 0x2000
|
||||
default 0x1000 if AM33XX
|
||||
default 0x4000 if SANDBOX
|
||||
default 0x2000 if (ARCH_IMX8 || ARCH_IMX8M || ARCH_MX7 || \
|
||||
ARCH_MX7ULP || ARCH_MX6 || ARCH_MX5 || \
|
||||
ARCH_LS1012A || ARCH_LS1021A || ARCH_LS1043A || \
|
||||
ARCH_LS1046A || ARCH_QEMU || ARCH_SUNXI || ARCH_OWL)
|
||||
default 0x400
|
||||
help
|
||||
Before relocation, memory is very limited on many platforms. Still,
|
||||
we can provide a small malloc() pool if needed. Driver model in
|
||||
@@ -267,13 +210,8 @@ config SYS_MALLOC_F_LEN
|
||||
|
||||
config SYS_MALLOC_LEN
|
||||
hex "Define memory for Dynamic allocation"
|
||||
default 0x4000000 if SANDBOX
|
||||
default 0x2000000 if ARCH_ROCKCHIP || ARCH_OMAP2PLUS || ARCH_MESON
|
||||
default 0x200000 if ARCH_BMIPS || X86
|
||||
default 0x120000 if MACH_SUNIV
|
||||
default 0x220000 if MACH_SUN8I_V3S
|
||||
default 0x4020000 if ARCH_SUNXI
|
||||
default 0x400000
|
||||
depends on ARCH_ZYNQ || ARCH_VERSAL || ARCH_STM32MP || ARCH_ROCKCHIP
|
||||
default 0x2000000 if ARCH_ROCKCHIP
|
||||
help
|
||||
This defines memory to be allocated for Dynamic allocation
|
||||
TODO: Use for other architectures
|
||||
@@ -281,7 +219,6 @@ config SYS_MALLOC_LEN
|
||||
config SPL_SYS_MALLOC_F_LEN
|
||||
hex "Size of malloc() pool in SPL"
|
||||
depends on SYS_MALLOC_F && SPL
|
||||
default 0 if !SPL_FRAMEWORK
|
||||
default 0x2800 if RCAR_GEN3
|
||||
default SYS_MALLOC_F_LEN
|
||||
help
|
||||
@@ -303,31 +240,6 @@ config TPL_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 VALGRIND
|
||||
bool "Inform valgrind about memory allocations"
|
||||
depends on !RISCV
|
||||
help
|
||||
Valgrind is an instrumentation framework for building dynamic analysis
|
||||
tools. In particular, it may be used to detect memory management bugs
|
||||
in U-Boot. It relies on knowing when heap blocks are allocated in
|
||||
order to give accurate results. This happens automatically for
|
||||
standard allocator functions provided by the host OS. However, this
|
||||
doesn't automatically happen for U-Boot's malloc implementation.
|
||||
|
||||
Enable this option to annotate U-Boot's malloc implementation so that
|
||||
it can be handled accurately by Valgrind. If you aren't planning on
|
||||
using valgrind to debug U-Boot, say 'n'.
|
||||
|
||||
config VPL_SYS_MALLOC_F_LEN
|
||||
hex "Size of malloc() pool in VPL before relocation"
|
||||
depends on SYS_MALLOC_F && VPL
|
||||
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
|
||||
@@ -356,6 +268,7 @@ if EXPERT
|
||||
|
||||
config SYS_MALLOC_DEFAULT_TO_INIT
|
||||
bool "Default malloc to init while reserving the memory for it"
|
||||
default n
|
||||
help
|
||||
It may happen that one needs to move the dynamic allocation
|
||||
from one to another memory range, eg. when moving the malloc
|
||||
@@ -391,6 +304,27 @@ config HAS_ROM
|
||||
Enables building of a u-boot.rom target. This collects U-Boot and
|
||||
any necessary binary blobs.
|
||||
|
||||
config ROM_NEEDS_BLOBS
|
||||
bool
|
||||
depends on HAS_ROM
|
||||
help
|
||||
Enable this if building the u-boot.rom target needs binary blobs, and
|
||||
so cannot be done normally. In this case, U-Boot will only build the
|
||||
ROM if the required blobs exist. If not, you will see an warning like:
|
||||
|
||||
Image 'main-section' is missing external blobs and is non-functional:
|
||||
intel-descriptor intel-me intel-refcode intel-vga intel-mrc
|
||||
|
||||
config BUILD_ROM
|
||||
bool "Build U-Boot as BIOS replacement"
|
||||
depends on HAS_ROM
|
||||
default y if !ROM_NEEDS_BLOBS
|
||||
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/arch/x86.rst for details.
|
||||
|
||||
config SPL_IMAGE
|
||||
string "SPL image used in the combined SPL+U-Boot image"
|
||||
default "spl/boot.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
|
||||
@@ -402,13 +336,6 @@ config SPL_IMAGE
|
||||
used to generate a combined image with SPL and main U-Boot
|
||||
proper as one single image.
|
||||
|
||||
config REMAKE_ELF
|
||||
bool "Recreate an ELF image from raw U-Boot binary"
|
||||
help
|
||||
Enable this to recreate an ELF image (u-boot.elf) from the raw
|
||||
U-Boot binary (u-boot.bin), which may already have been statically
|
||||
relocated and may already have a device-tree appended to it.
|
||||
|
||||
config BUILD_TARGET
|
||||
string "Build target special images"
|
||||
default "u-boot-with-spl.sfp" if TARGET_SOCFPGA_ARRIA10
|
||||
@@ -427,23 +354,6 @@ config BUILD_TARGET
|
||||
special image will be automatically built upon calling
|
||||
make / buildman.
|
||||
|
||||
config HAS_BOARD_SIZE_LIMIT
|
||||
bool "Define a maximum size for the U-Boot image"
|
||||
default y if RCAR_GEN3
|
||||
help
|
||||
In some cases, we need to enforce a hard limit on how big the U-Boot
|
||||
image itself can be.
|
||||
|
||||
config BOARD_SIZE_LIMIT
|
||||
int "Maximum size of the U-Boot image in bytes"
|
||||
default 1048576 if RCAR_GEN3
|
||||
depends on HAS_BOARD_SIZE_LIMIT
|
||||
help
|
||||
Maximum size of the U-Boot image. When defined, the build system
|
||||
checks that the actual size does not exceed it. This does not
|
||||
include SPL nor TPL, on platforms that use that functionality, they
|
||||
have a separate option to restict size.
|
||||
|
||||
config SYS_CUSTOM_LDSCRIPT
|
||||
bool "Use a custom location for the U-Boot linker script"
|
||||
help
|
||||
@@ -461,21 +371,6 @@ config SYS_LDSCRIPT
|
||||
Path within the source tree to the linker script to use for the
|
||||
main U-Boot binary.
|
||||
|
||||
config SYS_LOAD_ADDR
|
||||
hex "Address in memory to use by default"
|
||||
default 0x01000000 if ARCH_SOCFPGA
|
||||
default 0x02000000 if PPC || X86
|
||||
default 0x81000000 if MACH_SUNIV
|
||||
default 0x22000000 if MACH_SUN9I
|
||||
default 0x42000000 if ARCH_SUNXI
|
||||
default 0x82000000 if ARCH_KEYSTONE || ARCH_OMAP2PLUS || ARCH_K3
|
||||
default 0x82000000 if ARCH_MX6 && (MX6SL || MX6SLL || MX6SX || MX6UL || MX6ULL)
|
||||
default 0x12000000 if ARCH_MX6 && !(MX6SL || MX6SLL || MX6SX || MX6UL || MX6ULL)
|
||||
default 0x80800000 if ARCH_MX7
|
||||
default 0x90000000 if FSL_LSCH2 || FSL_LSCH3
|
||||
help
|
||||
Address in memory to use as the default safe load address.
|
||||
|
||||
config ERR_PTR_OFFSET
|
||||
hex
|
||||
default 0x0
|
||||
@@ -505,22 +400,12 @@ config STACK_SIZE
|
||||
by the UEFI sub-system. On some boards initrd_high is calculated as
|
||||
base stack pointer minus this stack size.
|
||||
|
||||
config SYS_MEM_TOP_HIDE
|
||||
hex "Exclude some memory from U-Boot / OS information"
|
||||
default 0x0
|
||||
help
|
||||
If set, this specified memory area will get subtracted from the top
|
||||
(end) of RAM and won't get "touched" at all by U-Boot. By fixing up
|
||||
gd->ram_size the OS / next stage should gets passed the now
|
||||
"corrected" memory size and won't touch it either.
|
||||
WARNING: Please make sure that this value is a multiple of the OS
|
||||
page size.
|
||||
|
||||
config SYS_HAS_SRAM
|
||||
bool
|
||||
default y if TARGET_PIC32MZDASK
|
||||
default y if TARGET_DEVKIT8000
|
||||
default y if TARGET_TRICORDER
|
||||
default n
|
||||
help
|
||||
Enable this to allow support for the on board SRAM.
|
||||
SRAM base address is controlled by CONFIG_SYS_SRAM_BASE.
|
||||
@@ -540,12 +425,6 @@ config SYS_SRAM_SIZE
|
||||
default 0x10000 if TARGET_TRICORDER
|
||||
default 0x0
|
||||
|
||||
config MP
|
||||
bool "Support for multiprocessor"
|
||||
help
|
||||
This provides an option to bringup different processors
|
||||
in multiprocessor cases.
|
||||
|
||||
config EXAMPLES
|
||||
bool "Compile API examples"
|
||||
depends on !SANDBOX
|
||||
@@ -558,8 +437,6 @@ endmenu # General setup
|
||||
|
||||
source "api/Kconfig"
|
||||
|
||||
source "boot/Kconfig"
|
||||
|
||||
source "common/Kconfig"
|
||||
|
||||
source "cmd/Kconfig"
|
||||
|
||||
@@ -139,7 +139,6 @@ License identifier syntax
|
||||
|
||||
Full name SPDX Identifier OSI Approved File name URI
|
||||
=======================================================================================================================================
|
||||
bzip2 and libbzip2 License v1.0.6 bzip2-1.0.6 bzip2-1.0.6.txt https://spdx.org/licenses/bzip2-1.0.6.html
|
||||
GNU General Public License v2.0 only GPL-2.0 Y gpl-2.0.txt http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
GNU General Public License v2.0 or later GPL-2.0+ Y gpl-2.0.txt http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
GNU Library General Public License v2 or later LGPL-2.0+ Y lgpl-2.0.txt http://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. The origin of this software must not be misrepresented; you must
|
||||
not claim that you wrote the original software. If you use this
|
||||
software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
3. Altered source versions must be plainly marked as such, and must
|
||||
not be misrepresented as being the original software.
|
||||
|
||||
4. The name of the author may not be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR 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.
|
||||
@@ -133,7 +133,7 @@ such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
|
||||
446
MAINTAINERS
446
MAINTAINERS
@@ -50,12 +50,6 @@ so much easier [Ed]
|
||||
Maintainers List (try to look for most precise areas first)
|
||||
|
||||
-----------------------------------
|
||||
ACPI:
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
F: cmd/acpi.c
|
||||
F: lib/acpi/
|
||||
|
||||
ANDROID AB
|
||||
M: Igor Opaniuk <igor.opaniuk@gmail.com>
|
||||
R: Sam Protsenko <joe.skb7@gmail.com>
|
||||
@@ -81,7 +75,7 @@ M: Alexey Brodkin <alexey.brodkin@synopsys.com>
|
||||
M: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
|
||||
S: Maintained
|
||||
L: uboot-snps-arc@synopsys.com
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-arc.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-arc.git
|
||||
F: arch/arc/
|
||||
F: board/synopsys/
|
||||
|
||||
@@ -114,31 +108,19 @@ L: uboot-snps-arc@synopsys.com
|
||||
F: doc/device-tree-bindings/mmc/snps,dw-mmc.txt
|
||||
F: drivers/mmc/snps_dw_mmc.c
|
||||
|
||||
APPLE M1 SOC SUPPORT
|
||||
M: Mark Kettenis <kettenis@openbsd.org>
|
||||
S: Maintained
|
||||
F: arch/arm/include/asm/arch-m1/
|
||||
F: arch/arm/mach-apple/
|
||||
F: configs/apple_m1_defconfig
|
||||
F: drivers/iommu/apple_dart.c
|
||||
F: drivers/nvme/nvme_apple.c
|
||||
F: drivers/pinctrl/pinctrl-apple.c
|
||||
F: drivers/watchdog/apple_wdt.c
|
||||
F: include/configs/apple.h
|
||||
|
||||
ARM
|
||||
M: Tom Rini <trini@konsulko.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-arm.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-arm.git
|
||||
F: arch/arm/
|
||||
F: cmd/arm/
|
||||
|
||||
ARM ALTERA SOCFPGA
|
||||
M: Marek Vasut <marex@denx.de>
|
||||
M: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
|
||||
M: Tien Fong Chee <tien.fong.chee@intel.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-socfpga.git
|
||||
M: Ley Foon Tan <ley.foon.tan@intel.com>
|
||||
S: Maintainted
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-socfpga.git
|
||||
F: arch/arm/mach-socfpga/
|
||||
F: drivers/sysreset/sysreset_socfpga*
|
||||
|
||||
@@ -146,7 +128,7 @@ ARM AMLOGIC SOC SUPPORT
|
||||
M: Neil Armstrong <narmstrong@baylibre.com>
|
||||
S: Maintained
|
||||
L: u-boot-amlogic@groups.io
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-amlogic.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-amlogic.git
|
||||
F: arch/arm/mach-meson/
|
||||
F: arch/arm/include/asm/arch-meson/
|
||||
F: drivers/clk/meson/
|
||||
@@ -170,26 +152,15 @@ ARM ASPEED
|
||||
M: Ryan Chen <ryan_chen@aspeedtech.com>
|
||||
M: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
|
||||
R: Aspeed BMC SW team <BMC-SW@aspeedtech.com>
|
||||
R: Joel Stanley <joel@jms.id.au>
|
||||
S: Maintained
|
||||
F: arch/arm/mach-aspeed/
|
||||
F: arch/arm/include/asm/arch-aspeed/
|
||||
F: board/aspeed/
|
||||
F: drivers/clk/aspeed/
|
||||
F: drivers/crypto/aspeed/
|
||||
F: drivers/gpio/gpio-aspeed.c
|
||||
F: drivers/i2c/ast_i2c.[ch]
|
||||
F: drivers/mmc/aspeed_sdhci.c
|
||||
F: drivers/net/aspeed_mdio.c
|
||||
F: drivers/net/ftgmac100.[ch]
|
||||
F: drivers/pinctrl/aspeed/
|
||||
F: drivers/pwm/pwm-aspeed.c
|
||||
F: drivers/ram/aspeed/
|
||||
F: drivers/reset/reset-ast2500.c
|
||||
F: drivers/watchdog/ast_wdt.c
|
||||
N: aspeed
|
||||
|
||||
ARM BROADCOM BCM283X / BCM27XX
|
||||
ARM BROADCOM BCM283X
|
||||
M: Matthias Brugger <mbrugger@suse.com>
|
||||
S: Maintained
|
||||
F: arch/arm/dts/bcm283*
|
||||
@@ -204,8 +175,6 @@ F: drivers/video/bcm2835.c
|
||||
F: include/dm/platform_data/serial_bcm283x_mu.h
|
||||
F: include/dt-bindings/pinctrl/bcm2835.h
|
||||
F: drivers/pinctrl/broadcom/
|
||||
F: configs/rpi_*
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-arm.git
|
||||
|
||||
ARM BROADCOM BCMSTB
|
||||
M: Thomas Fitzsimmons <fitzsim@fitzsim.org>
|
||||
@@ -249,7 +218,7 @@ M: Stefano Babic <sbabic@denx.de>
|
||||
M: Fabio Estevam <festevam@gmail.com>
|
||||
R: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-imx.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-imx.git
|
||||
F: arch/arm/cpu/arm1136/mx*/
|
||||
F: arch/arm/cpu/arm926ejs/mx*/
|
||||
F: arch/arm/cpu/armv7/vf610/
|
||||
@@ -286,44 +255,21 @@ F: drivers/rng/msm_rng.c
|
||||
ARM MARVELL KIRKWOOD ARMADA-XP ARMADA-38X ARMADA-37XX ARMADA-7K/8K
|
||||
M: Stefan Roese <sr@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-marvell.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-marvell.git
|
||||
F: arch/arm/mach-kirkwood/
|
||||
F: arch/arm/mach-mvebu/
|
||||
F: drivers/ata/ahci_mvebu.c
|
||||
F: drivers/clk/mvebu/
|
||||
F: drivers/ddr/marvell/
|
||||
F: drivers/gpio/mvebu_gpio.c
|
||||
F: drivers/i2c/mvtwsi.c
|
||||
F: drivers/mmc/xenon_sdhci.c
|
||||
F: drivers/phy/marvell/
|
||||
F: drivers/pinctrl/mvebu/
|
||||
F: drivers/rtc/armada38x.c
|
||||
F: drivers/spi/kirkwood_spi.c
|
||||
F: drivers/spi/mvebu_a3700_spi.c
|
||||
F: drivers/pci/pcie_dw_mvebu.c
|
||||
F: drivers/watchdog/armada-37xx-wdt.c
|
||||
F: drivers/watchdog/orion_wdt.c
|
||||
F: include/configs/mv-common.h
|
||||
|
||||
ARM MARVELL PCIE CONTROLLER DRIVERS
|
||||
M: Pali Rohár <pali@kernel.org>
|
||||
M: Stefan Roese <sr@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-marvell.git
|
||||
F: drivers/pci/pci-aardvark.c
|
||||
F: drivers/pci/pci_mvebu.c
|
||||
|
||||
ARM MARVELL SERIAL DRIVERS
|
||||
M: Pali Rohár <pali@kernel.org>
|
||||
M: Stefan Roese <sr@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-marvell.git
|
||||
F: drivers/serial/serial_mvebu_a3700.c
|
||||
F: drivers/pci/pcie_dw_mvebu.c
|
||||
F: drivers/watchdog/orion_wdt.c
|
||||
|
||||
ARM MARVELL PXA
|
||||
M: Marek Vasut <marex@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-pxa.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-pxa.git
|
||||
F: arch/arm/cpu/pxa/
|
||||
F: arch/arm/include/asm/arch-pxa/
|
||||
|
||||
@@ -359,13 +305,11 @@ N: mediatek
|
||||
ARM MICROCHIP/ATMEL AT91
|
||||
M: Eugen Hristev <eugen.hristev@microchip.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-atmel.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-atmel.git
|
||||
F: arch/arm/mach-at91/
|
||||
F: board/atmel/
|
||||
F: drivers/cpu/at91_cpu.c
|
||||
F: drivers/misc/microchip_flexcom.c
|
||||
F: drivers/timer/atmel_tcb_timer.c
|
||||
F: include/dt-bindings/mfd/atmel-flexcom.h
|
||||
F: drivers/timer/mchp-pit64b-timer.c
|
||||
|
||||
ARM NEXELL S5P4418
|
||||
@@ -401,18 +345,15 @@ ARM RENESAS RMOBILE/R-CAR
|
||||
M: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
|
||||
M: Marek Vasut <marek.vasut+renesas@gmail.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-sh.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-sh.git
|
||||
F: arch/arm/mach-rmobile/
|
||||
|
||||
ARM ROCKCHIP
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
M: Philipp Tomsich <philipp.tomsich@vrull.eu>
|
||||
M: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
|
||||
M: Kever Yang <kever.yang@rock-chips.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-rockchip.git
|
||||
F: arch/arm/dts/rk3*
|
||||
F: arch/arm/dts/rockchip*
|
||||
F: arch/arm/dts/rv1108*
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip.git
|
||||
F: arch/arm/include/asm/arch-rockchip/
|
||||
F: arch/arm/mach-rockchip/
|
||||
F: board/rockchip/
|
||||
@@ -430,12 +371,11 @@ F: tools/rkcommon.h
|
||||
F: tools/rkimage.c
|
||||
F: tools/rksd.c
|
||||
F: tools/rkspi.c
|
||||
N: rockchip
|
||||
|
||||
ARM SAMSUNG
|
||||
M: Minkyu Kang <mk7.kang@samsung.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-samsung.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-samsung.git
|
||||
F: arch/arm/mach-exynos/
|
||||
F: arch/arm/mach-s5pc1xx/
|
||||
F: arch/arm/cpu/armv7/s5p-common/
|
||||
@@ -448,15 +388,13 @@ F: drivers/gpio/msm_gpio.c
|
||||
F: drivers/mmc/msm_sdhci.c
|
||||
F: drivers/phy/msm8916-usbh-phy.c
|
||||
F: drivers/serial/serial_msm.c
|
||||
F: drivers/serial/serial_msm_geni.c
|
||||
F: drivers/smem/msm_smem.c
|
||||
F: drivers/spmi/spmi-msm.c
|
||||
F: drivers/usb/host/ehci-msm.c
|
||||
|
||||
ARM STI
|
||||
M: Patrice Chotard <patrice.chotard@foss.st.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-stm.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git
|
||||
F: arch/arm/mach-sti/
|
||||
F: arch/arm/include/asm/arch-sti*/
|
||||
F: drivers/phy/sti_usb_phy.c
|
||||
@@ -472,11 +410,18 @@ F: include/dt-bindings/clock/stih407-clks.h
|
||||
F: include/dt-bindings/clock/stih410-clks.h
|
||||
F: include/dt-bindings/reset/stih407-resets.h
|
||||
|
||||
ARM STM SPEAR
|
||||
#M: Vipin Kumar <vipin.kumar@st.com>
|
||||
S: Orphaned (Since 2016-02)
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/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@foss.st.com>
|
||||
M: Patrice Chotard <patrice.chotard@foss.st.com>
|
||||
L: uboot-stm32@st-md-mailman.stormreply.com (moderated for non-subscribers)
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-stm.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-stm.git
|
||||
S: Maintained
|
||||
F: arch/arm/mach-stm32mp/
|
||||
F: doc/board/st/
|
||||
@@ -498,7 +443,6 @@ F: drivers/power/regulator/stpmic1.c
|
||||
F: drivers/ram/stm32mp1/
|
||||
F: drivers/remoteproc/stm32_copro.c
|
||||
F: drivers/reset/stm32-reset.c
|
||||
F: drivers/rng/optee_rng.c
|
||||
F: drivers/rng/stm32mp1_rng.c
|
||||
F: drivers/rtc/stm32_rtc.c
|
||||
F: drivers/serial/serial_stm32.*
|
||||
@@ -527,30 +471,23 @@ ARM SUNXI
|
||||
M: Jagan Teki <jagan@amarulasolutions.com>
|
||||
M: Andre Przywara <andre.przywara@arm.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-sunxi.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/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/
|
||||
F: drivers/clk/sunxi/
|
||||
F: drivers/phy/allwinner/
|
||||
F: drivers/pinctrl/sunxi/
|
||||
F: drivers/video/sunxi/
|
||||
F: tools/sunxi*
|
||||
|
||||
ARM TEGRA
|
||||
M: Tom Warren <twarren@nvidia.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-tegra.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-tegra.git
|
||||
F: arch/arm/mach-tegra/
|
||||
F: arch/arm/include/asm/arch-tegra*/
|
||||
|
||||
ARM TI
|
||||
M: Tom Rini <trini@konsulko.com>
|
||||
M: Lokesh Vutla <lokeshvutla@ti.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-ti.git
|
||||
F: arch/arm/dts/am57xx*
|
||||
F: arch/arm/dts/dra7*
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-ti.git
|
||||
F: arch/arm/mach-davinci/
|
||||
F: arch/arm/mach-k3/
|
||||
F: arch/arm/mach-keystone/
|
||||
@@ -570,11 +507,8 @@ F: drivers/phy/omap-usb2-phy.c
|
||||
F: drivers/phy/phy-ti-am654.c
|
||||
F: drivers/phy/ti-pipe3-phy.c
|
||||
F: drivers/ram/k3*
|
||||
F: drivers/remoteproc/ipu_rproc.c
|
||||
F: drivers/remoteproc/k3_system_controller.c
|
||||
F: drivers/remoteproc/pruc_rpoc.c
|
||||
F: drivers/remoteproc/ti*
|
||||
F: drivers/reset/reset-dra7.c
|
||||
F: drivers/reset/reset-ti-sci.c
|
||||
F: drivers/rtc/davinci.c
|
||||
F: drivers/serial/serial_omap.c
|
||||
@@ -583,7 +517,6 @@ F: drivers/sysreset/sysreset-ti-sci.c
|
||||
F: drivers/thermal/ti-bandgap.c
|
||||
F: drivers/timer/omap-timer.c
|
||||
F: drivers/watchdog/omap_wdt.c
|
||||
F: include/linux/pruss_driver.h
|
||||
F: include/linux/soc/ti/
|
||||
|
||||
ARM U8500
|
||||
@@ -592,12 +525,7 @@ R: Linus Walleij <linus.walleij@linaro.org>
|
||||
S: Maintained
|
||||
F: arch/arm/dts/ste-*
|
||||
F: arch/arm/mach-u8500/
|
||||
F: drivers/gpio/nmk_gpio.c
|
||||
F: drivers/phy/phy-ab8500-usb.c
|
||||
F: drivers/power/pmic/ab8500.c
|
||||
F: drivers/timer/nomadik-mtu-timer.c
|
||||
F: drivers/usb/musb-new/ux500.c
|
||||
F: drivers/video/mcde_simple.c
|
||||
|
||||
ARM UNIPHIER
|
||||
S: Orphan (Since 2020-09)
|
||||
@@ -606,12 +534,10 @@ F: configs/uniphier_*_defconfig
|
||||
N: uniphier
|
||||
|
||||
ARM VERSAL
|
||||
M: Michal Simek <michal.simek@amd.com>
|
||||
M: Michal Simek <michal.simek@xilinx.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
F: arch/arm/mach-versal/
|
||||
F: drivers/net/xilinx_axi_mrmac.*
|
||||
F: drivers/soc/soc_xilinx_versal.c
|
||||
F: drivers/watchdog/xilinx_wwdt.c
|
||||
N: (?<!uni)versal
|
||||
|
||||
@@ -625,7 +551,7 @@ N: vexpress
|
||||
ARM ZYNQ
|
||||
M: Michal Simek <monstr@monstr.eu>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
F: arch/arm/mach-zynq/
|
||||
F: doc/board/xilinx/
|
||||
F: doc/device-tree-bindings/video/syncoam,seps525.txt
|
||||
@@ -637,10 +563,8 @@ F: drivers/i2c/muxes/pca954x.c
|
||||
F: drivers/i2c/zynq_i2c.c
|
||||
F: drivers/mmc/zynq_sdhci.c
|
||||
F: drivers/mtd/nand/raw/zynq_nand.c
|
||||
F: drivers/net/phy/ethernet_id.c
|
||||
F: drivers/net/phy/xilinx_phy.c
|
||||
F: drivers/net/zynq_gem.c
|
||||
F: drivers/pinctrl/pinctrl-zynqmp.c
|
||||
F: drivers/serial/serial_zynq.c
|
||||
F: drivers/spi/zynq_qspi.c
|
||||
F: drivers/spi/zynq_spi.c
|
||||
@@ -651,16 +575,14 @@ F: tools/zynqimage.c
|
||||
N: zynq
|
||||
|
||||
ARM ZYNQMP
|
||||
M: Michal Simek <michal.simek@amd.com>
|
||||
M: Michal Simek <michal.simek@xilinx.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
F: arch/arm/mach-zynqmp/
|
||||
F: drivers/clk/clk_zynqmp.c
|
||||
F: driver/firmware/firmware-zynqmp.c
|
||||
F: drivers/fpga/zynqpl.c
|
||||
F: drivers/gpio/gpio_slg7xl45106.c
|
||||
F: drivers/gpio/zynq_gpio.c
|
||||
F: drivers/gpio/zynqmp_gpio_modepin.c
|
||||
F: drivers/i2c/i2c-cdns.c
|
||||
F: drivers/i2c/muxes/pca954x.c
|
||||
F: drivers/i2c/zynq_i2c.c
|
||||
@@ -669,16 +591,11 @@ F: drivers/mmc/zynq_sdhci.c
|
||||
F: drivers/mtd/nand/raw/zynq_nand.c
|
||||
F: drivers/net/phy/xilinx_phy.c
|
||||
F: drivers/net/zynq_gem.c
|
||||
F: drivers/phy/phy-zynqmp.c
|
||||
F: drivers/power/domain/zynqmp-power-domain.c
|
||||
F: drivers/pwm/pwm-cadence-ttc.c
|
||||
F: drivers/serial/serial_zynq.c
|
||||
F: drivers/reset/reset-zynqmp.c
|
||||
F: drivers/rtc/zynqmp_rtc.c
|
||||
F: drivers/soc/soc_xilinx_zynqmp.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/video/seps525.c
|
||||
F: drivers/watchdog/cdns_wdt.c
|
||||
F: include/zynqmppl.h
|
||||
@@ -688,9 +605,9 @@ N: ultra96
|
||||
N: zynqmp
|
||||
|
||||
ARM ZYNQMP R5
|
||||
M: Michal Simek <michal.simek@amd.com>
|
||||
M: Michal Simek <michal.simek@xilinx.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
F: arch/arm/mach-zynqmp-r5/
|
||||
|
||||
ARM PHYTIUM
|
||||
@@ -702,31 +619,9 @@ F: arch/arm/dts/phytium-durian.dts
|
||||
|
||||
BINMAN
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
M: Alper Nebi Yasak <alpernebiyasak@gmail.com>
|
||||
S: Maintained
|
||||
F: tools/binman/
|
||||
|
||||
BOOTDEVICE
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
F: boot/bootdev*.c
|
||||
F: boot/bootflow.c
|
||||
F: boot/bootmeth*.c
|
||||
F: boot/bootstd.c
|
||||
F: cmd/bootdev.c
|
||||
F: cmd/bootflow.c
|
||||
F: doc/develop/bootstd.rst
|
||||
F: doc/usage/bootdev.rst
|
||||
F: doc/usage/bootflow.rst
|
||||
F: doc/usage/bootmeth.rst
|
||||
F: drivers/mmc/mmc_bootdev.c
|
||||
F: include/bootdev.h
|
||||
F: include/bootflow.h
|
||||
F: include/bootmeth.h
|
||||
F: include/bootstd.h
|
||||
F: net/eth_bootdevice.c
|
||||
F: test/boot/
|
||||
|
||||
BTRFS
|
||||
M: Marek Behun <marek.behun@nic.cz>
|
||||
R: Qu Wenruo <wqu@suse.com>
|
||||
@@ -744,15 +639,14 @@ F: tools/buildman/
|
||||
CFI FLASH
|
||||
M: Stefan Roese <sr@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-cfi-flash.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-cfi-flash.git
|
||||
F: drivers/mtd/cfi_flash.c
|
||||
F: drivers/mtd/jedec_flash.c
|
||||
|
||||
CLOCK
|
||||
M: Lukasz Majewski <lukma@denx.de>
|
||||
M: Sean Anderson <seanga2@gmail.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-clk.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-clk.git
|
||||
F: drivers/clk/
|
||||
F: drivers/clk/imx/
|
||||
|
||||
@@ -760,21 +654,20 @@ COLDFIRE
|
||||
M: Huan Wang <alison.wang@nxp.com>
|
||||
M: Angelo Dureghello <angelo@sysam.it>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-coldfire.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-coldfire.git
|
||||
F: arch/m68k/
|
||||
F: doc/arch/m68k.rst
|
||||
|
||||
DFU
|
||||
M: Lukasz Majewski <lukma@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-dfu.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-dfu.git
|
||||
F: cmd/dfu.c
|
||||
F: cmd/usb_*.c
|
||||
F: common/dfu.c
|
||||
F: common/update.c
|
||||
F: common/usb_storage.c
|
||||
F: doc/api/dfu.rst
|
||||
F: doc/usage/dfu.rst
|
||||
F: drivers/dfu/
|
||||
F: drivers/usb/gadget/
|
||||
F: include/dfu.h
|
||||
@@ -782,33 +675,19 @@ F: include/dfu.h
|
||||
DRIVER MODEL
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-dm.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-dm.git
|
||||
F: doc/driver-model/
|
||||
F: drivers/core/
|
||||
F: include/dm/
|
||||
F: test/dm/
|
||||
|
||||
EFI APP
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
M: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
||||
S: Maintained
|
||||
W: https://u-boot.readthedocs.io/en/latest/develop/uefi/u-boot_on_efi.html
|
||||
F: board/efi/efi-x86_app
|
||||
F: configs/efi-x86_app*
|
||||
F: doc/develop/uefi/u-boot_on_efi.rst
|
||||
F: drivers/block/efi-media-uclass.c
|
||||
F: drivers/block/sb_efi_media.c
|
||||
F: lib/efi/efi_app.c
|
||||
F: scripts/build-efi.sh
|
||||
F: test/dm/efi_media.c
|
||||
|
||||
EFI PAYLOAD
|
||||
M: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
||||
R: Alexander Graf <agraf@csgraf.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-efi.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-efi.git
|
||||
F: doc/api/efi.rst
|
||||
F: doc/develop/uefi/*
|
||||
F: doc/mkeficapsule.1
|
||||
F: doc/uefi/*
|
||||
F: doc/usage/bootefi.rst
|
||||
F: drivers/rtc/emul_rtc.c
|
||||
F: include/capitalization.h
|
||||
@@ -829,7 +708,6 @@ F: cmd/efidebug.c
|
||||
F: cmd/nvedit_efi.c
|
||||
F: tools/efivar.py
|
||||
F: tools/file2include.c
|
||||
F: tools/mkeficapsule.c
|
||||
|
||||
EFI VARIABLES VIA OP-TEE
|
||||
M: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
||||
@@ -847,48 +725,10 @@ F: test/env/
|
||||
F: tools/env*
|
||||
F: tools/mkenvimage.c
|
||||
|
||||
ENVIRONMENT AS TEXT
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
R: Wolfgang Denk <wd@denx.de>
|
||||
S: Maintained
|
||||
F: doc/usage/environment.rst
|
||||
F: scripts/env2string.awk
|
||||
|
||||
EROFS
|
||||
M: Huang Jianan <jnhuang95@gmail.com>
|
||||
L: linux-erofs@lists.ozlabs.org
|
||||
S: Maintained
|
||||
F: cmd/erofs.c
|
||||
F: fs/erofs/
|
||||
F: include/erofs.h
|
||||
F: test/py/tests/test_fs/test_erofs.py
|
||||
|
||||
EVENTS
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
F: cmd/event.c
|
||||
F: common/event.c
|
||||
F: include/event.h
|
||||
F: scripts/event_dump.py
|
||||
F: test/common/event.c
|
||||
F: test/py/tests/test_event_dump.py
|
||||
|
||||
FASTBOOT
|
||||
S: Orphaned
|
||||
F: cmd/fastboot.c
|
||||
F: doc/android/fastboot*.rst
|
||||
F: include/fastboot.h
|
||||
F: include/fastboot-internal.h
|
||||
F: include/net/fastboot.h
|
||||
F: drivers/fastboot/
|
||||
F: drivers/usb/gadget/f_fastboot.c
|
||||
F: net/fastboot.c
|
||||
F: test/dm/fastboot.c
|
||||
|
||||
FPGA
|
||||
M: Michal Simek <michal.simek@amd.com>
|
||||
M: Michal Simek <michal.simek@xilinx.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
F: drivers/fpga/
|
||||
F: cmd/fpga.c
|
||||
F: include/fpga.h
|
||||
@@ -896,59 +736,36 @@ F: include/fpga.h
|
||||
FLATTENED DEVICE TREE
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-fdt.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-fdt.git
|
||||
F: lib/fdtdec*
|
||||
F: lib/libfdt/
|
||||
F: include/fdt*
|
||||
F: include/linux/libfdt*
|
||||
F: cmd/fdt.c
|
||||
F: common/fdt_support.c
|
||||
F: scripts/dtc-version.sh
|
||||
|
||||
FREEBSD
|
||||
M: Rafal Jaworowski <raj@semihalf.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-freebsd.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-freebsd.git
|
||||
|
||||
FREESCALE QORIQ
|
||||
M: Priyanka Jain <priyanka.jain@nxp.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq.git
|
||||
F: drivers/watchdog/sp805_wdt.c
|
||||
F: drivers/watchdog/sbsa_gwdt.c
|
||||
|
||||
GATEWORKS_SC
|
||||
M: Tim Harvey <tharvey@gateworks.com>
|
||||
S: Maintained
|
||||
F: drivers/misc/gsc.c
|
||||
F: include/gsc.h
|
||||
|
||||
I2C
|
||||
M: Heiko Schocher <hs@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-i2c.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-i2c.git
|
||||
F: drivers/i2c/
|
||||
|
||||
KWBIMAGE / KWBOOT TOOLS
|
||||
M: Pali Rohár <pali@kernel.org>
|
||||
M: Marek Behún <marek.behun@nic.cz>
|
||||
M: Stefan Roese <sr@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-marvell.git
|
||||
F: doc/README.kwbimage
|
||||
F: doc/kwboot.1
|
||||
F: tools/kwb*
|
||||
|
||||
LED
|
||||
M: Ivan Vozvakhov <i.vozvakhov@vk.team>
|
||||
S: Supported
|
||||
F: doc/device-tree-bindings/leds/leds-pwm.txt
|
||||
F: drivers/led/led_pwm.c
|
||||
|
||||
LOGGING
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/u-boot.git
|
||||
T: git https://gitlab.denx.de/u-boot/u-boot.git
|
||||
F: common/log*
|
||||
F: cmd/log.c
|
||||
F: doc/develop/logging.rst
|
||||
@@ -967,7 +784,7 @@ F: drivers/i2c/i2c-versatile.c
|
||||
MICROBLAZE
|
||||
M: Michal Simek <monstr@monstr.eu>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze.git
|
||||
F: arch/microblaze/
|
||||
F: cmd/mfsl.c
|
||||
F: drivers/gpio/xilinx_gpio.c
|
||||
@@ -982,7 +799,7 @@ N: xilinx
|
||||
MIPS
|
||||
M: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-mips.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-mips.git
|
||||
F: arch/mips/
|
||||
|
||||
MIPS CORTINA ACCESS CAxxxx
|
||||
@@ -1058,23 +875,27 @@ F: arch/mips/dts/mrvl,cn73xx.dtsi
|
||||
|
||||
MMC
|
||||
M: Peng Fan <peng.fan@nxp.com>
|
||||
M: Jaehoon Chung <jh80.chung@samsung.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-mmc.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-mmc.git
|
||||
F: drivers/mmc/
|
||||
|
||||
NAND FLASH
|
||||
M: Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
||||
M: Michael Trimarchi <michael@amarulasolutions.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-nand-flash.git
|
||||
#M: Scott Wood <oss@buserror.net>
|
||||
S: Orphaned (Since 2018-07)
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-nand-flash.git
|
||||
F: drivers/mtd/nand/raw/
|
||||
|
||||
NDS32
|
||||
M: Rick Chen <rick@andestech.com>
|
||||
S: Maintained
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-nds32.git
|
||||
F: arch/nds32/
|
||||
|
||||
NETWORK
|
||||
M: Joe Hershberger <joe.hershberger@ni.com>
|
||||
M: Ramon Fried <rfried.dev@gmail.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-net.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-net.git
|
||||
F: drivers/net/
|
||||
F: include/net.h
|
||||
F: net/
|
||||
@@ -1082,40 +903,15 @@ F: net/
|
||||
NIOS
|
||||
M: Thomas Chou <thomas@wytron.com.tw>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-nios.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-nios.git
|
||||
F: arch/nios2/
|
||||
|
||||
NVMe
|
||||
M: Bin Meng <bmeng.cn@gmail.com>
|
||||
S: Maintained
|
||||
F: drivers/nvme/
|
||||
F: cmd/nvme.c
|
||||
F: include/nvme.h
|
||||
F: doc/develop/driver-model/nvme.rst
|
||||
|
||||
NXP C45 TJA11XX PHY DRIVER
|
||||
M: Radu Pirea <radu-nicolae.pirea@oss.nxp.com>
|
||||
S: Maintained
|
||||
F: drivers/net/phy/nxp-c45-tja11xx.c
|
||||
|
||||
ONENAND
|
||||
#M: Lukasz Majewski <l.majewski@majess.pl>
|
||||
S: Orphaned (Since 2017-01)
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-onenand.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-onenand.git
|
||||
F: drivers/mtd/onenand/
|
||||
|
||||
OUT4-IMX6ULL-NANO BOARD
|
||||
M: Oleh Kravchenko <oleg@kaa.org.ua>
|
||||
S: Maintained
|
||||
T: git https://github.com/Oleh-Kravchenko/u-boot-out4.git
|
||||
F: arch/arm/dts/ev-imx280-nano-x-mb.dts
|
||||
F: arch/arm/dts/o4-imx-nano.dts
|
||||
F: arch/arm/dts/o4-imx6ull-nano.dtsi
|
||||
F: board/out4
|
||||
F: configs/ev-imx280-nano-x-mb_defconfig
|
||||
F: configs/o4-imx6ull-nano_defconfig
|
||||
F: include/configs/o4-imx6ull-nano.h
|
||||
|
||||
PATMAN
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
S: Maintained
|
||||
@@ -1135,7 +931,7 @@ F: drivers/pci/pci_mpc85xx.c
|
||||
POWER
|
||||
M: Jaehoon Chung <jh80.chung@samsung.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-pmic.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-pmic.git
|
||||
F: drivers/power/
|
||||
|
||||
POWERPC
|
||||
@@ -1144,15 +940,15 @@ S: Maintained
|
||||
F: arch/powerpc/
|
||||
|
||||
POWERPC MPC8XX
|
||||
M: Christophe Leroy <christophe.leroy@csgroup.eu>
|
||||
M: Christophe Leroy <christophe.leroy@c-s.fr>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-mpc8xx.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-mpc8xx.git
|
||||
F: arch/powerpc/cpu/mpc8xx/
|
||||
|
||||
POWERPC MPC83XX
|
||||
M: Mario Six <mario.six@gdsys.cc>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-mpc83xx.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-mpc83xx.git
|
||||
F: drivers/ram/mpc83xx_sdram.c
|
||||
F: include/dt-bindings/memory/mpc83xx-sdram.h
|
||||
F: drivers/sysreset/sysreset_mpc83xx.c
|
||||
@@ -1170,30 +966,34 @@ F: arch/powerpc/include/asm/arch-mpc83xx/
|
||||
POWERPC MPC85XX
|
||||
M: Priyanka Jain <priyanka.jain@nxp.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-mpc85xx.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx.git
|
||||
F: arch/powerpc/cpu/mpc85xx/
|
||||
|
||||
POWERPC MPC86XX
|
||||
M: Priyanka Jain <priyanka.jain@nxp.com>
|
||||
S: Maintained
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-mpc86xx.git
|
||||
F: arch/powerpc/cpu/mpc86xx/
|
||||
|
||||
RISC-V
|
||||
M: Rick Chen <rick@andestech.com>
|
||||
M: Leo <ycliang@andestech.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-riscv.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-riscv.git
|
||||
F: arch/riscv/
|
||||
F: cmd/riscv/
|
||||
F: doc/usage/sbi.rst
|
||||
F: drivers/sysreset/sysreset_sbi.c
|
||||
F: drivers/timer/andes_plmt_timer.c
|
||||
F: drivers/timer/sifive_clint_timer.c
|
||||
F: tools/prelink-riscv.c
|
||||
|
||||
RISC-V CANAAN KENDRYTE K210
|
||||
RISC-V KENDRYTE
|
||||
M: Sean Anderson <seanga2@gmail.com>
|
||||
S: Maintained
|
||||
F: doc/device-tree-bindings/mfd/canaan,k210-sysctl.txt
|
||||
F: doc/device-tree-bindings/pinctrl/canaan,k210-fpioa.txt
|
||||
F: drivers/clk/clk_k210.c
|
||||
F: drivers/pinctrl/pinctrl-k210.c
|
||||
F: include/k210/
|
||||
F: doc/device-tree-bindings/mfd/kendryte,k210-sysctl.txt
|
||||
F: doc/device-tree-bindings/pinctrl/kendryte,k210-fpioa.txt
|
||||
F: drivers/clk/kendryte/
|
||||
F: drivers/pinctrl/kendryte/
|
||||
F: include/kendryte/
|
||||
|
||||
RNG
|
||||
M: Sughosh Ganu <sughosh.ganu@linaro.org>
|
||||
@@ -1219,35 +1019,17 @@ F: arch/sandbox/
|
||||
F: doc/arch/sandbox.rst
|
||||
F: include/dt-bindings/*/sandbox*.h
|
||||
|
||||
SEMIHOSTING
|
||||
R: Sean Anderson <sean.anderson@seco.com>
|
||||
S: Orphaned
|
||||
N: semihosting
|
||||
|
||||
SETEXPR
|
||||
M: Roland Gaudig <roland.gaudig@weidmueller.com>
|
||||
S: Maintained
|
||||
F: cmd/printf.c
|
||||
F: doc/usage/setexpr.rst
|
||||
|
||||
SH
|
||||
M: Marek Vasut <marek.vasut+renesas@gmail.com>
|
||||
M: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-sh.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-sh.git
|
||||
F: arch/sh/
|
||||
|
||||
SL28CLPD
|
||||
M: Michael Walle <michael@walle.cc>
|
||||
S: Maintained
|
||||
F: drivers/gpio/sl28cpld-gpio.c
|
||||
F: drivers/misc/sl28cpld.c
|
||||
F: drivers/watchdog/sl28cpld-wdt.c
|
||||
|
||||
SPI
|
||||
M: Jagan Teki <jagan@amarulasolutions.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-spi.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-spi.git
|
||||
F: drivers/spi/
|
||||
F: include/spi*
|
||||
|
||||
@@ -1276,13 +1058,6 @@ F: include/sqfs.h
|
||||
F: cmd/sqfs.c
|
||||
F: test/py/tests/test_fs/test_squashfs/
|
||||
|
||||
STACKPROTECTOR
|
||||
M: Joel Peshkin <joel.peshkin@broadcom.com>
|
||||
S: Maintained
|
||||
F: common/stackprot.c
|
||||
F: cmd/stackprot_test.c
|
||||
F: test/py/tests/test_stackprotector.py
|
||||
|
||||
TARGET_BCMNS3
|
||||
M: Bharat Gooty <bharat.gooty@broadcom.com>
|
||||
M: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
|
||||
@@ -1331,11 +1106,6 @@ F: configs/am65x_hs_evm_a53_defconfig
|
||||
F: configs/j721e_hs_evm_r5_defconfig
|
||||
F: configs/j721e_hs_evm_a72_defconfig
|
||||
|
||||
TPM DRIVERS
|
||||
M: Ilias Apalodimas <ilias.apalodimas@linaro.org>
|
||||
S: Maintained
|
||||
F: drivers/tpm/
|
||||
|
||||
TQ GROUP
|
||||
#M: Martin Krause <martin.krause@tq-systems.de>
|
||||
S: Orphaned (Since 2016-02)
|
||||
@@ -1357,7 +1127,7 @@ UBI
|
||||
M: Kyungmin Park <kmpark@infradead.org>
|
||||
M: Heiko Schocher <hs@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-ubi.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-ubi.git
|
||||
F: drivers/mtd/ubi/
|
||||
|
||||
UFS
|
||||
@@ -1368,7 +1138,7 @@ F: drivers/ufs/
|
||||
USB
|
||||
M: Marek Vasut <marex@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-usb.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-usb.git
|
||||
F: drivers/usb/
|
||||
F: common/usb.c
|
||||
F: common/usb_kbd.c
|
||||
@@ -1377,49 +1147,29 @@ F: include/usb.h
|
||||
USB xHCI
|
||||
M: Bin Meng <bmeng.cn@gmail.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-usb.git topic-xhci
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-usb.git topic-xhci
|
||||
F: drivers/usb/host/xhci*
|
||||
F: include/usb/xhci.h
|
||||
|
||||
VIDEO
|
||||
M: Anatolij Gustschin <agust@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-video.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-video.git
|
||||
F: drivers/video/
|
||||
F: common/lcd*.c
|
||||
F: include/lcd*.h
|
||||
F: include/video*.h
|
||||
|
||||
VirtIO
|
||||
M: Bin Meng <bmeng.cn@gmail.com>
|
||||
S: Maintained
|
||||
F: drivers/virtio/
|
||||
F: cmd/virtio.c
|
||||
F: include/config/virtio/
|
||||
F: include/config/virtio.h
|
||||
F: include/config/cmd/virtio.h
|
||||
F: include/virtio*.h
|
||||
F: test/dm/virtio.c
|
||||
F: doc/develop/driver-model/virtio.rst
|
||||
|
||||
WATCHDOG
|
||||
M: Stefan Roese <sr@denx.de>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-watchdog.git
|
||||
F: cmd/wdt.c
|
||||
F: drivers/watchdog/
|
||||
F: include/watchdog*.h
|
||||
|
||||
X86
|
||||
M: Simon Glass <sjg@chromium.org>
|
||||
M: Bin Meng <bmeng.cn@gmail.com>
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/custodians/u-boot-x86.git
|
||||
T: git https://gitlab.denx.de/u-boot/custodians/u-boot-x86.git
|
||||
F: arch/x86/
|
||||
F: cmd/x86/
|
||||
|
||||
XEN
|
||||
M: Anastasiia Lukianenko <vicooodin@gmail.com>
|
||||
M: Anastasiia Lukianenko <anastasiia_lukianenko@epam.com>
|
||||
M: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
|
||||
S: Maintained
|
||||
F: arch/arm/cpu/armv8/xen/
|
||||
@@ -1444,13 +1194,7 @@ M: Tom Rini <trini@konsulko.com>
|
||||
L: u-boot@lists.denx.de
|
||||
Q: http://patchwork.ozlabs.org/project/uboot/list/
|
||||
S: Maintained
|
||||
T: git https://source.denx.de/u-boot/u-boot.git
|
||||
T: git https://gitlab.denx.de/u-boot/u-boot.git
|
||||
F: configs/tools-only_defconfig
|
||||
F: *
|
||||
F: */
|
||||
|
||||
CAAM
|
||||
M: Gaurav Jain <gaurav.jain@nxp.com>
|
||||
S: Maintained
|
||||
F: drivers/crypto/fsl/
|
||||
F: include/fsl_sec.h
|
||||
|
||||
@@ -2,6 +2,7 @@ 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.
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <common.h>
|
||||
#include <api_public.h>
|
||||
#include <part.h>
|
||||
#include <scsi.h>
|
||||
|
||||
#if defined(CONFIG_CMD_USB) && defined(CONFIG_USB_STORAGE)
|
||||
#include <usb.h>
|
||||
@@ -72,7 +71,7 @@ void dev_stor_init(void)
|
||||
specs[ENUM_SATA].name = "sata";
|
||||
#endif
|
||||
#if defined(CONFIG_SCSI)
|
||||
specs[ENUM_SCSI].max_dev = SCSI_MAX_DEVICE;
|
||||
specs[ENUM_SCSI].max_dev = CONFIG_SYS_SCSI_MAX_DEVICE;
|
||||
specs[ENUM_SCSI].enum_started = 0;
|
||||
specs[ENUM_SCSI].enum_ended = 0;
|
||||
specs[ENUM_SCSI].type = DEV_TYP_STOR | DT_STOR_SCSI;
|
||||
|
||||
152
arch/Kconfig
152
arch/Kconfig
@@ -1,7 +1,3 @@
|
||||
config ARCH_MAP_SYSMEM
|
||||
depends on SANDBOX
|
||||
def_bool y
|
||||
|
||||
config CREATE_ARCH_SYMLINK
|
||||
bool
|
||||
|
||||
@@ -11,27 +7,6 @@ config HAVE_ARCH_IOREMAP
|
||||
config NEEDS_MANUAL_RELOC
|
||||
bool
|
||||
|
||||
config SYS_CACHE_SHIFT_4
|
||||
bool
|
||||
|
||||
config SYS_CACHE_SHIFT_5
|
||||
bool
|
||||
|
||||
config SYS_CACHE_SHIFT_6
|
||||
bool
|
||||
|
||||
config SYS_CACHE_SHIFT_7
|
||||
bool
|
||||
|
||||
config SYS_CACHELINE_SIZE
|
||||
int
|
||||
default 128 if SYS_CACHE_SHIFT_7
|
||||
default 64 if SYS_CACHE_SHIFT_6
|
||||
default 32 if SYS_CACHE_SHIFT_5
|
||||
default 16 if SYS_CACHE_SHIFT_4
|
||||
# Fall-back for MIPS
|
||||
default 32 if MIPS
|
||||
|
||||
config LINKER_LIST_ALIGN
|
||||
int
|
||||
default 32 if SANDBOX
|
||||
@@ -54,15 +29,12 @@ config ARC
|
||||
select DM
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
select SUPPORT_OF_CONTROL
|
||||
select SYS_CACHE_SHIFT_7
|
||||
select TIMER
|
||||
|
||||
config ARM
|
||||
bool "ARM architecture"
|
||||
select ARCH_SUPPORTS_LTO
|
||||
select CREATE_ARCH_SYMLINK
|
||||
select HAVE_PRIVATE_LIBGCC if !ARM64
|
||||
select SUPPORT_ACPI
|
||||
select SUPPORT_OF_CONTROL
|
||||
|
||||
config M68K
|
||||
@@ -71,7 +43,6 @@ config M68K
|
||||
select NEEDS_MANUAL_RELOC
|
||||
select SYS_BOOT_GET_CMDLINE
|
||||
select SYS_BOOT_GET_KBD
|
||||
select SYS_CACHE_SHIFT_4
|
||||
select SUPPORT_OF_CONTROL
|
||||
|
||||
config MICROBLAZE
|
||||
@@ -85,13 +56,15 @@ config MIPS
|
||||
select HAVE_ARCH_IOREMAP
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
select SUPPORT_OF_CONTROL
|
||||
select SPL_SEPARATE_BSS if SPL
|
||||
|
||||
config NDS32
|
||||
bool "NDS32 architecture"
|
||||
select SUPPORT_OF_CONTROL
|
||||
|
||||
config NIOS2
|
||||
bool "Nios II architecture"
|
||||
select CPU
|
||||
select DM
|
||||
imply DM_EVENT
|
||||
select OF_CONTROL
|
||||
select SUPPORT_OF_CONTROL
|
||||
imply CMD_DM
|
||||
@@ -109,10 +82,8 @@ config RISCV
|
||||
select SUPPORT_OF_CONTROL
|
||||
select OF_CONTROL
|
||||
select DM
|
||||
select SPL_SEPARATE_BSS if SPL
|
||||
imply DM_SERIAL
|
||||
imply DM_ETH
|
||||
imply DM_EVENT
|
||||
imply DM_MMC
|
||||
imply DM_SPI
|
||||
imply DM_SPI_FLASH
|
||||
@@ -125,12 +96,11 @@ config RISCV
|
||||
imply SPL_OF_CONTROL
|
||||
imply SPL_LIBCOMMON_SUPPORT
|
||||
imply SPL_LIBGENERIC_SUPPORT
|
||||
imply SPL_SERIAL
|
||||
imply SPL_SERIAL_SUPPORT
|
||||
imply SPL_TIMER
|
||||
|
||||
config SANDBOX
|
||||
bool "Sandbox"
|
||||
select ARCH_SUPPORTS_LTO
|
||||
select BOARD_LATE_INIT
|
||||
select BZIP2
|
||||
select CMD_POWEROFF
|
||||
@@ -150,13 +120,8 @@ config SANDBOX
|
||||
select SPI
|
||||
select SUPPORT_OF_CONTROL
|
||||
select SYSRESET_CMD_POWEROFF
|
||||
select SYS_CACHE_SHIFT_4
|
||||
select IRQ
|
||||
select SUPPORT_EXTENSION_SCAN
|
||||
select SUPPORT_ACPI
|
||||
imply BITREVERSE
|
||||
select BLOBLIST
|
||||
imply LTO
|
||||
imply CMD_DM
|
||||
imply CMD_EXCEPTION
|
||||
imply CMD_GETTIME
|
||||
@@ -172,13 +137,11 @@ config SANDBOX
|
||||
imply FIRMWARE
|
||||
imply HASH_VERIFY
|
||||
imply LZMA
|
||||
imply SCSI
|
||||
imply TEE
|
||||
imply AVB_VERIFY
|
||||
imply LIBAVB
|
||||
imply CMD_AVB
|
||||
imply PARTITION_TYPE_GUID
|
||||
imply SCP03
|
||||
imply CMD_SCP03
|
||||
imply UDP_FUNCTION_FASTBOOT
|
||||
imply VIRTIO_MMIO
|
||||
imply VIRTIO_PCI
|
||||
@@ -197,13 +160,6 @@ config SANDBOX
|
||||
imply CMD_CLONE
|
||||
imply SILENT_CONSOLE
|
||||
imply BOOTARGS_SUBST
|
||||
imply PHY_FIXED
|
||||
imply DM_DSA
|
||||
imply CMD_EXTENSION
|
||||
imply KEYBOARD
|
||||
imply PHYSMEM
|
||||
imply GENERATE_ACPI_TABLE
|
||||
imply BINMAN
|
||||
|
||||
config SH
|
||||
bool "SuperH architecture"
|
||||
@@ -216,17 +172,15 @@ config X86
|
||||
select SUPPORT_TPL
|
||||
select CREATE_ARCH_SYMLINK
|
||||
select DM
|
||||
select DM_PCI
|
||||
select HAVE_ARCH_IOMAP
|
||||
select HAVE_PRIVATE_LIBGCC
|
||||
select OF_CONTROL
|
||||
select PCI
|
||||
select SUPPORT_ACPI
|
||||
select SUPPORT_OF_CONTROL
|
||||
select SYS_CACHE_SHIFT_6
|
||||
select TIMER
|
||||
select USE_PRIVATE_LIBGCC
|
||||
select X86_TSC_TIMER
|
||||
select IRQ
|
||||
imply HAS_ROM if X86_RESET_VECTOR
|
||||
imply BLK
|
||||
imply CMD_DM
|
||||
@@ -239,7 +193,6 @@ config X86
|
||||
imply CMD_SF_TEST
|
||||
imply CMD_ZBOOT
|
||||
imply DM_ETH
|
||||
imply DM_EVENT
|
||||
imply DM_GPIO
|
||||
imply DM_KEYBOARD
|
||||
imply DM_MMC
|
||||
@@ -257,36 +210,35 @@ config X86
|
||||
imply USB_ETHER_SMSC95XX
|
||||
imply USB_HOST_ETHER
|
||||
imply PCH
|
||||
imply PHYSMEM
|
||||
imply RTC_MC146818
|
||||
imply ACPIGEN if !QEMU && !EFI_APP
|
||||
imply IRQ
|
||||
imply ACPIGEN if !QEMU
|
||||
imply SYSINFO if GENERATE_SMBIOS_TABLE
|
||||
imply SYSINFO_SMBIOS if GENERATE_SMBIOS_TABLE
|
||||
imply TIMESTAMP
|
||||
|
||||
# Thing to enable for when SPL/TPL are enabled: SPL
|
||||
imply SPL_DM
|
||||
imply SPL_OF_LIBFDT
|
||||
imply SPL_DRIVERS_MISC
|
||||
imply SPL_GPIO
|
||||
imply SPL_DRIVERS_MISC_SUPPORT
|
||||
imply SPL_GPIO_SUPPORT
|
||||
imply SPL_PINCTRL
|
||||
imply SPL_LIBCOMMON_SUPPORT
|
||||
imply SPL_LIBGENERIC_SUPPORT
|
||||
imply SPL_SERIAL
|
||||
imply SPL_SERIAL_SUPPORT
|
||||
imply SPL_SPI_FLASH_SUPPORT
|
||||
imply SPL_SPI
|
||||
imply SPL_SPI_SUPPORT
|
||||
imply SPL_OF_CONTROL
|
||||
imply SPL_TIMER
|
||||
imply SPL_REGMAP
|
||||
imply SPL_SYSCON
|
||||
# TPL
|
||||
imply TPL_DM
|
||||
imply TPL_DRIVERS_MISC
|
||||
imply TPL_GPIO
|
||||
imply TPL_DRIVERS_MISC_SUPPORT
|
||||
imply TPL_GPIO_SUPPORT
|
||||
imply TPL_PINCTRL
|
||||
imply TPL_LIBCOMMON_SUPPORT
|
||||
imply TPL_LIBGENERIC_SUPPORT
|
||||
imply TPL_SERIAL
|
||||
imply TPL_SERIAL_SUPPORT
|
||||
imply TPL_OF_CONTROL
|
||||
imply TPL_TIMER
|
||||
imply TPL_REGMAP
|
||||
@@ -364,80 +316,12 @@ config SYS_DISABLE_DCACHE_OPS
|
||||
Note that, its up to the individual architectures to implement
|
||||
this functionality.
|
||||
|
||||
config SYS_IMMR
|
||||
hex "Address for the Internal Memory-Mapped Registers (IMMR) window"
|
||||
depends on PPC || FSL_LSCH2 || FSL_LSCH3 || ARCH_LS1021A
|
||||
default 0xFF000000 if MPC8xx
|
||||
default 0xF0000000 if ARCH_MPC8313
|
||||
default 0xE0000000 if MPC83xx && !ARCH_MPC8313
|
||||
default 0x01000000 if ARCH_LS1021A || FSL_LSCH2 || FSL_LSCH3
|
||||
default SYS_CCSRBAR_DEFAULT
|
||||
help
|
||||
Address for the Internal Memory-Mapped Registers (IMMR) window used
|
||||
to configure the features of many Freescale / NXP SoCs.
|
||||
|
||||
config SKIP_LOWLEVEL_INIT
|
||||
bool "Skip the calls to certain low level initialization functions"
|
||||
depends on ARM || MIPS || RISCV
|
||||
help
|
||||
If enabled, then certain low level initializations (like setting up
|
||||
the memory controller) are omitted and/or U-Boot does not relocate
|
||||
itself into RAM.
|
||||
Normally this variable MUST NOT be defined. The only exception is
|
||||
when U-Boot is loaded (to RAM) by some other boot loader or by a
|
||||
debugger which performs these initializations itself.
|
||||
|
||||
config SPL_SKIP_LOWLEVEL_INIT
|
||||
bool "Skip the calls to certain low level initialization functions"
|
||||
depends on SPL && (ARM || MIPS || RISCV)
|
||||
help
|
||||
If enabled, then certain low level initializations (like setting up
|
||||
the memory controller) are omitted and/or U-Boot does not relocate
|
||||
itself into RAM.
|
||||
Normally this variable MUST NOT be defined. The only exception is
|
||||
when U-Boot is loaded (to RAM) by some other boot loader or by a
|
||||
debugger which performs these initializations itself.
|
||||
|
||||
config TPL_SKIP_LOWLEVEL_INIT
|
||||
bool "Skip the calls to certain low level initialization functions"
|
||||
depends on SPL && ARM
|
||||
help
|
||||
If enabled, then certain low level initializations (like setting up
|
||||
the memory controller) are omitted and/or U-Boot does not relocate
|
||||
itself into RAM.
|
||||
Normally this variable MUST NOT be defined. The only exception is
|
||||
when U-Boot is loaded (to RAM) by some other boot loader or by a
|
||||
debugger which performs these initializations itself.
|
||||
|
||||
config SKIP_LOWLEVEL_INIT_ONLY
|
||||
bool "Skip the call to lowlevel_init during early boot ONLY"
|
||||
depends on ARM
|
||||
help
|
||||
This allows just the call to lowlevel_init() to be skipped. The
|
||||
normal CP15 init (such as enabling the instruction cache) is still
|
||||
performed.
|
||||
|
||||
config SPL_SKIP_LOWLEVEL_INIT_ONLY
|
||||
bool "Skip the call to lowlevel_init during early boot ONLY"
|
||||
depends on SPL && ARM
|
||||
help
|
||||
This allows just the call to lowlevel_init() to be skipped. The
|
||||
normal CP15 init (such as enabling the instruction cache) is still
|
||||
performed.
|
||||
|
||||
config TPL_SKIP_LOWLEVEL_INIT_ONLY
|
||||
bool "Skip the call to lowlevel_init during early boot ONLY"
|
||||
depends on TPL && ARM
|
||||
help
|
||||
This allows just the call to lowlevel_init() to be skipped. The
|
||||
normal CP15 init (such as enabling the instruction cache) is still
|
||||
performed.
|
||||
|
||||
source "arch/arc/Kconfig"
|
||||
source "arch/arm/Kconfig"
|
||||
source "arch/m68k/Kconfig"
|
||||
source "arch/microblaze/Kconfig"
|
||||
source "arch/mips/Kconfig"
|
||||
source "arch/nds32/Kconfig"
|
||||
source "arch/nios2/Kconfig"
|
||||
source "arch/powerpc/Kconfig"
|
||||
source "arch/sandbox/Kconfig"
|
||||
@@ -445,5 +329,3 @@ source "arch/sh/Kconfig"
|
||||
source "arch/x86/Kconfig"
|
||||
source "arch/xtensa/Kconfig"
|
||||
source "arch/riscv/Kconfig"
|
||||
|
||||
source "board/keymile/Kconfig"
|
||||
|
||||
@@ -104,11 +104,13 @@ endchoice
|
||||
|
||||
config CPU_BIG_ENDIAN
|
||||
bool "Enable Big Endian Mode"
|
||||
default n
|
||||
help
|
||||
Build kernel for Big Endian Mode of ARC CPU
|
||||
|
||||
config SYS_ICACHE_OFF
|
||||
bool "Do not enable icache"
|
||||
default n
|
||||
help
|
||||
Do not enable instruction cache in U-Boot.
|
||||
|
||||
@@ -121,6 +123,7 @@ config SPL_SYS_ICACHE_OFF
|
||||
|
||||
config SYS_DCACHE_OFF
|
||||
bool "Do not enable dcache"
|
||||
default n
|
||||
help
|
||||
Do not enable data cache in U-Boot.
|
||||
|
||||
@@ -133,12 +136,14 @@ config SPL_SYS_DCACHE_OFF
|
||||
|
||||
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.
|
||||
|
||||
@@ -8,8 +8,6 @@ dtb-$(CONFIG_TARGET_EMSDP) += emsdp.dtb
|
||||
dtb-$(CONFIG_TARGET_HSDK) += hsdk.dtb hsdk-4xd.dtb
|
||||
dtb-$(CONFIG_TARGET_IOT_DEVKIT) += iot_devkit.dtb
|
||||
|
||||
include $(srctree)/scripts/Makefile.dts
|
||||
|
||||
targets += $(dtb-y)
|
||||
|
||||
DTC_FLAGS += -R 4 -p 0x1000
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
};
|
||||
|
||||
usbphy: phy {
|
||||
compatible = "usb-nop-xceiv";
|
||||
compatible = "nop-phy";
|
||||
#phy-cells = <0>;
|
||||
};
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
*/
|
||||
#define ARCH_DMA_MINALIGN 128
|
||||
|
||||
/* CONFIG_SYS_CACHELINE_SIZE is used a lot in drivers */
|
||||
#define CONFIG_SYS_CACHELINE_SIZE ARCH_DMA_MINALIGN
|
||||
|
||||
#if defined(ARC_MMU_ABSENT)
|
||||
#define CONFIG_ARC_MMU_VER 0
|
||||
#elif defined(CONFIG_ARC_MMU_V2)
|
||||
|
||||
@@ -8,4 +8,6 @@
|
||||
|
||||
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
|
||||
|
||||
#define CONFIG_LMB
|
||||
|
||||
#endif /*__ASM_ARC_CONFIG_H_ */
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#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 {
|
||||
|
||||
@@ -8,12 +8,42 @@
|
||||
#include <env.h>
|
||||
#include <image.h>
|
||||
#include <irq_func.h>
|
||||
#include <lmb.h>
|
||||
#include <log.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/global_data.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static ulong get_sp(void)
|
||||
{
|
||||
ulong ret;
|
||||
|
||||
asm("mov %0, sp" : "=r"(ret) : );
|
||||
return ret;
|
||||
}
|
||||
|
||||
void arch_lmb_reserve(struct lmb *lmb)
|
||||
{
|
||||
ulong sp;
|
||||
|
||||
/*
|
||||
* Booting a (Linux) kernel image
|
||||
*
|
||||
* Allocate space for command line and board info - the
|
||||
* address should be as high as possible within the reach of
|
||||
* the kernel (see CONFIG_SYS_BOOTMAPSZ settings), but in unused
|
||||
* memory, which means far enough below the current stack
|
||||
* pointer.
|
||||
*/
|
||||
sp = get_sp();
|
||||
debug("## Current stack ends at 0x%08lx ", sp);
|
||||
|
||||
/* adjust sp by 4K to be safe */
|
||||
sp -= 4096;
|
||||
lmb_reserve(lmb, sp, (CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp));
|
||||
}
|
||||
|
||||
static int cleanup_before_linux(void)
|
||||
{
|
||||
disable_interrupts();
|
||||
@@ -63,7 +93,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
|
||||
"(fake run for tracing)" : "");
|
||||
bootstage_mark_name(BOOTSTAGE_ID_BOOTM_HANDOFF, "start_kernel");
|
||||
|
||||
if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
|
||||
if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len) {
|
||||
r0 = 2;
|
||||
r2 = (unsigned int)images->ft_addr;
|
||||
} else {
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/log2.h>
|
||||
#include <lmb.h>
|
||||
#include <asm/arcregs.h>
|
||||
#include <asm/arc-bcr.h>
|
||||
#include <asm/cache.h>
|
||||
@@ -821,16 +820,3 @@ void sync_n_cleanup_cache_all(void)
|
||||
|
||||
__ic_entire_invalidate();
|
||||
}
|
||||
|
||||
static ulong get_sp(void)
|
||||
{
|
||||
ulong ret;
|
||||
|
||||
asm("mov %0, sp" : "=r"(ret) : );
|
||||
return ret;
|
||||
}
|
||||
|
||||
void arch_lmb_reserve(struct lmb *lmb)
|
||||
{
|
||||
arch_lmb_reserve_generic(lmb, get_sp(), gd->ram_top, 4096);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <clock_legacy.h>
|
||||
#include <init.h>
|
||||
#include <malloc.h>
|
||||
#include <vsprintf.h>
|
||||
@@ -19,7 +18,7 @@ int arch_cpu_init(void)
|
||||
{
|
||||
timer_init();
|
||||
|
||||
gd->cpu_clk = get_board_sys_clk();
|
||||
gd->cpu_clk = CONFIG_SYS_CLK_FREQ;
|
||||
gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
|
||||
|
||||
cache_init();
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef int HItype __attribute__ ((mode (HI)));
|
||||
typedef unsigned int UHItype __attribute__ ((mode (HI)));
|
||||
#if MIN_UNITS_PER_WORD > 1
|
||||
/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1. */
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef int SItype __attribute__ ((mode (SI)));
|
||||
typedef unsigned int USItype __attribute__ ((mode (SI)));
|
||||
#if __SIZEOF_LONG_LONG__ > 4
|
||||
/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2. */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <common.h>
|
||||
#include <cpu_func.h>
|
||||
|
||||
__weak void reset_cpu(void)
|
||||
__weak void reset_cpu(ulong addr)
|
||||
{
|
||||
/* Stop debug session here */
|
||||
__builtin_arc_brk();
|
||||
@@ -17,7 +17,7 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
{
|
||||
printf("Resetting the board...\n");
|
||||
|
||||
reset_cpu();
|
||||
reset_cpu(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
739
arch/arm/Kconfig
739
arch/arm/Kconfig
File diff suppressed because it is too large
Load Diff
@@ -18,11 +18,7 @@ arch-$(CONFIG_CPU_V7A) =$(call cc-option, -march=armv7-a, \
|
||||
$(call cc-option, -march=armv7))
|
||||
arch-$(CONFIG_CPU_V7M) =-march=armv7-m
|
||||
arch-$(CONFIG_CPU_V7R) =-march=armv7-r
|
||||
ifeq ($(CONFIG_ARM64_CRC32),y)
|
||||
arch-$(CONFIG_ARM64) =-march=armv8-a+crc
|
||||
else
|
||||
arch-$(CONFIG_ARM64) =-march=armv8-a
|
||||
endif
|
||||
|
||||
# On Tegra systems we must build SPL for the armv4 core on the device
|
||||
# but otherwise we can use the value in CONFIG_SYS_ARM_ARCH
|
||||
@@ -55,7 +51,6 @@ PLATFORM_CPPFLAGS += $(arch-y) $(tune-y)
|
||||
|
||||
# Machine directory name. This list is sorted alphanumerically
|
||||
# by CONFIG_* macro name.
|
||||
machine-$(CONFIG_ARCH_APPLE) += apple
|
||||
machine-$(CONFIG_ARCH_ASPEED) += aspeed
|
||||
machine-$(CONFIG_ARCH_AT91) += at91
|
||||
machine-$(CONFIG_ARCH_BCM283X) += bcm283x
|
||||
@@ -72,7 +67,6 @@ machine-$(CONFIG_ARCH_MEDIATEK) += mediatek
|
||||
machine-$(CONFIG_ARCH_MESON) += meson
|
||||
machine-$(CONFIG_ARCH_MVEBU) += mvebu
|
||||
machine-$(CONFIG_ARCH_NEXELL) += nexell
|
||||
machine-$(CONFIG_ARCH_NPCM) += npcm
|
||||
machine-$(CONFIG_ARCH_OMAP2PLUS) += omap2
|
||||
machine-$(CONFIG_ARCH_ORION5X) += orion5x
|
||||
machine-$(CONFIG_ARCH_OWL) += owl
|
||||
@@ -113,11 +107,11 @@ libs-y += arch/arm/cpu/
|
||||
libs-y += arch/arm/lib/
|
||||
|
||||
ifeq ($(CONFIG_SPL_BUILD),y)
|
||||
ifneq (,$(CONFIG_MX23)$(CONFIG_MX28)$(filter $(SOC), mx25 mx5 mx6 mx7 mx35 imx8m imx8 imx8ulp imxrt))
|
||||
ifneq (,$(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_MX35)$(filter $(SOC), mx25 mx5 mx6 mx7 mx35 imx8m imx8 imxrt))
|
||||
libs-y += arch/arm/mach-imx/
|
||||
endif
|
||||
else
|
||||
ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx7ulp mx31 mx35 mxs imx8m imx8 imx8ulp imxrt vf610))
|
||||
ifneq (,$(filter $(SOC), mx25 mx27 mx5 mx6 mx7 mx7ulp mx31 mx35 mxs imx8m imx8 imxrt vf610))
|
||||
libs-y += arch/arm/mach-imx/
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -11,21 +11,13 @@ CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata-sections \
|
||||
-fstack-protector-strong
|
||||
CFLAGS_NON_EFI := -fno-pic -ffixed-r9 -ffunction-sections -fdata-sections
|
||||
CFLAGS_EFI := -fpic -fshort-wchar
|
||||
|
||||
ifneq ($(CONFIG_LTO)$(CONFIG_USE_PRIVATE_LIBGCC),yy)
|
||||
LDFLAGS_FINAL += --gc-sections
|
||||
endif
|
||||
|
||||
ifndef CONFIG_LTO
|
||||
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
|
||||
endif
|
||||
|
||||
PLATFORM_RELFLAGS += -fno-common -ffixed-r9
|
||||
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections \
|
||||
-fno-common -ffixed-r9
|
||||
PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) \
|
||||
$(call cc-option,-mgeneral-regs-only) \
|
||||
$(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
|
||||
|
||||
# LLVM support
|
||||
@@ -159,8 +151,7 @@ ifdef CONFIG_EFI_LOADER
|
||||
OBJCOPYFLAGS += -j .efi_runtime -j .efi_runtime_rel
|
||||
endif
|
||||
|
||||
ifdef CONFIG_MACH_IMX
|
||||
ifneq ($(CONFIG_IMX_CONFIG),"")
|
||||
ifneq ($(CONFIG_IMX_CONFIG),)
|
||||
ifdef CONFIG_SPL
|
||||
ifndef CONFIG_SPL_BUILD
|
||||
INPUTS-y += SPL
|
||||
@@ -176,7 +167,6 @@ ifneq ($(CONFIG_VF610),)
|
||||
INPUTS-y += u-boot.vyb
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
EFI_LDS := elf_arm_efi.lds
|
||||
EFI_CRT0 := crt0_arm_efi.o
|
||||
|
||||
@@ -7,3 +7,4 @@ extra-y = start.o
|
||||
|
||||
obj-y += ../arm11/
|
||||
obj-$(CONFIG_MX31) += mx31/
|
||||
obj-$(CONFIG_MX35) += mx35/
|
||||
|
||||
11
arch/arm/cpu/arm1136/mx35/Makefile
Normal file
11
arch/arm/cpu/arm1136/mx35/Makefile
Normal file
@@ -0,0 +1,11 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# (C) Copyright 2000-2006
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
# (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
|
||||
|
||||
obj-y += generic.o
|
||||
obj-y += timer.o
|
||||
obj-y += mx35_sdram.o
|
||||
obj-y += relocate.o
|
||||
530
arch/arm/cpu/arm1136/mx35/generic.c
Normal file
530
arch/arm/cpu/arm1136/mx35/generic.c
Normal file
@@ -0,0 +1,530 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2007
|
||||
* Sascha Hauer, Pengutronix
|
||||
*
|
||||
* (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <clock_legacy.h>
|
||||
#include <command.h>
|
||||
#include <div64.h>
|
||||
#include <init.h>
|
||||
#include <net.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/errno.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/crm_regs.h>
|
||||
#include <asm/arch/clock.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#ifdef CONFIG_FSL_ESDHC_IMX
|
||||
#include <fsl_esdhc_imx.h>
|
||||
#endif
|
||||
#include <netdev.h>
|
||||
#include <spl.h>
|
||||
|
||||
#define CLK_CODE(arm, ahb, sel) (((arm) << 16) + ((ahb) << 8) + (sel))
|
||||
#define CLK_CODE_ARM(c) (((c) >> 16) & 0xFF)
|
||||
#define CLK_CODE_AHB(c) (((c) >> 8) & 0xFF)
|
||||
#define CLK_CODE_PATH(c) ((c) & 0xFF)
|
||||
|
||||
#define CCM_GET_DIVIDER(x, m, o) (((x) & (m)) >> (o))
|
||||
|
||||
#ifdef CONFIG_FSL_ESDHC_IMX
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
#endif
|
||||
|
||||
static int g_clk_mux_auto[8] = {
|
||||
CLK_CODE(1, 3, 0), CLK_CODE(1, 2, 1), CLK_CODE(2, 1, 1), -1,
|
||||
CLK_CODE(1, 6, 0), CLK_CODE(1, 4, 1), CLK_CODE(2, 2, 1), -1,
|
||||
};
|
||||
|
||||
static int g_clk_mux_consumer[16] = {
|
||||
CLK_CODE(1, 4, 0), CLK_CODE(1, 3, 1), CLK_CODE(1, 3, 1), -1,
|
||||
-1, -1, CLK_CODE(4, 1, 0), CLK_CODE(1, 5, 0),
|
||||
CLK_CODE(1, 8, 1), CLK_CODE(1, 6, 1), CLK_CODE(2, 4, 0), -1,
|
||||
-1, -1, CLK_CODE(4, 2, 0), -1,
|
||||
};
|
||||
|
||||
static int hsp_div_table[3][16] = {
|
||||
{4, 3, 2, -1, -1, -1, 1, 5, 4, 3, 2, -1, -1, -1, 1, -1},
|
||||
{-1, -1, -1, -1, -1, -1, -1, -1, 8, 6, 4, -1, -1, -1, 2, -1},
|
||||
{3, -1, -1, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1},
|
||||
};
|
||||
|
||||
u32 get_cpu_rev(void)
|
||||
{
|
||||
int reg;
|
||||
struct iim_regs *iim =
|
||||
(struct iim_regs *)IIM_BASE_ADDR;
|
||||
reg = readl(&iim->iim_srev);
|
||||
if (!reg) {
|
||||
reg = readw(ROMPATCH_REV);
|
||||
reg <<= 4;
|
||||
} else {
|
||||
reg += CHIP_REV_1_0;
|
||||
}
|
||||
|
||||
return 0x35000 + (reg & 0xFF);
|
||||
}
|
||||
|
||||
static u32 get_arm_div(u32 pdr0, u32 *fi, u32 *fd)
|
||||
{
|
||||
int *pclk_mux;
|
||||
if (pdr0 & MXC_CCM_PDR0_AUTO_CON) {
|
||||
pclk_mux = g_clk_mux_consumer +
|
||||
((pdr0 & MXC_CCM_PDR0_CON_MUX_DIV_MASK) >>
|
||||
MXC_CCM_PDR0_CON_MUX_DIV_OFFSET);
|
||||
} else {
|
||||
pclk_mux = g_clk_mux_auto +
|
||||
((pdr0 & MXC_CCM_PDR0_AUTO_MUX_DIV_MASK) >>
|
||||
MXC_CCM_PDR0_AUTO_MUX_DIV_OFFSET);
|
||||
}
|
||||
|
||||
if ((*pclk_mux) == -1)
|
||||
return -1;
|
||||
|
||||
if (fi && fd) {
|
||||
if (!CLK_CODE_PATH(*pclk_mux)) {
|
||||
*fi = *fd = 1;
|
||||
return CLK_CODE_ARM(*pclk_mux);
|
||||
}
|
||||
if (pdr0 & MXC_CCM_PDR0_AUTO_CON) {
|
||||
*fi = 3;
|
||||
*fd = 4;
|
||||
} else {
|
||||
*fi = 2;
|
||||
*fd = 3;
|
||||
}
|
||||
}
|
||||
return CLK_CODE_ARM(*pclk_mux);
|
||||
}
|
||||
|
||||
static int get_ahb_div(u32 pdr0)
|
||||
{
|
||||
int *pclk_mux;
|
||||
|
||||
pclk_mux = g_clk_mux_consumer +
|
||||
((pdr0 & MXC_CCM_PDR0_CON_MUX_DIV_MASK) >>
|
||||
MXC_CCM_PDR0_CON_MUX_DIV_OFFSET);
|
||||
|
||||
if ((*pclk_mux) == -1)
|
||||
return -1;
|
||||
|
||||
return CLK_CODE_AHB(*pclk_mux);
|
||||
}
|
||||
|
||||
static u32 decode_pll(u32 reg, u32 infreq)
|
||||
{
|
||||
u32 mfi = (reg >> 10) & 0xf;
|
||||
s32 mfn = reg & 0x3ff;
|
||||
u32 mfd = (reg >> 16) & 0x3ff;
|
||||
u32 pd = (reg >> 26) & 0xf;
|
||||
|
||||
mfi = mfi <= 5 ? 5 : mfi;
|
||||
mfn = mfn >= 512 ? mfn - 1024 : mfn;
|
||||
mfd += 1;
|
||||
pd += 1;
|
||||
|
||||
return lldiv(2 * (u64)infreq * (mfi * mfd + mfn),
|
||||
mfd * pd);
|
||||
}
|
||||
|
||||
static u32 get_mcu_main_clk(void)
|
||||
{
|
||||
u32 arm_div = 0, fi = 0, fd = 0;
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
arm_div = get_arm_div(readl(&ccm->pdr0), &fi, &fd);
|
||||
fi *= decode_pll(readl(&ccm->mpctl), MXC_HCLK);
|
||||
return fi / (arm_div * fd);
|
||||
}
|
||||
|
||||
static u32 get_ipg_clk(void)
|
||||
{
|
||||
u32 freq = get_mcu_main_clk();
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
u32 pdr0 = readl(&ccm->pdr0);
|
||||
|
||||
return freq / (get_ahb_div(pdr0) * 2);
|
||||
}
|
||||
|
||||
static u32 get_ipg_per_clk(void)
|
||||
{
|
||||
u32 freq = get_mcu_main_clk();
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
u32 pdr0 = readl(&ccm->pdr0);
|
||||
u32 pdr4 = readl(&ccm->pdr4);
|
||||
u32 div;
|
||||
if (pdr0 & MXC_CCM_PDR0_PER_SEL) {
|
||||
div = CCM_GET_DIVIDER(pdr4,
|
||||
MXC_CCM_PDR4_PER0_PODF_MASK,
|
||||
MXC_CCM_PDR4_PER0_PODF_OFFSET) + 1;
|
||||
} else {
|
||||
div = CCM_GET_DIVIDER(pdr0,
|
||||
MXC_CCM_PDR0_PER_PODF_MASK,
|
||||
MXC_CCM_PDR0_PER_PODF_OFFSET) + 1;
|
||||
div *= get_ahb_div(pdr0);
|
||||
}
|
||||
return freq / div;
|
||||
}
|
||||
|
||||
u32 imx_get_uartclk(void)
|
||||
{
|
||||
u32 freq;
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
u32 pdr4 = readl(&ccm->pdr4);
|
||||
|
||||
if (readl(&ccm->pdr3) & MXC_CCM_PDR3_UART_M_U)
|
||||
freq = get_mcu_main_clk();
|
||||
else
|
||||
freq = decode_pll(readl(&ccm->ppctl), MXC_HCLK);
|
||||
freq /= CCM_GET_DIVIDER(pdr4,
|
||||
MXC_CCM_PDR4_UART_PODF_MASK,
|
||||
MXC_CCM_PDR4_UART_PODF_OFFSET) + 1;
|
||||
return freq;
|
||||
}
|
||||
|
||||
unsigned int mxc_get_main_clock(enum mxc_main_clock clk)
|
||||
{
|
||||
u32 nfc_pdf, hsp_podf;
|
||||
u32 pll, ret_val = 0, usb_podf;
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
|
||||
u32 reg = readl(&ccm->pdr0);
|
||||
u32 reg4 = readl(&ccm->pdr4);
|
||||
|
||||
reg |= 0x1;
|
||||
|
||||
switch (clk) {
|
||||
case CPU_CLK:
|
||||
ret_val = get_mcu_main_clk();
|
||||
break;
|
||||
case AHB_CLK:
|
||||
ret_val = get_mcu_main_clk();
|
||||
break;
|
||||
case HSP_CLK:
|
||||
if (reg & CLKMODE_CONSUMER) {
|
||||
hsp_podf = (reg >> 20) & 0x3;
|
||||
pll = get_mcu_main_clk();
|
||||
hsp_podf = hsp_div_table[hsp_podf][(reg>>16)&0xF];
|
||||
if (hsp_podf > 0) {
|
||||
ret_val = pll / hsp_podf;
|
||||
} else {
|
||||
puts("mismatch HSP with ARM clock setting\n");
|
||||
ret_val = 0;
|
||||
}
|
||||
} else {
|
||||
ret_val = get_mcu_main_clk();
|
||||
}
|
||||
break;
|
||||
case IPG_CLK:
|
||||
ret_val = get_ipg_clk();
|
||||
break;
|
||||
case IPG_PER_CLK:
|
||||
ret_val = get_ipg_per_clk();
|
||||
break;
|
||||
case NFC_CLK:
|
||||
nfc_pdf = (reg4 >> 28) & 0xF;
|
||||
pll = get_mcu_main_clk();
|
||||
/* AHB/nfc_pdf */
|
||||
ret_val = pll / (nfc_pdf + 1);
|
||||
break;
|
||||
case USB_CLK:
|
||||
usb_podf = (reg4 >> 22) & 0x3F;
|
||||
if (reg4 & 0x200)
|
||||
pll = get_mcu_main_clk();
|
||||
else
|
||||
pll = decode_pll(readl(&ccm->ppctl), MXC_HCLK);
|
||||
|
||||
ret_val = pll / (usb_podf + 1);
|
||||
break;
|
||||
default:
|
||||
printf("Unknown clock: %d\n", clk);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
unsigned int mxc_get_peri_clock(enum mxc_peri_clock clk)
|
||||
{
|
||||
u32 ret_val = 0, pdf, pre_pdf, clk_sel;
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
u32 mpdr2 = readl(&ccm->pdr2);
|
||||
u32 mpdr3 = readl(&ccm->pdr3);
|
||||
u32 mpdr4 = readl(&ccm->pdr4);
|
||||
|
||||
switch (clk) {
|
||||
case UART1_BAUD:
|
||||
case UART2_BAUD:
|
||||
case UART3_BAUD:
|
||||
clk_sel = mpdr3 & (1 << 14);
|
||||
pdf = (mpdr4 >> 10) & 0x3F;
|
||||
ret_val = ((clk_sel != 0) ? mxc_get_main_clock(CPU_CLK) :
|
||||
decode_pll(readl(&ccm->ppctl), MXC_HCLK)) / (pdf + 1);
|
||||
break;
|
||||
case SSI1_BAUD:
|
||||
pre_pdf = (mpdr2 >> 24) & 0x7;
|
||||
pdf = mpdr2 & 0x3F;
|
||||
clk_sel = mpdr2 & (1 << 6);
|
||||
ret_val = ((clk_sel != 0) ? mxc_get_main_clock(CPU_CLK) :
|
||||
decode_pll(readl(&ccm->ppctl), MXC_HCLK)) /
|
||||
((pre_pdf + 1) * (pdf + 1));
|
||||
break;
|
||||
case SSI2_BAUD:
|
||||
pre_pdf = (mpdr2 >> 27) & 0x7;
|
||||
pdf = (mpdr2 >> 8) & 0x3F;
|
||||
clk_sel = mpdr2 & (1 << 6);
|
||||
ret_val = ((clk_sel != 0) ? mxc_get_main_clock(CPU_CLK) :
|
||||
decode_pll(readl(&ccm->ppctl), MXC_HCLK)) /
|
||||
((pre_pdf + 1) * (pdf + 1));
|
||||
break;
|
||||
case CSI_BAUD:
|
||||
clk_sel = mpdr2 & (1 << 7);
|
||||
pdf = (mpdr2 >> 16) & 0x3F;
|
||||
ret_val = ((clk_sel != 0) ? mxc_get_main_clock(CPU_CLK) :
|
||||
decode_pll(readl(&ccm->ppctl), MXC_HCLK)) / (pdf + 1);
|
||||
break;
|
||||
case MSHC_CLK:
|
||||
pre_pdf = readl(&ccm->pdr1);
|
||||
clk_sel = (pre_pdf & 0x80);
|
||||
pdf = (pre_pdf >> 22) & 0x3F;
|
||||
pre_pdf = (pre_pdf >> 28) & 0x7;
|
||||
ret_val = ((clk_sel != 0) ? mxc_get_main_clock(CPU_CLK) :
|
||||
decode_pll(readl(&ccm->ppctl), MXC_HCLK)) /
|
||||
((pre_pdf + 1) * (pdf + 1));
|
||||
break;
|
||||
case ESDHC1_CLK:
|
||||
clk_sel = mpdr3 & 0x40;
|
||||
pdf = mpdr3 & 0x3F;
|
||||
ret_val = ((clk_sel != 0) ? mxc_get_main_clock(CPU_CLK) :
|
||||
decode_pll(readl(&ccm->ppctl), MXC_HCLK)) / (pdf + 1);
|
||||
break;
|
||||
case ESDHC2_CLK:
|
||||
clk_sel = mpdr3 & 0x40;
|
||||
pdf = (mpdr3 >> 8) & 0x3F;
|
||||
ret_val = ((clk_sel != 0) ? mxc_get_main_clock(CPU_CLK) :
|
||||
decode_pll(readl(&ccm->ppctl), MXC_HCLK)) / (pdf + 1);
|
||||
break;
|
||||
case ESDHC3_CLK:
|
||||
clk_sel = mpdr3 & 0x40;
|
||||
pdf = (mpdr3 >> 16) & 0x3F;
|
||||
ret_val = ((clk_sel != 0) ? mxc_get_main_clock(CPU_CLK) :
|
||||
decode_pll(readl(&ccm->ppctl), MXC_HCLK)) / (pdf + 1);
|
||||
break;
|
||||
case SPDIF_CLK:
|
||||
clk_sel = mpdr3 & 0x400000;
|
||||
pre_pdf = (mpdr3 >> 29) & 0x7;
|
||||
pdf = (mpdr3 >> 23) & 0x3F;
|
||||
ret_val = ((clk_sel != 0) ? mxc_get_main_clock(CPU_CLK) :
|
||||
decode_pll(readl(&ccm->ppctl), MXC_HCLK)) /
|
||||
((pre_pdf + 1) * (pdf + 1));
|
||||
break;
|
||||
default:
|
||||
printf("%s(): This clock: %d not supported yet\n",
|
||||
__func__, clk);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
unsigned int mxc_get_clock(enum mxc_clock clk)
|
||||
{
|
||||
switch (clk) {
|
||||
case MXC_ARM_CLK:
|
||||
return get_mcu_main_clk();
|
||||
case MXC_AHB_CLK:
|
||||
break;
|
||||
case MXC_IPG_CLK:
|
||||
return get_ipg_clk();
|
||||
case MXC_IPG_PERCLK:
|
||||
case MXC_I2C_CLK:
|
||||
return get_ipg_per_clk();
|
||||
case MXC_UART_CLK:
|
||||
return imx_get_uartclk();
|
||||
case MXC_ESDHC1_CLK:
|
||||
return mxc_get_peri_clock(ESDHC1_CLK);
|
||||
case MXC_ESDHC2_CLK:
|
||||
return mxc_get_peri_clock(ESDHC2_CLK);
|
||||
case MXC_ESDHC3_CLK:
|
||||
return mxc_get_peri_clock(ESDHC3_CLK);
|
||||
case MXC_USB_CLK:
|
||||
return mxc_get_main_clock(USB_CLK);
|
||||
case MXC_FEC_CLK:
|
||||
return get_ipg_clk();
|
||||
case MXC_CSPI_CLK:
|
||||
return get_ipg_clk();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FEC_MXC
|
||||
/*
|
||||
* The MX35 has no fuse for MAC, return a NULL MAC
|
||||
*/
|
||||
void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
|
||||
{
|
||||
memset(mac, 0, 6);
|
||||
}
|
||||
|
||||
u32 imx_get_fecclk(void)
|
||||
{
|
||||
return mxc_get_clock(MXC_IPG_CLK);
|
||||
}
|
||||
#endif
|
||||
|
||||
int do_mx35_showclocks(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
u32 cpufreq = get_mcu_main_clk();
|
||||
printf("mx35 cpu clock: %dMHz\n", cpufreq / 1000000);
|
||||
printf("ipg clock : %dHz\n", get_ipg_clk());
|
||||
printf("ipg per clock : %dHz\n", get_ipg_per_clk());
|
||||
printf("uart clock : %dHz\n", mxc_get_clock(MXC_UART_CLK));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
clocks, CONFIG_SYS_MAXARGS, 1, do_mx35_showclocks,
|
||||
"display clocks",
|
||||
""
|
||||
);
|
||||
|
||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
||||
static char *get_reset_cause(void)
|
||||
{
|
||||
/* read RCSR register from CCM module */
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
|
||||
u32 cause = readl(&ccm->rcsr) & 0x0F;
|
||||
|
||||
switch (cause) {
|
||||
case 0x0000:
|
||||
return "POR";
|
||||
case 0x0002:
|
||||
return "JTAG";
|
||||
case 0x0004:
|
||||
return "RST";
|
||||
case 0x0008:
|
||||
return "WDOG";
|
||||
default:
|
||||
return "unknown reset";
|
||||
}
|
||||
}
|
||||
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
u32 srev = get_cpu_rev();
|
||||
|
||||
printf("CPU: Freescale i.MX35 rev %d.%d at %d MHz.\n",
|
||||
(srev & 0xF0) >> 4, (srev & 0x0F),
|
||||
get_mcu_main_clk() / 1000000);
|
||||
|
||||
printf("Reset cause: %s\n", get_reset_cause());
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initializes on-chip ethernet controllers.
|
||||
* to override, implement board_eth_init()
|
||||
*/
|
||||
int cpu_eth_init(struct bd_info *bis)
|
||||
{
|
||||
int rc = -ENODEV;
|
||||
|
||||
#if defined(CONFIG_FEC_MXC)
|
||||
rc = fecmxc_initialize(bis);
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FSL_ESDHC_IMX
|
||||
/*
|
||||
* Initializes on-chip MMC controllers.
|
||||
* to override, implement board_mmc_init()
|
||||
*/
|
||||
int cpu_mmc_init(struct bd_info *bis)
|
||||
{
|
||||
return fsl_esdhc_mmc_init(bis);
|
||||
}
|
||||
#endif
|
||||
|
||||
int get_clocks(void)
|
||||
{
|
||||
#ifdef CONFIG_FSL_ESDHC_IMX
|
||||
#if CONFIG_SYS_FSL_ESDHC_ADDR == MMC_SDHC2_BASE_ADDR
|
||||
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
|
||||
#elif CONFIG_SYS_FSL_ESDHC_ADDR == MMC_SDHC3_BASE_ADDR
|
||||
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
|
||||
#else
|
||||
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC1_CLK);
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define RCSR_MEM_CTL_WEIM 0
|
||||
#define RCSR_MEM_CTL_NAND 1
|
||||
#define RCSR_MEM_CTL_ATA 2
|
||||
#define RCSR_MEM_CTL_EXPANSION 3
|
||||
#define RCSR_MEM_TYPE_NOR 0
|
||||
#define RCSR_MEM_TYPE_ONENAND 2
|
||||
#define RCSR_MEM_TYPE_SD 0
|
||||
#define RCSR_MEM_TYPE_I2C 2
|
||||
#define RCSR_MEM_TYPE_SPI 3
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
|
||||
u32 rcsr = readl(&ccm->rcsr);
|
||||
u32 mem_type, mem_ctl;
|
||||
|
||||
/* In external mode, no boot device is returned */
|
||||
if ((rcsr >> 10) & 0x03)
|
||||
return BOOT_DEVICE_NONE;
|
||||
|
||||
mem_ctl = (rcsr >> 25) & 0x03;
|
||||
mem_type = (rcsr >> 23) & 0x03;
|
||||
|
||||
switch (mem_ctl) {
|
||||
case RCSR_MEM_CTL_WEIM:
|
||||
switch (mem_type) {
|
||||
case RCSR_MEM_TYPE_NOR:
|
||||
return BOOT_DEVICE_NOR;
|
||||
case RCSR_MEM_TYPE_ONENAND:
|
||||
return BOOT_DEVICE_ONENAND;
|
||||
default:
|
||||
return BOOT_DEVICE_NONE;
|
||||
}
|
||||
case RCSR_MEM_CTL_NAND:
|
||||
return BOOT_DEVICE_NAND;
|
||||
case RCSR_MEM_CTL_EXPANSION:
|
||||
switch (mem_type) {
|
||||
case RCSR_MEM_TYPE_SD:
|
||||
return BOOT_DEVICE_MMC1;
|
||||
case RCSR_MEM_TYPE_I2C:
|
||||
return BOOT_DEVICE_I2C;
|
||||
case RCSR_MEM_TYPE_SPI:
|
||||
return BOOT_DEVICE_SPI;
|
||||
default:
|
||||
return BOOT_DEVICE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
return BOOT_DEVICE_NONE;
|
||||
}
|
||||
120
arch/arm/cpu/arm1136/mx35/mx35_sdram.c
Normal file
120
arch/arm/cpu/arm1136/mx35/mx35_sdram.c
Normal file
@@ -0,0 +1,120 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2012, Stefano Babic <sbabic@denx.de>
|
||||
*/
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <linux/errno.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
|
||||
#define ESDCTL_DDR2_EMR2 0x04000000
|
||||
#define ESDCTL_DDR2_EMR3 0x06000000
|
||||
#define ESDCTL_PRECHARGE 0x00000400
|
||||
#define ESDCTL_DDR2_EN_DLL 0x02000400
|
||||
#define ESDCTL_DDR2_RESET_DLL 0x00000333
|
||||
#define ESDCTL_DDR2_MR 0x00000233
|
||||
#define ESDCTL_DDR2_OCD_DEFAULT 0x02000780
|
||||
|
||||
enum {
|
||||
SMODE_NORMAL = 0,
|
||||
SMODE_PRECHARGE,
|
||||
SMODE_AUTO_REFRESH,
|
||||
SMODE_LOAD_REG,
|
||||
SMODE_MANUAL_REFRESH
|
||||
};
|
||||
|
||||
#define set_mode(x, en, m) (x | (en << 31) | (m << 28))
|
||||
|
||||
static inline void dram_wait(unsigned int count)
|
||||
{
|
||||
volatile unsigned int wait = count;
|
||||
|
||||
while (wait--)
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
void mx3_setup_sdram_bank(u32 start_address, u32 ddr2_config,
|
||||
u32 row, u32 col, u32 dsize, u32 refresh)
|
||||
{
|
||||
struct esdc_regs *esdc = (struct esdc_regs *)ESDCTL_BASE_ADDR;
|
||||
u32 *cfg_reg, *ctl_reg;
|
||||
u32 val;
|
||||
u32 ctlval;
|
||||
|
||||
switch (start_address) {
|
||||
case CSD0_BASE_ADDR:
|
||||
cfg_reg = &esdc->esdcfg0;
|
||||
ctl_reg = &esdc->esdctl0;
|
||||
break;
|
||||
case CSD1_BASE_ADDR:
|
||||
cfg_reg = &esdc->esdcfg1;
|
||||
ctl_reg = &esdc->esdctl1;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
/* The MX35 supports 11 up to 14 rows */
|
||||
if (row < 11 || row > 14 || col < 8 || col > 10)
|
||||
return;
|
||||
ctlval = (row - 11) << 24 | (col - 8) << 20 | (dsize << 16);
|
||||
|
||||
/* Initialize MISC register for DDR2 */
|
||||
val = ESDC_MISC_RST | ESDC_MISC_MDDR_EN | ESDC_MISC_MDDR_DL_RST |
|
||||
ESDC_MISC_DDR_EN | ESDC_MISC_DDR2_EN;
|
||||
writel(val, &esdc->esdmisc);
|
||||
val &= ~(ESDC_MISC_RST | ESDC_MISC_MDDR_DL_RST);
|
||||
writel(val, &esdc->esdmisc);
|
||||
|
||||
/*
|
||||
* according to DDR2 specs, wait a while before
|
||||
* the PRECHARGE_ALL command
|
||||
*/
|
||||
dram_wait(0x20000);
|
||||
|
||||
/* Load DDR2 config and timing */
|
||||
writel(ddr2_config, cfg_reg);
|
||||
|
||||
/* Precharge ALL */
|
||||
writel(set_mode(ctlval, 1, SMODE_PRECHARGE),
|
||||
ctl_reg);
|
||||
writel(0xda, start_address + ESDCTL_PRECHARGE);
|
||||
|
||||
/* Load mode */
|
||||
writel(set_mode(ctlval, 1, SMODE_LOAD_REG),
|
||||
ctl_reg);
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_EMR2); /* EMRS2 */
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_EMR3); /* EMRS3 */
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_EN_DLL); /* Enable DLL */
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_RESET_DLL); /* Reset DLL */
|
||||
|
||||
/* Precharge ALL */
|
||||
writel(set_mode(ctlval, 1, SMODE_PRECHARGE),
|
||||
ctl_reg);
|
||||
writel(0xda, start_address + ESDCTL_PRECHARGE);
|
||||
|
||||
/* Set mode auto refresh : at least two refresh are required */
|
||||
writel(set_mode(ctlval, 1, SMODE_AUTO_REFRESH),
|
||||
ctl_reg);
|
||||
writel(0xda, start_address);
|
||||
writel(0xda, start_address);
|
||||
|
||||
writel(set_mode(ctlval, 1, SMODE_LOAD_REG),
|
||||
ctl_reg);
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_MR);
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_OCD_DEFAULT);
|
||||
|
||||
/* OCD mode exit */
|
||||
writeb(0xda, start_address + ESDCTL_DDR2_EN_DLL); /* Enable DLL */
|
||||
|
||||
/* Set normal mode */
|
||||
writel(set_mode(ctlval, 1, SMODE_NORMAL) | refresh,
|
||||
ctl_reg);
|
||||
|
||||
dram_wait(0x20000);
|
||||
|
||||
/* Do not set delay lines, only for MDDR */
|
||||
}
|
||||
22
arch/arm/cpu/arm1136/mx35/relocate.S
Normal file
22
arch/arm/cpu/arm1136/mx35/relocate.S
Normal file
@@ -0,0 +1,22 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* relocate - i.MX35-specific vector relocation
|
||||
*
|
||||
* Copyright (c) 2013 Albert ARIBAUD <albert.u.boot@aribaud.net>
|
||||
*/
|
||||
|
||||
#include <linux/linkage.h>
|
||||
|
||||
/*
|
||||
* The i.MX35 SoC is very specific with respect to exceptions: it
|
||||
* does not provide RAM at the high vectors address (0xFFFF0000),
|
||||
* thus only the low address (0x00000000) is useable; but that is
|
||||
* in ROM, so let's avoid relocating the vectors.
|
||||
*/
|
||||
.section .text.relocate_vectors,"ax",%progbits
|
||||
|
||||
ENTRY(relocate_vectors)
|
||||
|
||||
bx lr
|
||||
|
||||
ENDPROC(relocate_vectors)
|
||||
46
arch/arm/cpu/arm1136/mx35/timer.c
Normal file
46
arch/arm/cpu/arm1136/mx35/timer.c
Normal file
@@ -0,0 +1,46 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2007
|
||||
* Sascha Hauer, Pengutronix
|
||||
*
|
||||
* (C) Copyright 2008-2009 Freescale Semiconductor, Inc.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <init.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/crm_regs.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
/* General purpose timers bitfields */
|
||||
#define GPTCR_SWR (1<<15) /* Software reset */
|
||||
#define GPTCR_FRR (1<<9) /* Freerun / restart */
|
||||
#define GPTCR_CLKSOURCE_32 (4<<6) /* Clock source */
|
||||
#define GPTCR_TEN (1) /* Timer enable */
|
||||
|
||||
/*
|
||||
* nothing really to do with interrupts, just starts up a counter.
|
||||
* The 32KHz 32-bit timer overruns in 134217 seconds
|
||||
*/
|
||||
int timer_init(void)
|
||||
{
|
||||
int i;
|
||||
struct gpt_regs *gpt = (struct gpt_regs *)GPT1_BASE_ADDR;
|
||||
struct ccm_regs *ccm = (struct ccm_regs *)CCM_BASE_ADDR;
|
||||
|
||||
/* setup GP Timer 1 */
|
||||
writel(GPTCR_SWR, &gpt->ctrl);
|
||||
|
||||
writel(readl(&ccm->cgr1) | 3 << MXC_CCM_CGR1_GPT_OFFSET, &ccm->cgr1);
|
||||
|
||||
for (i = 0; i < 100; i++)
|
||||
writel(0, &gpt->ctrl); /* We have no udelay by now */
|
||||
writel(0, &gpt->pre); /* prescaler = 1 */
|
||||
/* Freerun Mode, 32KHz input */
|
||||
writel(readl(&gpt->ctrl) | GPTCR_CLKSOURCE_32 | GPTCR_FRR,
|
||||
&gpt->ctrl);
|
||||
writel(readl(&gpt->ctrl) | GPTCR_TEN, &gpt->ctrl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ reset:
|
||||
msr cpsr,r0
|
||||
|
||||
/* the mask ROM code should have PLL and others stable */
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
@@ -62,7 +62,7 @@ c_runtime_cpu_setup:
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
cpu_init_crit:
|
||||
/*
|
||||
* flush v4 I/D caches
|
||||
@@ -81,7 +81,7 @@ cpu_init_crit:
|
||||
orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT_ONLY)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
|
||||
/*
|
||||
* Jump to board specific initialization... The Mask ROM will have already initialized
|
||||
* basic memory. Go here to bump up clock rate and handle wake up conditions.
|
||||
@@ -91,4 +91,4 @@ cpu_init_crit:
|
||||
mov lr, ip /* restore link */
|
||||
#endif
|
||||
mov pc, lr /* back to my caller */
|
||||
#endif /* !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) */
|
||||
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||
|
||||
@@ -37,8 +37,8 @@ reset:
|
||||
* we do sys-critical inits only at reboot,
|
||||
* not when booting from ram!
|
||||
*/
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) && \
|
||||
!CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT_ONLY)
|
||||
#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
|
||||
!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
@@ -62,8 +62,8 @@ c_runtime_cpu_setup:
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) && \
|
||||
!CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT_ONLY)
|
||||
#if !defined(CONFIG_SKIP_LOWLEVEL_INIT) && \
|
||||
!defined(CONFIG_SKIP_LOWLEVEL_INIT_ONLY)
|
||||
cpu_init_crit:
|
||||
|
||||
mov ip, lr
|
||||
@@ -76,4 +76,4 @@ cpu_init_crit:
|
||||
mov lr, ip
|
||||
|
||||
mov pc, lr
|
||||
#endif /* CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) */
|
||||
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||
|
||||
@@ -7,6 +7,7 @@ extra-y = start.o
|
||||
|
||||
obj-y += cpu.o
|
||||
|
||||
obj-$(CONFIG_EP93XX) += ep93xx/
|
||||
obj-$(CONFIG_IMX) += imx/
|
||||
|
||||
# some files can only build in ARM mode
|
||||
|
||||
19
arch/arm/cpu/arm920t/ep93xx/Makefile
Normal file
19
arch/arm/cpu/arm920t/ep93xx/Makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# Cirrus Logic EP93xx CPU-specific Makefile
|
||||
#
|
||||
# Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
|
||||
#
|
||||
# Copyright (C) 2004, 2005
|
||||
# Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
|
||||
#
|
||||
# Copyright (C) 2006
|
||||
# Dominic Rath <Dominic.Rath@gmx.de>
|
||||
#
|
||||
# Based on an original Makefile, which is
|
||||
#
|
||||
# (C) Copyright 2000, 2001, 2002
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
|
||||
obj-y = cpu.o led.o speed.o timer.o
|
||||
obj-y += lowlevel_init.o
|
||||
37
arch/arm/cpu/arm920t/ep93xx/cpu.c
Normal file
37
arch/arm/cpu/arm920t/ep93xx/cpu.c
Normal file
@@ -0,0 +1,37 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Cirrus Logic EP93xx CPU-specific support.
|
||||
*
|
||||
* Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
|
||||
*
|
||||
* Copyright (C) 2004, 2005
|
||||
* Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <cpu_func.h>
|
||||
#include <asm/arch/ep93xx.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
/* We reset the CPU by generating a 1-->0 transition on DeviceCfg bit 31. */
|
||||
extern void reset_cpu(ulong addr)
|
||||
{
|
||||
struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
|
||||
uint32_t value;
|
||||
|
||||
/* Unlock DeviceCfg and set SWRST */
|
||||
writel(0xAA, &syscon->sysswlock);
|
||||
value = readl(&syscon->devicecfg);
|
||||
value |= SYSCON_DEVICECFG_SWRST;
|
||||
writel(value, &syscon->devicecfg);
|
||||
|
||||
/* Unlock DeviceCfg and clear SWRST */
|
||||
writel(0xAA, &syscon->sysswlock);
|
||||
value = readl(&syscon->devicecfg);
|
||||
value &= ~SYSCON_DEVICECFG_SWRST;
|
||||
writel(value, &syscon->devicecfg);
|
||||
|
||||
/* Dying... */
|
||||
while (1)
|
||||
; /* noop */
|
||||
}
|
||||
85
arch/arm/cpu/arm920t/ep93xx/led.c
Normal file
85
arch/arm/cpu/arm920t/ep93xx/led.c
Normal file
@@ -0,0 +1,85 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2010, 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
|
||||
*/
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/ep93xx.h>
|
||||
#include <config.h>
|
||||
#include <status_led.h>
|
||||
|
||||
static uint8_t saved_state[2] = {CONFIG_LED_STATUS_OFF, CONFIG_LED_STATUS_OFF};
|
||||
static uint32_t gpio_pin[2] = {1 << CONFIG_LED_STATUS_GREEN,
|
||||
1 << CONFIG_LED_STATUS_RED};
|
||||
|
||||
static inline void switch_LED_on(uint8_t led)
|
||||
{
|
||||
register struct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE;
|
||||
|
||||
writel(readl(&gpio->pedr) | gpio_pin[led], &gpio->pedr);
|
||||
saved_state[led] = CONFIG_LED_STATUS_ON;
|
||||
}
|
||||
|
||||
static inline void switch_LED_off(uint8_t led)
|
||||
{
|
||||
register struct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE;
|
||||
|
||||
writel(readl(&gpio->pedr) & ~gpio_pin[led], &gpio->pedr);
|
||||
saved_state[led] = CONFIG_LED_STATUS_OFF;
|
||||
}
|
||||
|
||||
void red_led_on(void)
|
||||
{
|
||||
switch_LED_on(CONFIG_LED_STATUS_RED);
|
||||
}
|
||||
|
||||
void red_led_off(void)
|
||||
{
|
||||
switch_LED_off(CONFIG_LED_STATUS_RED);
|
||||
}
|
||||
|
||||
void green_led_on(void)
|
||||
{
|
||||
switch_LED_on(CONFIG_LED_STATUS_GREEN);
|
||||
}
|
||||
|
||||
void green_led_off(void)
|
||||
{
|
||||
switch_LED_off(CONFIG_LED_STATUS_GREEN);
|
||||
}
|
||||
|
||||
void __led_init(led_id_t mask, int state)
|
||||
{
|
||||
__led_set(mask, state);
|
||||
}
|
||||
|
||||
void __led_toggle(led_id_t mask)
|
||||
{
|
||||
if (CONFIG_LED_STATUS_RED == mask) {
|
||||
if (CONFIG_LED_STATUS_ON == saved_state[CONFIG_LED_STATUS_RED])
|
||||
red_led_off();
|
||||
else
|
||||
red_led_on();
|
||||
} else if (CONFIG_LED_STATUS_GREEN == mask) {
|
||||
if (CONFIG_LED_STATUS_ON ==
|
||||
saved_state[CONFIG_LED_STATUS_GREEN])
|
||||
green_led_off();
|
||||
else
|
||||
green_led_on();
|
||||
}
|
||||
}
|
||||
|
||||
void __led_set(led_id_t mask, int state)
|
||||
{
|
||||
if (CONFIG_LED_STATUS_RED == mask) {
|
||||
if (CONFIG_LED_STATUS_ON == state)
|
||||
red_led_on();
|
||||
else
|
||||
red_led_off();
|
||||
} else if (CONFIG_LED_STATUS_GREEN == mask) {
|
||||
if (CONFIG_LED_STATUS_ON == state)
|
||||
green_led_on();
|
||||
else
|
||||
green_led_off();
|
||||
}
|
||||
}
|
||||
457
arch/arm/cpu/arm920t/ep93xx/lowlevel_init.S
Normal file
457
arch/arm/cpu/arm920t/ep93xx/lowlevel_init.S
Normal file
@@ -0,0 +1,457 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Low-level initialization for EP93xx
|
||||
*
|
||||
* Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
|
||||
* Copyright (C) 2013
|
||||
* Sergey Kostanabev <sergey.kostanbaev <at> fairwaves.ru>
|
||||
*
|
||||
* Copyright (C) 2006 Dominic Rath <Dominic.Rath@gmx.de>
|
||||
* Copyright (C) 2006 Cirrus Logic Inc.
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <asm/arch-ep93xx/ep93xx.h>
|
||||
|
||||
/*
|
||||
/* Configure the SDRAM based on the supplied settings.
|
||||
*
|
||||
* Input: r0 - SDRAM DEVCFG register
|
||||
* r2 - configuration for SDRAM chips
|
||||
* Output: none
|
||||
* Modifies: r3, r4
|
||||
*/
|
||||
ep93xx_sdram_config:
|
||||
/* Program the SDRAM device configuration register. */
|
||||
ldr r3, =SDRAM_BASE
|
||||
#ifdef CONFIG_EDB93XX_SDCS0
|
||||
str r0, [r3, #SDRAM_OFF_DEVCFG0]
|
||||
#endif
|
||||
#ifdef CONFIG_EDB93XX_SDCS1
|
||||
str r0, [r3, #SDRAM_OFF_DEVCFG1]
|
||||
#endif
|
||||
#ifdef CONFIG_EDB93XX_SDCS2
|
||||
str r0, [r3, #SDRAM_OFF_DEVCFG2]
|
||||
#endif
|
||||
#ifdef CONFIG_EDB93XX_SDCS3
|
||||
str r0, [r3, #SDRAM_OFF_DEVCFG3]
|
||||
#endif
|
||||
|
||||
/* Set the Initialize and MRS bits (issue continuous NOP commands
|
||||
* (INIT & MRS set))
|
||||
*/
|
||||
ldr r4, =(EP93XX_SDRAMCTRL_GLOBALCFG_INIT | \
|
||||
EP93XX_SDRAMCTRL_GLOBALCFG_MRS | \
|
||||
EP93XX_SDRAMCTRL_GLOBALCFG_CKE)
|
||||
str r4, [r3, #SDRAM_OFF_GLCONFIG]
|
||||
|
||||
/* Delay for 200us. */
|
||||
mov r4, #0x3000
|
||||
delay1:
|
||||
subs r4, r4, #1
|
||||
bne delay1
|
||||
|
||||
/* Clear the MRS bit to issue a precharge all. */
|
||||
ldr r4, =(EP93XX_SDRAMCTRL_GLOBALCFG_INIT | \
|
||||
EP93XX_SDRAMCTRL_GLOBALCFG_CKE)
|
||||
str r4, [r3, #SDRAM_OFF_GLCONFIG]
|
||||
|
||||
/* Temporarily set the refresh timer to 0x10. Make it really low so
|
||||
* that refresh cycles are generated.
|
||||
*/
|
||||
ldr r4, =0x10
|
||||
str r4, [r3, #SDRAM_OFF_REFRSHTIMR]
|
||||
|
||||
/* Delay for at least 80 SDRAM clock cycles. */
|
||||
mov r4, #80
|
||||
delay2:
|
||||
subs r4, r4, #1
|
||||
bne delay2
|
||||
|
||||
/* Set the refresh timer to the fastest required for any device
|
||||
* that might be used. Set 9.6 ms refresh time.
|
||||
*/
|
||||
ldr r4, =0x01e0
|
||||
str r4, [r3, #SDRAM_OFF_REFRSHTIMR]
|
||||
|
||||
/* Select mode register update mode. */
|
||||
ldr r4, =(EP93XX_SDRAMCTRL_GLOBALCFG_CKE | \
|
||||
EP93XX_SDRAMCTRL_GLOBALCFG_MRS)
|
||||
str r4, [r3, #SDRAM_OFF_GLCONFIG]
|
||||
|
||||
/* Program the mode register on the SDRAM by performing fake read */
|
||||
ldr r4, [r2]
|
||||
|
||||
/* Select normal operating mode. */
|
||||
ldr r4, =EP93XX_SDRAMCTRL_GLOBALCFG_CKE
|
||||
str r4, [r3, #SDRAM_OFF_GLCONFIG]
|
||||
|
||||
/* Return to the caller. */
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
* Test to see if the SDRAM has been configured in a usable mode.
|
||||
*
|
||||
* Input: r0 - Test address of SDRAM
|
||||
* Output: r0 - 0 -- Test OK, -1 -- Failed
|
||||
* Modifies: r0-r5
|
||||
*/
|
||||
ep93xx_sdram_test:
|
||||
/* Load the test patterns to be written to SDRAM. */
|
||||
ldr r1, =0xf00dface
|
||||
ldr r2, =0xdeadbeef
|
||||
ldr r3, =0x08675309
|
||||
ldr r4, =0xdeafc0ed
|
||||
|
||||
/* Store the test patterns to SDRAM. */
|
||||
stmia r0, {r1-r4}
|
||||
|
||||
/* Load the test patterns from SDRAM one at a time and compare them
|
||||
* to the actual pattern.
|
||||
*/
|
||||
ldr r5, [r0]
|
||||
cmp r5, r1
|
||||
ldreq r5, [r0, #0x0004]
|
||||
cmpeq r5, r2
|
||||
ldreq r5, [r0, #0x0008]
|
||||
cmpeq r5, r3
|
||||
ldreq r5, [r0, #0x000c]
|
||||
cmpeq r5, r4
|
||||
|
||||
/* Return -1 if a mismatch was encountered, 0 otherwise. */
|
||||
mvnne r0, #0xffffffff
|
||||
moveq r0, #0x00000000
|
||||
|
||||
/* Return to the caller. */
|
||||
mov pc, lr
|
||||
|
||||
/*
|
||||
* Determine the size of the SDRAM. Use data=address for the scan.
|
||||
*
|
||||
* Input: r0 - Start SDRAM address
|
||||
* Return: r0 - Single block size
|
||||
* r1 - Valid block mask
|
||||
* r2 - Total block count
|
||||
* Modifies: r0-r5
|
||||
*/
|
||||
ep93xx_sdram_size:
|
||||
/* Store zero at offset zero. */
|
||||
str r0, [r0]
|
||||
|
||||
/* Start checking for an alias at 1MB into SDRAM. */
|
||||
ldr r1, =0x00100000
|
||||
|
||||
/* Store the offset at the current offset. */
|
||||
check_block_size:
|
||||
str r1, [r0, r1]
|
||||
|
||||
/* Read back from zero. */
|
||||
ldr r2, [r0]
|
||||
|
||||
/* Stop searching of an alias was found. */
|
||||
cmp r1, r2
|
||||
beq found_block_size
|
||||
|
||||
/* Advance to the next power of two boundary. */
|
||||
mov r1, r1, lsl #1
|
||||
|
||||
/* Loop back if the size has not reached 256MB. */
|
||||
cmp r1, #0x10000000
|
||||
bne check_block_size
|
||||
|
||||
/* A full 256MB of memory was found, so return it now. */
|
||||
ldr r0, =0x10000000
|
||||
ldr r1, =0x00000000
|
||||
ldr r2, =0x00000001
|
||||
mov pc, lr
|
||||
|
||||
/* An alias was found. See if the first block is 128MB in size. */
|
||||
found_block_size:
|
||||
cmp r1, #0x08000000
|
||||
|
||||
/* The first block is 128MB, so there is no further memory. Return it
|
||||
* now.
|
||||
*/
|
||||
ldreq r0, =0x08000000
|
||||
ldreq r1, =0x00000000
|
||||
ldreq r2, =0x00000001
|
||||
moveq pc, lr
|
||||
|
||||
/* Save the block size, set the block address bits to zero, and
|
||||
* initialize the block count to one.
|
||||
*/
|
||||
mov r3, r1
|
||||
ldr r4, =0x00000000
|
||||
ldr r5, =0x00000001
|
||||
|
||||
/* Look for additional blocks of memory by searching for non-aliases. */
|
||||
find_blocks:
|
||||
/* Store zero back to address zero. It may be overwritten. */
|
||||
str r0, [r0]
|
||||
|
||||
/* Advance to the next power of two boundary. */
|
||||
mov r1, r1, lsl #1
|
||||
|
||||
/* Store the offset at the current offset. */
|
||||
str r1, [r0, r1]
|
||||
|
||||
/* Read back from zero. */
|
||||
ldr r2, [r0]
|
||||
|
||||
/* See if a non-alias was found. */
|
||||
cmp r1, r2
|
||||
|
||||
/* If a non-alias was found, then or in the block address bit and
|
||||
* multiply the block count by two (since there are two unique
|
||||
* blocks, one with this bit zero and one with it one).
|
||||
*/
|
||||
orrne r4, r4, r1
|
||||
movne r5, r5, lsl #1
|
||||
|
||||
/* Continue searching if there are more address bits to check. */
|
||||
cmp r1, #0x08000000
|
||||
bne find_blocks
|
||||
|
||||
/* Return the block size, address mask, and count. */
|
||||
mov r0, r3
|
||||
mov r1, r4
|
||||
mov r2, r5
|
||||
|
||||
/* Return to the caller. */
|
||||
mov pc, lr
|
||||
|
||||
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
|
||||
mov r6, lr
|
||||
|
||||
/* Make sure caches are off and invalidated. */
|
||||
ldr r0, =0x00000000
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
/* Turn off the green LED and turn on the red LED. If the red LED
|
||||
* is left on for too long, the external reset circuit described
|
||||
* by application note AN258 will cause the system to reset.
|
||||
*/
|
||||
ldr r1, =EP93XX_LED_DATA
|
||||
ldr r0, [r1]
|
||||
bic r0, r0, #EP93XX_LED_GREEN_ON
|
||||
orr r0, r0, #EP93XX_LED_RED_ON
|
||||
str r0, [r1]
|
||||
|
||||
/* Undo the silly static memory controller programming performed
|
||||
* by the boot rom.
|
||||
*/
|
||||
ldr r0, =SMC_BASE
|
||||
|
||||
/* Set WST1 and WST2 to 31 HCLK cycles (slowest access) */
|
||||
ldr r1, =0x0000fbe0
|
||||
|
||||
/* Reset EP93XX_OFF_SMCBCR0 */
|
||||
ldr r2, [r0]
|
||||
orr r2, r2, r1
|
||||
str r2, [r0]
|
||||
|
||||
ldr r2, [r0, #EP93XX_OFF_SMCBCR1]
|
||||
orr r2, r2, r1
|
||||
str r2, [r0, #EP93XX_OFF_SMCBCR1]
|
||||
|
||||
ldr r2, [r0, #EP93XX_OFF_SMCBCR2]
|
||||
orr r2, r2, r1
|
||||
str r2, [r0, #EP93XX_OFF_SMCBCR2]
|
||||
|
||||
ldr r2, [r0, #EP93XX_OFF_SMCBCR3]
|
||||
orr r2, r2, r1
|
||||
str r2, [r0, #EP93XX_OFF_SMCBCR3]
|
||||
|
||||
ldr r2, [r0, #EP93XX_OFF_SMCBCR6]
|
||||
orr r2, r2, r1
|
||||
str r2, [r0, #EP93XX_OFF_SMCBCR6]
|
||||
|
||||
ldr r2, [r0, #EP93XX_OFF_SMCBCR7]
|
||||
orr r2, r2, r1
|
||||
str r2, [r0, #EP93XX_OFF_SMCBCR7]
|
||||
|
||||
/* Set the PLL1 and processor clock. */
|
||||
ldr r0, =SYSCON_BASE
|
||||
#ifdef CONFIG_EDB9301
|
||||
/* 332MHz, giving a 166MHz processor clock. */
|
||||
ldr r1, = 0x02b49907
|
||||
#else
|
||||
|
||||
#ifdef CONFIG_EDB93XX_INDUSTRIAL
|
||||
/* 384MHz, giving a 196MHz processor clock. */
|
||||
ldr r1, =0x02a4bb38
|
||||
#else
|
||||
/* 400MHz, giving a 200MHz processor clock. */
|
||||
ldr r1, =0x02a4e39e
|
||||
#endif
|
||||
#endif
|
||||
str r1, [r0, #SYSCON_OFF_CLKSET1]
|
||||
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
/* Need to make sure that SDRAM is configured correctly before
|
||||
* coping the code into it.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_EDB93XX_SDCS0
|
||||
mov r11, #SDRAM_DEVCFG0_BASE
|
||||
#endif
|
||||
#ifdef CONFIG_EDB93XX_SDCS1
|
||||
mov r11, #SDRAM_DEVCFG1_BASE
|
||||
#endif
|
||||
#ifdef CONFIG_EDB93XX_SDCS2
|
||||
mov r11, #SDRAM_DEVCFG2_BASE
|
||||
#endif
|
||||
#ifdef CONFIG_EDB93XX_SDCS3
|
||||
ldr r0, =SYSCON_BASE
|
||||
ldr r0, [r0, #SYSCON_OFF_SYSCFG]
|
||||
ands r0, r0, #SYSCON_SYSCFG_LASDO
|
||||
moveq r11, #SDRAM_DEVCFG3_ASD0_BASE
|
||||
movne r11, #SDRAM_DEVCFG3_ASD1_BASE
|
||||
#endif
|
||||
/* See Table 13-5 in EP93xx datasheet for more info about DRAM
|
||||
* register mapping */
|
||||
|
||||
/* Try a 32-bit wide configuration of SDRAM. */
|
||||
ldr r0, =(EP93XX_SDRAMCTRL_DEVCFG_BANKCOUNT | \
|
||||
EP93XX_SDRAMCTRL_DEVCFG_SROMLL | \
|
||||
EP93XX_SDRAMCTRL_DEVCFG_CASLAT_2 | \
|
||||
EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_2)
|
||||
|
||||
/* Set burst count: 4 and CAS: 2
|
||||
* Burst mode [A11:A10]; CAS [A16:A14]
|
||||
*/
|
||||
orr r2, r11, #0x00008800
|
||||
bl ep93xx_sdram_config
|
||||
|
||||
/* Test the SDRAM. */
|
||||
mov r0, r11
|
||||
bl ep93xx_sdram_test
|
||||
cmp r0, #0x00000000
|
||||
beq ep93xx_sdram_done
|
||||
|
||||
/* Try a 16-bit wide configuration of SDRAM. */
|
||||
ldr r0, =(EP93XX_SDRAMCTRL_DEVCFG_BANKCOUNT | \
|
||||
EP93XX_SDRAMCTRL_DEVCFG_SROMLL | \
|
||||
EP93XX_SDRAMCTRL_DEVCFG_CASLAT_2 | \
|
||||
EP93XX_SDRAMCTRL_DEVCFG_RASTOCAS_2 | \
|
||||
EP93XX_SDRAMCTRL_DEVCFG_EXTBUSWIDTH)
|
||||
|
||||
/* Set burst count: 8, CAS: 2, sequential burst
|
||||
* Accoring to Table 13-3 for 16bit operations mapping must be shifted.
|
||||
* Burst mode [A10:A9]; CAS [A15:A13]
|
||||
*/
|
||||
orr r2, r11, #0x00004600
|
||||
bl ep93xx_sdram_config
|
||||
|
||||
/* Test the SDRAM. */
|
||||
mov r0, r11
|
||||
bl ep93xx_sdram_test
|
||||
cmp r0, #0x00000000
|
||||
beq ep93xx_sdram_done
|
||||
|
||||
/* Turn off the red LED. */
|
||||
ldr r0, =EP93XX_LED_DATA
|
||||
ldr r1, [r0]
|
||||
bic r1, r1, #EP93XX_LED_RED_ON
|
||||
str r1, [r0]
|
||||
|
||||
/* There is no SDRAM so flash the green LED. */
|
||||
flash_green:
|
||||
orr r1, r1, #EP93XX_LED_GREEN_ON
|
||||
str r1, [r0]
|
||||
ldr r2, =0x00010000
|
||||
flash_green_delay_1:
|
||||
subs r2, r2, #1
|
||||
bne flash_green_delay_1
|
||||
bic r1, r1, #EP93XX_LED_GREEN_ON
|
||||
str r1, [r0]
|
||||
ldr r2, =0x00010000
|
||||
flash_green_delay_2:
|
||||
subs r2, r2, #1
|
||||
bne flash_green_delay_2
|
||||
orr r1, r1, #EP93XX_LED_GREEN_ON
|
||||
str r1, [r0]
|
||||
ldr r2, =0x00010000
|
||||
flash_green_delay_3:
|
||||
subs r2, r2, #1
|
||||
bne flash_green_delay_3
|
||||
bic r1, r1, #EP93XX_LED_GREEN_ON
|
||||
str r1, [r0]
|
||||
ldr r2, =0x00050000
|
||||
flash_green_delay_4:
|
||||
subs r2, r2, #1
|
||||
bne flash_green_delay_4
|
||||
b flash_green
|
||||
|
||||
|
||||
ep93xx_sdram_done:
|
||||
ldr r1, =EP93XX_LED_DATA
|
||||
ldr r0, [r1]
|
||||
bic r0, r0, #EP93XX_LED_RED_ON
|
||||
str r0, [r1]
|
||||
|
||||
/* Determine the size of the SDRAM. */
|
||||
mov r0, r11
|
||||
bl ep93xx_sdram_size
|
||||
|
||||
/* Save the SDRAM characteristics. */
|
||||
mov r8, r0
|
||||
mov r9, r1
|
||||
mov r10, r2
|
||||
|
||||
/* Compute total memory size into r1 */
|
||||
mul r1, r8, r10
|
||||
#ifdef CONFIG_EDB93XX_SDCS0
|
||||
ldr r2, [r0, #SDRAM_OFF_DEVCFG0]
|
||||
#endif
|
||||
#ifdef CONFIG_EDB93XX_SDCS1
|
||||
ldr r2, [r0, #SDRAM_OFF_DEVCFG1]
|
||||
#endif
|
||||
#ifdef CONFIG_EDB93XX_SDCS2
|
||||
ldr r2, [r0, #SDRAM_OFF_DEVCFG2]
|
||||
#endif
|
||||
#ifdef CONFIG_EDB93XX_SDCS3
|
||||
ldr r2, [r0, #SDRAM_OFF_DEVCFG3]
|
||||
#endif
|
||||
|
||||
/* Consider small DRAM size as:
|
||||
* < 32Mb for 32bit bus
|
||||
* < 64Mb for 16bit bus
|
||||
*/
|
||||
tst r2, #EP93XX_SDRAMCTRL_DEVCFG_EXTBUSWIDTH
|
||||
moveq r1, r1, lsr #1
|
||||
cmp r1, #0x02000000
|
||||
|
||||
#if defined(CONFIG_EDB9301)
|
||||
/* Set refresh counter to 20ms for small DRAM size, otherwise 9.6ms */
|
||||
movlt r1, #0x03f0
|
||||
movge r1, #0x01e0
|
||||
#else
|
||||
/* Set refresh counter to 30.7ms for small DRAM size, otherwise 15ms */
|
||||
movlt r1, #0x0600
|
||||
movge r1, #0x2f0
|
||||
#endif
|
||||
str r1, [r0, #SDRAM_OFF_REFRSHTIMR]
|
||||
|
||||
/* Save the memory configuration information. */
|
||||
orr r0, r11, #UBOOT_MEMORYCNF_BANK_SIZE
|
||||
stmia r0, {r8-r11}
|
||||
|
||||
mov lr, r6
|
||||
mov pc, lr
|
||||
95
arch/arm/cpu/arm920t/ep93xx/speed.c
Normal file
95
arch/arm/cpu/arm920t/ep93xx/speed.c
Normal file
@@ -0,0 +1,95 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Cirrus Logic EP93xx PLL support.
|
||||
*
|
||||
* Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/arch/ep93xx.h>
|
||||
#include <asm/io.h>
|
||||
#include <div64.h>
|
||||
|
||||
/*
|
||||
* CONFIG_SYS_CLK_FREQ should be defined as the input frequency of the PLL.
|
||||
*
|
||||
* get_FCLK(), get_HCLK(), get_PCLK() and get_UCLK() return the clock of
|
||||
* the specified bus in HZ.
|
||||
*/
|
||||
|
||||
/*
|
||||
* return the PLL output frequency
|
||||
*
|
||||
* PLL rate = CONFIG_SYS_CLK_FREQ * (X1FBD + 1) * (X2FBD + 1)
|
||||
* / (X2IPD + 1) / 2^PS
|
||||
*/
|
||||
static ulong get_PLLCLK(uint32_t *pllreg)
|
||||
{
|
||||
uint8_t i;
|
||||
const uint32_t clkset = readl(pllreg);
|
||||
uint64_t rate = CONFIG_SYS_CLK_FREQ;
|
||||
rate *= ((clkset >> SYSCON_CLKSET_PLL_X1FBD1_SHIFT) & 0x1f) + 1;
|
||||
rate *= ((clkset >> SYSCON_CLKSET_PLL_X2FBD2_SHIFT) & 0x3f) + 1;
|
||||
do_div(rate, (clkset & 0x1f) + 1); /* X2IPD */
|
||||
for (i = 0; i < ((clkset >> SYSCON_CLKSET_PLL_PS_SHIFT) & 3); i++)
|
||||
rate >>= 1;
|
||||
|
||||
return (ulong)rate;
|
||||
}
|
||||
|
||||
/* return FCLK frequency */
|
||||
ulong get_FCLK(void)
|
||||
{
|
||||
const uint8_t fclk_divisors[] = { 1, 2, 4, 8, 16, 1, 1, 1 };
|
||||
struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
|
||||
|
||||
const uint32_t clkset1 = readl(&syscon->clkset1);
|
||||
const uint8_t fclk_div =
|
||||
fclk_divisors[(clkset1 >> SYSCON_CLKSET1_FCLK_DIV_SHIFT) & 7];
|
||||
const ulong fclk_rate = get_PLLCLK(&syscon->clkset1) / fclk_div;
|
||||
|
||||
return fclk_rate;
|
||||
}
|
||||
|
||||
/* return HCLK frequency */
|
||||
ulong get_HCLK(void)
|
||||
{
|
||||
const uint8_t hclk_divisors[] = { 1, 2, 4, 5, 6, 8, 16, 32 };
|
||||
struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
|
||||
|
||||
const uint32_t clkset1 = readl(&syscon->clkset1);
|
||||
const uint8_t hclk_div =
|
||||
hclk_divisors[(clkset1 >> SYSCON_CLKSET1_HCLK_DIV_SHIFT) & 7];
|
||||
const ulong hclk_rate = get_PLLCLK(&syscon->clkset1) / hclk_div;
|
||||
|
||||
return hclk_rate;
|
||||
}
|
||||
|
||||
/* return PCLK frequency */
|
||||
ulong get_PCLK(void)
|
||||
{
|
||||
const uint8_t pclk_divisors[] = { 1, 2, 4, 8 };
|
||||
struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
|
||||
|
||||
const uint32_t clkset1 = readl(&syscon->clkset1);
|
||||
const uint8_t pclk_div =
|
||||
pclk_divisors[(clkset1 >> SYSCON_CLKSET1_PCLK_DIV_SHIFT) & 3];
|
||||
const ulong pclk_rate = get_HCLK() / pclk_div;
|
||||
|
||||
return pclk_rate;
|
||||
}
|
||||
|
||||
/* return UCLK frequency */
|
||||
ulong get_UCLK(void)
|
||||
{
|
||||
struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
|
||||
ulong uclk_rate;
|
||||
|
||||
const uint32_t value = readl(&syscon->pwrcnt);
|
||||
if (value & SYSCON_PWRCNT_UART_BAUD)
|
||||
uclk_rate = CONFIG_SYS_CLK_FREQ;
|
||||
else
|
||||
uclk_rate = CONFIG_SYS_CLK_FREQ / 2;
|
||||
|
||||
return uclk_rate;
|
||||
}
|
||||
117
arch/arm/cpu/arm920t/ep93xx/timer.c
Normal file
117
arch/arm/cpu/arm920t/ep93xx/timer.c
Normal file
@@ -0,0 +1,117 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Cirrus Logic EP93xx timer support.
|
||||
*
|
||||
* Copyright (C) 2009, 2010 Matthias Kaehlcke <matthias@kaehlcke.net>
|
||||
*
|
||||
* Copyright (C) 2004, 2005
|
||||
* Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
|
||||
*
|
||||
* Based on the original intr.c Cirrus Logic EP93xx Rev D. interrupt support,
|
||||
* author unknown.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <init.h>
|
||||
#include <time.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/arch/ep93xx.h>
|
||||
#include <asm/io.h>
|
||||
#include <div64.h>
|
||||
|
||||
#define TIMER_CLKSEL (1 << 3)
|
||||
#define TIMER_ENABLE (1 << 7)
|
||||
|
||||
#define TIMER_FREQ 508469 /* ticks / second */
|
||||
#define TIMER_MAX_VAL 0xFFFFFFFF
|
||||
|
||||
static struct ep93xx_timer
|
||||
{
|
||||
unsigned long long ticks;
|
||||
unsigned long last_read;
|
||||
} timer;
|
||||
|
||||
static inline unsigned long long usecs_to_ticks(unsigned long usecs)
|
||||
{
|
||||
unsigned long long ticks = (unsigned long long)usecs * TIMER_FREQ;
|
||||
do_div(ticks, 1000 * 1000);
|
||||
|
||||
return ticks;
|
||||
}
|
||||
|
||||
static inline void read_timer(void)
|
||||
{
|
||||
struct timer_regs *timer_regs = (struct timer_regs *)TIMER_BASE;
|
||||
const unsigned long now = TIMER_MAX_VAL - readl(&timer_regs->timer3.value);
|
||||
|
||||
if (now >= timer.last_read)
|
||||
timer.ticks += now - timer.last_read;
|
||||
else
|
||||
/* an overflow occurred */
|
||||
timer.ticks += TIMER_MAX_VAL - timer.last_read + now;
|
||||
|
||||
timer.last_read = now;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the number of ticks (in CONFIG_SYS_HZ resolution)
|
||||
*/
|
||||
unsigned long long get_ticks(void)
|
||||
{
|
||||
unsigned long long sys_ticks;
|
||||
|
||||
read_timer();
|
||||
|
||||
sys_ticks = timer.ticks * CONFIG_SYS_HZ;
|
||||
do_div(sys_ticks, TIMER_FREQ);
|
||||
|
||||
return sys_ticks;
|
||||
}
|
||||
|
||||
unsigned long get_timer(unsigned long base)
|
||||
{
|
||||
return get_ticks() - base;
|
||||
}
|
||||
|
||||
void __udelay(unsigned long usec)
|
||||
{
|
||||
unsigned long long target;
|
||||
|
||||
read_timer();
|
||||
|
||||
target = timer.ticks + usecs_to_ticks(usec);
|
||||
|
||||
while (timer.ticks < target)
|
||||
read_timer();
|
||||
}
|
||||
|
||||
int timer_init(void)
|
||||
{
|
||||
struct timer_regs *timer_regs = (struct timer_regs *)TIMER_BASE;
|
||||
|
||||
/* use timer 3 with 508KHz and free running, not enabled now */
|
||||
writel(TIMER_CLKSEL, &timer_regs->timer3.control);
|
||||
|
||||
/* set initial timer value */
|
||||
writel(TIMER_MAX_VAL, &timer_regs->timer3.load);
|
||||
|
||||
/* Enable the timer */
|
||||
writel(TIMER_ENABLE | TIMER_CLKSEL,
|
||||
&timer_regs->timer3.control);
|
||||
|
||||
/* Reset the timer */
|
||||
read_timer();
|
||||
timer.ticks = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is derived from PowerPC code (timebase clock frequency).
|
||||
* On ARM it returns the number of timer ticks per second.
|
||||
*/
|
||||
unsigned long get_tbclk(void)
|
||||
{
|
||||
return CONFIG_SYS_HZ;
|
||||
}
|
||||
@@ -7,14 +7,13 @@
|
||||
|
||||
#include <common.h>
|
||||
#if defined (CONFIG_IMX)
|
||||
#include <clock_legacy.h>
|
||||
|
||||
#include <asm/arch/imx-regs.h>
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* NOTE: This describes the proper use of this file.
|
||||
*
|
||||
* get_board_sys_clk() should be defined as the input frequency of the PLL.
|
||||
* CONFIG_SYS_CLK_FREQ should be defined as the input frequency of the PLL.
|
||||
* SH FIXME: 16780000 in our case
|
||||
* get_FCLK(), get_HCLK(), get_PCLK() and get_UCLK() return the clock of
|
||||
* the specified bus in HZ.
|
||||
@@ -46,7 +45,7 @@ ulong get_mcuPLLCLK(void)
|
||||
|
||||
mfi = mfi<=5 ? 5 : mfi;
|
||||
|
||||
return (2*(get_board_sys_clk()>>10)*( (mfi<<10) + (mfn<<10)/(mfd+1)))/(pd+1);
|
||||
return (2*(CONFIG_SYS_CLK_FREQ>>10)*( (mfi<<10) + (mfn<<10)/(mfd+1)))/(pd+1);
|
||||
}
|
||||
|
||||
ulong get_FCLK(void)
|
||||
|
||||
@@ -81,7 +81,7 @@ ulong get_tbclk(void)
|
||||
/*
|
||||
* Reset the cpu by setting up the watchdog timer and let him time out
|
||||
*/
|
||||
void reset_cpu(void)
|
||||
void reset_cpu(ulong ignored)
|
||||
{
|
||||
/* Disable watchdog and set Time-Out field to 0 */
|
||||
WCR = 0x00000000;
|
||||
|
||||
@@ -35,11 +35,25 @@ reset:
|
||||
orr r0, r0, #0xd3
|
||||
msr cpsr, r0
|
||||
|
||||
#if defined(CONFIG_AT91RM9200DK) || defined(CONFIG_AT91RM9200EK)
|
||||
/*
|
||||
* relocate exception table
|
||||
*/
|
||||
ldr r0, =_start
|
||||
ldr r1, =0x0
|
||||
mov r2, #16
|
||||
copyex:
|
||||
subs r2, r2, #1
|
||||
ldr r3, [r0], #4
|
||||
str r3, [r1], #4
|
||||
bne copyex
|
||||
#endif
|
||||
|
||||
/*
|
||||
* we do sys-critical inits only at reboot,
|
||||
* not when booting from ram!
|
||||
*/
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
@@ -64,7 +78,7 @@ c_runtime_cpu_setup:
|
||||
*/
|
||||
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
cpu_init_crit:
|
||||
/*
|
||||
* flush v4 I/D caches
|
||||
@@ -83,7 +97,7 @@ cpu_init_crit:
|
||||
orr r0, r0, #0x00001000 @ set bit 12 (I) I-Cache
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT_ONLY)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
|
||||
/*
|
||||
* before relocating, we have to setup RAM timing
|
||||
* because memory timing is board-dependend, you will
|
||||
@@ -95,4 +109,4 @@ cpu_init_crit:
|
||||
mov lr, ip
|
||||
#endif
|
||||
mov pc, lr
|
||||
#endif /* CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) */
|
||||
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||
|
||||
@@ -12,10 +12,11 @@ extra-y :=
|
||||
endif
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_ARMADA100) += armada100/
|
||||
obj-$(CONFIG_MX25) += mx25/
|
||||
obj-$(CONFIG_MX27) += mx27/
|
||||
obj-$(if $(filter mxs,$(SOC)),y) += mxs/
|
||||
obj-$(if $(filter spear,$(SOC)),y) += spear/
|
||||
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
|
||||
|
||||
# some files can only build in ARM or THUMB2, not THUMB1
|
||||
|
||||
@@ -24,8 +25,6 @@ ifndef CONFIG_HAS_THUMB2
|
||||
|
||||
CFLAGS_cpu.o := -marm
|
||||
CFLAGS_cache.o := -marm
|
||||
CFLAGS_REMOVE_cpu.o := $(LTO_CFLAGS)
|
||||
CFLAGS_REMOVE_cache.o := $(LTO_CFLAGS)
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
7
arch/arm/cpu/arm926ejs/armada100/Makefile
Normal file
7
arch/arm/cpu/arm926ejs/armada100/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# (C) Copyright 2010
|
||||
# Marvell Semiconductor <www.marvell.com>
|
||||
# Written-by: Prafulla Wadaskar <prafulla@marvell.com>
|
||||
|
||||
obj-y = cpu.o timer.o dram.o
|
||||
93
arch/arm/cpu/arm926ejs/armada100/cpu.c
Normal file
93
arch/arm/cpu/arm926ejs/armada100/cpu.c
Normal file
@@ -0,0 +1,93 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2010
|
||||
* Marvell Semiconductor <www.marvell.com>
|
||||
* Written-by: Prafulla Wadaskar <prafulla@marvell.com>
|
||||
* Contributor: Mahavir Jain <mjain@marvell.com>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <cpu_func.h>
|
||||
#include <init.h>
|
||||
#include <asm/arch/cpu.h>
|
||||
#include <asm/arch/armada100.h>
|
||||
|
||||
#define UARTCLK14745KHZ (APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1))
|
||||
#define SET_MRVL_ID (1<<8)
|
||||
#define L2C_RAM_SEL (1<<4)
|
||||
|
||||
int arch_cpu_init(void)
|
||||
{
|
||||
u32 val;
|
||||
struct armd1cpu_registers *cpuregs =
|
||||
(struct armd1cpu_registers *) ARMD1_CPU_BASE;
|
||||
|
||||
struct armd1apb1_registers *apb1clkres =
|
||||
(struct armd1apb1_registers *) ARMD1_APBC1_BASE;
|
||||
|
||||
struct armd1mpmu_registers *mpmu =
|
||||
(struct armd1mpmu_registers *) ARMD1_MPMU_BASE;
|
||||
|
||||
/* set SEL_MRVL_ID bit in ARMADA100_CPU_CONF register */
|
||||
val = readl(&cpuregs->cpu_conf);
|
||||
val = val | SET_MRVL_ID;
|
||||
writel(val, &cpuregs->cpu_conf);
|
||||
|
||||
/* Enable Clocks for all hardware units */
|
||||
writel(0xFFFFFFFF, &mpmu->acgr);
|
||||
|
||||
/* Turn on AIB and AIB-APB Functional clock */
|
||||
writel(APBC_APBCLK | APBC_FNCLK, &apb1clkres->aib);
|
||||
|
||||
/* ensure L2 cache is not mapped as SRAM */
|
||||
val = readl(&cpuregs->cpu_conf);
|
||||
val = val & ~(L2C_RAM_SEL);
|
||||
writel(val, &cpuregs->cpu_conf);
|
||||
|
||||
/* Enable GPIO clock */
|
||||
writel(APBC_APBCLK, &apb1clkres->gpio);
|
||||
|
||||
#ifdef CONFIG_I2C_MV
|
||||
/* Enable general I2C clock */
|
||||
writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi0);
|
||||
writel(APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi0);
|
||||
|
||||
/* Enable power I2C clock */
|
||||
writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi1);
|
||||
writel(APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi1);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enable Functional and APB clock at 14.7456MHz
|
||||
* for configured UART console
|
||||
*/
|
||||
#if (CONFIG_SYS_NS16550_COM1 == ARMD1_UART3_BASE)
|
||||
writel(UARTCLK14745KHZ, &apb1clkres->uart3);
|
||||
#elif (CONFIG_SYS_NS16550_COM1 == ARMD1_UART2_BASE)
|
||||
writel(UARTCLK14745KHZ, &apb1clkres->uart2);
|
||||
#else
|
||||
writel(UARTCLK14745KHZ, &apb1clkres->uart1);
|
||||
#endif
|
||||
icache_enable();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
u32 id;
|
||||
struct armd1cpu_registers *cpuregs =
|
||||
(struct armd1cpu_registers *) ARMD1_CPU_BASE;
|
||||
|
||||
id = readl(&cpuregs->chip_id);
|
||||
printf("SoC: Armada 88AP%X-%X\n", (id & 0xFFF), (id >> 0x10));
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_I2C_MV
|
||||
void i2c_clk_enable(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
117
arch/arm/cpu/arm926ejs/armada100/dram.c
Normal file
117
arch/arm/cpu/arm926ejs/armada100/dram.c
Normal file
@@ -0,0 +1,117 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2010
|
||||
* Marvell Semiconductor <www.marvell.com>
|
||||
* Written-by: Prafulla Wadaskar <prafulla@marvell.com>,
|
||||
* Contributor: Mahavir Jain <mjain@marvell.com>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <init.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/armada100.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/*
|
||||
* ARMADA100 DRAM controller supports upto 8 banks
|
||||
* for chip select 0 and 1
|
||||
*/
|
||||
|
||||
/*
|
||||
* DDR Memory Control Registers
|
||||
* Refer Datasheet Appendix A.17
|
||||
*/
|
||||
struct armd1ddr_map_registers {
|
||||
u32 cs; /* Memory Address Map Register -CS */
|
||||
u32 pad[3];
|
||||
};
|
||||
|
||||
struct armd1ddr_registers {
|
||||
u8 pad[0x100 - 0x000];
|
||||
struct armd1ddr_map_registers mmap[2];
|
||||
};
|
||||
|
||||
/*
|
||||
* armd1_sdram_base - reads SDRAM Base Address Register
|
||||
*/
|
||||
u32 armd1_sdram_base(int chip_sel)
|
||||
{
|
||||
struct armd1ddr_registers *ddr_regs =
|
||||
(struct armd1ddr_registers *)ARMD1_DRAM_BASE;
|
||||
u32 result = 0;
|
||||
u32 CS_valid = 0x01 & readl(&ddr_regs->mmap[chip_sel].cs);
|
||||
|
||||
if (!CS_valid)
|
||||
return 0;
|
||||
|
||||
result = readl(&ddr_regs->mmap[chip_sel].cs) & 0xFF800000;
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* armd1_sdram_size - reads SDRAM size
|
||||
*/
|
||||
u32 armd1_sdram_size(int chip_sel)
|
||||
{
|
||||
struct armd1ddr_registers *ddr_regs =
|
||||
(struct armd1ddr_registers *)ARMD1_DRAM_BASE;
|
||||
u32 result = 0;
|
||||
u32 CS_valid = 0x01 & readl(&ddr_regs->mmap[chip_sel].cs);
|
||||
|
||||
if (!CS_valid)
|
||||
return 0;
|
||||
|
||||
result = readl(&ddr_regs->mmap[chip_sel].cs);
|
||||
result = (result >> 16) & 0xF;
|
||||
if (result < 0x7) {
|
||||
printf("Unknown DRAM Size\n");
|
||||
return -1;
|
||||
} else {
|
||||
return ((0x8 << (result - 0x7)) * 1024 * 1024);
|
||||
}
|
||||
}
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
gd->ram_size = 0;
|
||||
for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
|
||||
gd->bd->bi_dram[i].start = armd1_sdram_base(i);
|
||||
gd->bd->bi_dram[i].size = armd1_sdram_size(i);
|
||||
/*
|
||||
* It is assumed that all memory banks are consecutive
|
||||
* and without gaps.
|
||||
* If the gap is found, ram_size will be reported for
|
||||
* consecutive memory only
|
||||
*/
|
||||
if (gd->bd->bi_dram[i].start != gd->ram_size)
|
||||
break;
|
||||
|
||||
gd->ram_size += gd->bd->bi_dram[i].size;
|
||||
|
||||
}
|
||||
|
||||
for (; i < CONFIG_NR_DRAM_BANKS; i++) {
|
||||
/* If above loop terminated prematurely, we need to set
|
||||
* remaining banks' start address & size as 0. Otherwise other
|
||||
* u-boot functions and Linux kernel gets wrong values which
|
||||
* could result in crash */
|
||||
gd->bd->bi_dram[i].start = 0;
|
||||
gd->bd->bi_dram[i].size = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* If this function is not defined here,
|
||||
* board.c alters dram bank zero configuration defined above.
|
||||
*/
|
||||
int dram_init_banksize(void)
|
||||
{
|
||||
dram_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
198
arch/arm/cpu/arm926ejs/armada100/timer.c
Normal file
198
arch/arm/cpu/arm926ejs/armada100/timer.c
Normal file
@@ -0,0 +1,198 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2010
|
||||
* Marvell Semiconductor <www.marvell.com>
|
||||
* Written-by: Prafulla Wadaskar <prafulla@marvell.com>
|
||||
* Contributor: Mahavir Jain <mjain@marvell.com>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <cpu_func.h>
|
||||
#include <init.h>
|
||||
#include <time.h>
|
||||
#include <asm/arch/cpu.h>
|
||||
#include <asm/arch/armada100.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
/*
|
||||
* Timer registers
|
||||
* Refer Section A.6 in Datasheet
|
||||
*/
|
||||
struct armd1tmr_registers {
|
||||
u32 clk_ctrl; /* Timer clk control reg */
|
||||
u32 match[9]; /* Timer match registers */
|
||||
u32 count[3]; /* Timer count registers */
|
||||
u32 status[3];
|
||||
u32 ie[3];
|
||||
u32 preload[3]; /* Timer preload value */
|
||||
u32 preload_ctrl[3];
|
||||
u32 wdt_match_en;
|
||||
u32 wdt_match_r;
|
||||
u32 wdt_val;
|
||||
u32 wdt_sts;
|
||||
u32 icr[3];
|
||||
u32 wdt_icr;
|
||||
u32 cer; /* Timer count enable reg */
|
||||
u32 cmr;
|
||||
u32 ilr[3];
|
||||
u32 wcr;
|
||||
u32 wfar;
|
||||
u32 wsar;
|
||||
u32 cvwr;
|
||||
};
|
||||
|
||||
#define TIMER 0 /* Use TIMER 0 */
|
||||
/* Each timer has 3 match registers */
|
||||
#define MATCH_CMP(x) ((3 * TIMER) + x)
|
||||
#define TIMER_LOAD_VAL 0xffffffff
|
||||
#define COUNT_RD_REQ 0x1
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
/* Using gd->arch.tbu from timestamp and gd->arch.tbl for lastdec */
|
||||
|
||||
/* For preventing risk of instability in reading counter value,
|
||||
* first set read request to register cvwr and then read same
|
||||
* register after it captures counter value.
|
||||
*/
|
||||
ulong read_timer(void)
|
||||
{
|
||||
struct armd1tmr_registers *armd1timers =
|
||||
(struct armd1tmr_registers *) ARMD1_TIMER_BASE;
|
||||
volatile int loop=100;
|
||||
|
||||
writel(COUNT_RD_REQ, &armd1timers->cvwr);
|
||||
while (loop--);
|
||||
return(readl(&armd1timers->cvwr));
|
||||
}
|
||||
|
||||
static ulong get_timer_masked(void)
|
||||
{
|
||||
ulong now = read_timer();
|
||||
|
||||
if (now >= gd->arch.tbl) {
|
||||
/* normal mode */
|
||||
gd->arch.tbu += now - gd->arch.tbl;
|
||||
} else {
|
||||
/* we have an overflow ... */
|
||||
gd->arch.tbu += now + TIMER_LOAD_VAL - gd->arch.tbl;
|
||||
}
|
||||
gd->arch.tbl = now;
|
||||
|
||||
return gd->arch.tbu;
|
||||
}
|
||||
|
||||
ulong get_timer(ulong base)
|
||||
{
|
||||
return ((get_timer_masked() / (CONFIG_SYS_HZ_CLOCK / 1000)) -
|
||||
base);
|
||||
}
|
||||
|
||||
void __udelay(unsigned long usec)
|
||||
{
|
||||
ulong delayticks;
|
||||
ulong endtime;
|
||||
|
||||
delayticks = (usec * (CONFIG_SYS_HZ_CLOCK / 1000000));
|
||||
endtime = get_timer_masked() + delayticks;
|
||||
|
||||
while (get_timer_masked() < endtime);
|
||||
}
|
||||
|
||||
/*
|
||||
* init the Timer
|
||||
*/
|
||||
int timer_init(void)
|
||||
{
|
||||
struct armd1apb1_registers *apb1clkres =
|
||||
(struct armd1apb1_registers *) ARMD1_APBC1_BASE;
|
||||
struct armd1tmr_registers *armd1timers =
|
||||
(struct armd1tmr_registers *) ARMD1_TIMER_BASE;
|
||||
|
||||
/* Enable Timer clock at 3.25 MHZ */
|
||||
writel(APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(3), &apb1clkres->timers);
|
||||
|
||||
/* load value into timer */
|
||||
writel(0x0, &armd1timers->clk_ctrl);
|
||||
/* Use Timer 0 Match Resiger 0 */
|
||||
writel(TIMER_LOAD_VAL, &armd1timers->match[MATCH_CMP(0)]);
|
||||
/* Preload value is 0 */
|
||||
writel(0x0, &armd1timers->preload[TIMER]);
|
||||
/* Enable match comparator 0 for Timer 0 */
|
||||
writel(0x1, &armd1timers->preload_ctrl[TIMER]);
|
||||
|
||||
/* Enable timer 0 */
|
||||
writel(0x1, &armd1timers->cer);
|
||||
/* init the gd->arch.tbu and gd->arch.tbl value */
|
||||
gd->arch.tbl = read_timer();
|
||||
gd->arch.tbu = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MPMU_APRR_WDTR (1<<4)
|
||||
#define TMR_WFAR 0xbaba /* WDT Register First key */
|
||||
#define TMP_WSAR 0xeb10 /* WDT Register Second key */
|
||||
|
||||
/*
|
||||
* This function uses internal Watchdog Timer
|
||||
* based reset mechanism.
|
||||
* Steps to write watchdog registers (protected access)
|
||||
* 1. Write key value to TMR_WFAR reg.
|
||||
* 2. Write key value to TMP_WSAR reg.
|
||||
* 3. Perform write operation.
|
||||
*/
|
||||
void reset_cpu(unsigned long ignored)
|
||||
{
|
||||
struct armd1mpmu_registers *mpmu =
|
||||
(struct armd1mpmu_registers *) ARMD1_MPMU_BASE;
|
||||
struct armd1tmr_registers *armd1timers =
|
||||
(struct armd1tmr_registers *) ARMD1_TIMER_BASE;
|
||||
u32 val;
|
||||
|
||||
/* negate hardware reset to the WDT after system reset */
|
||||
val = readl(&mpmu->aprr);
|
||||
val = val | MPMU_APRR_WDTR;
|
||||
writel(val, &mpmu->aprr);
|
||||
|
||||
/* reset/enable WDT clock */
|
||||
writel(APBC_APBCLK | APBC_FNCLK | APBC_RST, &mpmu->wdtpcr);
|
||||
readl(&mpmu->wdtpcr);
|
||||
writel(APBC_APBCLK | APBC_FNCLK, &mpmu->wdtpcr);
|
||||
readl(&mpmu->wdtpcr);
|
||||
|
||||
/* clear previous WDT status */
|
||||
writel(TMR_WFAR, &armd1timers->wfar);
|
||||
writel(TMP_WSAR, &armd1timers->wsar);
|
||||
writel(0, &armd1timers->wdt_sts);
|
||||
|
||||
/* set match counter */
|
||||
writel(TMR_WFAR, &armd1timers->wfar);
|
||||
writel(TMP_WSAR, &armd1timers->wsar);
|
||||
writel(0xf, &armd1timers->wdt_match_r);
|
||||
|
||||
/* enable WDT reset */
|
||||
writel(TMR_WFAR, &armd1timers->wfar);
|
||||
writel(TMP_WSAR, &armd1timers->wsar);
|
||||
writel(0x3, &armd1timers->wdt_match_en);
|
||||
|
||||
while(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is derived from PowerPC code (read timebase as long long).
|
||||
* On ARM it just returns the timer value.
|
||||
*/
|
||||
unsigned long long get_ticks(void)
|
||||
{
|
||||
return get_timer(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is derived from PowerPC code (timebase clock frequency).
|
||||
* On ARM it returns the number of timer ticks per second.
|
||||
*/
|
||||
ulong get_tbclk(void)
|
||||
{
|
||||
return (ulong)CONFIG_SYS_HZ;
|
||||
}
|
||||
@@ -89,3 +89,4 @@ void enable_caches(void)
|
||||
dcache_enable();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -21,19 +21,6 @@
|
||||
|
||||
static void cache_flush(void);
|
||||
|
||||
/************************************************************
|
||||
* sdelay() - simple spin loop. Will be constant time as
|
||||
* its generally used in bypass conditions only. This
|
||||
* is necessary until timers are accessible.
|
||||
*
|
||||
* not inline to increase chances its in cache when called
|
||||
*************************************************************/
|
||||
void sdelay(unsigned long loops)
|
||||
{
|
||||
__asm__ volatile ("1:\n" "subs %0, %1, #1\n"
|
||||
"bne 1b":"=r" (loops):"0"(loops));
|
||||
}
|
||||
|
||||
int cleanup_before_linux (void)
|
||||
{
|
||||
/*
|
||||
|
||||
7
arch/arm/cpu/arm926ejs/mx25/Makefile
Normal file
7
arch/arm/cpu/arm926ejs/mx25/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# (C) Copyright 2000-2006
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
#
|
||||
|
||||
obj-y += generic.o timer.o reset.o relocate.o
|
||||
274
arch/arm/cpu/arm926ejs/mx25/generic.c
Normal file
274
arch/arm/cpu/arm926ejs/mx25/generic.c
Normal file
@@ -0,0 +1,274 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2009 DENX Software Engineering
|
||||
* Author: John Rigby <jrigby@gmail.com>
|
||||
*
|
||||
* Based on mx27/generic.c:
|
||||
* Copyright (c) 2008 Eric Jarrige <eric.jarrige@armadeus.org>
|
||||
* Copyright (c) 2009 Ilya Yanok <yanok@emcraft.com>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <clock_legacy.h>
|
||||
#include <div64.h>
|
||||
#include <init.h>
|
||||
#include <net.h>
|
||||
#include <netdev.h>
|
||||
#include <vsprintf.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch-imx/cpu.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/clock.h>
|
||||
|
||||
#ifdef CONFIG_FSL_ESDHC_IMX
|
||||
#include <fsl_esdhc_imx.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* get the system pll clock in Hz
|
||||
*
|
||||
* mfi + mfn / (mfd +1)
|
||||
* f = 2 * f_ref * --------------------
|
||||
* pd + 1
|
||||
*/
|
||||
static unsigned int imx_decode_pll(unsigned int pll, unsigned int f_ref)
|
||||
{
|
||||
unsigned int mfi = (pll >> CCM_PLL_MFI_SHIFT)
|
||||
& CCM_PLL_MFI_MASK;
|
||||
int mfn = (pll >> CCM_PLL_MFN_SHIFT)
|
||||
& CCM_PLL_MFN_MASK;
|
||||
unsigned int mfd = (pll >> CCM_PLL_MFD_SHIFT)
|
||||
& CCM_PLL_MFD_MASK;
|
||||
unsigned int pd = (pll >> CCM_PLL_PD_SHIFT)
|
||||
& CCM_PLL_PD_MASK;
|
||||
|
||||
mfi = mfi <= 5 ? 5 : mfi;
|
||||
mfn = mfn >= 512 ? mfn - 1024 : mfn;
|
||||
mfd += 1;
|
||||
pd += 1;
|
||||
|
||||
return lldiv(2 * (u64) f_ref * (mfi * mfd + mfn),
|
||||
mfd * pd);
|
||||
}
|
||||
|
||||
static ulong imx_get_mpllclk(void)
|
||||
{
|
||||
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
||||
ulong fref = MXC_HCLK;
|
||||
|
||||
return imx_decode_pll(readl(&ccm->mpctl), fref);
|
||||
}
|
||||
|
||||
static ulong imx_get_upllclk(void)
|
||||
{
|
||||
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
||||
ulong fref = MXC_HCLK;
|
||||
|
||||
return imx_decode_pll(readl(&ccm->upctl), fref);
|
||||
}
|
||||
|
||||
static ulong imx_get_armclk(void)
|
||||
{
|
||||
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
||||
ulong cctl = readl(&ccm->cctl);
|
||||
ulong fref = imx_get_mpllclk();
|
||||
ulong div;
|
||||
|
||||
if (cctl & CCM_CCTL_ARM_SRC)
|
||||
fref = lldiv((u64) fref * 3, 4);
|
||||
|
||||
div = ((cctl >> CCM_CCTL_ARM_DIV_SHIFT)
|
||||
& CCM_CCTL_ARM_DIV_MASK) + 1;
|
||||
|
||||
return fref / div;
|
||||
}
|
||||
|
||||
static ulong imx_get_ahbclk(void)
|
||||
{
|
||||
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
||||
ulong cctl = readl(&ccm->cctl);
|
||||
ulong fref = imx_get_armclk();
|
||||
ulong div;
|
||||
|
||||
div = ((cctl >> CCM_CCTL_AHB_DIV_SHIFT)
|
||||
& CCM_CCTL_AHB_DIV_MASK) + 1;
|
||||
|
||||
return fref / div;
|
||||
}
|
||||
|
||||
static ulong imx_get_ipgclk(void)
|
||||
{
|
||||
return imx_get_ahbclk() / 2;
|
||||
}
|
||||
|
||||
static ulong imx_get_perclk(int clk)
|
||||
{
|
||||
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
||||
ulong fref = readl(&ccm->mcr) & (1 << clk) ? imx_get_upllclk() :
|
||||
imx_get_ahbclk();
|
||||
ulong div;
|
||||
|
||||
div = readl(&ccm->pcdr[CCM_PERCLK_REG(clk)]);
|
||||
div = ((div >> CCM_PERCLK_SHIFT(clk)) & CCM_PERCLK_MASK) + 1;
|
||||
|
||||
return fref / div;
|
||||
}
|
||||
|
||||
int imx_set_perclk(enum mxc_clock clk, bool from_upll, unsigned int freq)
|
||||
{
|
||||
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
||||
ulong fref = from_upll ? imx_get_upllclk() : imx_get_ahbclk();
|
||||
ulong div = (fref + freq - 1) / freq;
|
||||
|
||||
if (clk > MXC_UART_CLK || !div || --div > CCM_PERCLK_MASK)
|
||||
return -EINVAL;
|
||||
|
||||
clrsetbits_le32(&ccm->pcdr[CCM_PERCLK_REG(clk)],
|
||||
CCM_PERCLK_MASK << CCM_PERCLK_SHIFT(clk),
|
||||
div << CCM_PERCLK_SHIFT(clk));
|
||||
if (from_upll)
|
||||
setbits_le32(&ccm->mcr, 1 << clk);
|
||||
else
|
||||
clrbits_le32(&ccm->mcr, 1 << clk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int mxc_get_clock(enum mxc_clock clk)
|
||||
{
|
||||
if (clk >= MXC_CLK_NUM)
|
||||
return -1;
|
||||
switch (clk) {
|
||||
case MXC_ARM_CLK:
|
||||
return imx_get_armclk();
|
||||
case MXC_AHB_CLK:
|
||||
return imx_get_ahbclk();
|
||||
case MXC_IPG_CLK:
|
||||
case MXC_CSPI_CLK:
|
||||
case MXC_FEC_CLK:
|
||||
return imx_get_ipgclk();
|
||||
default:
|
||||
return imx_get_perclk(clk);
|
||||
}
|
||||
}
|
||||
|
||||
u32 get_cpu_rev(void)
|
||||
{
|
||||
u32 srev;
|
||||
u32 system_rev = 0x25000;
|
||||
|
||||
/* read SREV register from IIM module */
|
||||
struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
|
||||
srev = readl(&iim->iim_srev);
|
||||
|
||||
switch (srev) {
|
||||
case 0x00:
|
||||
system_rev |= CHIP_REV_1_0;
|
||||
break;
|
||||
case 0x01:
|
||||
system_rev |= CHIP_REV_1_1;
|
||||
break;
|
||||
case 0x02:
|
||||
system_rev |= CHIP_REV_1_2;
|
||||
break;
|
||||
default:
|
||||
system_rev |= 0x8000;
|
||||
break;
|
||||
}
|
||||
|
||||
return system_rev;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DISPLAY_CPUINFO)
|
||||
static char *get_reset_cause(void)
|
||||
{
|
||||
/* read RCSR register from CCM module */
|
||||
struct ccm_regs *ccm =
|
||||
(struct ccm_regs *)IMX_CCM_BASE;
|
||||
|
||||
u32 cause = readl(&ccm->rcsr) & 0x0f;
|
||||
|
||||
if (cause == 0)
|
||||
return "POR";
|
||||
else if (cause == 1)
|
||||
return "RST";
|
||||
else if ((cause & 2) == 2)
|
||||
return "WDOG";
|
||||
else if ((cause & 4) == 4)
|
||||
return "SW RESET";
|
||||
else if ((cause & 8) == 8)
|
||||
return "JTAG";
|
||||
else
|
||||
return "unknown reset";
|
||||
|
||||
}
|
||||
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
char buf[32];
|
||||
u32 cpurev = get_cpu_rev();
|
||||
|
||||
printf("CPU: Freescale i.MX25 rev%d.%d%s at %s MHz\n",
|
||||
(cpurev & 0xF0) >> 4, (cpurev & 0x0F),
|
||||
((cpurev & 0x8000) ? " unknown" : ""),
|
||||
strmhz(buf, imx_get_armclk()));
|
||||
printf("Reset cause: %s\n", get_reset_cause());
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FEC_MXC)
|
||||
/*
|
||||
* Initializes on-chip ethernet controllers.
|
||||
* to override, implement board_eth_init()
|
||||
*/
|
||||
int cpu_eth_init(struct bd_info *bis)
|
||||
{
|
||||
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
||||
ulong val;
|
||||
|
||||
val = readl(&ccm->cgr0);
|
||||
val |= (1 << 23);
|
||||
writel(val, &ccm->cgr0);
|
||||
return fecmxc_initialize(bis);
|
||||
}
|
||||
#endif
|
||||
|
||||
int get_clocks(void)
|
||||
{
|
||||
#ifdef CONFIG_FSL_ESDHC_IMX
|
||||
#if CONFIG_SYS_FSL_ESDHC_ADDR == IMX_MMC_SDHC2_BASE
|
||||
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
|
||||
#else
|
||||
gd->arch.sdhc_clk = mxc_get_clock(MXC_ESDHC1_CLK);
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FSL_ESDHC_IMX
|
||||
/*
|
||||
* Initializes on-chip MMC controllers.
|
||||
* to override, implement board_mmc_init()
|
||||
*/
|
||||
int cpu_mmc_init(struct bd_info *bis)
|
||||
{
|
||||
return fsl_esdhc_mmc_init(bis);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEC_MXC
|
||||
void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
|
||||
{
|
||||
int i;
|
||||
struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
|
||||
struct fuse_bank *bank = &iim->bank[0];
|
||||
struct fuse_bank0_regs *fuse =
|
||||
(struct fuse_bank0_regs *)bank->fuse_regs;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
mac[i] = readl(&fuse->mac_addr[i]) & 0xff;
|
||||
}
|
||||
#endif /* CONFIG_FEC_MXC */
|
||||
22
arch/arm/cpu/arm926ejs/mx25/relocate.S
Normal file
22
arch/arm/cpu/arm926ejs/mx25/relocate.S
Normal file
@@ -0,0 +1,22 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* relocate - i.MX25-specific vector relocation
|
||||
*
|
||||
* Copyright (c) 2013 Albert ARIBAUD <albert.u.boot@aribaud.net>
|
||||
*/
|
||||
|
||||
#include <linux/linkage.h>
|
||||
|
||||
/*
|
||||
* The i.MX25 SoC is very specific with respect to exceptions: it
|
||||
* does not provide RAM at the high vectors address (0xFFFF0000),
|
||||
* thus only the low address (0x00000000) is useable; but that is
|
||||
* in ROM, so let's avoid relocating the vectors.
|
||||
*/
|
||||
.section .text.relocate_vectors,"ax",%progbits
|
||||
|
||||
ENTRY(relocate_vectors)
|
||||
|
||||
bx lr
|
||||
|
||||
ENDPROC(relocate_vectors)
|
||||
40
arch/arm/cpu/arm926ejs/mx25/reset.c
Normal file
40
arch/arm/cpu/arm926ejs/mx25/reset.c
Normal file
@@ -0,0 +1,40 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Alex Zuepke <azu@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
*
|
||||
* (C) Copyright 2009
|
||||
* Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <cpu_func.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
|
||||
/*
|
||||
* Reset the cpu by setting up the watchdog timer and let it time out
|
||||
*/
|
||||
void reset_cpu(ulong ignored)
|
||||
{
|
||||
struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
|
||||
/* Disable watchdog and set Time-Out field to 0 */
|
||||
writew(0, ®s->wcr);
|
||||
|
||||
/* Write Service Sequence */
|
||||
writew(WSR_UNLOCK1, ®s->wsr);
|
||||
writew(WSR_UNLOCK2, ®s->wsr);
|
||||
|
||||
/* Enable watchdog */
|
||||
writew(WCR_WDE, ®s->wcr);
|
||||
|
||||
while (1) ;
|
||||
}
|
||||
50
arch/arm/cpu/arm926ejs/mx25/timer.c
Normal file
50
arch/arm/cpu/arm926ejs/mx25/timer.c
Normal file
@@ -0,0 +1,50 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Marius Groeger <mgroeger@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Sysgo Real-Time Solutions, GmbH <www.elinos.com>
|
||||
* Alex Zuepke <azu@sysgo.de>
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
|
||||
*
|
||||
* (C) Copyright 2009
|
||||
* Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com>
|
||||
*
|
||||
* (C) Copyright 2009 DENX Software Engineering
|
||||
* Author: John Rigby <jrigby@gmail.com>
|
||||
* Add support for MX25
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <init.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
/* nothing really to do with interrupts, just starts up a counter. */
|
||||
/* The 32KHz 32-bit timer overruns in 134217 seconds */
|
||||
int timer_init(void)
|
||||
{
|
||||
int i;
|
||||
struct gpt_regs *gpt = (struct gpt_regs *)IMX_GPT1_BASE;
|
||||
struct ccm_regs *ccm = (struct ccm_regs *)IMX_CCM_BASE;
|
||||
|
||||
/* setup GP Timer 1 */
|
||||
writel(GPT_CTRL_SWR, &gpt->ctrl);
|
||||
|
||||
writel(readl(&ccm->cgr1) | CCM_CGR1_GPT1, &ccm->cgr1);
|
||||
|
||||
for (i = 0; i < 100; i++)
|
||||
writel(0, &gpt->ctrl); /* We have no udelay by now */
|
||||
writel(0, &gpt->pre); /* prescaler = 1 */
|
||||
/* Freerun Mode, 32KHz input */
|
||||
writel(readl(&gpt->ctrl) | GPT_CTRL_CLKSOURCE_32 | GPT_CTRL_FRR,
|
||||
&gpt->ctrl);
|
||||
writel(readl(&gpt->ctrl) | GPT_CTRL_TEN, &gpt->ctrl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
/*
|
||||
* Reset the cpu by setting up the watchdog timer and let it time out
|
||||
*/
|
||||
void reset_cpu(void)
|
||||
void reset_cpu(ulong ignored)
|
||||
{
|
||||
struct wdog_regs *regs = (struct wdog_regs *)IMX_WDT_BASE;
|
||||
/* Disable watchdog and set Time-Out field to 0 */
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <asm/arch/iomux.h>
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/sections.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
@@ -33,9 +32,9 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||
/* Lowlevel init isn't used on i.MX28, so just have a dummy here */
|
||||
__weak void lowlevel_init(void) {}
|
||||
|
||||
void reset_cpu(void) __attribute__((noreturn));
|
||||
void reset_cpu(ulong ignored) __attribute__((noreturn));
|
||||
|
||||
void reset_cpu(void)
|
||||
void reset_cpu(ulong ignored)
|
||||
{
|
||||
struct mxs_rtc_regs *rtc_regs =
|
||||
(struct mxs_rtc_regs *)MXS_RTC_BASE;
|
||||
@@ -99,6 +98,7 @@ int arch_cpu_init(void)
|
||||
{
|
||||
struct mxs_clkctrl_regs *clkctrl_regs =
|
||||
(struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
|
||||
extern uint32_t _start;
|
||||
|
||||
mx28_fixup_vt((uint32_t)&_start);
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ DISPLAYPROGRESS
|
||||
SECTION 0x0 BOOTABLE
|
||||
TAG LAST
|
||||
LOAD 0x1000 spl/u-boot-spl.bin
|
||||
LOAD IVT 0xE000 0x1000
|
||||
CALL HAB 0xE000 0x0
|
||||
LOAD IVT 0x8000 0x1000
|
||||
CALL HAB 0x8000 0x0
|
||||
|
||||
@@ -2,8 +2,8 @@ DISPLAYPROGRESS
|
||||
SECTION 0x0 BOOTABLE
|
||||
TAG LAST
|
||||
LOAD 0x1000 spl/u-boot-spl.bin
|
||||
LOAD IVT 0xE000 0x1000
|
||||
CALL HAB 0xE000 0x0
|
||||
LOAD IVT 0x8000 0x1000
|
||||
CALL HAB 0x8000 0x0
|
||||
LOAD 0x40002000 u-boot.bin
|
||||
LOAD IVT 0xE000 0x40002000
|
||||
CALL HAB 0xE000 0x0
|
||||
LOAD IVT 0x8000 0x40002000
|
||||
CALL HAB 0x8000 0x0
|
||||
|
||||
@@ -16,14 +16,13 @@
|
||||
#include <asm/arch/imx-regs.h>
|
||||
#include <asm/arch/sys_proto.h>
|
||||
#include <asm/gpio.h>
|
||||
#include <asm/sections.h>
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#include "mxs_init.h"
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
static gd_t gdata __section(".data");
|
||||
#ifdef CONFIG_SPL_SERIAL
|
||||
#ifdef CONFIG_SPL_SERIAL_SUPPORT
|
||||
static struct bd_info bdata __section(".data");
|
||||
#endif
|
||||
|
||||
@@ -101,6 +100,7 @@ static void mxs_spl_fixup_vectors(void)
|
||||
* thus this fixup. Our vectoring table is PIC, so copying is
|
||||
* fine.
|
||||
*/
|
||||
extern uint32_t _start;
|
||||
|
||||
/* cppcheck-suppress nullPointer */
|
||||
memcpy(0x0, &_start, 0x60);
|
||||
@@ -108,7 +108,7 @@ static void mxs_spl_fixup_vectors(void)
|
||||
|
||||
static void mxs_spl_console_init(void)
|
||||
{
|
||||
#ifdef CONFIG_SPL_SERIAL
|
||||
#ifdef CONFIG_SPL_SERIAL_SUPPORT
|
||||
gd->bd = &bdata;
|
||||
gd->baudrate = CONFIG_BAUDRATE;
|
||||
serial_init();
|
||||
@@ -122,7 +122,7 @@ void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
|
||||
{
|
||||
struct mxs_spl_data *data = MXS_SPL_DATA;
|
||||
uint8_t bootmode = mxs_get_bootmode_index();
|
||||
set_gd(&gdata);
|
||||
gd = &gdata;
|
||||
|
||||
mxs_spl_fixup_vectors();
|
||||
|
||||
|
||||
@@ -627,11 +627,11 @@ static void mxs_power_enable_4p2(void)
|
||||
|
||||
mxs_power_init_dcdc_4p2_source();
|
||||
|
||||
writel(vddioctrl, &power_regs->hw_power_vddioctrl);
|
||||
writel(vdddctrl, &power_regs->hw_power_vdddctrl);
|
||||
early_delay(20);
|
||||
writel(vddactrl, &power_regs->hw_power_vddactrl);
|
||||
early_delay(20);
|
||||
writel(vdddctrl, &power_regs->hw_power_vdddctrl);
|
||||
writel(vddioctrl, &power_regs->hw_power_vddioctrl);
|
||||
|
||||
/*
|
||||
* Check if FET is enabled on either powerout and if so,
|
||||
|
||||
21
arch/arm/cpu/arm926ejs/spear/Makefile
Normal file
21
arch/arm/cpu/arm926ejs/spear/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
#
|
||||
# (C) Copyright 2000-2006
|
||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||
|
||||
obj-y := cpu.o \
|
||||
reset.o \
|
||||
timer.o
|
||||
|
||||
ifdef CONFIG_SPL_BUILD
|
||||
obj-y += spl.o
|
||||
obj-$(CONFIG_SPEAR600) += spear600.o
|
||||
obj-$(CONFIG_DDR_MT47H64M16) += spr600_mt47h64m16_3_333_cl5_psync.o
|
||||
obj-$(CONFIG_DDR_MT47H32M16) += spr600_mt47h32m16_333_cl5_psync.o
|
||||
obj-$(CONFIG_DDR_MT47H32M16) += spr600_mt47h32m16_37e_166_cl4_sync.o
|
||||
obj-$(CONFIG_DDR_MT47H128M8) += spr600_mt47h128m8_3_266_cl5_async.o
|
||||
else
|
||||
obj-y += spr_misc.o spr_lowlevel_init.o
|
||||
endif
|
||||
|
||||
extra-$(CONFIG_SPL_BUILD) := start.o
|
||||
116
arch/arm/cpu/arm926ejs/spear/cpu.c
Normal file
116
arch/arm/cpu/arm926ejs/spear/cpu.c
Normal file
@@ -0,0 +1,116 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2010
|
||||
* Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <init.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/arch/spr_misc.h>
|
||||
|
||||
int arch_cpu_init(void)
|
||||
{
|
||||
struct misc_regs *const misc_p =
|
||||
(struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
u32 periph1_clken, periph_clk_cfg;
|
||||
|
||||
periph1_clken = readl(&misc_p->periph1_clken);
|
||||
|
||||
#if defined(CONFIG_SPEAR3XX)
|
||||
periph1_clken |= MISC_GPT2ENB;
|
||||
#elif defined(CONFIG_SPEAR600)
|
||||
periph1_clken |= MISC_GPT3ENB;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PL011_SERIAL)
|
||||
periph1_clken |= MISC_UART0ENB;
|
||||
|
||||
periph_clk_cfg = readl(&misc_p->periph_clk_cfg);
|
||||
periph_clk_cfg &= ~CONFIG_SPEAR_UARTCLKMSK;
|
||||
periph_clk_cfg |= CONFIG_SPEAR_UART48M;
|
||||
writel(periph_clk_cfg, &misc_p->periph_clk_cfg);
|
||||
#endif
|
||||
#if defined(CONFIG_ETH_DESIGNWARE)
|
||||
periph1_clken |= MISC_ETHENB;
|
||||
#endif
|
||||
#if defined(CONFIG_DW_UDC)
|
||||
periph1_clken |= MISC_USBDENB;
|
||||
#endif
|
||||
#if defined(CONFIG_SYS_I2C_DW)
|
||||
periph1_clken |= MISC_I2CENB;
|
||||
#endif
|
||||
#if defined(CONFIG_ST_SMI)
|
||||
periph1_clken |= MISC_SMIENB;
|
||||
#endif
|
||||
#if defined(CONFIG_NAND_FSMC)
|
||||
periph1_clken |= MISC_FSMCENB;
|
||||
#endif
|
||||
#if defined(CONFIG_USB_EHCI_SPEAR)
|
||||
periph1_clken |= PERIPH_USBH1 | PERIPH_USBH2;
|
||||
#endif
|
||||
#if defined(CONFIG_SPEAR_GPIO)
|
||||
periph1_clken |= MISC_GPIO3ENB | MISC_GPIO4ENB;
|
||||
#endif
|
||||
#if defined(CONFIG_PL022_SPI)
|
||||
periph1_clken |= MISC_SSP1ENB | MISC_SSP2ENB | MISC_SSP3ENB;
|
||||
#endif
|
||||
|
||||
writel(periph1_clken, &misc_p->periph1_clken);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DISPLAY_CPUINFO
|
||||
int print_cpuinfo(void)
|
||||
{
|
||||
#ifdef CONFIG_SPEAR300
|
||||
printf("CPU: SPEAr300\n");
|
||||
#elif defined(CONFIG_SPEAR310)
|
||||
printf("CPU: SPEAr310\n");
|
||||
#elif defined(CONFIG_SPEAR320)
|
||||
printf("CPU: SPEAr320\n");
|
||||
#elif defined(CONFIG_SPEAR600)
|
||||
printf("CPU: SPEAr600\n");
|
||||
#else
|
||||
#error CPU not supported in spear platform
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_NAND_ECC_BCH) && defined(CONFIG_NAND_FSMC)
|
||||
static int do_switch_ecc(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
goto usage;
|
||||
|
||||
if (strncmp(argv[1], "hw", 2) == 0) {
|
||||
/* 1-bit HW ECC */
|
||||
printf("Switching to 1-bit HW ECC\n");
|
||||
fsmc_nand_switch_ecc(1);
|
||||
} else if (strncmp(argv[1], "bch4", 2) == 0) {
|
||||
/* 4-bit SW ECC BCH4 */
|
||||
printf("Switching to 4-bit SW ECC (BCH4)\n");
|
||||
fsmc_nand_switch_ecc(4);
|
||||
} else {
|
||||
goto usage;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
usage:
|
||||
printf("Usage: nandecc %s\n", cmdtp->usage);
|
||||
return 1;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(
|
||||
nandecc, 2, 0, do_switch_ecc,
|
||||
"switch NAND ECC calculation algorithm",
|
||||
"hw|bch4 - Switch between NAND hardware 1-bit HW and"
|
||||
" 4-bit SW BCH\n"
|
||||
);
|
||||
#endif
|
||||
39
arch/arm/cpu/arm926ejs/spear/reset.c
Normal file
39
arch/arm/cpu/arm926ejs/spear/reset.c
Normal file
@@ -0,0 +1,39 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2009
|
||||
* Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <cpu_func.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/arch/spr_syscntl.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
void reset_cpu(ulong ignored)
|
||||
{
|
||||
struct syscntl_regs *syscntl_regs_p =
|
||||
(struct syscntl_regs *)CONFIG_SPEAR_SYSCNTLBASE;
|
||||
|
||||
printf("System is going to reboot ...\n");
|
||||
|
||||
/*
|
||||
* This 1 second delay will allow the above message
|
||||
* to be printed before reset
|
||||
*/
|
||||
udelay((1000 * 1000));
|
||||
|
||||
/* Going into slow mode before resetting SOC */
|
||||
writel(0x02, &syscntl_regs_p->scctrl);
|
||||
|
||||
/*
|
||||
* Writing any value to the system status register will
|
||||
* reset the SoC
|
||||
*/
|
||||
writel(0x00, &syscntl_regs_p->scsysstat);
|
||||
|
||||
/* system will restart */
|
||||
while (1)
|
||||
;
|
||||
}
|
||||
223
arch/arm/cpu/arm926ejs/spear/spear600.c
Normal file
223
arch/arm/cpu/arm926ejs/spear/spear600.c
Normal file
@@ -0,0 +1,223 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2000-2009
|
||||
* Viresh Kumar, ST Microelectronics, viresh.kumar@st.com
|
||||
* Vipin Kumar, ST Microelectronics, vipin.kumar@st.com
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <asm/hardware.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/spr_misc.h>
|
||||
#include <asm/arch/spr_defs.h>
|
||||
|
||||
void spear_late_init(void)
|
||||
{
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
|
||||
writel(0x80000007, &misc_p->arb_icm_ml1);
|
||||
writel(0x80000007, &misc_p->arb_icm_ml2);
|
||||
writel(0x80000007, &misc_p->arb_icm_ml3);
|
||||
writel(0x80000007, &misc_p->arb_icm_ml4);
|
||||
writel(0x80000007, &misc_p->arb_icm_ml5);
|
||||
writel(0x80000007, &misc_p->arb_icm_ml6);
|
||||
writel(0x80000007, &misc_p->arb_icm_ml7);
|
||||
writel(0x80000007, &misc_p->arb_icm_ml8);
|
||||
writel(0x80000007, &misc_p->arb_icm_ml9);
|
||||
}
|
||||
|
||||
static void sel_1v8(void)
|
||||
{
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
u32 ddr1v8, ddr2v5;
|
||||
|
||||
ddr2v5 = readl(&misc_p->ddr_2v5_compensation);
|
||||
ddr2v5 &= 0x8080ffc0;
|
||||
ddr2v5 |= 0x78000003;
|
||||
writel(ddr2v5, &misc_p->ddr_2v5_compensation);
|
||||
|
||||
ddr1v8 = readl(&misc_p->ddr_1v8_compensation);
|
||||
ddr1v8 &= 0x8080ffc0;
|
||||
ddr1v8 |= 0x78000010;
|
||||
writel(ddr1v8, &misc_p->ddr_1v8_compensation);
|
||||
|
||||
while (!(readl(&misc_p->ddr_1v8_compensation) & DDR_COMP_ACCURATE))
|
||||
;
|
||||
}
|
||||
|
||||
static void sel_2v5(void)
|
||||
{
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
u32 ddr1v8, ddr2v5;
|
||||
|
||||
ddr1v8 = readl(&misc_p->ddr_1v8_compensation);
|
||||
ddr1v8 &= 0x8080ffc0;
|
||||
ddr1v8 |= 0x78000003;
|
||||
writel(ddr1v8, &misc_p->ddr_1v8_compensation);
|
||||
|
||||
ddr2v5 = readl(&misc_p->ddr_2v5_compensation);
|
||||
ddr2v5 &= 0x8080ffc0;
|
||||
ddr2v5 |= 0x78000010;
|
||||
writel(ddr2v5, &misc_p->ddr_2v5_compensation);
|
||||
|
||||
while (!(readl(&misc_p->ddr_2v5_compensation) & DDR_COMP_ACCURATE))
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
* plat_ddr_init:
|
||||
*/
|
||||
void plat_ddr_init(void)
|
||||
{
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
u32 ddrpad;
|
||||
u32 core3v3, ddr1v8, ddr2v5;
|
||||
|
||||
/* DDR pad register configurations */
|
||||
ddrpad = readl(&misc_p->ddr_pad);
|
||||
ddrpad &= ~DDR_PAD_CNF_MSK;
|
||||
|
||||
#if (CONFIG_DDR_HCLK)
|
||||
ddrpad |= 0xEAAB;
|
||||
#elif (CONFIG_DDR_2HCLK)
|
||||
ddrpad |= 0xEAAD;
|
||||
#elif (CONFIG_DDR_PLL2)
|
||||
ddrpad |= 0xEAAD;
|
||||
#endif
|
||||
writel(ddrpad, &misc_p->ddr_pad);
|
||||
|
||||
/* Compensation register configurations */
|
||||
core3v3 = readl(&misc_p->core_3v3_compensation);
|
||||
core3v3 &= 0x8080ffe0;
|
||||
core3v3 |= 0x78000002;
|
||||
writel(core3v3, &misc_p->core_3v3_compensation);
|
||||
|
||||
ddr1v8 = readl(&misc_p->ddr_1v8_compensation);
|
||||
ddr1v8 &= 0x8080ffc0;
|
||||
ddr1v8 |= 0x78000004;
|
||||
writel(ddr1v8, &misc_p->ddr_1v8_compensation);
|
||||
|
||||
ddr2v5 = readl(&misc_p->ddr_2v5_compensation);
|
||||
ddr2v5 &= 0x8080ffc0;
|
||||
ddr2v5 |= 0x78000004;
|
||||
writel(ddr2v5, &misc_p->ddr_2v5_compensation);
|
||||
|
||||
if ((readl(&misc_p->ddr_pad) & DDR_PAD_SW_CONF) == DDR_PAD_SW_CONF) {
|
||||
/* Software memory configuration */
|
||||
if (readl(&misc_p->ddr_pad) & DDR_PAD_SSTL_SEL)
|
||||
sel_1v8();
|
||||
else
|
||||
sel_2v5();
|
||||
} else {
|
||||
/* Hardware memory configuration */
|
||||
if (readl(&misc_p->ddr_pad) & DDR_PAD_DRAM_TYPE)
|
||||
sel_1v8();
|
||||
else
|
||||
sel_2v5();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* xxx_boot_selected:
|
||||
*
|
||||
* return true if the particular booting option is selected
|
||||
* return false otherwise
|
||||
*/
|
||||
static u32 read_bootstrap(void)
|
||||
{
|
||||
return (readl(CONFIG_SPEAR_BOOTSTRAPCFG) >> CONFIG_SPEAR_BOOTSTRAPSHFT)
|
||||
& CONFIG_SPEAR_BOOTSTRAPMASK;
|
||||
}
|
||||
|
||||
int snor_boot_selected(void)
|
||||
{
|
||||
u32 bootstrap = read_bootstrap();
|
||||
|
||||
if (SNOR_BOOT_SUPPORTED) {
|
||||
/* Check whether SNOR boot is selected */
|
||||
if ((bootstrap & CONFIG_SPEAR_ONLYSNORBOOT) ==
|
||||
CONFIG_SPEAR_ONLYSNORBOOT)
|
||||
return true;
|
||||
|
||||
if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
|
||||
CONFIG_SPEAR_NORNAND8BOOT)
|
||||
return true;
|
||||
|
||||
if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
|
||||
CONFIG_SPEAR_NORNAND16BOOT)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int nand_boot_selected(void)
|
||||
{
|
||||
u32 bootstrap = read_bootstrap();
|
||||
|
||||
if (NAND_BOOT_SUPPORTED) {
|
||||
/* Check whether NAND boot is selected */
|
||||
if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
|
||||
CONFIG_SPEAR_NORNAND8BOOT)
|
||||
return true;
|
||||
|
||||
if ((bootstrap & CONFIG_SPEAR_NORNANDBOOT) ==
|
||||
CONFIG_SPEAR_NORNAND16BOOT)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int pnor_boot_selected(void)
|
||||
{
|
||||
/* Parallel NOR boot is not selected in any SPEAr600 revision */
|
||||
return false;
|
||||
}
|
||||
|
||||
int usb_boot_selected(void)
|
||||
{
|
||||
u32 bootstrap = read_bootstrap();
|
||||
|
||||
if (USB_BOOT_SUPPORTED) {
|
||||
/* Check whether USB boot is selected */
|
||||
if (!(bootstrap & CONFIG_SPEAR_USBBOOT))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int tftp_boot_selected(void)
|
||||
{
|
||||
/* TFTP boot is not selected in any SPEAr600 revision */
|
||||
return false;
|
||||
}
|
||||
|
||||
int uart_boot_selected(void)
|
||||
{
|
||||
/* UART boot is not selected in any SPEAr600 revision */
|
||||
return false;
|
||||
}
|
||||
|
||||
int spi_boot_selected(void)
|
||||
{
|
||||
/* SPI boot is not selected in any SPEAr600 revision */
|
||||
return false;
|
||||
}
|
||||
|
||||
int i2c_boot_selected(void)
|
||||
{
|
||||
/* I2C boot is not selected in any SPEAr600 revision */
|
||||
return false;
|
||||
}
|
||||
|
||||
int mmc_boot_selected(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void plat_late_init(void)
|
||||
{
|
||||
spear_late_init();
|
||||
}
|
||||
302
arch/arm/cpu/arm926ejs/spear/spl.c
Normal file
302
arch/arm/cpu/arm926ejs/spear/spl.c
Normal file
@@ -0,0 +1,302 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2011
|
||||
* Heiko Schocher, DENX Software Engineering, hs@denx.de.
|
||||
*
|
||||
* Copyright (C) 2012 Stefan Roese <sr@denx.de>
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <init.h>
|
||||
#include <spl.h>
|
||||
#include <version.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/arch/spr_defs.h>
|
||||
#include <asm/arch/spr_misc.h>
|
||||
#include <asm/arch/spr_syscntl.h>
|
||||
#include <linux/mtd/st_smi.h>
|
||||
|
||||
/* Reserve some space to store the BootROM's stack pointer during SPL operation.
|
||||
* The BSS cannot be used for this purpose because it will be zeroed after
|
||||
* having stored the pointer, so force the location to the data section.
|
||||
*/
|
||||
u32 bootrom_stash_sp __attribute__((section(".data")));
|
||||
|
||||
static void ddr_clock_init(void)
|
||||
{
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
u32 clkenb, ddrpll;
|
||||
|
||||
clkenb = readl(&misc_p->periph1_clken);
|
||||
clkenb &= ~PERIPH_MPMCMSK;
|
||||
clkenb |= PERIPH_MPMC_WE;
|
||||
|
||||
/* Intentionally done twice */
|
||||
writel(clkenb, &misc_p->periph1_clken);
|
||||
writel(clkenb, &misc_p->periph1_clken);
|
||||
|
||||
ddrpll = readl(&misc_p->pll_ctr_reg);
|
||||
ddrpll &= ~MEM_CLK_SEL_MSK;
|
||||
#if (CONFIG_DDR_HCLK)
|
||||
ddrpll |= MEM_CLK_HCLK;
|
||||
#elif (CONFIG_DDR_2HCLK)
|
||||
ddrpll |= MEM_CLK_2HCLK;
|
||||
#elif (CONFIG_DDR_PLL2)
|
||||
ddrpll |= MEM_CLK_PLL2;
|
||||
#else
|
||||
#error "please define one of CONFIG_DDR_(HCLK|2HCLK|PLL2)"
|
||||
#endif
|
||||
writel(ddrpll, &misc_p->pll_ctr_reg);
|
||||
|
||||
writel(readl(&misc_p->periph1_clken) | PERIPH_MPMC_EN,
|
||||
&misc_p->periph1_clken);
|
||||
}
|
||||
|
||||
static void mpmc_init_values(void)
|
||||
{
|
||||
u32 i;
|
||||
u32 *mpmc_reg_p = (u32 *)CONFIG_SPEAR_MPMCBASE;
|
||||
u32 *mpmc_val_p = &mpmc_conf_vals[0];
|
||||
|
||||
for (i = 0; i < CONFIG_SPEAR_MPMCREGS; i++, mpmc_reg_p++, mpmc_val_p++)
|
||||
writel(*mpmc_val_p, mpmc_reg_p);
|
||||
|
||||
mpmc_reg_p = (u32 *)CONFIG_SPEAR_MPMCBASE;
|
||||
|
||||
/*
|
||||
* MPMC controller start
|
||||
* MPMC waiting for DLLLOCKREG high
|
||||
*/
|
||||
writel(0x01000100, &mpmc_reg_p[7]);
|
||||
|
||||
while (!(readl(&mpmc_reg_p[3]) & 0x10000))
|
||||
;
|
||||
}
|
||||
|
||||
static void mpmc_init(void)
|
||||
{
|
||||
/* Clock related settings for DDR */
|
||||
ddr_clock_init();
|
||||
|
||||
/*
|
||||
* DDR pad register bits are different for different SoCs
|
||||
* Compensation values are also handled separately
|
||||
*/
|
||||
plat_ddr_init();
|
||||
|
||||
/* Initialize mpmc register values */
|
||||
mpmc_init_values();
|
||||
}
|
||||
|
||||
static void pll_init(void)
|
||||
{
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
|
||||
/* Initialize PLLs */
|
||||
writel(FREQ_332, &misc_p->pll1_frq);
|
||||
writel(0x1C0A, &misc_p->pll1_cntl);
|
||||
writel(0x1C0E, &misc_p->pll1_cntl);
|
||||
writel(0x1C06, &misc_p->pll1_cntl);
|
||||
writel(0x1C0E, &misc_p->pll1_cntl);
|
||||
|
||||
writel(FREQ_332, &misc_p->pll2_frq);
|
||||
writel(0x1C0A, &misc_p->pll2_cntl);
|
||||
writel(0x1C0E, &misc_p->pll2_cntl);
|
||||
writel(0x1C06, &misc_p->pll2_cntl);
|
||||
writel(0x1C0E, &misc_p->pll2_cntl);
|
||||
|
||||
/* wait for pll locks */
|
||||
while (!(readl(&misc_p->pll1_cntl) & 0x1))
|
||||
;
|
||||
while (!(readl(&misc_p->pll2_cntl) & 0x1))
|
||||
;
|
||||
}
|
||||
|
||||
static void mac_init(void)
|
||||
{
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
|
||||
writel(readl(&misc_p->periph1_clken) & (~PERIPH_GMAC),
|
||||
&misc_p->periph1_clken);
|
||||
|
||||
writel(SYNTH23, &misc_p->gmac_synth_clk);
|
||||
|
||||
switch (get_socrev()) {
|
||||
case SOC_SPEAR600_AA:
|
||||
case SOC_SPEAR600_AB:
|
||||
case SOC_SPEAR600_BA:
|
||||
case SOC_SPEAR600_BB:
|
||||
case SOC_SPEAR600_BC:
|
||||
case SOC_SPEAR600_BD:
|
||||
writel(0x0, &misc_p->gmac_ctr_reg);
|
||||
break;
|
||||
|
||||
case SOC_SPEAR300:
|
||||
case SOC_SPEAR310:
|
||||
case SOC_SPEAR320:
|
||||
writel(0x4, &misc_p->gmac_ctr_reg);
|
||||
break;
|
||||
}
|
||||
|
||||
writel(readl(&misc_p->periph1_clken) | PERIPH_GMAC,
|
||||
&misc_p->periph1_clken);
|
||||
|
||||
writel(readl(&misc_p->periph1_rst) | PERIPH_GMAC,
|
||||
&misc_p->periph1_rst);
|
||||
writel(readl(&misc_p->periph1_rst) & (~PERIPH_GMAC),
|
||||
&misc_p->periph1_rst);
|
||||
}
|
||||
|
||||
static void sys_init(void)
|
||||
{
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
struct syscntl_regs *syscntl_p =
|
||||
(struct syscntl_regs *)CONFIG_SPEAR_SYSCNTLBASE;
|
||||
|
||||
/* Set system state to SLOW */
|
||||
writel(SLOW, &syscntl_p->scctrl);
|
||||
writel(PLL_TIM << 3, &syscntl_p->scpllctrl);
|
||||
|
||||
/* Initialize PLLs */
|
||||
pll_init();
|
||||
|
||||
/*
|
||||
* Ethernet configuration
|
||||
* To be done only if the tftp boot is not selected already
|
||||
* Boot code ensures the correct configuration in tftp booting
|
||||
*/
|
||||
if (!tftp_boot_selected())
|
||||
mac_init();
|
||||
|
||||
writel(RTC_DISABLE | PLLTIMEEN, &misc_p->periph_clk_cfg);
|
||||
writel(0x555, &misc_p->amba_clk_cfg);
|
||||
|
||||
writel(NORMAL, &syscntl_p->scctrl);
|
||||
|
||||
/* Wait for system to switch to normal mode */
|
||||
while (((readl(&syscntl_p->scctrl) >> MODE_SHIFT) & MODE_MASK)
|
||||
!= NORMAL)
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
* get_socrev
|
||||
*
|
||||
* Get SoC Revision.
|
||||
* @return SOC_SPEARXXX
|
||||
*/
|
||||
int get_socrev(void)
|
||||
{
|
||||
#if defined(CONFIG_SPEAR600)
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
u32 soc_id = readl(&misc_p->soc_core_id);
|
||||
u32 pri_socid = (soc_id >> SOC_PRI_SHFT) & 0xFF;
|
||||
u32 sec_socid = (soc_id >> SOC_SEC_SHFT) & 0xFF;
|
||||
|
||||
if ((pri_socid == 'B') && (sec_socid == 'B'))
|
||||
return SOC_SPEAR600_BB;
|
||||
else if ((pri_socid == 'B') && (sec_socid == 'C'))
|
||||
return SOC_SPEAR600_BC;
|
||||
else if ((pri_socid == 'B') && (sec_socid == 'D'))
|
||||
return SOC_SPEAR600_BD;
|
||||
else if (soc_id == 0)
|
||||
return SOC_SPEAR600_BA;
|
||||
else
|
||||
return SOC_SPEAR_NA;
|
||||
#elif defined(CONFIG_SPEAR300)
|
||||
return SOC_SPEAR300;
|
||||
#elif defined(CONFIG_SPEAR310)
|
||||
return SOC_SPEAR310;
|
||||
#elif defined(CONFIG_SPEAR320)
|
||||
return SOC_SPEAR320;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* SNOR (Serial NOR flash) related functions
|
||||
*/
|
||||
static void snor_init(void)
|
||||
{
|
||||
struct smi_regs *const smicntl =
|
||||
(struct smi_regs * const)CONFIG_SYS_SMI_BASE;
|
||||
|
||||
/* Setting the fast mode values. SMI working at 166/4 = 41.5 MHz */
|
||||
writel(HOLD1 | FAST_MODE | BANK_EN | DSEL_TIME | PRESCAL4,
|
||||
&smicntl->smi_cr1);
|
||||
}
|
||||
|
||||
u32 spl_boot_device(void)
|
||||
{
|
||||
u32 mode = 0;
|
||||
|
||||
if (usb_boot_selected()) {
|
||||
mode = BOOT_DEVICE_BOOTROM;
|
||||
} else if (snor_boot_selected()) {
|
||||
/* SNOR-SMI initialization */
|
||||
snor_init();
|
||||
|
||||
mode = BOOT_DEVICE_NOR;
|
||||
}
|
||||
|
||||
return mode;
|
||||
}
|
||||
|
||||
void board_boot_order(u32 *spl_boot_list)
|
||||
{
|
||||
spl_boot_list[0] = spl_boot_device();
|
||||
|
||||
/*
|
||||
* If the main boot device (eg. NOR) is empty, try to jump back into the
|
||||
* BootROM for USB boot process.
|
||||
*/
|
||||
if (USB_BOOT_SUPPORTED)
|
||||
spl_boot_list[1] = BOOT_DEVICE_BOOTROM;
|
||||
}
|
||||
|
||||
void board_init_f(ulong dummy)
|
||||
{
|
||||
struct misc_regs *misc_p = (struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
|
||||
/* Initialize PLLs */
|
||||
sys_init();
|
||||
|
||||
preloader_console_init();
|
||||
arch_cpu_init();
|
||||
|
||||
/* Enable IPs (release reset) */
|
||||
writel(PERIPH_RST_ALL, &misc_p->periph1_rst);
|
||||
|
||||
/* Initialize MPMC */
|
||||
puts("Configure DDR\n");
|
||||
mpmc_init();
|
||||
spear_late_init();
|
||||
}
|
||||
|
||||
/*
|
||||
* In a few cases (Ethernet, UART or USB boot, we might want to go back into the
|
||||
* BootROM code right after having initialized a few components like the DRAM).
|
||||
* The following function is called from SPL common code (board_init_r).
|
||||
*/
|
||||
int board_return_to_bootrom(struct spl_image_info *spl_image,
|
||||
struct spl_boot_device *bootdev)
|
||||
{
|
||||
/*
|
||||
* Retrieve the BootROM's stack pointer and jump back to the start of
|
||||
* the SPL, where we can easily branch back into the BootROM. Don't do
|
||||
* it right here because SPL might be compiled in Thumb mode while the
|
||||
* BootROM expects ARM mode.
|
||||
*/
|
||||
asm volatile ("ldr r0, =bootrom_stash_sp;"
|
||||
"ldr r0, [r0];"
|
||||
"mov sp, r0;"
|
||||
#if defined(CONFIG_SPL_SYS_THUMB_BUILD)
|
||||
"blx back_to_bootrom;"
|
||||
#else
|
||||
"bl back_to_bootrom;"
|
||||
#endif
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
113
arch/arm/cpu/arm926ejs/spear/spr600_mt47h128m8_3_266_cl5_async.c
Normal file
113
arch/arm/cpu/arm926ejs/spear/spr600_mt47h128m8_3_266_cl5_async.c
Normal file
@@ -0,0 +1,113 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2000-2009
|
||||
* Vipin Kumar, ST Microelectronics, vipin.kumar@st.com
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if (CONFIG_DDR_PLL2)
|
||||
|
||||
const u32 mpmc_conf_vals[CONFIG_SPEAR_MPMCREGS] = {
|
||||
0x00000001,
|
||||
0x00000000,
|
||||
0x01000000,
|
||||
0x00000101,
|
||||
0x00000001,
|
||||
0x01000000,
|
||||
0x00010001,
|
||||
0x00000100,
|
||||
0x00010001,
|
||||
0x00000003,
|
||||
0x01000201,
|
||||
0x06000202,
|
||||
0x06060106,
|
||||
0x03050502,
|
||||
0x03040404,
|
||||
0x02020503,
|
||||
0x02010106,
|
||||
0x03000404,
|
||||
0x02030202,
|
||||
0x03000204,
|
||||
0x0707073f,
|
||||
0x07070707,
|
||||
0x06060607,
|
||||
0x06060606,
|
||||
0x05050506,
|
||||
0x05050505,
|
||||
0x04040405,
|
||||
0x04040404,
|
||||
0x03030304,
|
||||
0x03030303,
|
||||
0x02020203,
|
||||
0x02020202,
|
||||
0x01010102,
|
||||
0x01010101,
|
||||
0x08080a01,
|
||||
0x0000023f,
|
||||
0x00040800,
|
||||
0x00000000,
|
||||
0x00000f02,
|
||||
0x00001b1b,
|
||||
0x7f000000,
|
||||
0x005f0000,
|
||||
0x1c040b6a,
|
||||
0x00640064,
|
||||
0x00640064,
|
||||
0x00640064,
|
||||
0x00000064,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x000007ff,
|
||||
0x00000000,
|
||||
0x47ec00c8,
|
||||
0x00c8001f,
|
||||
0x00000000,
|
||||
0x0000cd98,
|
||||
0x00000000,
|
||||
0x03030100,
|
||||
0x03030303,
|
||||
0x03030303,
|
||||
0x03030303,
|
||||
0x00270000,
|
||||
0x00250027,
|
||||
0x00300000,
|
||||
0x008900b7,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
#endif
|
||||
118
arch/arm/cpu/arm926ejs/spear/spr600_mt47h32m16_333_cl5_psync.c
Normal file
118
arch/arm/cpu/arm926ejs/spear/spr600_mt47h32m16_333_cl5_psync.c
Normal file
@@ -0,0 +1,118 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2000-2009
|
||||
* Vipin Kumar, ST Microelectronics, vipin.kumar@st.com
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if (CONFIG_DDR_PLL2 || CONFIG_DDR_2HCLK)
|
||||
|
||||
const u32 mpmc_conf_vals[CONFIG_SPEAR_MPMCREGS] = {
|
||||
#if (CONFIG_DDR_PLL2)
|
||||
0x00000001,
|
||||
0x00000000,
|
||||
#elif (CONFIG_DDR_2HCLK)
|
||||
0x02020201,
|
||||
0x02020202,
|
||||
#endif
|
||||
0x01000000,
|
||||
0x00000101,
|
||||
0x00000101,
|
||||
0x01000000,
|
||||
0x00010001,
|
||||
0x00000100,
|
||||
0x01010001,
|
||||
0x00000201,
|
||||
0x01000101,
|
||||
0x06000002,
|
||||
0x06060106,
|
||||
0x03050502,
|
||||
0x03040404,
|
||||
0x02020503,
|
||||
0x02010106,
|
||||
0x03000405,
|
||||
0x03040202,
|
||||
0x04000305,
|
||||
0x0707073f,
|
||||
0x07070707,
|
||||
0x06060607,
|
||||
0x06060606,
|
||||
0x05050506,
|
||||
0x05050505,
|
||||
0x04040405,
|
||||
0x04040404,
|
||||
0x03030304,
|
||||
0x03030303,
|
||||
0x02020203,
|
||||
0x02020202,
|
||||
0x01010102,
|
||||
0x01010101,
|
||||
0x0a0a0a01,
|
||||
0x0000023f,
|
||||
0x00050a00,
|
||||
0x11000000,
|
||||
0x00001302,
|
||||
0x00000A0A,
|
||||
0x72000000,
|
||||
0x00550000,
|
||||
0x2b050e86,
|
||||
0x00640064,
|
||||
0x00640064,
|
||||
0x00640064,
|
||||
0x00000064,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00000a24,
|
||||
0x43C20000,
|
||||
0x5b1c00c8,
|
||||
0x00c8002e,
|
||||
0x00000000,
|
||||
0x0001046b,
|
||||
0x00000000,
|
||||
0x03030100,
|
||||
0x03030303,
|
||||
0x03030303,
|
||||
0x03030303,
|
||||
0x00210000,
|
||||
0x00010021,
|
||||
0x00200000,
|
||||
0x006c0090,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
#endif
|
||||
@@ -0,0 +1,113 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2000-2009
|
||||
* Vipin Kumar, ST Microelectronics, vipin.kumar@st.com
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if (CONFIG_DDR_HCLK)
|
||||
|
||||
const u32 mpmc_conf_vals[CONFIG_SPEAR_MPMCREGS] = {
|
||||
0x03030301,
|
||||
0x03030303,
|
||||
0x01000000,
|
||||
0x00000101,
|
||||
0x00000001,
|
||||
0x01000000,
|
||||
0x00010001,
|
||||
0x00000100,
|
||||
0x00010001,
|
||||
0x00000003,
|
||||
0x01000201,
|
||||
0x06000202,
|
||||
0x06060106,
|
||||
0x03050502,
|
||||
0x03040404,
|
||||
0x02020503,
|
||||
0x02010106,
|
||||
0x03000404,
|
||||
0x02020202,
|
||||
0x03000203,
|
||||
0x0707073f,
|
||||
0x07070707,
|
||||
0x06060607,
|
||||
0x06060606,
|
||||
0x05050506,
|
||||
0x05050505,
|
||||
0x04040405,
|
||||
0x04040404,
|
||||
0x03030304,
|
||||
0x03030303,
|
||||
0x02020203,
|
||||
0x02020202,
|
||||
0x01010102,
|
||||
0x01010101,
|
||||
0x08080a01,
|
||||
0x0000023f,
|
||||
0x00030600,
|
||||
0x00000000,
|
||||
0x00000a02,
|
||||
0x00001c1c,
|
||||
0x7f000000,
|
||||
0x005f0000,
|
||||
0x12030743,
|
||||
0x00640064,
|
||||
0x00640064,
|
||||
0x00640064,
|
||||
0x00000064,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x0000050e,
|
||||
0x00000000,
|
||||
0x2d8900c8,
|
||||
0x00c80014,
|
||||
0x00000000,
|
||||
0x00008236,
|
||||
0x00000000,
|
||||
0x03030100,
|
||||
0x03030303,
|
||||
0x03030303,
|
||||
0x03030303,
|
||||
0x00400000,
|
||||
0x003a0040,
|
||||
0x00680000,
|
||||
0x00d80120,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
#endif
|
||||
127
arch/arm/cpu/arm926ejs/spear/spr600_mt47h64m16_3_333_cl5_psync.c
Normal file
127
arch/arm/cpu/arm926ejs/spear/spr600_mt47h64m16_3_333_cl5_psync.c
Normal file
@@ -0,0 +1,127 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2000-2009
|
||||
* Vipin Kumar, ST Microelectronics, vipin.kumar@st.com
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
|
||||
#if (CONFIG_DDR_PLL2 || CONFIG_DDR_2HCLK)
|
||||
|
||||
const u32 mpmc_conf_vals[CONFIG_SPEAR_MPMCREGS] = {
|
||||
#if (CONFIG_DDR_PLL2)
|
||||
0x00000001,
|
||||
0x00000000,
|
||||
#elif (CONFIG_DDR_2HCLK)
|
||||
0x02020201,
|
||||
0x02020202,
|
||||
#endif
|
||||
0x01000000,
|
||||
0x00000101,
|
||||
0x00000101,
|
||||
0x01000000,
|
||||
0x00010001,
|
||||
0x00000100,
|
||||
0x01010001,
|
||||
0x00000201,
|
||||
0x01000101,
|
||||
0x06000002,
|
||||
0x06060106,
|
||||
0x03050502,
|
||||
0x03040404,
|
||||
0x02020503,
|
||||
#ifdef CONFIG_X600
|
||||
0x02030206,
|
||||
#else
|
||||
0x02010106,
|
||||
#endif
|
||||
0x03000405,
|
||||
0x03040202,
|
||||
0x04000305,
|
||||
0x0707073f,
|
||||
0x07070707,
|
||||
0x06060607,
|
||||
0x06060606,
|
||||
0x05050506,
|
||||
0x05050505,
|
||||
0x04040405,
|
||||
0x04040404,
|
||||
0x03030304,
|
||||
0x03030303,
|
||||
0x02020203,
|
||||
0x02020202,
|
||||
0x01010102,
|
||||
0x01010101,
|
||||
0x0a0a0a01,
|
||||
0x0000023f,
|
||||
0x00050a00,
|
||||
0x11000000,
|
||||
0x00001302,
|
||||
0x00000A0A,
|
||||
#ifdef CONFIG_X600
|
||||
0x7f000000,
|
||||
0x005c0000,
|
||||
#else
|
||||
0x72000000,
|
||||
0x00550000,
|
||||
#endif
|
||||
0x2b050e86,
|
||||
0x00640064,
|
||||
0x00640064,
|
||||
0x00640064,
|
||||
0x00000064,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00200020,
|
||||
0x00000a24,
|
||||
0x43C20000,
|
||||
0x5b1c00c8,
|
||||
0x00c8002e,
|
||||
0x00000000,
|
||||
0x0001046b,
|
||||
0x00000000,
|
||||
0x03030100,
|
||||
0x03030303,
|
||||
0x03030303,
|
||||
0x03030303,
|
||||
0x00210000,
|
||||
0x00010021,
|
||||
0x00200000,
|
||||
0x006c0090,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x003fffff,
|
||||
0x003fffff,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000
|
||||
};
|
||||
#endif
|
||||
173
arch/arm/cpu/arm926ejs/spear/spr_lowlevel_init.S
Normal file
173
arch/arm/cpu/arm926ejs/spear/spr_lowlevel_init.S
Normal file
@@ -0,0 +1,173 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* (C) Copyright 2006
|
||||
* Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/*
|
||||
* platform specific initializations are already done in Xloader
|
||||
* Initializations already done include
|
||||
* DDR, PLLs, IP's clock enable and reset release etc
|
||||
*/
|
||||
.globl lowlevel_init
|
||||
lowlevel_init:
|
||||
mov pc, lr
|
||||
|
||||
/* void setfreq(unsigned int device, unsigned int frequency) */
|
||||
.global setfreq
|
||||
setfreq:
|
||||
stmfd sp!,{r14}
|
||||
stmfd sp!,{r0-r12}
|
||||
|
||||
mov r8,sp
|
||||
ldr sp,SRAM_STACK_V
|
||||
|
||||
/* Saving the function arguements for later use */
|
||||
mov r4,r0
|
||||
mov r5,r1
|
||||
|
||||
/* Putting DDR into self refresh */
|
||||
ldr r0,DDR_07_V
|
||||
ldr r1,[r0]
|
||||
ldr r2,DDR_ACTIVE_V
|
||||
bic r1, r1, r2
|
||||
str r1,[r0]
|
||||
ldr r0,DDR_57_V
|
||||
ldr r1,[r0]
|
||||
ldr r2,CYCLES_MASK_V
|
||||
bic r1, r1, r2
|
||||
ldr r2,REFRESH_CYCLES_V
|
||||
orr r1, r1, r2, lsl #16
|
||||
str r1,[r0]
|
||||
ldr r0,DDR_07_V
|
||||
ldr r1,[r0]
|
||||
ldr r2,SREFRESH_MASK_V
|
||||
orr r1, r1, r2
|
||||
str r1,[r0]
|
||||
|
||||
/* flush pipeline */
|
||||
b flush
|
||||
.align 5
|
||||
flush:
|
||||
/* Delay to ensure self refresh mode */
|
||||
ldr r0,SREFRESH_DELAY_V
|
||||
delay:
|
||||
sub r0,r0,#1
|
||||
cmp r0,#0
|
||||
bne delay
|
||||
|
||||
/* Putting system in slow mode */
|
||||
ldr r0,SCCTRL_V
|
||||
mov r1,#2
|
||||
str r1,[r0]
|
||||
|
||||
/* Changing PLL(1/2) frequency */
|
||||
mov r0,r4
|
||||
mov r1,r5
|
||||
|
||||
cmp r4,#0
|
||||
beq pll1_freq
|
||||
|
||||
/* Change PLL2 (DDR frequency) */
|
||||
ldr r6,PLL2_FREQ_V
|
||||
ldr r7,PLL2_CNTL_V
|
||||
b pll2_freq
|
||||
|
||||
pll1_freq:
|
||||
/* Change PLL1 (CPU frequency) */
|
||||
ldr r6,PLL1_FREQ_V
|
||||
ldr r7,PLL1_CNTL_V
|
||||
|
||||
pll2_freq:
|
||||
mov r0,r6
|
||||
ldr r1,[r0]
|
||||
ldr r2,PLLFREQ_MASK_V
|
||||
bic r1,r1,r2
|
||||
mov r2,r5,lsr#1
|
||||
orr r1,r1,r2,lsl#24
|
||||
str r1,[r0]
|
||||
|
||||
mov r0,r7
|
||||
ldr r1,P1C0A_V
|
||||
str r1,[r0]
|
||||
ldr r1,P1C0E_V
|
||||
str r1,[r0]
|
||||
ldr r1,P1C06_V
|
||||
str r1,[r0]
|
||||
ldr r1,P1C0E_V
|
||||
str r1,[r0]
|
||||
|
||||
lock:
|
||||
ldr r1,[r0]
|
||||
and r1,r1,#1
|
||||
cmp r1,#0
|
||||
beq lock
|
||||
|
||||
/* Putting system back to normal mode */
|
||||
ldr r0,SCCTRL_V
|
||||
mov r1,#4
|
||||
str r1,[r0]
|
||||
|
||||
/* Putting DDR back to normal */
|
||||
ldr r0,DDR_07_V
|
||||
ldr r1,[R0]
|
||||
ldr r2,SREFRESH_MASK_V
|
||||
bic r1, r1, r2
|
||||
str r1,[r0]
|
||||
ldr r2,DDR_ACTIVE_V
|
||||
orr r1, r1, r2
|
||||
str r1,[r0]
|
||||
|
||||
/* Delay to ensure self refresh mode */
|
||||
ldr r0,SREFRESH_DELAY_V
|
||||
1:
|
||||
sub r0,r0,#1
|
||||
cmp r0,#0
|
||||
bne 1b
|
||||
|
||||
mov sp,r8
|
||||
/* Resuming back to code */
|
||||
ldmia sp!,{r0-r12}
|
||||
ldmia sp!,{pc}
|
||||
|
||||
SCCTRL_V:
|
||||
.word 0xfca00000
|
||||
PLL1_FREQ_V:
|
||||
.word 0xfca8000C
|
||||
PLL1_CNTL_V:
|
||||
.word 0xfca80008
|
||||
PLL2_FREQ_V:
|
||||
.word 0xfca80018
|
||||
PLL2_CNTL_V:
|
||||
.word 0xfca80014
|
||||
PLLFREQ_MASK_V:
|
||||
.word 0xff000000
|
||||
P1C0A_V:
|
||||
.word 0x1C0A
|
||||
P1C0E_V:
|
||||
.word 0x1C0E
|
||||
P1C06_V:
|
||||
.word 0x1C06
|
||||
|
||||
SREFRESH_DELAY_V:
|
||||
.word 0x9999
|
||||
SRAM_STACK_V:
|
||||
.word 0xD2800600
|
||||
DDR_07_V:
|
||||
.word 0xfc60001c
|
||||
DDR_ACTIVE_V:
|
||||
.word 0x01000000
|
||||
DDR_57_V:
|
||||
.word 0xfc6000e4
|
||||
CYCLES_MASK_V:
|
||||
.word 0xffff0000
|
||||
REFRESH_CYCLES_V:
|
||||
.word 0xf0f0
|
||||
SREFRESH_MASK_V:
|
||||
.word 0x00010000
|
||||
|
||||
.global setfreq_sz
|
||||
setfreq_sz:
|
||||
.word setfreq_sz - setfreq
|
||||
253
arch/arm/cpu/arm926ejs/spear/spr_misc.c
Normal file
253
arch/arm/cpu/arm926ejs/spear/spr_misc.c
Normal file
@@ -0,0 +1,253 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2009
|
||||
* Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <cpu_func.h>
|
||||
#include <env.h>
|
||||
#include <i2c.h>
|
||||
#include <init.h>
|
||||
#include <net.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <linux/mtd/st_smi.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/arch/spr_emi.h>
|
||||
#include <asm/arch/spr_defs.h>
|
||||
|
||||
#define CPU 0
|
||||
#define DDR 1
|
||||
#define SRAM_REL 0xD2801000
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#if defined(CONFIG_CMD_NET)
|
||||
static int i2c_read_mac(uchar *buffer);
|
||||
#endif
|
||||
|
||||
int dram_init(void)
|
||||
{
|
||||
/* Store complete RAM size and return */
|
||||
gd->ram_size = get_ram_size(PHYS_SDRAM_1, PHYS_SDRAM_1_MAXSIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dram_init_banksize(void)
|
||||
{
|
||||
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
|
||||
gd->bd->bi_dram[0].size = gd->ram_size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_early_init_f()
|
||||
{
|
||||
#if defined(CONFIG_ST_SMI)
|
||||
smi_init();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
int misc_init_r(void)
|
||||
{
|
||||
#if defined(CONFIG_CMD_NET)
|
||||
uchar mac_id[6];
|
||||
|
||||
if (!eth_env_get_enetaddr("ethaddr", mac_id) && !i2c_read_mac(mac_id))
|
||||
eth_env_set_enetaddr("ethaddr", mac_id);
|
||||
#endif
|
||||
env_set("verify", "n");
|
||||
|
||||
#if defined(CONFIG_SPEAR_USBTTY)
|
||||
env_set("stdin", "usbtty");
|
||||
env_set("stdout", "usbtty");
|
||||
env_set("stderr", "usbtty");
|
||||
|
||||
#ifndef CONFIG_SYS_NO_DCACHE
|
||||
dcache_enable();
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SPEAR_EMI
|
||||
struct cust_emi_para {
|
||||
unsigned int tap;
|
||||
unsigned int tsdp;
|
||||
unsigned int tdpw;
|
||||
unsigned int tdpr;
|
||||
unsigned int tdcs;
|
||||
};
|
||||
|
||||
/* EMI timing setting of m28w640hc of linux kernel */
|
||||
const struct cust_emi_para emi_timing_m28w640hc = {
|
||||
.tap = 0x10,
|
||||
.tsdp = 0x05,
|
||||
.tdpw = 0x0a,
|
||||
.tdpr = 0x0a,
|
||||
.tdcs = 0x05,
|
||||
};
|
||||
|
||||
/* EMI timing setting of bootrom */
|
||||
const struct cust_emi_para emi_timing_bootrom = {
|
||||
.tap = 0xf,
|
||||
.tsdp = 0x0,
|
||||
.tdpw = 0xff,
|
||||
.tdpr = 0x111,
|
||||
.tdcs = 0x02,
|
||||
};
|
||||
|
||||
void spear_emi_init(void)
|
||||
{
|
||||
const struct cust_emi_para *p = &emi_timing_m28w640hc;
|
||||
struct emi_regs *emi_regs_p = (struct emi_regs *)CONFIG_SPEAR_EMIBASE;
|
||||
unsigned int cs;
|
||||
unsigned int val, tmp;
|
||||
|
||||
val = readl(CONFIG_SPEAR_RASBASE);
|
||||
|
||||
if (val & EMI_ACKMSK)
|
||||
tmp = 0x3f;
|
||||
else
|
||||
tmp = 0x0;
|
||||
|
||||
writel(tmp, &emi_regs_p->ack);
|
||||
|
||||
for (cs = 0; cs < CONFIG_SYS_MAX_FLASH_BANKS; cs++) {
|
||||
writel(p->tap, &emi_regs_p->bank_regs[cs].tap);
|
||||
writel(p->tsdp, &emi_regs_p->bank_regs[cs].tsdp);
|
||||
writel(p->tdpw, &emi_regs_p->bank_regs[cs].tdpw);
|
||||
writel(p->tdpr, &emi_regs_p->bank_regs[cs].tdpr);
|
||||
writel(p->tdcs, &emi_regs_p->bank_regs[cs].tdcs);
|
||||
writel(EMI_CNTL_ENBBYTERW | ((val & 0x18) >> 3),
|
||||
&emi_regs_p->bank_regs[cs].control);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int spear_board_init(ulong mach_type)
|
||||
{
|
||||
gd->bd->bi_arch_number = mach_type;
|
||||
|
||||
/* adress of boot parameters */
|
||||
gd->bd->bi_boot_params = CONFIG_BOOT_PARAMS_ADDR;
|
||||
|
||||
#ifdef CONFIG_SPEAR_EMI
|
||||
spear_emi_init();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_CMD_NET)
|
||||
static int i2c_read_mac(uchar *buffer)
|
||||
{
|
||||
u8 buf[2];
|
||||
|
||||
i2c_read(CONFIG_I2C_CHIPADDRESS, MAGIC_OFF, 1, buf, MAGIC_LEN);
|
||||
|
||||
/* Check if mac in i2c memory is valid */
|
||||
if ((buf[0] == MAGIC_BYTE0) && (buf[1] == MAGIC_BYTE1)) {
|
||||
/* Valid mac address is saved in i2c eeprom */
|
||||
i2c_read(CONFIG_I2C_CHIPADDRESS, MAC_OFF, 1, buffer, MAC_LEN);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int write_mac(uchar *mac)
|
||||
{
|
||||
u8 buf[2];
|
||||
|
||||
buf[0] = (u8)MAGIC_BYTE0;
|
||||
buf[1] = (u8)MAGIC_BYTE1;
|
||||
i2c_write(CONFIG_I2C_CHIPADDRESS, MAGIC_OFF, 1, buf, MAGIC_LEN);
|
||||
|
||||
buf[0] = (u8)~MAGIC_BYTE0;
|
||||
buf[1] = (u8)~MAGIC_BYTE1;
|
||||
|
||||
i2c_read(CONFIG_I2C_CHIPADDRESS, MAGIC_OFF, 1, buf, MAGIC_LEN);
|
||||
|
||||
/* check if valid MAC address is saved in I2C EEPROM or not? */
|
||||
if ((buf[0] == MAGIC_BYTE0) && (buf[1] == MAGIC_BYTE1)) {
|
||||
i2c_write(CONFIG_I2C_CHIPADDRESS, MAC_OFF, 1, mac, MAC_LEN);
|
||||
puts("I2C EEPROM written with mac address \n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
puts("I2C EEPROM writing failed\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int do_chip_config(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
void (*sram_setfreq) (unsigned int, unsigned int);
|
||||
unsigned int frequency;
|
||||
#if defined(CONFIG_CMD_NET)
|
||||
unsigned char mac[6];
|
||||
#endif
|
||||
|
||||
if ((argc > 3) || (argc < 2))
|
||||
return cmd_usage(cmdtp);
|
||||
|
||||
if ((!strcmp(argv[1], "cpufreq")) || (!strcmp(argv[1], "ddrfreq"))) {
|
||||
|
||||
frequency = simple_strtoul(argv[2], NULL, 0);
|
||||
|
||||
if (frequency > 333) {
|
||||
printf("Frequency is limited to 333MHz\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
sram_setfreq = memcpy((void *)SRAM_REL, setfreq, setfreq_sz);
|
||||
|
||||
if (!strcmp(argv[1], "cpufreq")) {
|
||||
sram_setfreq(CPU, frequency);
|
||||
printf("CPU frequency changed to %u\n", frequency);
|
||||
} else {
|
||||
sram_setfreq(DDR, frequency);
|
||||
printf("DDR frequency changed to %u\n", frequency);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
#if defined(CONFIG_CMD_NET)
|
||||
} else if (!strcmp(argv[1], "ethaddr")) {
|
||||
|
||||
u32 reg;
|
||||
char *e, *s = argv[2];
|
||||
for (reg = 0; reg < 6; ++reg) {
|
||||
mac[reg] = s ? simple_strtoul(s, &e, 16) : 0;
|
||||
if (s)
|
||||
s = (*e) ? e + 1 : e;
|
||||
}
|
||||
write_mac(mac);
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
} else if (!strcmp(argv[1], "print")) {
|
||||
#if defined(CONFIG_CMD_NET)
|
||||
if (!i2c_read_mac(mac)) {
|
||||
printf("Ethaddr (from i2c mem) = %pM\n", mac);
|
||||
} else {
|
||||
printf("Ethaddr (from i2c mem) = Not set\n");
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
return cmd_usage(cmdtp);
|
||||
}
|
||||
|
||||
U_BOOT_CMD(chip_config, 3, 1, do_chip_config,
|
||||
"configure chip",
|
||||
"chip_config cpufreq/ddrfreq frequency\n"
|
||||
#if defined(CONFIG_CMD_NET)
|
||||
"chip_config ethaddr XX:XX:XX:XX:XX:XX\n"
|
||||
#endif
|
||||
"chip_config print");
|
||||
65
arch/arm/cpu/arm926ejs/spear/start.S
Normal file
65
arch/arm/cpu/arm926ejs/spear/start.S
Normal file
@@ -0,0 +1,65 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* armboot - Startup Code for ARM926EJS CPU-core
|
||||
*
|
||||
* Copyright (c) 2003 Texas Instruments
|
||||
*
|
||||
* ----- Adapted for OMAP1610 OMAP730 from ARM925t code ------
|
||||
*
|
||||
* Copyright (c) 2001 Marius Gröger <mag@sysgo.de>
|
||||
* Copyright (c) 2002 Alex Züpke <azu@sysgo.de>
|
||||
* Copyright (c) 2002 Gary Jennejohn <garyj@denx.de>
|
||||
* Copyright (c) 2003 Richard Woodruff <r-woodruff2@ti.com>
|
||||
* Copyright (c) 2003 Kshitij <kshitij@ti.com>
|
||||
*/
|
||||
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
*
|
||||
* Startup Code (reset vector)
|
||||
*
|
||||
* The BootROM already initialized its own stack in the [0-0xb00] reserved
|
||||
* range of the SRAM. The SPL (in _main) will update the stack pointer to
|
||||
* its own SRAM area (right before the gd section).
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
|
||||
.globl reset
|
||||
.globl back_to_bootrom
|
||||
|
||||
reset:
|
||||
/*
|
||||
* SPL has to return back to BootROM in a few cases (eg. Ethernet boot,
|
||||
* UART boot, USB boot): save registers in BootROM's stack and then the
|
||||
* BootROM's stack pointer in the SPL's data section.
|
||||
*/
|
||||
push {r0-r12,lr}
|
||||
ldr r0, =bootrom_stash_sp
|
||||
str sp, [r0]
|
||||
|
||||
/*
|
||||
* Flush v4 I/D caches
|
||||
*/
|
||||
mov r0, #0
|
||||
mcr p15, 0, r0, c7, c7, 0 /* Flush v3/v4 cache */
|
||||
mcr p15, 0, r0, c8, c7, 0 /* Flush v4 TLB */
|
||||
|
||||
/*
|
||||
* Enable instruction cache
|
||||
*/
|
||||
mrc p15, 0, r0, c1, c0, 0
|
||||
orr r0, r0, #0x00001000 /* set bit 12 (I) I-Cache */
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
/*
|
||||
* Go setup Memory and board specific bits prior to relocation.
|
||||
* This call is not supposed to return.
|
||||
*/
|
||||
b _main /* _main will call board_init_f */
|
||||
|
||||
back_to_bootrom:
|
||||
pop {r0-r12,pc}
|
||||
124
arch/arm/cpu/arm926ejs/spear/timer.c
Normal file
124
arch/arm/cpu/arm926ejs/spear/timer.c
Normal file
@@ -0,0 +1,124 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* (C) Copyright 2009
|
||||
* Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
|
||||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <init.h>
|
||||
#include <time.h>
|
||||
#include <asm/global_data.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/arch/hardware.h>
|
||||
#include <asm/arch/spr_gpt.h>
|
||||
#include <asm/arch/spr_misc.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#define GPT_RESOLUTION (CONFIG_SPEAR_HZ_CLOCK / CONFIG_SPEAR_HZ)
|
||||
#define READ_TIMER() (readl(&gpt_regs_p->count) & GPT_FREE_RUNNING)
|
||||
|
||||
static struct gpt_regs *const gpt_regs_p =
|
||||
(struct gpt_regs *)CONFIG_SPEAR_TIMERBASE;
|
||||
|
||||
static struct misc_regs *const misc_regs_p =
|
||||
(struct misc_regs *)CONFIG_SPEAR_MISCBASE;
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
static ulong get_timer_masked(void);
|
||||
|
||||
#define timestamp gd->arch.tbl
|
||||
#define lastdec gd->arch.lastinc
|
||||
|
||||
int timer_init(void)
|
||||
{
|
||||
u32 synth;
|
||||
|
||||
/* Prescaler setting */
|
||||
#if defined(CONFIG_SPEAR3XX)
|
||||
writel(MISC_PRSC_CFG, &misc_regs_p->prsc2_clk_cfg);
|
||||
synth = MISC_GPT4SYNTH;
|
||||
#elif defined(CONFIG_SPEAR600)
|
||||
writel(MISC_PRSC_CFG, &misc_regs_p->prsc1_clk_cfg);
|
||||
synth = MISC_GPT3SYNTH;
|
||||
#else
|
||||
# error Incorrect config. Can only be SPEAR{600|300|310|320}
|
||||
#endif
|
||||
|
||||
writel(readl(&misc_regs_p->periph_clk_cfg) | synth,
|
||||
&misc_regs_p->periph_clk_cfg);
|
||||
|
||||
/* disable timers */
|
||||
writel(GPT_PRESCALER_1 | GPT_MODE_AUTO_RELOAD, &gpt_regs_p->control);
|
||||
|
||||
/* load value for free running */
|
||||
writel(GPT_FREE_RUNNING, &gpt_regs_p->compare);
|
||||
|
||||
/* auto reload, start timer */
|
||||
writel(readl(&gpt_regs_p->control) | GPT_ENABLE, &gpt_regs_p->control);
|
||||
|
||||
/* Reset the timer */
|
||||
lastdec = READ_TIMER();
|
||||
timestamp = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* timer without interrupts
|
||||
*/
|
||||
ulong get_timer(ulong base)
|
||||
{
|
||||
return (get_timer_masked() / GPT_RESOLUTION) - base;
|
||||
}
|
||||
|
||||
void __udelay(unsigned long usec)
|
||||
{
|
||||
ulong tmo;
|
||||
ulong start = get_timer_masked();
|
||||
ulong tenudelcnt = CONFIG_SPEAR_HZ_CLOCK / (1000 * 100);
|
||||
ulong rndoff;
|
||||
|
||||
rndoff = (usec % 10) ? 1 : 0;
|
||||
|
||||
/* tenudelcnt timer tick gives 10 microsecconds delay */
|
||||
tmo = ((usec / 10) + rndoff) * tenudelcnt;
|
||||
|
||||
while ((ulong) (get_timer_masked() - start) < tmo)
|
||||
;
|
||||
}
|
||||
|
||||
static ulong get_timer_masked(void)
|
||||
{
|
||||
ulong now = READ_TIMER();
|
||||
|
||||
if (now >= lastdec) {
|
||||
/* normal mode */
|
||||
timestamp += now - lastdec;
|
||||
} else {
|
||||
/* we have an overflow ... */
|
||||
timestamp += now + GPT_FREE_RUNNING - lastdec;
|
||||
}
|
||||
lastdec = now;
|
||||
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is derived from PowerPC code (read timebase as long long).
|
||||
* On ARM it just returns the timer value.
|
||||
*/
|
||||
unsigned long long get_ticks(void)
|
||||
{
|
||||
return get_timer(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is derived from PowerPC code (timebase clock frequency).
|
||||
* On ARM it returns the number of timer ticks per second.
|
||||
*/
|
||||
ulong get_tbclk(void)
|
||||
{
|
||||
return CONFIG_SPEAR_HZ;
|
||||
}
|
||||
54
arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
Normal file
54
arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
Normal file
@@ -0,0 +1,54 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Copyright (C) 2015 Stefan Roese <sr@denx.de>
|
||||
*
|
||||
* Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com>
|
||||
* on behalf of DENX Software Engineering GmbH
|
||||
*
|
||||
* January 2004 - Changed to support H4 device
|
||||
* Copyright (c) 2004-2008 Texas Instruments
|
||||
*
|
||||
* (C) Copyright 2002
|
||||
* Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
|
||||
*/
|
||||
|
||||
MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,\
|
||||
LENGTH = IMAGE_MAX_SIZE }
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
__start = .;
|
||||
*(.vectors)
|
||||
CPUDIR/spear/start.o (.text*)
|
||||
*(.text*)
|
||||
} > .sram
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
|
||||
|
||||
. = ALIGN(4);
|
||||
.u_boot_list : {
|
||||
KEEP(*(SORT(.u_boot_list*)));
|
||||
} > .sram
|
||||
|
||||
. = ALIGN(4);
|
||||
__image_copy_end = .;
|
||||
_end = .;
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
*(.bss*)
|
||||
. = ALIGN(4);
|
||||
__bss_end = .;
|
||||
} > .sram
|
||||
}
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <common.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
/*
|
||||
*************************************************************************
|
||||
@@ -33,13 +32,8 @@
|
||||
*/
|
||||
|
||||
.globl reset
|
||||
.globl save_boot_params_ret
|
||||
.type save_boot_params_ret,%function
|
||||
|
||||
reset:
|
||||
/* Allow the board to save important registers */
|
||||
b save_boot_params
|
||||
save_boot_params_ret:
|
||||
/*
|
||||
* set the cpu to SVC32 mode
|
||||
*/
|
||||
@@ -52,7 +46,7 @@ save_boot_params_ret:
|
||||
* we do sys-critical inits only at reboot,
|
||||
* not when booting from ram!
|
||||
*/
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
@@ -75,7 +69,7 @@ c_runtime_cpu_setup:
|
||||
*
|
||||
*************************************************************************
|
||||
*/
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
cpu_init_crit:
|
||||
/*
|
||||
* flush D cache before disabling it
|
||||
@@ -106,7 +100,7 @@ flush_dcache:
|
||||
#endif
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT_ONLY)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
|
||||
/*
|
||||
* Go setup Memory and board specific bits prior to relocation.
|
||||
*/
|
||||
@@ -115,17 +109,4 @@ flush_dcache:
|
||||
mov lr, r4 /* restore link */
|
||||
#endif
|
||||
mov pc, lr /* back to my caller */
|
||||
#endif /* CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT) */
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3)
|
||||
* __attribute__((weak));
|
||||
*
|
||||
* Stack pointer is not yet initialized at this moment
|
||||
* Don't save anything to stack even if compiled with -O0
|
||||
*
|
||||
*************************************************************************/
|
||||
WEAK(save_boot_params)
|
||||
b save_boot_params_ret /* back to my caller */
|
||||
ENDPROC(save_boot_params)
|
||||
#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0+
|
||||
# (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
|
||||
|
||||
obj-y += fel_utils.o
|
||||
CFLAGS_fel_utils.o := -marm
|
||||
@@ -1,6 +0,0 @@
|
||||
# Build a combined spl + u-boot image
|
||||
ifdef CONFIG_SPL
|
||||
ifndef CONFIG_SPL_BUILD
|
||||
ALL-y += u-boot-sunxi-with-spl.bin
|
||||
endif
|
||||
endif
|
||||
@@ -1,33 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* Utility functions for FEL mode.
|
||||
*
|
||||
* Copyright (c) 2015 Google, Inc
|
||||
*/
|
||||
|
||||
#include <asm-offsets.h>
|
||||
#include <config.h>
|
||||
#include <asm/system.h>
|
||||
#include <linux/linkage.h>
|
||||
|
||||
ENTRY(save_boot_params)
|
||||
ldr r0, =fel_stash
|
||||
str sp, [r0, #0]
|
||||
str lr, [r0, #4]
|
||||
mrs lr, cpsr @ Read CPSR
|
||||
str lr, [r0, #8]
|
||||
mrc p15, 0, lr, c1, c0, 0 @ Read CP15 SCTLR Register
|
||||
str lr, [r0, #12]
|
||||
b save_boot_params_ret
|
||||
ENDPROC(save_boot_params)
|
||||
|
||||
ENTRY(return_to_fel)
|
||||
mov sp, r0
|
||||
mov lr, r1
|
||||
ldr r0, =fel_stash
|
||||
ldr r1, [r0, #12]
|
||||
mcr p15, 0, r1, c1, c0, 0 @ Write CP15 SCTLR register
|
||||
ldr r1, [r0, #8]
|
||||
msr cpsr, r1 @ Write CPSR
|
||||
bx lr
|
||||
ENDPROC(return_to_fel)
|
||||
@@ -1,48 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0+ */
|
||||
/*
|
||||
* (C) Copyright 2018
|
||||
* Icenowy Zheng <icenowy@aosc.io>
|
||||
*
|
||||
* Based on arch/arm/cpu/armv7/sunxi/u-boot-spl.lds:
|
||||
*/
|
||||
MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
|
||||
LENGTH = CONFIG_SPL_MAX_SIZE }
|
||||
MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
|
||||
LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
|
||||
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
__start = .;
|
||||
*(.vectors)
|
||||
*(.text*)
|
||||
} > .sram
|
||||
|
||||
. = ALIGN(4);
|
||||
.rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
|
||||
|
||||
. = ALIGN(4);
|
||||
.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
|
||||
|
||||
. = ALIGN(4);
|
||||
.u_boot_list : {
|
||||
KEEP(*(SORT(.u_boot_list*)));
|
||||
} > .sram
|
||||
|
||||
. = ALIGN(4);
|
||||
__image_copy_end = .;
|
||||
_end = .;
|
||||
|
||||
.bss :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__bss_start = .;
|
||||
*(.bss*)
|
||||
. = ALIGN(4);
|
||||
__bss_end = .;
|
||||
} > .sdram
|
||||
}
|
||||
@@ -56,7 +56,7 @@ static void cache_flush (void)
|
||||
|
||||
#ifndef CONFIG_ARCH_INTEGRATOR
|
||||
|
||||
__attribute__((noreturn)) void reset_cpu(void)
|
||||
__attribute__((noreturn)) void reset_cpu(ulong addr __attribute__((unused)))
|
||||
{
|
||||
writew(0x0, 0xfffece10);
|
||||
writew(0x8, 0xfffece10);
|
||||
|
||||
@@ -45,7 +45,7 @@ reset:
|
||||
* we do sys-critical inits only at reboot,
|
||||
* not when booting from ram!
|
||||
*/
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
bl cpu_init_crit
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,7 @@ c_runtime_cpu_setup:
|
||||
*/
|
||||
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
cpu_init_crit:
|
||||
/*
|
||||
* flush v4 I/D caches
|
||||
@@ -89,7 +89,7 @@ cpu_init_crit:
|
||||
orr r0, r0, #0x00001000 /* set bit 12 (I) I-Cache */
|
||||
mcr p15, 0, r0, c1, c0, 0
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SKIP_LOWLEVEL_INIT_ONLY)
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
|
||||
/*
|
||||
* Go setup Memory and board specific bits prior to relocation.
|
||||
*/
|
||||
|
||||
@@ -27,37 +27,6 @@ config ARMV7_BOOT_SEC_DEFAULT
|
||||
This can be overridden at run-time by setting the bootm_boot_mode env.
|
||||
variable to "sec" or "nonsec".
|
||||
|
||||
config HAS_ARMV7_SECURE_BASE
|
||||
bool "Enable support for a ahardware secure memory area"
|
||||
default y if ARCH_LS1021A || ARCH_MX7 || ARCH_MX7ULP || ARCH_STM32MP \
|
||||
|| MACH_SUN6I || MACH_SUN7I || MACH_SUN8I || TEGRA124
|
||||
|
||||
config ARMV7_SECURE_BASE
|
||||
hex "Base address for secure mode memory"
|
||||
depends on HAS_ARMV7_SECURE_BASE
|
||||
default 0xfff00000 if TEGRA124
|
||||
default 0x2ffc0000 if ARCH_STM32MP
|
||||
default 0x2f000000 if ARCH_MX7ULP
|
||||
default 0x10010000 if ARCH_LS1021A
|
||||
default 0x00900000 if ARCH_MX7
|
||||
default 0x00044000 if MACH_SUN8I
|
||||
default 0x00020000 if MACH_SUN6I || MACH_SUN7I
|
||||
|
||||
config ARMV7_SECURE_RESERVE_SIZE
|
||||
hex
|
||||
depends on TEGRA124 && HAS_ARMV7_SECURE_BASE
|
||||
default 0x100000
|
||||
help
|
||||
Reserve top 1M for secure RAM
|
||||
|
||||
config ARMV7_SECURE_MAX_SIZE
|
||||
hex
|
||||
depends on ARMV7_SECURE_BASE && ARCH_STM32MP || MACH_SUN6I \
|
||||
|| MACH_SUN7I || MACH_SUN8I
|
||||
default 0xbc00 if MACH_SUN8I && !MACH_SUN8I_H3
|
||||
default 0x3c00 if MACH_SUN8I && MACH_SUN8I_H3
|
||||
default 0x10000
|
||||
|
||||
config ARMV7_VIRT
|
||||
bool "Enable support for hardware virtualization" if EXPERT
|
||||
depends on CPU_V7_HAS_VIRT && ARMV7_NONSEC
|
||||
@@ -107,9 +76,4 @@ config ARMV7_LPAE
|
||||
Say Y here to use the long descriptor page table format. This is
|
||||
required if U-Boot runs in HYP mode.
|
||||
|
||||
config SPL_ARMV7_SET_CORTEX_SMPEN
|
||||
bool
|
||||
help
|
||||
Enable the ARM Cortex ACTLR.SMP enable bit on SPL startup.
|
||||
|
||||
endif
|
||||
|
||||
@@ -17,7 +17,7 @@ obj-$(CONFIG_EFI_LOADER) += sctlr.o
|
||||
obj-$(CONFIG_ARMV7_NONSEC) += exception_level.o
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_$(SPL_)SKIP_LOWLEVEL_INIT),y)
|
||||
ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y)
|
||||
obj-y += lowlevel_init.o
|
||||
endif
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define CLKS_SHIFT 20 /* Clock period shift */
|
||||
#define LD_SHIFT 0 /* Reload value shift */
|
||||
|
||||
void reset_cpu(void)
|
||||
void reset_cpu(ulong ignored)
|
||||
{
|
||||
/*
|
||||
* Set WD enable, RST enable,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define CRMU_MAIL_BOX1 0x03024028
|
||||
#define CRMU_SOFT_RESET_CMD 0xFFFFFFFF
|
||||
|
||||
void reset_cpu(void)
|
||||
void reset_cpu(ulong ignored)
|
||||
{
|
||||
/* Send soft reset command via Mailbox. */
|
||||
writel(CRMU_SOFT_RESET_CMD, CRMU_MAIL_BOX1);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#define CRU_RESET_OFFSET 0x1803F184
|
||||
|
||||
void reset_cpu(void)
|
||||
void reset_cpu(ulong ignored)
|
||||
{
|
||||
/* Reset the cpu by setting software reset request bit */
|
||||
writel(0x1, CRU_RESET_OFFSET);
|
||||
|
||||
@@ -176,6 +176,9 @@ void mmu_page_table_flush(unsigned long start, unsigned long stop)
|
||||
{
|
||||
}
|
||||
|
||||
void arm_init_domains(void)
|
||||
{
|
||||
}
|
||||
#endif /* #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) */
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SYS_ICACHE_OFF)
|
||||
|
||||
@@ -19,22 +19,19 @@ struct armpll_parameters {
|
||||
};
|
||||
|
||||
struct armpll_parameters armpll_clk_tab[] = {
|
||||
{ 25, 64, 1, 1, 0},
|
||||
{ 100, 64, 1, 1, 2},
|
||||
{ 400, 64, 1, 1, 6},
|
||||
{ 448, 71, 713050, 1, 6},
|
||||
{ 500, 80, 1, 1, 6},
|
||||
{ 560, 89, 629145, 1, 6},
|
||||
{ 600, 96, 1, 1, 6},
|
||||
{ 800, 64, 1, 1, 7},
|
||||
{ 896, 71, 713050, 1, 7},
|
||||
{ 1000, 80, 1, 1, 7},
|
||||
{ 1100, 88, 1, 1, 7},
|
||||
{ 1120, 89, 629145, 1, 7},
|
||||
{ 1200, 96, 1, 1, 7},
|
||||
{ 1300, 104, 1, 1, 7},
|
||||
{ 1350, 108, 1, 1, 7},
|
||||
{ 1400, 112, 1, 1, 7},
|
||||
{ 25, 64, 1, 1, 0},
|
||||
{ 100, 64, 1, 1, 2},
|
||||
{ 400, 64, 1, 1, 6},
|
||||
{ 448, 71, 713050, 1, 6},
|
||||
{ 500, 80, 1, 1, 6},
|
||||
{ 560, 89, 629145, 1, 6},
|
||||
{ 600, 96, 1, 1, 6},
|
||||
{ 800, 64, 1, 1, 7},
|
||||
{ 896, 71, 713050, 1, 7},
|
||||
{ 1000, 80, 1, 1, 7},
|
||||
{ 1100, 88, 1, 1, 7},
|
||||
{ 1120, 89, 629145, 1, 7},
|
||||
{ 1200, 96, 1, 1, 7},
|
||||
};
|
||||
|
||||
uint32_t armpll_config(uint32_t clkmhz)
|
||||
|
||||
@@ -14,7 +14,7 @@ int __weak clk_sdio_enable(void *base, u32 rate, u32 *actual_ratep)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __weak clk_bsc_enable(void *base)
|
||||
int __weak clk_bsc_enable(void *base, u32 rate, u32 *actual_ratep)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
config ARCH_LS1021A
|
||||
bool
|
||||
select FSL_IFC if !QSPI_BOOT && !SD_BOOT_QSPI
|
||||
select SYS_FSL_DDR_BE if SYS_FSL_DDR
|
||||
select SYS_FSL_DDR_VER_50 if SYS_FSL_DDR
|
||||
select SYS_FSL_ERRATUM_A008378
|
||||
select SYS_FSL_ERRATUM_A008407
|
||||
select SYS_FSL_ERRATUM_A008850 if SYS_FSL_DDR
|
||||
select SYS_FSL_ERRATUM_A008850
|
||||
select SYS_FSL_ERRATUM_A008997 if USB
|
||||
select SYS_FSL_ERRATUM_A009007 if USB
|
||||
select SYS_FSL_ERRATUM_A009008 if USB
|
||||
select SYS_FSL_ERRATUM_A009663
|
||||
select SYS_FSL_ERRATUM_A009798 if USB
|
||||
@@ -20,7 +20,6 @@ config ARCH_LS1021A
|
||||
select SYS_FSL_SEC_LE
|
||||
select SYS_FSL_SRDS_1
|
||||
select SYS_HAS_SERDES
|
||||
select SYS_I2C_MXC
|
||||
imply CMD_PCI
|
||||
imply SCSI
|
||||
imply SCSI_AHCI
|
||||
|
||||
@@ -39,11 +39,11 @@ void get_sys_info(struct sys_info *sys_info)
|
||||
uint i;
|
||||
uint freq_c_pll[CONFIG_SYS_FSL_NUM_CC_PLLS];
|
||||
uint ratio[CONFIG_SYS_FSL_NUM_CC_PLLS];
|
||||
unsigned long sysclk = get_board_sys_clk();
|
||||
unsigned long sysclk = CONFIG_SYS_CLK_FREQ;
|
||||
|
||||
sys_info->freq_systembus = sysclk;
|
||||
#if defined(CONFIG_DYNAMIC_DDR_CLK_FREQ) || defined(CONFIG_STATIC_DDR_CLK_FREQ)
|
||||
sys_info->freq_ddrbus = get_board_ddr_clk();
|
||||
#ifdef CONFIG_DDR_CLK_FREQ
|
||||
sys_info->freq_ddrbus = CONFIG_DDR_CLK_FREQ;
|
||||
#else
|
||||
sys_info->freq_ddrbus = sysclk;
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user