diff --git a/.gitignore b/.gitignore index f72f3a2fd4e..cedfe85522d 100644 --- a/.gitignore +++ b/.gitignore @@ -87,3 +87,5 @@ GTAGS *.orig *~ \#*# + +rkbin diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..42e54617152 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "rkbin"] + path = rkbin + url = https://github.com/hardkernel/rk3568_rkbin + branch = odroidm1-v2017.09 diff --git a/.travis.yml b/.travis.yml index 0b7a0622bfd..fa44b97d980 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,15 @@ -# Copyright Roger Meier -# SPDX-License-Identifier: GPL-2.0+ - -# build U-Boot on Travis CI - https://travis-ci.org/ +language: c -sudo: required -dist: trusty +env: + global: + - TRAVIS_SECURE_ENV_VARS=true + - ARCH=arm64 + - CROSS_COMPILE=aarch64-linux-gnu- -language: c +matrix: + include: + - env: + - TARGET_BOARD=odroid_rk3568 addons: apt: @@ -27,328 +30,45 @@ addons: - rpm2cpio - wget - device-tree-compiler + - lzop + - gcc + - libncurses5-dev -install: - # Clone uboot-test-hooks - - git clone --depth=1 git://github.com/swarren/uboot-test-hooks.git /tmp/uboot-test-hooks - - ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname` - - ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname` - # prepare buildman environment - - echo -e "[toolchain]\nroot = /usr" > ~/.buildman - - echo -e "aarch64 = /tmp/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu" >> ~/.buildman - - echo -e "arm = /tmp/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf" >> ~/.buildman - - echo -e "arc = /tmp/arc_gnu_2016.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman - - echo -e "\n[toolchain-alias]\nsh = sh4\nopenrisc = or32" >> ~/.buildman - - cat ~/.buildman - - virtualenv /tmp/venv - - . /tmp/venv/bin/activate - - pip install pytest - - grub-mkimage -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd - - mkdir ~/grub2-arm - - ( cd ~/grub2-arm; wget -O - http://download.opensuse.org/ports/armv7hl/distribution/leap/42.2/repo/oss/suse/armv7hl/grub2-arm-efi-2.02~beta2-87.1.armv7hl.rpm | rpm2cpio | cpio -di ) +git: + depth: 1 -env: - global: - - PATH=/tmp/qemu-install/bin:/tmp/uboot-test-hooks/bin:/usr/bin:/bin - - PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci - - BUILD_DIR=build - - HOSTCC="cc" - - HOSTCXX="c++" +before_install: + - if [ `uname -m` = x86_64 ]; then sudo apt-get install libc6-i386 lib32stdc++6 lib32z1; fi + +install: before_script: - # install toolchains based on TOOLCHAIN} variable - - if [[ "${TOOLCHAIN}" == *m68k* ]]; then ./tools/buildman/buildman --fetch-arch m68k ; fi - - if [[ "${TOOLCHAIN}" == *microblaze* ]]; then ./tools/buildman/buildman --fetch-arch microblaze ; fi - - if [[ "${TOOLCHAIN}" == *mips* ]]; then ./tools/buildman/buildman --fetch-arch mips ; fi - - if [[ "${TOOLCHAIN}" == *or32* ]]; then ./tools/buildman/buildman --fetch-arch or32 ; fi - - if [[ "${TOOLCHAIN}" == *sh4* ]]; then ./tools/buildman/buildman --fetch-arch sh4 ; fi - - if [[ "${TOOLCHAIN}" == *x86_64* ]]; then - ./tools/buildman/buildman --fetch-arch x86_64; - echo -e "\n[toolchain-prefix]\nx86 = ${HOME}/.buildman-toolchains/gcc-4.9.0-nolibc/x86_64-linux/bin/x86_64-linux-" >> ~/.buildman; - fi - - if [[ "${TOOLCHAIN}" == arc ]]; then - wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2016.09-release/arc_gnu_2016.09_prebuilt_uclibc_le_archs_linux_install.tar.gz && - tar -C /tmp -xf arc_gnu_2016.09_prebuilt_uclibc_le_archs_linux_install.tar.gz; - fi - - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then ./tools/buildman/buildman --fetch-arch xtensa ; fi - # If TOOLCHAIN is unset, we're on some flavour of ARM. - - if [[ "${TOOLCHAIN}" == "" ]]; then - wget http://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz && - wget http://releases.linaro.org/components/toolchain/binaries/6.3-2017.02/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz && - tar -C /tmp -xf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz && - tar -C /tmp -xf gcc-linaro-6.3.1-2017.02-x86_64_arm-linux-gnueabihf.tar.xz; - fi - - if [[ "${QEMU_TARGET}" != "" ]]; then - git clone git://git.qemu.org/qemu.git /tmp/qemu; - pushd /tmp/qemu; - git submodule update --init dtc && - git checkout v2.8.0-rc3 && - ./configure --prefix=/tmp/qemu-install --target-list=${QEMU_TARGET} && - make -j4 all install; - popd; - fi + - mkdir -p /opt/toolchains + - wget https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz + - tar xvf gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt/toolchains/ + - wget https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.2.0-1.2/xpack-riscv-none-embed-gcc-10.2.0-1.2-linux-x64.tar.gz + - tar xvf xpack-riscv-none-embed-gcc-10.2.0-1.2-linux-x64.tar.gz -C /opt/toolchains/ + - export PATH=$TOPDIR/opt/toolchains/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin:/opt/toolchains/xpack-riscv-none-embed-gcc-10.2.0-1.2/bin:$PATH script: - # Comments must be outside the command strings below, or the Travis parser - # will get confused. - # - # Exit code 129 means warnings only. - - if [[ "${BUILDMAN}" != "" ]]; then - set +e; - tools/buildman/buildman -P ${BUILDMAN}; - ret=$?; - if [[ $ret -ne 0 && $ret -ne 129 ]]; then - tools/buildman/buildman -sdeP ${BUILDMAN}; - exit $ret; - fi; - fi - # "not a_test_which_does_not_exist" is a dummy -k parameter which will - # never prevent any test from running. That way, we can always pass - # "-k something" even when $TEST_PY_TEST_SPEC doesnt need a custom - # value. - - export UBOOT_TRAVIS_BUILD_DIR=`cd .. && pwd`/.bm-work/${TEST_PY_BD}; - cp ~/grub_x86.efi $UBOOT_TRAVIS_BUILD_DIR/; - cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi; - if [[ "${TEST_PY_BD}" != "" ]]; then - ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} - -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" - --build-dir "$UBOOT_TRAVIS_BUILD_DIR"; - fi + - ./make.sh ${TARGET_BOARD} -matrix: - include: - # we need to build by vendor due to 50min time limit for builds - # each env setting here is a dedicated build - - env: - - BUILDMAN="arc" - TOOLCHAIN="arc" - - env: - - BUILDMAN="arm11" - - env: - - BUILDMAN="arm7" - - env: - - BUILDMAN="arm920t" - - env: - - JOB="arm926ejs" - BUILDMAN="arm926ejs -x mx,siemens,atmel" - - env: - - BUILDMAN="arm946es" - - env: - - BUILDMAN="atmel" - - env: - - BUILDMAN="aries" - - env: - - JOB="Boundary Devices" - BUILDMAN="boundary" - - env: - - JOB="engicam" - BUILDMAN="engicam" - - env: - - JOB="Freescale ARM32" - BUILDMAN="freescale -x powerpc,m68k,aarch64" - - env: - - JOB="Freescale AArch64" - BUILDMAN="freescale&aarch64" - - env: - - JOB="i.MX6 (non-Freescale)" - BUILDMAN="mx6 -x freescale,toradex,boundary,engicam" - - env: - - JOB="i.MX (non-Freescale, non-i.MX6)" - BUILDMAN="mx -x freescale,mx6,toradex" - - env: - - BUILDMAN="k2" - - env: - - BUILDMAN="samsung" - - env: - - BUILDMAN="socfpga" - - env: - - BUILDMAN="sun4i" - - env: - - BUILDMAN="sun5i" - - env: - - BUILDMAN="sun6i" - - env: - - BUILDMAN="sun7i" - - env: - - BUILDMAN="sun8i" - - env: - - BUILDMAN="sun9i" - - env: - - BUILDMAN="sun50i" - - env: - - JOB="Catch-all ARM" - BUILDMAN="arm -x arm11,arm7,arm9,aarch64,atmel,aries,freescale,kirkwood,mvebu,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap3,omap4,omap5,pxa,rockchip,toradex,socfpga,k2,xilinx" - - env: - - BUILDMAN="sandbox x86" - TOOLCHAIN="x86_64" - - env: - - BUILDMAN="toradex" - - env: - - BUILDMAN="kirkwood" - - env: - - BUILDMAN="mvebu" - - env: - - JOB="PXA" - - BUILDMAN="pxa -x toradex" - - env: - - BUILDMAN="m68k" - TOOLCHAIN="m68k" - - env: - - BUILDMAN="microblaze" - TOOLCHAIN="microblaze" - - env: - - BUILDMAN="mips" - TOOLCHAIN="mips" - - env: - - BUILDMAN="mpc83xx" - - env: - - BUILDMAN="mpc85xx -x freescale" - - env: - - BUILDMAN="mpc85xx -x t208xrdb -x t4qds -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x b4860qds -x sbc8548 -x bsc91*" - - env: - - BUILDMAN="t208xrdb t4qds t102*" - - env: - - BUILDMAN="p1_p2_rdb_pc" - - env: - - BUILDMAN="p1010rdb" - - env: - - BUILDMAN="corenet_ds b4860qds sbc8548 bsc91*" - - env: - - BUILDMAN="mpc86xx" - - env: - - BUILDMAN="mpc8xx" - - env: - - BUILDMAN="siemens" - - env: - - JOB="tegra" - BUILDMAN="tegra -x toradex" - - env: - - JOB="am33xx" - BUILDMAN="am33xx -x siemens" - - env: - - BUILDMAN="omap3" - - env: - - BUILDMAN="omap4" - - env: - - BUILDMAN="omap5" - - env: - - BUILDMAN="uniphier" - - env: - - JOB="aarch64" - BUILDMAN="aarch64 -x tegra,freescale,mvebu,uniphier,sunxi,samsung,rockchip" - - env: - - BUILDMAN="rockchip" - - env: - - BUILDMAN="sh4" - TOOLCHAIN="sh4" - - env: - - JOB="Xilinx (ARM)" - BUILDMAN="xilinx -x microblaze" - - env: - - BUILDMAN="xtensa" - TOOLCHAIN="xtensa" - - # QA jobs for code analytics - # static code analysis with cppcheck (we can add --enable=all later) - - env: - - JOB="cppcheck" - script: - - cppcheck --force --quiet --inline-suppr . - # search for TODO within source tree - - env: - - JOB="grep TODO" - script: - - grep -r TODO . - # search for FIXME within source tree - - env: - - JOB="grep FIXME HACK" - script: - - grep -r FIXME . - # search for HACK within source tree and ignore HACKKIT board - script: - - grep -r HACK . | grep -v HACKKIT - # some statistics about the code base - - env: - - JOB="sloccount" - script: - - sloccount . - - # test/py - - env: - - TEST_PY_BD="sandbox" - BUILDMAN="^sandbox$" - TOOLCHAIN="x86_64" - - env: - - TEST_PY_BD="sandbox_spl" - TEST_PY_TEST_SPEC="test_ofplatdata" - BUILDMAN="^sandbox$" - TOOLCHAIN="x86_64" - - env: - - TEST_PY_BD="sandbox_flattree" - BUILDMAN="^sandbox_flattree$" - TOOLCHAIN="x86_64" - - env: - - TEST_PY_BD="vexpress_ca15_tc2" - TEST_PY_ID="--id qemu" - QEMU_TARGET="arm-softmmu" - BUILDMAN="^vexpress_ca15_tc2$" - - env: - - TEST_PY_BD="vexpress_ca9x4" - TEST_PY_ID="--id qemu" - QEMU_TARGET="arm-softmmu" - BUILDMAN="^vexpress_ca9x4$" - - env: - - TEST_PY_BD="integratorcp_cm926ejs" - TEST_PY_TEST_SPEC="not sleep" - TEST_PY_ID="--id qemu" - QEMU_TARGET="arm-softmmu" - BUILDMAN="^integratorcp_cm926ejs$" - - env: - - TEST_PY_BD="qemu_arm" - TEST_PY_TEST_SPEC="not sleep" - QEMU_TARGET="arm-softmmu" - BUILDMAN="^qemu_arm$" - - env: - - TEST_PY_BD="qemu_mips" - TEST_PY_TEST_SPEC="not sleep" - QEMU_TARGET="mips-softmmu" - BUILDMAN="^qemu_mips$" - TOOLCHAIN="mips" - - env: - - TEST_PY_BD="qemu_mipsel" - TEST_PY_TEST_SPEC="not sleep" - QEMU_TARGET="mipsel-softmmu" - BUILDMAN="^qemu_mipsel$" - TOOLCHAIN="mips" - - env: - - TEST_PY_BD="qemu_mips64" - TEST_PY_TEST_SPEC="not sleep" - QEMU_TARGET="mips64-softmmu" - BUILDMAN="^qemu_mips64$" - TOOLCHAIN="mips" - - env: - - TEST_PY_BD="qemu_mips64el" - TEST_PY_TEST_SPEC="not sleep" - QEMU_TARGET="mips64el-softmmu" - BUILDMAN="^qemu_mips64el$" - TOOLCHAIN="mips" - - env: - - TEST_PY_BD="qemu-ppce500" - TEST_PY_TEST_SPEC="not sleep" - QEMU_TARGET="ppc-softmmu" - BUILDMAN="^qemu-ppce500$" - - env: - - TEST_PY_BD="qemu-x86" - TEST_PY_TEST_SPEC="not sleep" - QEMU_TARGET="i386-softmmu" - BUILDMAN="^qemu-x86$" - TOOLCHAIN="x86_64" - BUILD_ROM="yes" - - env: - - TEST_PY_BD="zynq_zc702" - TEST_PY_TEST_SPEC="not sleep" - QEMU_TARGET="arm-softmmu" - TEST_PY_ID="--id qemu" - BUILDMAN="^zynq_zc702$" +before_deploy: + - export RELEASE_VERSION="${TARGET_BOARD}-${TRAVIS_BUILD_NUMBER}" + - tar czf u-boot-${RELEASE_VERSION}.tar.gz uboot.img + - git config --global user.name ${GIT_USER_NAME} + - git config --global user.email ${GIT_USER_EMAIL} + - export REMOTE_URL=`git config --get remote.origin.url` + - export GIT_TAG="travis/${RELEASE_VERSION}" + - git tag ${GIT_TAG} -a -m "Tagged by Travis CI" + - git push --quiet https://${PRIVATE_ACCESS_TOKEN}@${REMOTE_URL#$"https://"} ${GIT_TAG} -# TODO make it perfect ;-r +deploy: + provider: releases + api_key: ${PRIVATE_ACCESS_TOKEN} + file_glob: true + file: u-boot-${RELEASE_VERSION}.tar.gz + skip_cleanup: true + on: + tags: false + all_branches: true diff --git a/arch/arm/dts/rk3568-odroid-m1.dts b/arch/arm/dts/rk3568-odroid-m1.dts new file mode 100644 index 00000000000..2c9fc41ce84 --- /dev/null +++ b/arch/arm/dts/rk3568-odroid-m1.dts @@ -0,0 +1,64 @@ +/* + * SPDX-License-Identifier: GPL-2.0+ + * + * (C) Copyright 2021 Hardkernel Co., Ltd + */ + +/dts-v1/; +#include "rk3568-evb.dts" + +/ { + model = "Hardkernel ODROID-M1"; + compatible = "hardkernel,odroid-m1", "rockchip,rk3568"; + + aliases { + ethernet0 = &gmac0; + mmc0 = &sdhci; + mmc1 = &sdmmc0; + }; + + chosen { + stdout-path = &uart2; + u-boot,spl-boot-order = &sdhci, &sdmmc0, &spi_nor; + }; + + /delete-node/ adc-keys; +}; + +&gmac0 { + snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +&gmac1 { + status = "disabled"; +}; + +&nandc0 { + status = "disabled"; +}; + +&sdhci { + pinctrl-names = "default"; + pinctrl-0 = <&emmc_bus8 + &emmc_clk + &emmc_cmd + &emmc_datastrobe + &emmc_rstnout>; + non-removable; + cap-mmc-hw-reset; +}; + +&sfc { + spi_nor: flash@0 { + u-boot,dm-spl; + compatible = "jedec,spi-nor"; + label = "sfc_nor"; + reg = <0>; + spi-tx-bus-width = <1>; + spi-rx-bus-width = <1>; + spi-max-frequency = <100000000>; + }; + + /delete-node/ flash@1; +}; diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index aafaa23b40a..d6e5cee3de3 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -1036,95 +1036,6 @@ void board_quiesce_devices(void *images) #endif } -char *board_fdt_chosen_bootargs(void *fdt) -{ - /* bootargs_ext is used when dtbo is applied. */ - const char *arr_bootargs[] = { "bootargs", "bootargs_ext" }; - const char *bootargs; - int nodeoffset; - int i, dump; - - /* debug */ - hotkey_run(HK_INITCALL); - dump = is_hotkey(HK_CMDLINE); - if (dump) - printf("## bootargs(u-boot): %s\n\n", env_get("bootargs")); - - /* find or create "/chosen" node. */ - nodeoffset = fdt_find_or_add_subnode(fdt, 0, "chosen"); - if (nodeoffset < 0) - return NULL; - - for (i = 0; i < ARRAY_SIZE(arr_bootargs); i++) { - bootargs = fdt_getprop(fdt, nodeoffset, arr_bootargs[i], NULL); - if (!bootargs) - continue; - if (dump) - printf("## bootargs(kernel-%s): %s\n\n", - arr_bootargs[i], bootargs); - /* - * Append kernel bootargs - * If use AB system, delete default "root=" which route - * to rootfs. Then the ab bootctl will choose the - * high priority system to boot and add its UUID - * to cmdline. The format is "roo=PARTUUID=xxxx...". - */ -#ifdef CONFIG_ANDROID_AB - env_update_filter("bootargs", bootargs, "root="); -#else - env_update("bootargs", bootargs); -#endif - } - -#ifdef CONFIG_MTD_BLK - char *mtd_par_info = mtd_part_parse(NULL); - - if (mtd_par_info) { - if (memcmp(env_get("devtype"), "mtd", 3) == 0) - env_update("bootargs", mtd_par_info); - } -#endif - /* - * Initrd fixup: remove unused "initrd=0x...,0x...", - * this for compatible with legacy parameter.txt - */ - env_delete("bootargs", "initrd=", 0); - - /* - * If uart is required to be disabled during - * power on, it would be not initialized by - * any pre-loader and U-Boot. - * - * If we don't remove earlycon from commandline, - * kernel hangs while using earlycon to putc/getc - * which may dead loop for waiting uart status. - * (It seems the root cause is baundrate is not - * initilalized) - * - * So let's remove earlycon from commandline. - */ - if (gd->flags & GD_FLG_DISABLE_CONSOLE) - env_delete("bootargs", "earlycon=", 0); - - /* Android header v4+ need this handle */ -#ifdef CONFIG_ANDROID_BOOT_IMAGE - struct andr_img_hdr *hdr; - - hdr = (void *)env_get_ulong("android_addr_r", 16, 0); - if (hdr && !android_image_check_header(hdr) && hdr->header_version >= 4) { - if (env_update_extract_subset("bootargs", "andr_bootargs", "androidboot.")) - printf("extract androidboot.xxx error\n"); - if (dump) - printf("## bootargs(android): %s\n\n", env_get("andr_bootargs")); - } -#endif - bootargs = env_get("bootargs"); - if (dump) - printf("## bootargs(merged): %s\n\n", bootargs); - - return (char *)bootargs; -} - int ft_verify_fdt(void *fdt) { /* for android header v4+, we load bootparams and fixup initrd */ diff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c index cd5a6a2135b..2ed1a9112d4 100644 --- a/arch/arm/mach-rockchip/boot_mode.c +++ b/arch/arm/mach-rockchip/boot_mode.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/arch/arm/mach-rockchip/boot_rkimg.c b/arch/arm/mach-rockchip/boot_rkimg.c index 89c554b8794..6d6199bb900 100644 --- a/arch/arm/mach-rockchip/boot_rkimg.c +++ b/arch/arm/mach-rockchip/boot_rkimg.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -531,6 +532,11 @@ static int rockchip_read_distro_dtb(void *fdt_addr) } #endif +int __weak board_read_dtb_file(void *fdt_addr) +{ + return 1; +} + int rockchip_read_dtb_file(void *fdt_addr) { int hash_size = 0; @@ -541,6 +547,17 @@ int rockchip_read_dtb_file(void *fdt_addr) /* init from storage if resource list is empty */ resource_traverse_init_list(); +#ifdef CONFIG_TARGET_ODROID_M1 + ret = board_read_dtb_file(fdt_addr); + if (!ret) { + fdt_size = fdt_totalsize(fdt_addr); + + if (sysmem_alloc_base(MEM_FDT, (phys_addr_t)fdt_addr, + ALIGN(fdt_size, RK_BLK_SIZE) + CONFIG_SYS_FDT_PAD)) + return 0; + } +#endif + /* distro */ #ifdef CONFIG_ROCKCHIP_EARLY_DISTRO_DTB ret = rockchip_read_distro_dtb(fdt_addr); diff --git a/arch/arm/mach-rockchip/resource_img.c b/arch/arm/mach-rockchip/resource_img.c index 1ae1503e8af..a0499f50c95 100644 --- a/arch/arm/mach-rockchip/resource_img.c +++ b/arch/arm/mach-rockchip/resource_img.c @@ -584,6 +584,9 @@ int resource_populate_dtb(void *img, void *fdt) int format; int ret; + if (!fdt_check_header(fdt)) + return 0; + format = (genimg_get_format(img)); #ifdef CONFIG_ANDROID_BOOT_IMAGE if (format == IMAGE_FORMAT_ANDROID) { diff --git a/arch/arm/mach-rockchip/rk3568/Kconfig b/arch/arm/mach-rockchip/rk3568/Kconfig index 7027e74aec8..188f6922b69 100644 --- a/arch/arm/mach-rockchip/rk3568/Kconfig +++ b/arch/arm/mach-rockchip/rk3568/Kconfig @@ -6,6 +6,12 @@ config TARGET_EVB_RK3568 help RK3568 EVB is a evaluation board for Rockchp RK3568. +config TARGET_ODROID_M1 + bool "ODROID-M1" + select BOARD_LATE_INIT + help + Hardkernel's ODROID-M1 SBC board for Rockchp RK3568. + config SYS_SOC default "rockchip" @@ -13,5 +19,6 @@ config SYS_MALLOC_F_LEN default 0x400 source board/rockchip/evb_rk3568/Kconfig +source board/hardkernel/odroid-m1/Kconfig endif diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c index 58cf3a63ff4..ae59a7d187c 100644 --- a/arch/arm/mach-rockchip/spl.c +++ b/arch/arm/mach-rockchip/spl.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/arch/arm/mach-rockchip/spl_boot_mode.c b/arch/arm/mach-rockchip/spl_boot_mode.c index df21397914e..10716f55665 100644 --- a/arch/arm/mach-rockchip/spl_boot_mode.c +++ b/arch/arm/mach-rockchip/spl_boot_mode.c @@ -9,6 +9,7 @@ #include #include #include +#include static int misc_require_recovery(struct blk_desc *dev_desc, u32 bcb_offset) { diff --git a/board/hardkernel/odroid-m1/Kconfig b/board/hardkernel/odroid-m1/Kconfig new file mode 100644 index 00000000000..115436e0c96 --- /dev/null +++ b/board/hardkernel/odroid-m1/Kconfig @@ -0,0 +1,15 @@ +if TARGET_ODROID_M1 + +config SYS_BOARD + default "odroid-m1" + +config SYS_VENDOR + default "hardkernel" + +config SYS_CONFIG_NAME + default "odroid-m1" + +config BOARD_SPECIFIC_OPTIONS # dummy + def_bool y + +endif diff --git a/board/hardkernel/odroid-m1/Makefile b/board/hardkernel/odroid-m1/Makefile new file mode 100644 index 00000000000..2ff0597f5e0 --- /dev/null +++ b/board/hardkernel/odroid-m1/Makefile @@ -0,0 +1,7 @@ +# +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) 2021 Hardkernel Co., Ltd +# + +obj-y += odroid-m1.o diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c new file mode 100644 index 00000000000..5062ca7d722 --- /dev/null +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -0,0 +1,286 @@ +/* + * SPDX-License-Identifier: GPL-2.0+ + * + * (C) Copyright 2020 Rockchip Electronics Co., Ltd + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(CONFIG_RKSFC_NOR) +#include +#endif +#include "../../../drivers/video/drm/rockchip_display.h" +#include +#include + +extern int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); +extern struct rockchip_logo_cache *find_or_alloc_logo_cache(const char *bmp); +extern void *get_display_buffer(int size); + +DECLARE_GLOBAL_DATA_PTR; + +static char *panel = NULL; + +#ifdef CONFIG_USB_DWC3 +static struct dwc3_device dwc3_device_data = { + .maximum_speed = USB_SPEED_HIGH, + .base = 0xfcc00000, + .dr_mode = USB_DR_MODE_PERIPHERAL, + .index = 0, + .dis_u2_susphy_quirk = 1, + .usb2_phyif_utmi_width = 16, +}; + +int usb_gadget_handle_interrupts(void) +{ + dwc3_uboot_handle_interrupt(0); + return 0; +} + +int board_usb_init(int index, enum usb_init_type init) +{ + return dwc3_uboot_init(&dwc3_device_data); +} +#endif + +int rk_board_late_init(void) +{ + char buf[1024] = "run distro_bootcmd"; + + /* Load SPI firmware when boot device is SPI flash memory + * and environment value 'skip_spiboot' is not 'true' + */ + if (strcmp(env_get("skip_spiboot"), "true")) { + snprintf(buf, sizeof(buf), + "cramfsload $scriptaddr boot.scr;" + "source $scriptaddr;" + "%s", env_get("bootcmd")); + } + + env_set("bootcmd", buf); + env_set("variant", "m1"); /* FIXME: if we have variant model */ + + return 0; +} + +int board_early_init_r(void) +{ + struct blk_desc *dev_desc = rockchip_get_bootdev(); + int ret = -EINVAL; + char buf[16]; + char cmd[256]; + char env[CONFIG_ENV_SIZE]; + int n; + +#if defined(CONFIG_RKSFC_NOR) + if (dev_desc->if_type == IF_TYPE_MMC) + rksfc_scan_namespace(); +#endif + + for (n = 1; n <= 3; n++) { + snprintf(buf, sizeof(buf), "%d:%d", dev_desc->devnum, n); + + if (file_exists("mmc", buf, "ODROIDBIOS.BIN", FS_TYPE_ANY)) { + snprintf(cmd, sizeof(cmd), + "load mmc %s $cramfsaddr ODROIDBIOS.BIN", buf); + ret = run_command(cmd, 0); + if (!ret) + break; + } + } + + run_command("sf probe", 0); + if (ret) + run_command("sf read $cramfsaddr 0x400000 0xc00000", 0); + + snprintf(cmd, sizeof(cmd), "sf read 0x%p 0x%p 0x%p\n", + env, (void*)CONFIG_ENV_OFFSET, (void*)CONFIG_ENV_SIZE); + if (run_command(cmd, 0) == 0) { + env_t *ep = (env_t *)env; + uint32_t crc; + + memcpy(&crc, &ep->crc, sizeof(crc)); + if (crc32(0, ep->data, ENV_SIZE) == crc) { + struct hsearch_data env_htab = { + .change_ok = env_flags_validate, + }; + + if (himport_r(&env_htab, env, ENV_SIZE, '\0', 0, 0, 0, NULL)) { + ENTRY e, *ep; + + e.key = "panel"; + e.data = NULL; + + hsearch_r(e, FIND, &ep, &env_htab, 0); + panel = ep->data; + } + } + } + + return 0; +} + +int board_read_dtb_file(void *fdt_addr) +{ + char buf[32]; + char *argv[3] = { + "cramfsload", + buf, + CONFIG_EMBED_KERNEL_DTB_PATH + }; + + snprintf(buf, sizeof(buf), "0x%p", fdt_addr); + + if (do_cramfs_load(NULL, 0, ARRAY_SIZE(argv), argv)) + return 1; + + if (panel) { + snprintf(buf, sizeof(buf), "%s.dtbo", panel); + + argv[1] = env_get("loadaddr"); + argv[2] = buf; + + if (do_cramfs_load(NULL, 0, ARRAY_SIZE(argv), argv) == 0) { + ulong fdt_dtbo = env_get_ulong("loadaddr", 16, 0); + + fdt_increase_size(fdt_addr, fdt_totalsize((void *)fdt_dtbo)); + fdt_overlay_apply_verbose(fdt_addr, (void *)fdt_dtbo); + } + } + + return fdt_check_header(fdt_addr); +} + +#ifdef CONFIG_MISC_INIT_R +static int set_bmp_logo(const char *bmp_name, void *addr, int flip) +{ + struct logo_info *logo; + struct rockchip_logo_cache *logo_cache; + struct bmp_image *bmp = (struct bmp_image *)map_sysmem((ulong)addr, 0); + struct bmp_header *header = (struct bmp_header *)bmp; + void *src; + void *dst; + int stride; + int i; + + if (!bmp_name || !addr) + return -EINVAL; + + if (!((bmp->header.signature[0]=='B') && + (bmp->header.signature[1]=='M'))) + return -EINVAL; + + logo_cache = find_or_alloc_logo_cache(bmp_name); + if (!logo_cache) + return -ENOMEM; + + logo = &logo_cache->logo; + logo->bpp = get_unaligned_le16(&header->bit_count); + if (logo->bpp != 24) { + printf("Unsupported bpp=%d\n", logo->bpp); + return -EINVAL; + } + + logo->width = get_unaligned_le32(&header->width); + logo->height = get_unaligned_le32(&header->height); + logo->offset = get_unaligned_le32(&header->data_offset); + logo->ymirror = 0; + + logo->mem = get_display_buffer(get_unaligned_le32(&header->file_size)); + if (!logo->mem) + return -ENOMEM; + + src = addr + logo->offset; + dst = logo->mem + logo->offset; + stride = ALIGN(logo->width * 3, 4); + + if (flip) + src += stride * (logo->height - 1); + + for (i = 0; i < logo->height; i++) { + memcpy(dst, src, 3 * logo->width); + dst += stride; + src += stride; + + if (flip) + src -= stride * 2; + } + + flush_dcache_range((ulong)logo->mem, + ALIGN((ulong)logo->mem + + (logo->width * logo->height * logo->bpp >> 3), + CONFIG_SYS_CACHELINE_SIZE)); + + return 0; +} + +static int load_bootsplash_from_mmc(int devnum, unsigned int loadaddr) +{ + char buf[16]; + int n; + + for (n = 1; n <= 2; n++) { + snprintf(buf, sizeof(buf), "%d:%d", devnum, n); + if (file_exists("mmc", buf, "boot-logo.bmp.gz", FS_TYPE_ANY)) { + char cmd[128]; + snprintf(cmd, sizeof(cmd), + "load mmc %s 0x%08x boot-logo.bmp.gz", buf, loadaddr); + if (run_command(cmd, 0) == 0) + return 0; + } + } + + return -ENODEV; +} + +int misc_init_r(void) +{ + void *decomp; + struct bmp_image *bmp; + unsigned int loadaddr = (unsigned int)env_get_ulong("loadaddr", 16, 0); + unsigned long len; + char str[80]; + + int ret = load_bootsplash_from_mmc(0, loadaddr); // eMMC + if (ret) + ret = load_bootsplash_from_mmc(1, loadaddr); // SD + + if (ret) { // SPI + /* Try to load splash image from SPI flash memory */ + snprintf(str, sizeof(str), + "sf read 0x%08x 0x300000 0x100000", loadaddr); + ret = run_command(str, 0); + if (ret) { + /* Try to load splash image from CRAMFS */ + snprintf(str, sizeof(str), + "cramfsload 0x%08x boot-logo.bmp.gz", loadaddr); + ret = run_command(str, 0); + if (ret) + return 0; + } + } + + bmp = (struct bmp_image *)map_sysmem(loadaddr, 0); + + /* Check if splash image is uncompressed */ + if (!((bmp->header.signature[0] == 'B') + && (bmp->header.signature[1] == 'M'))) + bmp = gunzip_bmp(loadaddr, &len, &decomp); + + if (bmp) + set_bmp_logo("logo.bmp", bmp, 1); + + if (decomp) + free(decomp); + + return 0; +} +#endif diff --git a/cmd/Kconfig b/cmd/Kconfig index 051d3955fcb..e41cdc1c63d 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -589,6 +589,23 @@ config CMD_ARMFLASH help ARM Ltd reference designs flash partition access +config CMD_BCB + bool "bcb" + depends on MMC + depends on PARTITIONS + help + Read/modify/write the fields of Bootloader Control Block, usually + stored on the flash "misc" partition with its structure defined in: + https://android.googlesource.com/platform/bootable/recovery/+/master/ + bootloader_message/include/bootloader_message/bootloader_message.h + + Some real-life use-cases include (but are not limited to): + - Determine the "boot reason" (and act accordingly): + https://source.android.com/devices/bootloader/boot-reason + - Get/pass a list of commands from/to recovery: + https://android.googlesource.com/platform/bootable/recovery + - Inspect/dump the contents of the BCB fields + config CMD_CLK bool "clk - Show clock frequencies" help @@ -729,6 +746,11 @@ config CMD_IDE geting device info. It also enables the 'diskboot' command which permits booting from an IDE drive. +config CMD_INI + bool "ini - import data from an ini file into the env" + help + Enables the 'ini' command to import env data from an ini file. + config CMD_IO bool "io - Support for performing I/O accesses" help diff --git a/cmd/Makefile b/cmd/Makefile index 7fe7a95cb6f..ed11613d8e9 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_CMD_ARMFLASH) += armflash.o obj-y += blk_common.o obj-$(CONFIG_SOURCE) += source.o obj-$(CONFIG_CMD_SOURCE) += source.o +obj-$(CONFIG_CMD_BCB) += bcb.o obj-$(CONFIG_CMD_BDI) += bdinfo.o obj-$(CONFIG_CMD_BEDBUG) += bedbug.o obj-$(CONFIG_CMD_BLOCK_CACHE) += blkcache.o @@ -177,6 +178,8 @@ obj-$(CONFIG_CMD_BLOB) += blob.o obj-$(CONFIG_ARCH_ROCKCHIP) += rkimgtest.o obj-$(CONFIG_CMD_ATAGS) += atags.o +obj-$(CONFIG_TARGET_ODROID_M1) += setbootdev.o + endif # !CONFIG_SPL_BUILD # core command diff --git a/cmd/bcb.c b/cmd/bcb.c new file mode 100644 index 00000000000..9626f2c69e3 --- /dev/null +++ b/cmd/bcb.c @@ -0,0 +1,338 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Eugeniu Rosca + * + * Command to read/modify/write Android BCB fields + */ + +#include +#include +#include + +enum bcb_cmd { + BCB_CMD_LOAD, + BCB_CMD_FIELD_SET, + BCB_CMD_FIELD_CLEAR, + BCB_CMD_FIELD_TEST, + BCB_CMD_FIELD_DUMP, + BCB_CMD_STORE, +}; + +static int bcb_dev = -1; +static int bcb_part = -1; +static struct bootloader_message bcb = { { 0 } }; + +static int bcb_cmd_get(char *cmd) +{ + if (!strcmp(cmd, "load")) + return BCB_CMD_LOAD; + if (!strcmp(cmd, "set")) + return BCB_CMD_FIELD_SET; + if (!strcmp(cmd, "clear")) + return BCB_CMD_FIELD_CLEAR; + if (!strcmp(cmd, "test")) + return BCB_CMD_FIELD_TEST; + if (!strcmp(cmd, "store")) + return BCB_CMD_STORE; + if (!strcmp(cmd, "dump")) + return BCB_CMD_FIELD_DUMP; + else + return -1; +} + +static int bcb_is_misused(int argc, char *const argv[]) +{ + int cmd = bcb_cmd_get(argv[0]); + + switch (cmd) { + case BCB_CMD_LOAD: + case BCB_CMD_FIELD_SET: + if (argc != 3) + goto err; + break; + case BCB_CMD_FIELD_TEST: + if (argc != 4) + goto err; + break; + case BCB_CMD_FIELD_CLEAR: + if (argc != 1 && argc != 2) + goto err; + break; + case BCB_CMD_STORE: + if (argc != 1) + goto err; + break; + case BCB_CMD_FIELD_DUMP: + if (argc != 2) + goto err; + break; + default: + printf("Error: 'bcb %s' not supported\n", argv[0]); + return -1; + } + + if (cmd != BCB_CMD_LOAD && (bcb_dev < 0 || bcb_part < 0)) { + printf("Error: Please, load BCB first!\n"); + return -1; + } + + return 0; +err: + printf("Error: Bad usage of 'bcb %s'\n", argv[0]); + + return -1; +} + +static int bcb_field_get(char *name, char **fieldp, int *sizep) +{ + if (!strcmp(name, "command")) { + *fieldp = bcb.command; + *sizep = sizeof(bcb.command); + } else if (!strcmp(name, "status")) { + *fieldp = bcb.status; + *sizep = sizeof(bcb.status); + } else if (!strcmp(name, "recovery")) { + *fieldp = bcb.recovery; + *sizep = sizeof(bcb.recovery); + } else if (!strcmp(name, "stage")) { + *fieldp = bcb.stage; + *sizep = sizeof(bcb.stage); + } else if (!strcmp(name, "reserved")) { + *fieldp = bcb.reserved; + *sizep = sizeof(bcb.reserved); + } else { + printf("Error: Unknown bcb field '%s'\n", name); + return -1; + } + + return 0; +} + +static int do_bcb_load(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + struct blk_desc *desc; + disk_partition_t info; + u64 cnt; + char *endp; + int part, ret; + + ret = blk_get_device_by_str("mmc", argv[1], &desc); + if (ret < 0) + goto err_read_fail; + + part = simple_strtoul(argv[2], &endp, 0); + if (*endp == '\0') { + ret = part_get_info(desc, part, &info); + if (ret) + goto err_read_fail; + } else { + part = part_get_info_by_name(desc, argv[2], &info); + if (part < 0) { + ret = part; + goto err_read_fail; + } + } + + cnt = DIV_ROUND_UP(sizeof(struct bootloader_message), info.blksz); + if (cnt > info.size) + goto err_too_small; + + if (blk_dread(desc, info.start, cnt, &bcb) != cnt) { + ret = -EIO; + goto err_read_fail; + } + + bcb_dev = desc->devnum; + bcb_part = part; + debug("%s: Loaded from mmc %d:%d\n", __func__, bcb_dev, bcb_part); + + return CMD_RET_SUCCESS; +err_read_fail: + printf("Error: mmc %s:%s read failed (%d)\n", argv[1], argv[2], ret); + goto err; +err_too_small: + printf("Error: mmc %s:%s too small!", argv[1], argv[2]); + goto err; +err: + bcb_dev = -1; + bcb_part = -1; + + return CMD_RET_FAILURE; +} + +static int do_bcb_set(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + int size, len; + char *field, *str, *found; + + if (bcb_field_get(argv[1], &field, &size)) + return CMD_RET_FAILURE; + + len = strlen(argv[2]); + if (len >= size) { + printf("Error: sizeof('%s') = %d >= %d = sizeof(bcb.%s)\n", + argv[2], len, size, argv[1]); + return CMD_RET_FAILURE; + } + str = argv[2]; + + field[0] = '\0'; + while ((found = strsep(&str, ":"))) { + if (field[0] != '\0') + strcat(field, "\n"); + strcat(field, found); + } + + return CMD_RET_SUCCESS; +} + +static int do_bcb_clear(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + int size; + char *field; + + if (argc == 1) { + memset(&bcb, 0, sizeof(bcb)); + return CMD_RET_SUCCESS; + } + + if (bcb_field_get(argv[1], &field, &size)) + return CMD_RET_FAILURE; + + memset(field, 0, size); + + return CMD_RET_SUCCESS; +} + +static int do_bcb_test(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + int size; + char *field; + char *op = argv[2]; + + if (bcb_field_get(argv[1], &field, &size)) + return CMD_RET_FAILURE; + + if (*op == '=' && *(op + 1) == '\0') { + if (!strncmp(argv[3], field, size)) + return CMD_RET_SUCCESS; + else + return CMD_RET_FAILURE; + } else if (*op == '~' && *(op + 1) == '\0') { + if (!strstr(field, argv[3])) + return CMD_RET_FAILURE; + else + return CMD_RET_SUCCESS; + } else { + printf("Error: Unknown operator '%s'\n", op); + } + + return CMD_RET_FAILURE; +} + +static int do_bcb_dump(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + int size; + char *field; + + if (bcb_field_get(argv[1], &field, &size)) + return CMD_RET_FAILURE; + + print_buffer((ulong)field - (ulong)&bcb, (void *)field, 1, size, 16); + + return CMD_RET_SUCCESS; +} + +static int do_bcb_store(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + struct blk_desc *desc; + disk_partition_t info; + u64 cnt; + int ret; + + desc = blk_get_devnum_by_type(IF_TYPE_MMC, bcb_dev); + if (!desc) { + ret = -ENODEV; + goto err; + } + + ret = part_get_info(desc, bcb_part, &info); + if (ret) + goto err; + + cnt = DIV_ROUND_UP(sizeof(struct bootloader_message), info.blksz); + + if (blk_dwrite(desc, info.start, cnt, &bcb) != cnt) { + ret = -EIO; + goto err; + } + + return CMD_RET_SUCCESS; +err: + printf("Error: mmc %d:%d write failed (%d)\n", bcb_dev, bcb_part, ret); + + return CMD_RET_FAILURE; +} + +static cmd_tbl_t cmd_bcb_sub[] = { + U_BOOT_CMD_MKENT(load, CONFIG_SYS_MAXARGS, 1, do_bcb_load, "", ""), + U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 1, do_bcb_set, "", ""), + U_BOOT_CMD_MKENT(clear, CONFIG_SYS_MAXARGS, 1, do_bcb_clear, "", ""), + U_BOOT_CMD_MKENT(test, CONFIG_SYS_MAXARGS, 1, do_bcb_test, "", ""), + U_BOOT_CMD_MKENT(dump, CONFIG_SYS_MAXARGS, 1, do_bcb_dump, "", ""), + U_BOOT_CMD_MKENT(store, CONFIG_SYS_MAXARGS, 1, do_bcb_store, "", ""), +}; + +static int do_bcb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +{ + cmd_tbl_t *c; + + if (argc < 2) + return CMD_RET_USAGE; + + argc--; + argv++; + + c = find_cmd_tbl(argv[0], cmd_bcb_sub, ARRAY_SIZE(cmd_bcb_sub)); + if (!c) + return CMD_RET_USAGE; + + if (bcb_is_misused(argc, argv)) { + /* + * We try to improve the user experience by reporting the + * root-cause of misusage, so don't return CMD_RET_USAGE, + * since the latter prints out the full-blown help text + */ + return CMD_RET_FAILURE; + } + + return c->cmd(cmdtp, flag, argc, argv); +} + +U_BOOT_CMD( + bcb, CONFIG_SYS_MAXARGS, 1, do_bcb, + "Load/set/clear/test/dump/store Android BCB fields", + "load - load BCB from mmc :\n" + "bcb set - set BCB to \n" + "bcb clear [] - clear BCB or all fields\n" + "bcb test - test BCB against \n" + "bcb dump - dump BCB \n" + "bcb store - store BCB back to mmc\n" + "\n" + "Legend:\n" + " - MMC device index containing the BCB partition\n" + " - MMC partition index or name containing the BCB\n" + " - one of {command,status,recovery,stage,reserved}\n" + " - the binary operator used in 'bcb test':\n" + " '=' returns true if matches the string stored in \n" + " '~' returns true if matches a subset of 's string\n" + " - string/text provided as input to bcb {set,test}\n" + " NOTE: any ':' character in will be replaced by line feed\n" + " during 'bcb set' and used as separator by upper layers\n" +); diff --git a/cmd/bmp.c b/cmd/bmp.c index fb6fe3f286c..c51dbbdf18b 100644 --- a/cmd/bmp.c +++ b/cmd/bmp.c @@ -58,7 +58,7 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp, bmp = dst; /* align to 32-bit-aligned-address + 2 */ - bmp = (struct bmp_image *)((((unsigned int)dst + 1) & ~3) + 2); + bmp = (struct bmp_image *)((((unsigned long)dst + 1) & ~3) + 2); if (gunzip(bmp, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0), &len) != 0) { @@ -81,6 +81,7 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp, debug("Gzipped BMP image detected!\n"); *alloc_addr = dst; + *lenp = len; return bmp; } #else diff --git a/cmd/ini.c b/cmd/ini.c index 8656299447b..d65356bce72 100644 --- a/cmd/ini.c +++ b/cmd/ini.c @@ -90,7 +90,7 @@ static char *memgets(char *str, int num, char **mem, size_t *memsize) end = *mem + *memsize; newline = 0; } - len = min((end - *mem) + newline, num); + len = min((int)(end - *mem) + newline, num); memcpy(str, *mem, len); if (len < num) str[len] = '\0'; diff --git a/cmd/setbootdev.c b/cmd/setbootdev.c new file mode 100644 index 00000000000..8b49fb340fc --- /dev/null +++ b/cmd/setbootdev.c @@ -0,0 +1,27 @@ +#include +#include + +static int do_setbootdev(cmd_tbl_t *cmdtp, int flag, + int argc, char *const argv[]) +{ + struct blk_desc *dev_desc; + + if (argc != 3) + return CMD_RET_USAGE; + + dev_desc = blk_get_dev(argv[1], simple_strtoul(argv[2], NULL, 16)); + if (!dev_desc) { + printf("%s: dev_desc is NULL.\n", __func__); + return CMD_RET_FAILURE; + } + + rockchip_set_bootdev(dev_desc); + + return CMD_RET_SUCCESS; +} + +U_BOOT_CMD( + setbootdev, 3, 0, do_setbootdev, + "Set bootting device descriptor", + " " +); diff --git a/cmd/source.c b/cmd/source.c index 6b1c8b744b4..cf820c072af 100644 --- a/cmd/source.c +++ b/cmd/source.c @@ -87,7 +87,7 @@ source (ulong addr, const char *fit_uname) * past the zero-terminated sequence of image lengths to get * to the actual image data */ - while (*data++ != IMAGE_PARAM_INVAL); + while (*data++); break; #endif #if defined(CONFIG_FIT) diff --git a/common/android_ab.c b/common/android_ab.c index 2182d3da50f..8691f314e89 100644 --- a/common/android_ab.c +++ b/common/android_ab.c @@ -21,20 +21,20 @@ * the CRC-32 calculation. */ static uint32_t android_boot_control_compute_crc( - struct android_bootloader_control *abc) + struct bootloader_control *abc) { return crc32(0, (void *)abc, offsetof(typeof(*abc), crc32_le)); } -/** android_boot_control_default - Initialize android_bootloader_control to the +/** android_boot_control_default - Initialize bootloader_control to the * default value which allows to boot all slots in order from the first one. * This value should be used when the bootloader message is corrupted, but not * when a valid message indicates that all slots are unbootable. */ -void android_boot_control_default(struct android_bootloader_control *abc) +void android_boot_control_default(struct bootloader_control *abc) { int i; - const struct android_slot_metadata metadata = { + const struct slot_metadata metadata = { .priority = 15, .tries_remaining = 7, .successful_boot = 0, @@ -70,7 +70,7 @@ static void *android_boot_control_create_from_disk( ulong abc_offset, abc_blocks; void *buf; - abc_offset = offsetof(struct android_bootloader_message_ab, + abc_offset = offsetof(struct bootloader_message_ab, slot_suffix); if (abc_offset % part_info->blksz) { printf("ANDROID: Boot control block not block aligned.\n"); @@ -78,7 +78,7 @@ static void *android_boot_control_create_from_disk( } abc_offset /= part_info->blksz; - abc_blocks = DIV_ROUND_UP(sizeof(struct android_bootloader_control), + abc_blocks = DIV_ROUND_UP(sizeof(struct bootloader_control), part_info->blksz); if (abc_offset + abc_blocks > part_info->size) { printf("ANDROID: boot control partition too small. Need at" @@ -116,9 +116,9 @@ static int android_boot_control_store(void *abc_data_block, { ulong abc_offset, abc_blocks; - abc_offset = offsetof(struct android_bootloader_message_ab, + abc_offset = offsetof(struct bootloader_message_ab, slot_suffix) / part_info->blksz; - abc_blocks = DIV_ROUND_UP(sizeof(struct android_bootloader_control), + abc_blocks = DIV_ROUND_UP(sizeof(struct bootloader_control), part_info->blksz); if (blk_dwrite(dev_desc, part_info->start + abc_offset, abc_blocks, abc_data_block) != abc_blocks) { @@ -135,8 +135,8 @@ static int android_boot_control_store(void *abc_data_block, * @return negative if the slot "a" is better, positive of the slot "b" is * better or 0 if they are equally good. */ -static int android_ab_compare_slots(const struct android_slot_metadata *a, - const struct android_slot_metadata *b) +static int android_ab_compare_slots(const struct slot_metadata *a, + const struct slot_metadata *b) { /* Higher priority is better */ if (a->priority != b->priority) @@ -155,7 +155,7 @@ static int android_ab_compare_slots(const struct android_slot_metadata *a, int android_ab_select(struct blk_desc *dev_desc, disk_partition_t *part_info) { - struct android_bootloader_control *abc; + struct bootloader_control *abc; u32 crc32_le; int slot, i; bool store_needed = false; @@ -274,7 +274,7 @@ int read_misc_virtual_ab_message(struct misc_virtual_ab_message *message) { struct blk_desc *dev_desc; disk_partition_t part_info; - u32 bcb_offset = (ANDROID_VIRTUAL_AB_METADATA_OFFSET_IN_MISC >> 9); + u32 bcb_offset = (VIRTUAL_AB_METADATA_OFFSET_IN_MISC >> 9); int cnt, ret; if (!message) { @@ -308,7 +308,7 @@ int write_misc_virtual_ab_message(struct misc_virtual_ab_message *message) { struct blk_desc *dev_desc; disk_partition_t part_info; - u32 bcb_offset = (ANDROID_VIRTUAL_AB_METADATA_OFFSET_IN_MISC >> 9); + u32 bcb_offset = (VIRTUAL_AB_METADATA_OFFSET_IN_MISC >> 9); int cnt, ret; if (!message) { diff --git a/common/android_bootloader.c b/common/android_bootloader.c index 52d4d0131d6..952eecda98b 100644 --- a/common/android_bootloader.c +++ b/common/android_bootloader.c @@ -34,9 +34,9 @@ DECLARE_GLOBAL_DATA_PTR; int android_bootloader_message_load( struct blk_desc *dev_desc, const disk_partition_t *part_info, - struct android_bootloader_message *message) + struct bootloader_message *message) { - ulong message_blocks = sizeof(struct android_bootloader_message) / + ulong message_blocks = sizeof(struct bootloader_message) / part_info->blksz; if (message_blocks > part_info->size) { printf("misc partition too small.\n"); @@ -56,9 +56,9 @@ int android_bootloader_message_load( static int android_bootloader_message_write( struct blk_desc *dev_desc, const disk_partition_t *part_info, - struct android_bootloader_message *message) + struct bootloader_message *message) { - ulong message_blocks = sizeof(struct android_bootloader_message) / + ulong message_blocks = sizeof(struct bootloader_message) / part_info->blksz + android_bcb_msg_sector_offset(); if (message_blocks > part_info->size) { @@ -79,7 +79,7 @@ static enum android_boot_mode android_bootloader_load_and_clear_mode( struct blk_desc *dev_desc, const disk_partition_t *misc_part_info) { - struct android_bootloader_message bcb; + struct bootloader_message bcb; #ifdef CONFIG_FASTBOOT char *bootloader_str; @@ -121,7 +121,7 @@ static enum android_boot_mode android_bootloader_load_and_clear_mode( int android_bcb_write(char *cmd) { - struct android_bootloader_message message = {0}; + struct bootloader_message message = {0}; disk_partition_t part_info; struct blk_desc *dev_desc; int ret; diff --git a/common/board_r.c b/common/board_r.c index 4ecd2d10c57..a016044f23d 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -465,13 +465,8 @@ static int initr_onenand(void) #ifdef CONFIG_MMC static int initr_mmc(void) { -/* - * When CONFIG_USING_KERNEL_DTB is enabled, mmc has been initialized earlier. - */ -#ifndef CONFIG_USING_KERNEL_DTB puts("MMC: "); mmc_initialize(gd->bd); -#endif return 0; } #endif diff --git a/configs/odroid_rk3568_defconfig b/configs/odroid_rk3568_defconfig new file mode 100644 index 00000000000..4428e65bfff --- /dev/null +++ b/configs/odroid_rk3568_defconfig @@ -0,0 +1,1615 @@ +# +# Automatically generated file; DO NOT EDIT. +# U-Boot 2017.09 Configuration +# +CONFIG_CREATE_ARCH_SYMLINK=y +# CONFIG_ARC is not set +CONFIG_ARM=y +# CONFIG_M68K is not set +# CONFIG_MICROBLAZE is not set +# CONFIG_MIPS is not set +# CONFIG_NDS32 is not set +# CONFIG_NIOS2 is not set +# CONFIG_PPC is not set +# CONFIG_RISCV is not set +# CONFIG_SANDBOX is not set +# CONFIG_SH is not set +# CONFIG_X86 is not set +# CONFIG_XTENSA is not set +CONFIG_SYS_ARCH="arm" +CONFIG_SYS_CPU="armv8" +CONFIG_SYS_SOC="rockchip" +CONFIG_SYS_VENDOR="hardkernel" +CONFIG_SYS_BOARD="odroid-m1" +CONFIG_SYS_CONFIG_NAME="odroid-m1" + +# +# ARM architecture +# +CONFIG_ARM64=y +# CONFIG_POSITION_INDEPENDENT is not set +CONFIG_STATIC_RELA=y +CONFIG_DMA_ADDR_T_64BIT=y +CONFIG_ARM_ASM_UNIFIED=y +CONFIG_SYS_ARM_ARCH=8 +CONFIG_SYS_CACHE_SHIFT_6=y +CONFIG_SYS_CACHELINE_SIZE=64 +CONFIG_ARM_SMCCC=y +CONFIG_ARM_CPU_SUSPEND=y +# CONFIG_SEMIHOSTING is not set +# CONFIG_SYS_L2CACHE_OFF is not set +CONFIG_ENABLE_ARM_SOC_BOOT0_HOOK=y +# CONFIG_ARM_CORTEX_CPU_IS_UP is not set +CONFIG_ARM64_SUPPORT_AARCH32=y +# CONFIG_ARCH_AT91 is not set +# CONFIG_TARGET_EDB93XX is not set +# CONFIG_TARGET_ASPENITE is not set +# CONFIG_TARGET_GPLUGD is not set +# CONFIG_ARCH_DAVINCI is not set +# CONFIG_KIRKWOOD is not set +# CONFIG_ARCH_MVEBU is not set +# CONFIG_TARGET_DEVKIT3250 is not set +# CONFIG_TARGET_WORK_92105 is not set +# CONFIG_TARGET_MX25PDK is not set +# CONFIG_TARGET_ZMX25 is not set +# CONFIG_TARGET_APF27 is not set +# CONFIG_TARGET_APX4DEVKIT is not set +# CONFIG_TARGET_XFI3 is not set +# CONFIG_TARGET_M28EVK is not set +# CONFIG_TARGET_MX23EVK is not set +# CONFIG_TARGET_MX28EVK is not set +# CONFIG_TARGET_MX23_OLINUXINO is not set +# CONFIG_TARGET_BG0900 is not set +# CONFIG_TARGET_SANSA_FUZE_PLUS is not set +# CONFIG_TARGET_SC_SPS_1 is not set +# CONFIG_ORION5X is not set +# CONFIG_TARGET_SPEAR300 is not set +# CONFIG_TARGET_SPEAR310 is not set +# CONFIG_TARGET_SPEAR320 is not set +# CONFIG_TARGET_SPEAR600 is not set +# CONFIG_TARGET_STV0991 is not set +# CONFIG_TARGET_X600 is not set +# CONFIG_TARGET_IMX31_PHYCORE is not set +# CONFIG_TARGET_IMX31_PHYCORE_EET is not set +# CONFIG_TARGET_MX31ADS is not set +# CONFIG_TARGET_MX31PDK is not set +# CONFIG_TARGET_WOODBURN is not set +# CONFIG_TARGET_WOODBURN_SD is not set +# CONFIG_TARGET_FLEA3 is not set +# CONFIG_TARGET_MX35PDK is not set +# CONFIG_ARCH_BCM283X is not set +# CONFIG_TARGET_VEXPRESS_CA15_TC2 is not set +# CONFIG_ARCH_BCMSTB is not set +# CONFIG_TARGET_VEXPRESS_CA5X2 is not set +# CONFIG_TARGET_VEXPRESS_CA9X4 is not set +# CONFIG_TARGET_BCM23550_W1D is not set +# CONFIG_TARGET_BCM28155_AP is not set +# CONFIG_TARGET_BCMCYGNUS is not set +# CONFIG_TARGET_BCMNSP is not set +# CONFIG_TARGET_BCMNS2 is not set +# CONFIG_ARCH_EXYNOS is not set +# CONFIG_ARCH_S5PC1XX is not set +# CONFIG_ARCH_HIGHBANK is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_KEYSTONE is not set +# CONFIG_ARCH_OMAP2PLUS is not set +# CONFIG_ARCH_MESON is not set +# CONFIG_ARCH_MX7ULP is not set +# CONFIG_ARCH_MX7 is not set +# CONFIG_ARCH_MX6 is not set +CONFIG_SPL_LDSCRIPT="arch/arm/cpu/armv8/u-boot-spl.lds" +# CONFIG_ARCH_MX5 is not set +# CONFIG_ARCH_RMOBILE is not set +# CONFIG_TARGET_S32V234EVB is not set +# CONFIG_ARCH_SNAPDRAGON is not set +# CONFIG_ARCH_SOCFPGA is not set +# CONFIG_ARCH_SUNXI is not set +# CONFIG_TARGET_TS4600 is not set +# CONFIG_ARCH_VF610 is not set +# CONFIG_ARCH_ZYNQ is not set +# CONFIG_ARCH_ZYNQMP is not set +# CONFIG_TEGRA is not set +# CONFIG_TARGET_VEXPRESS64_AEMV8A is not set +# CONFIG_TARGET_VEXPRESS64_BASE_FVP is not set +# CONFIG_TARGET_VEXPRESS64_BASE_FVP_DRAM is not set +# CONFIG_TARGET_VEXPRESS64_JUNO is not set +# CONFIG_TARGET_LS2080A_EMU is not set +# CONFIG_TARGET_LS2080A_SIMU is not set +# CONFIG_TARGET_LS2080AQDS is not set +# CONFIG_TARGET_LS2080ARDB is not set +# CONFIG_TARGET_LS2081ARDB is not set +# CONFIG_TARGET_HIKEY is not set +# CONFIG_TARGET_POPLAR is not set +# CONFIG_TARGET_LS1012AQDS is not set +# CONFIG_TARGET_LS1012ARDB is not set +# CONFIG_TARGET_LS1012AFRDM is not set +# CONFIG_TARGET_LS1021AQDS is not set +# CONFIG_TARGET_LS1021ATWR is not set +# CONFIG_TARGET_LS1021AIOT is not set +# CONFIG_TARGET_LS1043AQDS is not set +# CONFIG_TARGET_LS1043ARDB is not set +# CONFIG_TARGET_LS1046AQDS is not set +# CONFIG_TARGET_LS1046ARDB is not set +# CONFIG_TARGET_H2200 is not set +# CONFIG_TARGET_ZIPITZ2 is not set +# CONFIG_TARGET_COLIBRI_PXA270 is not set +# CONFIG_ARCH_UNIPHIER is not set +# CONFIG_STM32 is not set +# CONFIG_ARCH_STI is not set +CONFIG_ARCH_ROCKCHIP=y +# CONFIG_TARGET_THUNDERX_88XX is not set +# CONFIG_ARCH_ASPEED is not set +CONFIG_SPL_GPIO_SUPPORT=y +CONFIG_SPL_LIBCOMMON_SUPPORT=y +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_SYS_MALLOC_F_LEN=0x80000 +# CONFIG_ROCKCHIP_PX30 is not set +CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl-v8.lds" +CONFIG_TPL_TEXT_BASE=0xfdcc1000 +CONFIG_TPL_MAX_SIZE=61440 +# CONFIG_ROCKCHIP_RK3036 is not set +# CONFIG_ROCKCHIP_RK3128 is not set +# CONFIG_ROCKCHIP_RK3066 is not set +# CONFIG_ROCKCHIP_RK3188 is not set +# CONFIG_ROCKCHIP_RK322X is not set +# CONFIG_ROCKCHIP_RK3288 is not set +CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/make_fit_atf.sh" +# CONFIG_ROCKCHIP_RK3308 is not set +# CONFIG_ROCKCHIP_RK3328 is not set +# CONFIG_ROCKCHIP_RK3368 is not set +# CONFIG_ROCKCHIP_RK3399 is not set +CONFIG_ROCKCHIP_RK3568=y +# CONFIG_ROCKCHIP_RK1808 is not set +# CONFIG_ROCKCHIP_RV1108 is not set +# CONFIG_ROCKCHIP_RV1126 is not set +# CONFIG_SPL_ROCKCHIP_BACK_TO_BROM is not set +CONFIG_TPL_ROCKCHIP_BACK_TO_BROM=y +# CONFIG_ARM64_BOOT_AARCH32 is not set +# CONFIG_ARM64_SWITCH_TO_AARCH32 is not set +CONFIG_ROCKCHIP_BOOT_MODE_REG=0xfdc20200 +CONFIG_ROCKCHIP_STIMER_BASE=0xfdd1c020 +CONFIG_ROCKCHIP_IRAM_START_ADDR=0xfdcc0000 +CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0 +CONFIG_ROCKCHIP_BROM_HELPER=y +# CONFIG_SPL_ROCKCHIP_EARLYRETURN_TO_BROM is not set +# CONFIG_TPL_ROCKCHIP_EARLYRETURN_TO_BROM is not set +CONFIG_SPL_MMC_SUPPORT=y +CONFIG_RKIMG_BOOTLOADER=y +# CONFIG_RKIMG_ANDROID_BOOTMODE_LEGACY is not set +CONFIG_ROCKCHIP_RESOURCE_IMAGE=y +CONFIG_ROCKCHIP_DTB_VERIFY=y +# CONFIG_ROCKCHIP_USB_BOOT is not set +CONFIG_ROCKCHIP_FIT_IMAGE=y +# CONFIG_ROCKCHIP_UIMAGE is not set +# CONFIG_ROCKCHIP_EARLY_DISTRO_DTB is not set +# CONFIG_ROCKCHIP_HWID_DTB is not set +# CONFIG_ROCKCHIP_VENDOR_PARTITION is not set +CONFIG_USING_KERNEL_DTB=y +CONFIG_EMBED_KERNEL_DTB_PATH="rk3568-odroid-m1.dtb" +# CONFIG_EMBED_KERNEL_DTB_ALWAYS is not set +# CONFIG_ROCKCHIP_CRC is not set +CONFIG_ROCKCHIP_SMCCC=y +# CONFIG_ROCKCHIP_CRASH_DUMP is not set +CONFIG_ROCKCHIP_PRELOADER_ATAGS=y +CONFIG_ROCKCHIP_PRELOADER_SERIAL=y +CONFIG_ROCKCHIP_FIT_IMAGE_PACK=y +CONFIG_ROCKCHIP_UART_MUX_SEL_M=0 +# CONFIG_ROCKCHIP_REBOOT_TEST is not set +# CONFIG_ROCKCHIP_NEW_IDB is not set +# CONFIG_GICV2 is not set +CONFIG_GICV3=y +CONFIG_ROCKCHIP_EMMC_IOMUX=y +# CONFIG_ROCKCHIP_NAND_IOMUX is not set +CONFIG_ROCKCHIP_SFC_IOMUX=y +CONFIG_BASE_DEFCONFIG="" +CONFIG_CHIP_NAME="" +CONFIG_LOADER_INI="" +CONFIG_TRUST_INI="" +CONFIG_SPL_SERIAL_SUPPORT=y +CONFIG_BOARD_SPECIFIC_OPTIONS=y +# CONFIG_TPL_LIBCOMMON_SUPPORT is not set +# CONFIG_TPL_LIBGENERIC_SUPPORT is not set +CONFIG_SPL_DRIVERS_MISC_SUPPORT=y +CONFIG_ENV_SIZE=0x20000 +CONFIG_ENV_OFFSET=0xe0000 +# CONFIG_TARGET_EVB_RK3568 is not set +CONFIG_TARGET_ODROID_M1=y +CONFIG_SPL_LIBDISK_SUPPORT=y +# CONFIG_SPL_NAND_SUPPORT is not set +CONFIG_SPL_SPI_FLASH_SUPPORT=y +CONFIG_SPL_SPI_SUPPORT=y +# CONFIG_SPL_WATCHDOG_SUPPORT is not set +# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE is not set +CONFIG_IDENT_STRING="" +# CONFIG_SPL_FAT_SUPPORT is not set +# CONFIG_ARMV8_MULTIENTRY is not set +# CONFIG_ARMV8_SET_SMPEN is not set + +# +# ARMv8 secure monitor firmware +# +# CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT is not set +# CONFIG_SPL_ARMV8_SEC_FIRMWARE_SUPPORT is not set +CONFIG_PSCI_RESET=y +# CONFIG_ARMV8_PSCI is not set +# CONFIG_CMD_DEKBLOB is not set +# CONFIG_CMD_HDMIDETECT is not set + +# +# ARM debug +# +CONFIG_DEFAULT_DEVICE_TREE="rk3568-odroid-m1" +CONFIG_SMBIOS_PRODUCT_NAME="" +CONFIG_DEBUG_UART=y +# CONFIG_AHCI is not set + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_DISTRO_DEFAULTS=y +CONFIG_SYS_MALLOC_F=y +CONFIG_SPL_SYS_MALLOC_F_LEN=0x80000 +CONFIG_TPL_SYS_MALLOC_F_LEN=0x80000 +CONFIG_EXPERT=y +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +# CONFIG_TOOLS_DEBUG is not set +CONFIG_PHYS_64BIT=y + +# +# Boot images +# +CONFIG_ANDROID_BOOT_IMAGE=y +CONFIG_FIT=y +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y +# CONFIG_FIT_SIGNATURE is not set +# CONFIG_FIT_VERBOSE is not set +# CONFIG_FIT_BEST_MATCH is not set +CONFIG_FIT_IMAGE_POST_PROCESS=y +CONFIG_FIT_HW_CRYPTO=y +CONFIG_SPL_FIT=y +# CONFIG_SPL_FIT_SIGNATURE is not set +CONFIG_SPL_LOAD_FIT=y +CONFIG_SPL_FIT_IMAGE_POST_PROCESS=y +CONFIG_SPL_FIT_HW_CRYPTO=y +# CONFIG_SPL_SYS_DCACHE_OFF is not set +CONFIG_SPL_FIT_SOURCE="" +CONFIG_SPL_FIT_IMAGE_KB=2048 +CONFIG_SPL_FIT_IMAGE_MULTIPLE=1 +# CONFIG_OF_BOARD_SETUP is not set +# CONFIG_OF_SYSTEM_SETUP is not set +# CONFIG_OF_STDOUT_VIA_ALIAS is not set +CONFIG_SYS_EXTRA_OPTIONS="" +CONFIG_ARCH_FIXUP_FDT_MEMORY=y + +# +# API +# +# CONFIG_API is not set + +# +# Boot timing +# +# CONFIG_BOOTSTAGE is not set +CONFIG_BOOTSTAGE_USER_COUNT=20 +CONFIG_BOOTSTAGE_RECORD_COUNT=30 +CONFIG_BOOTSTAGE_STASH_ADDR=0 +CONFIG_BOOTSTAGE_STASH_SIZE=0x1000 +# CONFIG_BOOTSTAGE_PRINTF_TIMESTAMP is not set + +# +# Boot media +# +# CONFIG_NAND_BOOT is not set +# CONFIG_ONENAND_BOOT is not set +# CONFIG_QSPI_BOOT is not set +# CONFIG_SATA_BOOT is not set +# CONFIG_SD_BOOT is not set +# CONFIG_SPI_BOOT is not set +CONFIG_PASS_DEVICE_SERIAL_BY_FDT=y +CONFIG_BOOTDELAY=0 +CONFIG_USE_BOOTARGS=y +CONFIG_BOOTARGS="" +# CONFIG_IO_TRACE is not set + +# +# Console +# +CONFIG_MENU=y +# CONFIG_CONSOLE_RECORD is not set +# CONFIG_CONSOLE_DISABLE_CLI is not set +# CONFIG_DISABLE_CONSOLE is not set +CONFIG_LOGLEVEL=4 +CONFIG_SPL_LOGLEVEL=4 +# CONFIG_SILENT_CONSOLE is not set +# CONFIG_PRE_CONSOLE_BUFFER is not set +CONFIG_CONSOLE_MUX=y +CONFIG_SYS_CONSOLE_IS_IN_ENV=y +# CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE is not set +# CONFIG_SYS_CONSOLE_ENV_OVERWRITE is not set +CONFIG_SYS_CONSOLE_INFO_QUIET=y +# CONFIG_SYS_STDIO_DEREGISTER is not set + +# +# Logging +# +# CONFIG_LOG is not set +# CONFIG_SPL_LOG is not set +CONFIG_DEFAULT_FDT_FILE="" +# CONFIG_VERSION_VARIABLE is not set +CONFIG_BOARD_LATE_INIT=y +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_DISPLAY_BOARDINFO=y + +# +# Start-up hooks +# +# CONFIG_ARCH_EARLY_INIT_R is not set +# CONFIG_ARCH_MISC_INIT is not set +# CONFIG_BOARD_EARLY_INIT_F is not set +CONFIG_BOARD_EARLY_INIT_R=y + +# +# Android features support +# +CONFIG_ANDROID_BOOTLOADER=y +# CONFIG_ANDROID_AB is not set +# CONFIG_ANDROID_WRITE_KEYBOX is not set +CONFIG_ANDROID_AVB=y +# CONFIG_ANDROID_KEYMASTER_CA is not set +CONFIG_ANDROID_BOOT_IMAGE_HASH=y +# CONFIG_SKIP_RELOCATE_UBOOT is not set + +# +# Security support +# +CONFIG_HASH=y + +# +# SPL / TPL +# +CONFIG_SUPPORT_SPL=y +CONFIG_SUPPORT_TPL=y +CONFIG_SPL=y +# CONFIG_SPL_ADC_SUPPORT is not set +CONFIG_SPL_BOARD_INIT=y +# CONFIG_SPL_BOOTROM_SUPPORT is not set +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set +# CONFIG_SPL_LEGACY_IMAGE_SUPPORT is not set +CONFIG_SPL_SYS_MALLOC_SIMPLE=y +# CONFIG_TPL_SYS_MALLOC_SIMPLE is not set +# CONFIG_SPL_STACK_R is not set +CONFIG_SPL_SEPARATE_BSS=y +# CONFIG_SPL_DISPLAY_PRINT is not set +CONFIG_SPL_SKIP_RELOCATE=y +# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION=y +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION=1 +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_NAME="uboot" +# CONFIG_SPL_CRC32_SUPPORT is not set +# CONFIG_SPL_MD5_SUPPORT is not set +# CONFIG_SPL_SHA1_SUPPORT is not set +CONFIG_SPL_SHA256_SUPPORT=y +# CONFIG_SPL_FIT_IMAGE_TINY is not set +# CONFIG_SPL_CPU_SUPPORT is not set +CONFIG_SPL_CRYPTO_SUPPORT=y +CONFIG_SPL_HASH_SUPPORT=y +# CONFIG_SPL_DMA_SUPPORT is not set +# CONFIG_SPL_ENV_SUPPORT is not set +# CONFIG_SPL_EXT_SUPPORT is not set +# CONFIG_SPL_FPGA_SUPPORT is not set +# CONFIG_SPL_I2C_SUPPORT is not set +CONFIG_SPL_MMC_WRITE=y +# CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT is not set +CONFIG_SPL_MTD_SUPPORT=y +CONFIG_MTD_BLK_U_BOOT_OFFS=0x2000 +CONFIG_SPL_MTD_WRITE=y +# CONFIG_SPL_MUSB_NEW_SUPPORT is not set +# CONFIG_SPL_NET_SUPPORT is not set +# CONFIG_SPL_NO_CPU_SUPPORT is not set +# CONFIG_SPL_NOR_SUPPORT is not set +# CONFIG_SPL_XIP_SUPPORT is not set +# CONFIG_SPL_ONENAND_SUPPORT is not set +# CONFIG_SPL_OS_BOOT is not set +# CONFIG_SPL_PCI_SUPPORT is not set +# CONFIG_SPL_PCH_SUPPORT is not set +# CONFIG_SPL_POST_MEM_SUPPORT is not set +# CONFIG_SPL_POWER_SUPPORT is not set +# CONFIG_SPL_PWM_SUPPORT is not set +# CONFIG_SPL_RAM_SUPPORT is not set +# CONFIG_SPL_RTC_SUPPORT is not set +# CONFIG_SPL_SATA_SUPPORT is not set +# CONFIG_SPL_RKNAND_SUPPORT is not set +# CONFIG_SPL_SPI_FLASH_TINY is not set +# CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT is not set +# CONFIG_SPL_SPI_LOAD is not set +# CONFIG_SPL_USB_HOST_SUPPORT is not set +# CONFIG_SPL_USB_GADGET is not set +# CONFIG_SPL_YMODEM_SUPPORT is not set +CONFIG_SPL_ATF=y +# CONFIG_SPL_OPTEE_SUPPORT is not set +CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y +# CONFIG_SPL_OPTEE is not set +CONFIG_SPL_AB=y +# CONFIG_SPL_LOAD_RKFW is not set +# CONFIG_SPL_KERNEL_BOOT is not set +CONFIG_TPL=y +# CONFIG_TPL_BOARD_INIT is not set +# CONFIG_TPL_NEEDS_SEPARATE_TEXT_BASE is not set +# CONFIG_TPL_NEEDS_SEPARATE_STACK is not set +# CONFIG_TPL_BOOTROM_SUPPORT is not set +# CONFIG_TPL_DRIVERS_MISC_SUPPORT is not set +# CONFIG_TPL_ENV_SUPPORT is not set +# CONFIG_TPL_I2C_SUPPORT is not set +CONFIG_TPL_TINY_FRAMEWORK=y +# CONFIG_TPL_MPC8XXX_INIT_DDR_SUPPORT is not set +# CONFIG_TPL_MMC_SUPPORT is not set +# CONFIG_TPL_NAND_SUPPORT is not set +CONFIG_TPL_SERIAL_SUPPORT=y +# CONFIG_TPL_SPI_FLASH_SUPPORT is not set +# CONFIG_TPL_SPI_SUPPORT is not set + +# +# USBPLUG +# +# CONFIG_SUPPORT_USBPLUG is not set + +# +# Command line interface +# +CONFIG_CMDLINE=y +CONFIG_HUSH_PARSER=y +CONFIG_SYS_PROMPT="=> " + +# +# Autoboot options +# +CONFIG_AUTOBOOT=y +# CONFIG_AUTOBOOT_KEYED is not set + +# +# FASTBOOT +# +CONFIG_FASTBOOT=y +CONFIG_USB_FUNCTION_FASTBOOT=y +# CONFIG_UDP_FUNCTION_FASTBOOT is not set +CONFIG_CMD_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0xc00800 +CONFIG_FASTBOOT_BUF_SIZE=0x04000000 +CONFIG_FASTBOOT_USB_DEV=0 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +# CONFIG_RK_AVB_LIBAVB_ENABLE_ATH_UNLOCK is not set + +# +# Commands +# + +# +# Info commands +# +CONFIG_CMD_BDI=y +# CONFIG_CMD_CONFIG is not set +CONFIG_CMD_CONSOLE=y +# CONFIG_CMD_CPU is not set +# CONFIG_CMD_LICENSE is not set + +# +# Boot commands +# +CONFIG_CMD_BOOTD=y +CONFIG_CMD_BOOTM=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_BOOTI=y +CONFIG_CMD_BOOTEFI=y +# CONFIG_CMD_BOOTEFI_HELLO_COMPILE is not set +# CONFIG_CMD_BOOTMENU is not set +CONFIG_CMD_DTIMG=y +# CONFIG_CMD_ELF is not set +CONFIG_CMD_FDT=y +CONFIG_CMD_GO=y +CONFIG_CMD_RUN=y +# CONFIG_CMD_IMI is not set +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_XIMG is not set +# CONFIG_CMD_POWEROFF is not set +# CONFIG_CMD_SPL is not set +# CONFIG_CMD_THOR_DOWNLOAD is not set +# CONFIG_CMD_ZBOOT is not set + +# +# Environment commands +# +# CONFIG_CMD_ASKENV is not set +CONFIG_CMD_EXPORTENV=y +CONFIG_CMD_IMPORTENV=y +CONFIG_CMD_EDITENV=y +# CONFIG_CMD_GREPENV is not set +CONFIG_CMD_SAVEENV=y +CONFIG_CMD_ENV_EXISTS=y +# CONFIG_CMD_ENV_CALLBACK is not set +# CONFIG_CMD_ENV_FLAGS is not set + +# +# Memory commands +# +CONFIG_CMD_CRC32=y +# CONFIG_CRC32_VERIFY is not set +# CONFIG_CMD_EEPROM is not set +# CONFIG_LOOPW is not set +# CONFIG_CMD_MD5SUM is not set +# CONFIG_CMD_MEMINFO is not set +CONFIG_CMD_MEMORY=y +# CONFIG_CMD_MEMTEST is not set +# CONFIG_CMD_MX_CYCLIC is not set +# CONFIG_CMD_SHA1SUM is not set +# CONFIG_CMD_STRINGS is not set +# CONFIG_CMD_CRYPTO is not set +CONFIG_CMD_CRYPTO_SUM=y + +# +# Compression commands +# +# CONFIG_CMD_LZMADEC is not set +CONFIG_CMD_UNZIP=y +# CONFIG_CMD_ZIP is not set + +# +# Device access commands +# +# CONFIG_CMD_ARMFLASH is not set +CONFIG_CMD_BCB=y +# CONFIG_CMD_CLK is not set +# CONFIG_CMD_DEMO is not set +# CONFIG_CMD_DFU is not set +CONFIG_CMD_DM=y +# CONFIG_CMD_FDC is not set +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +# CONFIG_CMD_FPGAD is not set +# CONFIG_CMD_FUSE is not set +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_RANDOM_UUID=y +# CONFIG_CMD_GPT_RENAME is not set +# CONFIG_CMD_IDE is not set +CONFIG_CMD_INI=y +# CONFIG_CMD_IO is not set +# CONFIG_CMD_IOTRACE is not set +CONFIG_CMD_I2C=y +# CONFIG_CMD_LOADB is not set +# CONFIG_CMD_LOADS is not set +# CONFIG_CMD_LOAD_ANDROID is not set +CONFIG_CMD_BOOT_ANDROID=y +CONFIG_CMD_BOOT_FIT=y +CONFIG_CMD_BOOT_ROCKCHIP=y +CONFIG_CMD_MMC=y +CONFIG_CMD_MTD=y +# CONFIG_CMD_NAND is not set +# CONFIG_CMD_MMC_SPI is not set +# CONFIG_CMD_ONENAND is not set +CONFIG_CMD_PART=y +# CONFIG_CMD_PCI is not set +# CONFIG_CMD_PCMCIA is not set +# CONFIG_CMD_READ is not set +CONFIG_CMD_ROCKUSB=y +CONFIG_CMD_RKSFC=y +# CONFIG_CMD_RK_SECURE_STORAGE is not set +# CONFIG_CMD_SATA is not set +# CONFIG_CMD_SAVES is not set +# CONFIG_CMD_SDRAM is not set +CONFIG_CMD_SF=y +# CONFIG_CMD_SF_TEST is not set +# CONFIG_CMD_SPI is not set +# CONFIG_CMD_TSI148 is not set +# CONFIG_CMD_UNIVERSE is not set +CONFIG_CMD_USB=y +# CONFIG_CMD_USB_SDP is not set +CONFIG_CMD_USB_MASS_STORAGE=y + +# +# Shell scripting commands +# +CONFIG_CMD_ECHO=y +# CONFIG_CMD_ITEST is not set +CONFIG_CMD_SOURCE=y +# CONFIG_CMD_SETEXPR is not set + +# +# Network commands +# +CONFIG_CMD_NET=y +CONFIG_CMD_TFTPPUT=y +CONFIG_CMD_TFTP_BOOTM=y +CONFIG_CMD_TFTP_FLASH=y +# CONFIG_CMD_TFTP_UPDATE is not set +# CONFIG_CMD_TFTPSRV is not set +# CONFIG_CMD_RARP is not set +CONFIG_CMD_DHCP=y +CONFIG_CMD_PXE=y +CONFIG_CMD_NFS=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +# CONFIG_CMD_CDP is not set +# CONFIG_CMD_SNTP is not set +# CONFIG_CMD_DNS is not set +# CONFIG_CMD_LINK_LOCAL is not set +# CONFIG_CMD_ETHSW is not set +# CONFIG_CMD_MEMTESTER is not set +# CONFIG_CMD_DDR_TEST_TOOL is not set + +# +# Misc commands +# +CONFIG_CMD_BMP=y +# CONFIG_CMD_BSP is not set +# CONFIG_CMD_BKOPS_ENABLE is not set +# CONFIG_CMD_CACHE is not set +# CONFIG_CMD_DISPLAY is not set +# CONFIG_CMD_LED is not set +# CONFIG_CMD_DATE is not set +# CONFIG_CMD_TIME is not set +# CONFIG_CMD_GETTIME is not set +# CONFIG_CMD_RNG is not set +# CONFIG_CMD_MISC is not set +# CONFIG_CMD_TIMER is not set +# CONFIG_CMD_QFW is not set +# CONFIG_CMD_TERMINAL is not set +# CONFIG_CMD_UUID is not set + +# +# Power commands +# +CONFIG_CMD_PMIC=y +CONFIG_CMD_REGULATOR=y + +# +# Security commands +# +# CONFIG_CMD_AES is not set +# CONFIG_CMD_BLOB is not set +# CONFIG_CMD_HASH is not set + +# +# Firmware commands +# + +# +# Filesystem commands +# +CONFIG_CMD_CRAMFS=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +# CONFIG_CMD_EXT4_WRITE is not set +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +# CONFIG_CMD_FS_UUID is not set +# CONFIG_CMD_JFFS2 is not set +# CONFIG_CMD_MTDPARTS is not set +CONFIG_CMD_MTD_BLK=y +CONFIG_MTDIDS_DEFAULT="" +CONFIG_MTDPARTS_DEFAULT="nor0:0x100000(reserved),0x200000(uboot),0x100000(splash),0xc00000(Firmware)" +# CONFIG_CMD_REISER is not set +# CONFIG_CMD_SCSI is not set +# CONFIG_CMD_ZFS is not set + +# +# Debug commands +# +CONFIG_CMD_ATAGS=y +# CONFIG_CMD_BEDBUG is not set +# CONFIG_CMD_DIAG is not set +# CONFIG_CMD_KGDB is not set +# CONFIG_CMD_LOG is not set +# CONFIG_CMD_TRACE is not set +# CONFIG_CMD_UBI is not set + +# +# Partition Types +# +CONFIG_PARTITIONS=y +# CONFIG_MAC_PARTITION is not set +# CONFIG_SPL_MAC_PARTITION is not set +CONFIG_DOS_PARTITION=y +# CONFIG_SPL_DOS_PARTITION is not set +# CONFIG_ISO_PARTITION is not set +# CONFIG_SPL_ISO_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_SPL_AMIGA_PARTITION is not set +CONFIG_EFI_PARTITION=y +CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=64 +CONFIG_EFI_PARTITION_ENTRIES_OFF=0 +CONFIG_SPL_EFI_PARTITION=y +CONFIG_PARTITION_UUIDS=y +CONFIG_SPL_PARTITION_UUIDS=y +CONFIG_PARTITION_TYPE_GUID=y +# CONFIG_RKPARM_PARTITION is not set +# CONFIG_SPL_ROCKCHIP_PARTITION is not set +CONFIG_SUPPORT_OF_CONTROL=y +CONFIG_DTC=y + +# +# Device Tree Control +# +CONFIG_OF_CONTROL=y +# CONFIG_OF_BOARD_FIXUP is not set +CONFIG_SPL_OF_CONTROL=y +# CONFIG_SPL_DTB_MINIMUM is not set +# CONFIG_TPL_OF_CONTROL is not set +CONFIG_OF_LIVE=y +CONFIG_OF_SEPARATE=y +# CONFIG_OF_EMBED is not set +# CONFIG_OF_BOARD is not set +# CONFIG_OF_PRIOR_STAGE is not set +CONFIG_OF_LIST="rk3568-odroid-m1" +# CONFIG_MULTI_DTB_FIT is not set +# CONFIG_SPL_MULTI_DTB_FIT is not set +CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +CONFIG_OF_U_BOOT_REMOVE_PROPS="" +# CONFIG_SPL_OF_PLATDATA is not set +CONFIG_MKIMAGE_DTC_PATH="dtc" + +# +# Environment +# +# CONFIG_ENV_IS_NOWHERE is not set +# CONFIG_ENV_IS_IN_EEPROM is not set +# CONFIG_ENV_IS_IN_FAT is not set +# CONFIG_ENV_IS_IN_FLASH is not set +# CONFIG_ENV_IS_IN_MMC is not set +# CONFIG_ENV_IS_IN_NAND is not set +# CONFIG_ENV_IS_IN_NVRAM is not set +# CONFIG_ENV_IS_IN_ONENAND is not set +# CONFIG_ENV_IS_IN_REMOTE is not set +CONFIG_ENV_IS_IN_SPI_FLASH=y +# CONFIG_ENV_IS_IN_UBI is not set +# CONFIG_ENV_IS_IN_BLK_DEV is not set +# CONFIG_ENV_AES is not set +CONFIG_NET=y +# CONFIG_NET_RANDOM_ETHADDR is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NET_TFTP_VARS is not set +CONFIG_BOOTP_PXE_CLIENTARCH=0x16 +CONFIG_BOOTP_VCI_STRING="U-Boot.armv8" + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_DM=y +CONFIG_SPL_DM=y +# CONFIG_TPL_DM is not set +CONFIG_DM_WARN=y +# CONFIG_DM_DEBUG is not set +CONFIG_DM_DEVICE_REMOVE=y +CONFIG_DM_STDIO=y +CONFIG_DM_SEQ_ALIAS=y +# CONFIG_SPL_DM_SEQ_ALIAS is not set +CONFIG_REGMAP=y +CONFIG_SPL_REGMAP=y +CONFIG_SYSCON=y +CONFIG_SPL_SYSCON=y +# CONFIG_DEVRES is not set +CONFIG_SIMPLE_BUS=y +CONFIG_SPL_SIMPLE_BUS=y +CONFIG_OF_TRANSLATE=y +# CONFIG_SPL_OF_TRANSLATE is not set +CONFIG_ADC=y +# CONFIG_ADC_REQ_REGULATOR is not set +# CONFIG_ADC_EXYNOS is not set +# CONFIG_ADC_SANDBOX is not set +CONFIG_SARADC_ROCKCHIP=y +# CONFIG_SATA is not set +# CONFIG_SCSI_AHCI is not set + +# +# SATA/SCSI device support +# +CONFIG_BLK=y +CONFIG_SPL_BLK=y +# CONFIG_SPL_BLK_READ_PREPARE is not set +# CONFIG_BLOCK_CACHE is not set +# CONFIG_IDE is not set + +# +# Boot count support +# +# CONFIG_BOOTCOUNT is not set + +# +# Clock +# +CONFIG_CLK=y +CONFIG_SPL_CLK=y +# CONFIG_CLK_AT91 is not set +# CONFIG_CPU is not set +# CONFIG_AMP is not set + +# +# Hardware crypto devices +# +CONFIG_DM_CRYPTO=y +CONFIG_SPL_DM_CRYPTO=y +# CONFIG_FSL_CAAM is not set +# CONFIG_SYS_FSL_SEC_BE is not set +# CONFIG_SYS_FSL_SEC_LE is not set +CONFIG_ROCKCHIP_RSA=y +CONFIG_SPL_ROCKCHIP_RSA=y +# CONFIG_ROCKCHIP_CIPHER is not set +# CONFIG_SPL_ROCKCHIP_CIPHER is not set +# CONFIG_ROCKCHIP_HMAC is not set +# CONFIG_SPL_ROCKCHIP_HMAC is not set +# CONFIG_ROCKCHIP_CRYPTO_V1 is not set +# CONFIG_SPL_ROCKCHIP_CRYPTO_V1 is not set +CONFIG_ROCKCHIP_CRYPTO_V2=y +CONFIG_SPL_ROCKCHIP_CRYPTO_V2=y +CONFIG_DM_RNG=y +CONFIG_RNG_ROCKCHIP=y + +# +# Demo for driver model +# +# CONFIG_DM_DEMO is not set + +# +# DFU support +# + +# +# DMA Support +# +# CONFIG_DMA is not set +# CONFIG_TI_EDMA3 is not set +CONFIG_FIRMWARE=y +CONFIG_ARM_PSCI_FW=y +# CONFIG_SCMI_FIRMWARE is not set + +# +# FPGA support +# +# CONFIG_FPGA_ALTERA is not set +# CONFIG_FPGA_SOCFPGA is not set +# CONFIG_FPGA_XILINX is not set +# CONFIG_FPGA_ROCKCHIP is not set + +# +# GPIO Support +# +CONFIG_DM_GPIO=y +# CONFIG_ALTERA_PIO is not set +# CONFIG_DWAPB_GPIO is not set +# CONFIG_AT91_GPIO is not set +# CONFIG_ATMEL_PIO4 is not set +# CONFIG_INTEL_BROADWELL_GPIO is not set +# CONFIG_INTEL_ICH6_GPIO is not set +# CONFIG_IMX_RGPIO2P is not set +# CONFIG_LPC32XX_GPIO is not set +# CONFIG_MSM_GPIO is not set +# CONFIG_CMD_PCA953X is not set +# CONFIG_PCF8575_GPIO is not set +CONFIG_ROCKCHIP_GPIO=y +CONFIG_ROCKCHIP_GPIO_V2=y +# CONFIG_CMD_TCA642X is not set +# CONFIG_TEGRA_GPIO is not set +# CONFIG_TEGRA186_GPIO is not set +# CONFIG_VYBRID_GPIO is not set +# CONFIG_DM_74X164 is not set +# CONFIG_DM_PCA953X is not set +# CONFIG_MPC85XX_GPIO is not set + +# +# I2C support +# +CONFIG_DM_I2C=y +# CONFIG_DM_I2C_COMPAT is not set +# CONFIG_I2C_SET_DEFAULT_BUS_NUM is not set +# CONFIG_DM_I2C_GPIO is not set +# CONFIG_SYS_I2C_FSL is not set +# CONFIG_SYS_I2C_CADENCE is not set +# CONFIG_SYS_I2C_DW is not set +# CONFIG_SYS_I2C_INTEL is not set +# CONFIG_SYS_I2C_IMX_LPI2C is not set +CONFIG_SYS_I2C_ROCKCHIP=y +# CONFIG_SYS_I2C_MVTWSI is not set +# CONFIG_I2C_MUX is not set +CONFIG_INPUT=y +# CONFIG_SPL_INPUT is not set +# CONFIG_DM_KEYBOARD is not set +# CONFIG_DM_KEY is not set +# CONFIG_DM_RC is not set +# CONFIG_SPL_DM_KEYBOARD is not set +# CONFIG_CROS_EC_KEYB is not set + +# +# LED Support +# +CONFIG_LED=y +CONFIG_LED_BLINK=y +CONFIG_SPL_LED=y +CONFIG_LED_GPIO=y +CONFIG_SPL_LED_GPIO=y +CONFIG_LED_STATUS=y +CONFIG_LED_STATUS_OFF=0 +CONFIG_LED_STATUS_BLINKING=1 +CONFIG_LED_STATUS_ON=2 +CONFIG_LED_STATUS_GPIO=y +CONFIG_LED_STATUS_BOARD_SPECIFIC=y + +# +# LEDs parameters +# +CONFIG_LED_STATUS0=y +CONFIG_LED_STATUS_BIT=22 +CONFIG_LED_STATUS_STATE=2 +CONFIG_LED_STATUS_FREQ=2 +CONFIG_LED_STATUS1=y +CONFIG_LED_STATUS_BIT1=15 +CONFIG_LED_STATUS_STATE1=2 +CONFIG_LED_STATUS_FREQ1=2 +# CONFIG_LED_STATUS2 is not set +# CONFIG_LED_STATUS3 is not set +# CONFIG_LED_STATUS4 is not set +# CONFIG_LED_STATUS5 is not set +CONFIG_LED_STATUS_BOOT_ENABLE=y +CONFIG_LED_STATUS_BOOT=0 +# CONFIG_LED_STATUS_RED_ENABLE is not set +# CONFIG_LED_STATUS_YELLOW_ENABLE is not set +# CONFIG_LED_STATUS_BLUE_ENABLE is not set +# CONFIG_LED_STATUS_GREEN_ENABLE is not set +# CONFIG_LED_STATUS_CMD is not set + +# +# Mailbox Controller Support +# +# CONFIG_DM_MAILBOX is not set + +# +# Memory Controller drivers +# + +# +# Multifunction device drivers +# +CONFIG_MISC=y +CONFIG_SPL_MISC=y +# CONFIG_MISC_DECOMPRESS is not set +# CONFIG_SPL_MISC_DECOMPRESS is not set +# CONFIG_ALTERA_SYSID is not set +# CONFIG_ATSHA204A is not set +# CONFIG_ROCKCHIP_EFUSE is not set +CONFIG_ROCKCHIP_OTP=y +CONFIG_SPL_ROCKCHIP_SECURE_OTP_V1=y +# CONFIG_SPL_ROCKCHIP_SECURE_OTP_V2 is not set +# CONFIG_CROS_EC is not set +# CONFIG_DS4510 is not set +# CONFIG_FSL_SEC_MON is not set +# CONFIG_MXC_OCOTP is not set +# CONFIG_NUVOTON_NCT6102D is not set +# CONFIG_PWRSEQ is not set +# CONFIG_PCA9551_LED is not set +# CONFIG_WINBOND_W83627 is not set +# CONFIG_I2C_EEPROM is not set + +# +# MMC Host controller Support +# +CONFIG_MMC=y +CONFIG_MMC_WRITE=y +CONFIG_DM_MMC=y +CONFIG_SPL_DM_MMC=y +# CONFIG_SPL_MMC_TINY is not set +CONFIG_SUPPORT_EMMC_RPMB=y +CONFIG_MMC_DW=y +# CONFIG_MMC_DW_K3 is not set +CONFIG_MMC_DW_ROCKCHIP=y +# CONFIG_MMC_MXC is not set +# CONFIG_MMC_PCI is not set +# CONFIG_MMC_OMAP_HS is not set +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_SDMA=y +# CONFIG_MMC_SDHCI_BCMSTB is not set +# CONFIG_MMC_SDHCI_CADENCE is not set +# CONFIG_MMC_SDHCI_KONA is not set +# CONFIG_MMC_SDHCI_MSM is not set +CONFIG_MMC_SDHCI_ROCKCHIP=y +# CONFIG_MMC_SDHCI_S5P is not set +# CONFIG_MMC_SDHCI_SPEAR is not set +# CONFIG_MMC_SDHCI_STI is not set +# CONFIG_MMC_SDHCI_XENON is not set +# CONFIG_MMC_SDHCI_TANGIER is not set +# CONFIG_MMC_USE_PRE_CONFIG is not set + +# +# MTD Support +# +CONFIG_MTD_PARTITIONS=y +CONFIG_MTD=y +CONFIG_MTD_BLK=y +CONFIG_MTD_WRITE=y +# CONFIG_MTD_NOR_FLASH is not set +CONFIG_MTD_DEVICE=y +# CONFIG_FLASH_CFI_DRIVER is not set +# CONFIG_CFI_FLASH is not set +# CONFIG_ALTERA_QSPI is not set +CONFIG_MTD_NAND_CORE=y +CONFIG_MTD_NAND_BBT_USING_FLASH=y +# CONFIG_NAND is not set +CONFIG_MTD_SPI_NAND=y +CONFIG_SPI_NAND_GIGADEVICE=y +CONFIG_SPI_NAND_MACRONIX=y +CONFIG_SPI_NAND_MICRON=y +CONFIG_SPI_NAND_TOSHIBA=y +CONFIG_SPI_NAND_WINBOND=y +CONFIG_SPI_NAND_DOSILICON=y +CONFIG_SPI_NAND_ESMT=y +CONFIG_SPI_NAND_XTX=y +CONFIG_SPI_NAND_HYF=y +CONFIG_SPI_NAND_FMSH=y +CONFIG_SPI_NAND_FORESEE=y +CONFIG_SPI_NAND_BIWIN=y +CONFIG_SPI_NAND_ETRON=y +CONFIG_SPI_NAND_JSC=y +CONFIG_SPI_NAND_SILICONGO=y +CONFIG_SPI_NAND_UNIM=y + +# +# SPI Flash Support +# +CONFIG_DM_SPI_FLASH=y +CONFIG_SPI_FLASH=y +CONFIG_SF_DEFAULT_BUS=0 +CONFIG_SF_DEFAULT_CS=0 +CONFIG_SF_DEFAULT_MODE=3 +CONFIG_SF_DEFAULT_SPEED=20000000 +# CONFIG_SPI_FLASH_SFDP_SUPPORT is not set +# CONFIG_SPI_FLASH_BAR is not set +# CONFIG_SF_DUAL_FLASH is not set +# CONFIG_SPI_FLASH_ATMEL is not set +CONFIG_SPI_FLASH_EON=y +CONFIG_SPI_FLASH_GIGADEVICE=y +# CONFIG_SPI_FLASH_ISSI is not set +CONFIG_SPI_FLASH_MACRONIX=y +# CONFIG_SPI_FLASH_SPANSION is not set +# CONFIG_SPI_FLASH_STMICRO is not set +# CONFIG_SPI_FLASH_SST is not set +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_SPI_FLASH_XMC=y +# CONFIG_SPI_FLASH_XTX is not set +CONFIG_SPI_FLASH_USE_4K_SECTORS=y +# CONFIG_SPI_FLASH_DATAFLASH is not set +CONFIG_SPI_FLASH_MTD=y +# CONFIG_SPL_SPI_FLASH_MTD is not set + +# +# UBI support +# +# CONFIG_CONFIG_UBI_SILENCE_MSG is not set +# CONFIG_MTD_UBI is not set +# CONFIG_BITBANGMII is not set +# CONFIG_MV88E6352_SWITCH is not set +CONFIG_PHYLIB=y +# CONFIG_MV88E61XX_SWITCH is not set +# CONFIG_PHYLIB_10G is not set +# CONFIG_PHY_AQUANTIA is not set +# CONFIG_PHY_ATHEROS is not set +# CONFIG_PHY_BROADCOM is not set +# CONFIG_PHY_CORTINA is not set +# CONFIG_PHY_DAVICOM is not set +# CONFIG_PHY_ET1011C is not set +# CONFIG_PHY_LXT is not set +# CONFIG_PHY_MARVELL is not set +# CONFIG_PHY_MICREL is not set +# CONFIG_PHY_MSCC is not set +# CONFIG_PHY_NATSEMI is not set +CONFIG_PHY_REALTEK=y +CONFIG_RTL8211X_PHY_FORCE_MASTER=y +# CONFIG_PHY_SMSC is not set +# CONFIG_PHY_TERANETICS is not set +# CONFIG_PHY_TI is not set +# CONFIG_PHY_VITESSE is not set +# CONFIG_PHY_XILINX is not set +# CONFIG_PHY_FIXED is not set +CONFIG_DM_ETH=y +CONFIG_DM_MDIO=y +CONFIG_DM_ETH_PHY=y +CONFIG_NETDEVICES=y +# CONFIG_PHY_GIGE is not set +# CONFIG_ALTERA_TSE is not set +# CONFIG_BCM_SF2_ETH is not set +# CONFIG_DWC_ETH_QOS is not set +# CONFIG_E1000 is not set +# CONFIG_ETH_DESIGNWARE is not set +# CONFIG_ETHOC is not set +# CONFIG_FTMAC100 is not set +# CONFIG_MACB is not set +# CONFIG_RGMII is not set +# CONFIG_RTL8139 is not set +# CONFIG_RTL8169 is not set +# CONFIG_SUN7I_GMAC is not set +# CONFIG_SUN4I_EMAC is not set +# CONFIG_SUN8I_EMAC is not set +# CONFIG_PCI is not set + +# +# PHY Subsystem +# +CONFIG_PHY=y +# CONFIG_SPL_PHY is not set +# CONFIG_NOP_PHY is not set +CONFIG_PHY_ROCKCHIP_INNO_USB2=y +CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y +# CONFIG_PHY_ROCKCHIP_NANENG_USB2 is not set +# CONFIG_PHY_ROCKCHIP_INNO_USB3 is not set +CONFIG_PHY_ROCKCHIP_NANENG_EDP=y +# CONFIG_PHY_ROCKCHIP_SNPS_PCIE3 is not set +# CONFIG_PHY_ROCKCHIP_TYPEC is not set +# CONFIG_MVEBU_COMPHY_SUPPORT is not set + +# +# Pin controllers +# +CONFIG_PINCTRL=y +CONFIG_PINCTRL_FULL=y +CONFIG_PINCTRL_GENERIC=y +CONFIG_PINMUX=y +# CONFIG_PINCONF is not set +CONFIG_SPL_PINCTRL=y +CONFIG_SPL_PINCTRL_FULL=y +CONFIG_SPL_PINCTRL_GENERIC=y +CONFIG_SPL_PINMUX=y +# CONFIG_SPL_PINCONF is not set +# CONFIG_PINCTRL_AT91 is not set +# CONFIG_PINCTRL_AT91PIO4 is not set +CONFIG_PINCTRL_ROCKCHIP=y +CONFIG_SPL_PINCTRL_ROCKCHIP=y +# CONFIG_PINCTRL_SINGLE is not set +# CONFIG_PINCTRL_STM32 is not set + +# +# Power +# + +# +# Power Domain Support +# +# CONFIG_POWER_DOMAIN is not set +CONFIG_DM_FUEL_GAUGE=y +# CONFIG_SPL_DM_FUEL_GAUGE is not set +# CONFIG_POWER_FG_CW201X is not set +# CONFIG_POWER_FG_RK818 is not set +CONFIG_POWER_FG_RK817=y +# CONFIG_POWER_FG_RK816 is not set +# CONFIG_SPL_POWER_FG_RK816 is not set + +# +# IO Domain Support +# +CONFIG_IO_DOMAIN=y +CONFIG_ROCKCHIP_IO_DOMAIN=y +CONFIG_DM_PMIC=y +# CONFIG_SPL_DM_PMIC is not set +CONFIG_PMIC_CHILDREN=y +CONFIG_SPL_PMIC_CHILDREN=y +# CONFIG_PMIC_ACT8846 is not set +# CONFIG_PMIC_AS3722 is not set +# CONFIG_DM_PMIC_PFUZE100 is not set +# CONFIG_DM_PMIC_MAX77686 is not set +# CONFIG_DM_PMIC_MAX8998 is not set +# CONFIG_PMIC_MAX8997 is not set +# CONFIG_PMIC_PM8916 is not set +CONFIG_PMIC_RK8XX=y +# CONFIG_PMIC_S2MPS11 is not set +# CONFIG_DM_PMIC_SANDBOX is not set +# CONFIG_PMIC_S5M8767 is not set +# CONFIG_PMIC_RN5T567 is not set +# CONFIG_PMIC_TPS65090 is not set +# CONFIG_PMIC_PALMAS is not set +# CONFIG_PMIC_LP873X is not set +# CONFIG_PMIC_LP87565 is not set +# CONFIG_POWER_MC34VR500 is not set +CONFIG_DM_REGULATOR=y +# CONFIG_SPL_DM_REGULATOR is not set +# CONFIG_REGULATOR_FAN53555 is not set +# CONFIG_REGULATOR_PWM is not set +CONFIG_DM_REGULATOR_FIXED=y +# CONFIG_SPL_DM_REGULATOR_FIXED is not set +# CONFIG_DM_REGULATOR_GPIO is not set +# CONFIG_REGULATOR_RK860X is not set +CONFIG_REGULATOR_RK8XX=y +# CONFIG_DM_DVFS is not set +# CONFIG_CHARGER_BQ25700 is not set +# CONFIG_DM_CHARGE_DISPLAY is not set +CONFIG_DM_PWM=y +# CONFIG_PWM_EXYNOS is not set +CONFIG_PWM_ROCKCHIP=y +# CONFIG_PWM_SANDBOX is not set +# CONFIG_PWM_TEGRA is not set +CONFIG_RAM=y +CONFIG_SPL_RAM=y +CONFIG_TPL_RAM=y +# CONFIG_STM32_SDRAM is not set +# CONFIG_DM_RAMDISK is not set +# CONFIG_ROCKCHIP_DMC is not set +CONFIG_ROCKCHIP_SDRAM_COMMON=y +# CONFIG_ROCKCHIP_DRAM_EXTENDED_TEMP_SUPPORT is not set +CONFIG_ROCKCHIP_TPL_INIT_DRAM_TYPE=0 + +# +# Remote Processor drivers +# + +# +# Reset Controller Support +# +CONFIG_DM_RESET=y +CONFIG_SPL_DM_RESET=y +CONFIG_RESET_ROCKCHIP=y +CONFIG_SPL_RESET_ROCKCHIP=y +# CONFIG_RESET_SCMI is not set +# CONFIG_RKNAND is not set +CONFIG_RKFLASH=y + +# +# Rockchip Flash Devices +# +# CONFIG_RKNANDC_NAND is not set +# CONFIG_RKSFC_NAND is not set +CONFIG_RKSFC_NOR=y + +# +# Real Time Clock +# +# CONFIG_DM_RTC is not set +# CONFIG_SCSI is not set +# CONFIG_DM_SCSI is not set + +# +# Serial drivers +# +CONFIG_BAUDRATE=1500000 +CONFIG_REQUIRE_SERIAL_CONSOLE=y +CONFIG_SERIAL_PRESENT=y +CONFIG_SPL_SERIAL_PRESENT=y +CONFIG_DM_SERIAL=y +# CONFIG_SERIAL_RX_BUFFER is not set +CONFIG_SPL_DM_SERIAL=y +CONFIG_TPL_DM_SERIAL=y +# CONFIG_DEBUG_UART_ALTERA_JTAGUART is not set +# CONFIG_DEBUG_UART_ALTERA_UART is not set +# CONFIG_DEBUG_UART_ATMEL is not set +CONFIG_DEBUG_UART_NS16550=y +# CONFIG_DEBUG_UART_S5P is not set +# CONFIG_DEBUG_UART_UARTLITE is not set +# CONFIG_DEBUG_UART_ARM_DCC is not set +# CONFIG_DEBUG_MVEBU_A3700_UART is not set +# CONFIG_DEBUG_UART_ZYNQ is not set +# CONFIG_DEBUG_UART_PL010 is not set +# CONFIG_DEBUG_UART_PL011 is not set +# CONFIG_DEBUG_UART_OMAP is not set +CONFIG_DEBUG_UART_BASE=0xFE660000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_DEBUG_UART_BOARD_INIT=y +# CONFIG_DEBUG_UART_ANNOUNCE is not set +# CONFIG_DEBUG_UART_SKIP_INIT is not set +CONFIG_DEBUG_UART_ALWAYS=y +# CONFIG_ALTERA_JTAG_UART is not set +# CONFIG_ALTERA_UART is not set +# CONFIG_ATMEL_USART is not set +# CONFIG_FSL_LPUART is not set +# CONFIG_MVEBU_A3700_UART is not set +CONFIG_SYS_NS16550=y +# CONFIG_MSM_SERIAL is not set +# CONFIG_PXA_SERIAL is not set + +# +# Sound support +# +# CONFIG_SOUND is not set +CONFIG_SPI=y +CONFIG_DM_SPI=y +CONFIG_SPI_MEM=y +# CONFIG_ALTERA_SPI is not set +# CONFIG_ATCSPI200_SPI is not set +# CONFIG_ATMEL_SPI is not set +# CONFIG_BCMSTB_SPI is not set +# CONFIG_CADENCE_QSPI is not set +# CONFIG_DESIGNWARE_SPI is not set +# CONFIG_EXYNOS_SPI is not set +# CONFIG_FSL_DSPI is not set +# CONFIG_ICH_SPI is not set +# CONFIG_MVEBU_A3700_SPI is not set +# CONFIG_ROCKCHIP_SPI is not set +CONFIG_ROCKCHIP_SFC=y +# CONFIG_TEGRA114_SPI is not set +# CONFIG_TEGRA20_SFLASH is not set +# CONFIG_TEGRA20_SLINK is not set +# CONFIG_TEGRA210_QSPI is not set +# CONFIG_XILINX_SPI is not set +# CONFIG_SOFT_SPI is not set +# CONFIG_CF_SPI is not set +# CONFIG_FSL_ESPI is not set +# CONFIG_FSL_QSPI is not set +# CONFIG_SH_SPI is not set +# CONFIG_SH_QSPI is not set +# CONFIG_TI_QSPI is not set +# CONFIG_KIRKWOOD_SPI is not set +# CONFIG_LPC32XX_SSP is not set +# CONFIG_MPC8XXX_SPI is not set +# CONFIG_MXC_SPI is not set +# CONFIG_MXS_SPI is not set +# CONFIG_OMAP3_SPI is not set + +# +# SPMI support +# +# CONFIG_SPMI is not set + +# +# System reset device drivers +# +CONFIG_SYSRESET=y +CONFIG_SPL_SYSRESET=y +CONFIG_SYSRESET_PSCI=y +# CONFIG_SYSRESET_SYSCON is not set +CONFIG_SYSRESET_SYSCON_REBOOT=y +# CONFIG_SYSRESET_WATCHDOG is not set +# CONFIG_DM_THERMAL is not set + +# +# Timer Support +# +# CONFIG_TIMER is not set + +# +# TPM support +# +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_SPL_DM_USB=y +# CONFIG_DM_USB_GADGET is not set +# CONFIG_SPL_DM_USB_GADGET is not set + +# +# USB Host Controller Drivers +# +CONFIG_USB_HOST=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_DWC3=y +# CONFIG_USB_XHCI_DWC3_OF_SIMPLE is not set +# CONFIG_USB_XHCI_PCI is not set +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_MSM is not set +# CONFIG_USB_EHCI_PCI is not set +CONFIG_USB_EHCI_GENERIC=y +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_OHCI_PCI is not set +CONFIG_USB_OHCI_GENERIC=y +# CONFIG_USB_OHCI_DA8XX is not set +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USB_DWC2 is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_CDNS3 is not set +CONFIG_USB_DWC3=y +# CONFIG_USB_DWC3_HOST is not set +CONFIG_USB_DWC3_GADGET=y + +# +# Platform Glue Driver Support +# +# CONFIG_USB_DWC3_OMAP is not set +CONFIG_USB_DWC3_GENERIC=y + +# +# PHY Subsystem +# +# CONFIG_USB_DWC3_PHY_OMAP is not set +# CONFIG_USB_DWC3_PHY_SAMSUNG is not set + +# +# MUSB Controller Driver +# +# CONFIG_USB_MUSB_HOST is not set +# CONFIG_USB_MUSB_GADGET is not set +# CONFIG_USB_MUSB_DA8XX is not set +# CONFIG_USB_MUSB_TI is not set + +# +# ULPI drivers +# + +# +# USB peripherals +# +CONFIG_USB_STORAGE=y +# CONFIG_USB_KEYBOARD is not set +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="Rockchip" +CONFIG_USB_GADGET_VENDOR_NUM=0x2207 +CONFIG_USB_GADGET_PRODUCT_NUM=0x350a +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_BCM_UDC_OTG_PHY is not set +# CONFIG_USB_GADGET_DWC2_OTG is not set +# CONFIG_CI_UDC is not set +CONFIG_USB_GADGET_VBUS_DRAW=2 +CONFIG_USB_GADGET_DUALSPEED=y +CONFIG_USB_GADGET_DOWNLOAD=y +# CONFIG_USB_FUNCTION_SDP is not set +# CONFIG_USB_ETHER is not set +# CONFIG_USB_HOST_ETHER is not set + +# +# Graphics support +# +CONFIG_DM_VIDEO=y +CONFIG_BACKLIGHT_PWM=y +# CONFIG_BACKLIGHT_GPIO is not set +CONFIG_VIDEO_BPP8=y +CONFIG_VIDEO_BPP16=y +CONFIG_VIDEO_BPP32=y +CONFIG_CONSOLE_NORMAL=y +# CONFIG_CONSOLE_ROTATION is not set +# CONFIG_CONSOLE_TRUETYPE is not set +CONFIG_SYS_WHITE_ON_BLACK=y + +# +# TrueType Fonts +# +CONFIG_VIDCONSOLE_AS_LCD=y +# CONFIG_VIDEO_VESA is not set +# CONFIG_VIDEO_LCD_ANX9804 is not set +# CONFIG_VIDEO_LCD_SSD2828 is not set +# CONFIG_VIDEO_MVEBU is not set +CONFIG_I2C_EDID=y +CONFIG_DISPLAY=y +# CONFIG_ATMEL_HLCD is not set +CONFIG_VIDEO_ROCKCHIP=y +CONFIG_VIDEO_ROCKCHIP_MAX_XRES=1920 +CONFIG_VIDEO_ROCKCHIP_MAX_YRES=1080 +# CONFIG_DISPLAY_ROCKCHIP_EDP is not set +# CONFIG_DISPLAY_ROCKCHIP_LVDS is not set +CONFIG_DISPLAY_ROCKCHIP_HDMI=y +CONFIG_DISPLAY_ROCKCHIP_MIPI=y +CONFIG_DRM_ROCKCHIP=y +CONFIG_DRM_MEM_RESERVED_SIZE_MBYTES=32 +CONFIG_DRM_ROCKCHIP_PANEL=y +CONFIG_DRM_ROCKCHIP_DW_HDMI=y +# CONFIG_DRM_ROCKCHIP_INNO_HDMI is not set +# CONFIG_ROCKCHIP_INNO_HDMI_PHY is not set +CONFIG_DRM_ROCKCHIP_INNO_MIPI_PHY=y +# CONFIG_DRM_ROCKCHIP_INNO_VIDEO_PHY is not set +CONFIG_DRM_ROCKCHIP_INNO_VIDEO_COMBO_PHY=y +CONFIG_DRM_MIPI_DSI=y +CONFIG_DRM_ROCKCHIP_DW_MIPI_DSI=y +# CONFIG_DRM_ROCKCHIP_ANALOGIX_DP is not set +# CONFIG_DRM_ROCKCHIP_LVDS is not set +# CONFIG_DRM_ROCKCHIP_RGB is not set +# CONFIG_DRM_ROCKCHIP_RK618 is not set +# CONFIG_DRM_ROCKCHIP_RK1000 is not set +# CONFIG_ROCKCHIP_DRM_TVE is not set +CONFIG_ROCKCHIP_CUBIC_LUT_SIZE=0 +# CONFIG_VIDEO_TEGRA20 is not set +# CONFIG_VIDEO_TEGRA124 is not set +CONFIG_VIDEO_BRIDGE=y +# CONFIG_VIDEO_BRIDGE_PARADE_PS862X is not set +# CONFIG_VIDEO_BRIDGE_NXP_PTN3460 is not set +# CONFIG_VIDEO_BRIDGE_ANALOGIX_ANX6345 is not set +CONFIG_CONSOLE_SCROLL_LINES=1 +CONFIG_LCD=y +CONFIG_VIDEO_DW_HDMI=y +# CONFIG_ROCKCHIP_EINK is not set + +# +# Watchdog Timer Support +# +# CONFIG_BCM2835_WDT is not set +# CONFIG_ULP_WATCHDOG is not set +# CONFIG_WDT is not set +# CONFIG_IRQ is not set +# CONFIG_PHYS_TO_BUS is not set + +# +# File systems +# +# CONFIG_FS_CBFS is not set +CONFIG_FS_FAT=y +CONFIG_FAT_WRITE=y +CONFIG_FS_FAT_MAX_CLUSTSIZE=65536 +# CONFIG_FS_JFFS2 is not set +CONFIG_FS_CRAMFS=y +# CONFIG_YAFFS2 is not set + +# +# Library routines +# +# CONFIG_BCH is not set +# CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED is not set +CONFIG_SYS_HZ=1000 +CONFIG_SYS_STACK_SIZE=0x200000 +CONFIG_USE_TINY_PRINTF=y +CONFIG_PANIC_HANG=y +CONFIG_REGEX=y +# CONFIG_LIB_RAND is not set +CONFIG_SPL_TINY_MEMSET=y +# CONFIG_TPL_TINY_MEMSET is not set +CONFIG_SYSMEM=y +CONFIG_BIDRAM=y +# CONFIG_CMD_DHRYSTONE is not set + +# +# Security support +# +# CONFIG_AES is not set +CONFIG_RSA=y +CONFIG_SPL_RSA=y +CONFIG_RSA_SOFTWARE_EXP=y +CONFIG_RSA_N_SIZE=0x200 +CONFIG_RSA_E_SIZE=0x10 +CONFIG_RSA_C_SIZE=0x20 +# CONFIG_TPM is not set + +# +# Boot Configuration +# +# CONFIG_XBC is not set + +# +# Hashing Support +# +CONFIG_SHA1=y +CONFIG_SHA256=y +CONFIG_SHA512=y +# CONFIG_SHA_HW_ACCEL is not set + +# +# Compression Support +# +CONFIG_LZ4=y +# CONFIG_LZMA is not set +# CONFIG_LZO is not set +# CONFIG_SPL_LZO is not set +CONFIG_SPL_GZIP=y +CONFIG_SPL_ZLIB=y +CONFIG_ERRNO_STR=y +# CONFIG_HEXDUMP is not set +CONFIG_OF_LIBFDT=y +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_SPL_OF_LIBFDT=y +# CONFIG_TPL_OF_LIBFDT is not set +# CONFIG_FDT_FIXUP_PARTITIONS is not set + +# +# System tables +# +CONFIG_GENERATE_SMBIOS_TABLE=y +CONFIG_SMBIOS_MANUFACTURER="rockchip" +CONFIG_EFI_LOADER=y +# CONFIG_EFI_LOADER_BOUNCE_BUFFER is not set +CONFIG_AVB_LIBAVB=y +# CONFIG_SPL_AVB_LIBAVB is not set +# CONFIG_TPL_AVB_LIBAVB is not set +CONFIG_AVB_LIBAVB_AB=y +# CONFIG_SPL_AVB_LIBAVB_AB is not set +# CONFIG_TPL_AVB_LIBAVB_AB is not set +CONFIG_AVB_LIBAVB_ATX=y +# CONFIG_SPL_AVB_LIBAVB_ATX is not set +# CONFIG_TPL_AVB_LIBAVB_ATX is not set +CONFIG_AVB_LIBAVB_USER=y +# CONFIG_AVB_VBMETA_PUBLIC_KEY_VALIDATE is not set +# CONFIG_SPL_AVB_LIBAVB_USER is not set +# CONFIG_TPL_AVB_LIBAVB_USER is not set +CONFIG_RK_AVB_LIBAVB_USER=y +# CONFIG_SPL_RK_AVB_LIBAVB_USER is not set +# CONFIG_TPL_RK_AVB_LIBAVB_USER is not set +# CONFIG_ROCKCHIP_PRELOADER_PUB_KEY is not set +CONFIG_OPTEE_CLIENT=y +# CONFIG_OPTEE_V1 is not set +CONFIG_OPTEE_V2=y +# CONFIG_OPTEE_ALWAYS_USE_SECURITY_PARTITION is not set +# CONFIG_UNIT_TEST is not set +# CONFIG_TEST_ROCKCHIP is not set diff --git a/disk/part_efi.c b/disk/part_efi.c index 27f3e4dda31..e220293dc27 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -203,10 +203,10 @@ int get_disk_guid(struct blk_desc * dev_desc, char *guid) /* This function validates AND fills in the GPT header and PTE */ if (is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA, gpt_head, &gpt_pte) != 1) { - printf("%s: *** ERROR: Invalid GPT ***\n", __func__); + debug("%s: *** ERROR: Invalid GPT ***\n", __func__); if (is_gpt_valid(dev_desc, dev_desc->lba - 1, gpt_head, &gpt_pte) != 1) { - printf("%s: *** ERROR: Invalid Backup GPT ***\n", + debug("%s: *** ERROR: Invalid Backup GPT ***\n", __func__); return -EINVAL; } else { @@ -232,10 +232,10 @@ void part_print_efi(struct blk_desc *dev_desc) /* This function validates AND fills in the GPT header and PTE */ if (is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA, gpt_head, &gpt_pte) != 1) { - printf("%s: *** ERROR: Invalid GPT ***\n", __func__); + debug("%s: *** ERROR: Invalid GPT ***\n", __func__); if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), gpt_head, &gpt_pte) != 1) { - printf("%s: *** ERROR: Invalid Backup GPT ***\n", + debug("%s: *** ERROR: Invalid Backup GPT ***\n", __func__); return; } else { @@ -306,10 +306,10 @@ int part_get_info_efi(struct blk_desc *dev_desc, int part, /* This function validates AND fills in the GPT header and PTE */ if (is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA, gpt_head, &gpt_pte) != 1) { - printf("%s: *** ERROR: Invalid GPT ***\n", __func__); + debug("%s: *** ERROR: Invalid GPT ***\n", __func__); if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), gpt_head, &gpt_pte) != 1) { - printf("%s: *** ERROR: Invalid Backup GPT ***\n", + debug("%s: *** ERROR: Invalid Backup GPT ***\n", __func__); return -1; } else { @@ -445,7 +445,6 @@ static int part_efi_repair(struct blk_desc *dev_desc, gpt_entry *gpt_pte, static int part_test_efi(struct blk_desc *dev_desc) { ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, legacymbr, 1, dev_desc->blksz); - int ret = 0; /* Read legacy MBR from block 0 and validate it */ if ((blk_dread(dev_desc, 0, 1, (ulong *)legacymbr) != 1) @@ -489,10 +488,7 @@ static int part_test_efi(struct blk_desc *dev_desc) if (part_efi_repair(dev_desc, b_gpt_pte, b_gpt_head, head_gpt_valid, backup_gpt_valid)) printf("Primary GPT repair fail!\n"); - } else if (head_gpt_valid == 0 && backup_gpt_valid == 0) { - ret = -1; } - free(h_gpt_pte); h_gpt_pte = NULL; free(h_gpt_head); @@ -503,7 +499,7 @@ static int part_test_efi(struct blk_desc *dev_desc) b_gpt_head = NULL; #endif #endif - return ret; + return 0; } /** @@ -861,13 +857,13 @@ int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head, if (is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA, gpt_head, gpt_pte) != 1) { - printf("%s: *** ERROR: Invalid GPT ***\n", + debug("%s: *** ERROR: Invalid GPT ***\n", __func__); return -1; } if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), gpt_head, gpt_pte) != 1) { - printf("%s: *** ERROR: Invalid Backup GPT ***\n", + debug("%s: *** ERROR: Invalid Backup GPT ***\n", __func__); return -1; } @@ -1083,18 +1079,6 @@ static int is_pmbr_valid(legacy_mbr * mbr) { int i = 0; -#ifdef CONFIG_ARCH_ROCKCHIP - /* - * In sd-update card, we use RKPARM partition in bootloader to load - * firmware, and use MS-DOS partition in recovery to update system. - * Now, we want to use gpt in bootloader and abandon the RKPARM - * partition. So in new sd-update card, we write the MS-DOS partition - * table and gpt to sd card. Then we must return 1 directly when test - * the mbr sector otherwise the gpt is unavailable. - */ - return 1; -#endif - if (!mbr || le16_to_cpu(mbr->signature) != MSDOS_MBR_SIGNATURE) return 0; @@ -1133,13 +1117,13 @@ static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba, /* Read MBR Header from device */ if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1) { - printf("*** ERROR: Can't read MBR header ***\n"); + debug("*** ERROR: Can't read MBR header ***\n"); return 0; } /* Read GPT Header from device */ if (blk_dread(dev_desc, (lbaint_t)lba, 1, pgpt_head) != 1) { - printf("*** ERROR: Can't read GPT header ***\n"); + debug("*** ERROR: Can't read GPT header ***\n"); return 0; } diff --git a/drivers/core/device.c b/drivers/core/device.c index c3c775784e0..8ffd1aea343 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -56,16 +56,6 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv, if (drv->id == UCLASS_MMC || drv->id == UCLASS_RKNAND || drv->id == UCLASS_SPI_FLASH || drv->id == UCLASS_MTD || drv->id == UCLASS_PCI || drv->id == UCLASS_AHCI) { - /* - * Reject all mmc device from kernel. - * - * - we always follow the rule: use mmc device from U-Boot - * - avoid alias id on defferent device between U-Boot and kernel - */ - if ((gd->flags & GD_FLG_KDTB_READY) && - (drv->id == UCLASS_MMC)) - return 0; - list_for_each_entry(dev, &uc->dev_head, uclass_node) { if (!strcmp(name, dev->name)) { debug("%s do not bind dev already in list %s\n", diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c index 37294873870..db2f64bd566 100644 --- a/drivers/core/of_access.c +++ b/drivers/core/of_access.c @@ -731,10 +731,6 @@ static void of_alias_add(struct alias_prop *ap, struct device_node *np, mutex_lock(&of_mutex); list_for_each_entry(oldap, &aliases_lookup, link) { if (stem && !strcmp(stem, oldap->alias) && (id == oldap->id)) { - /* Always use from U-Boot aliase */ - if (strcmp(stem, "mmc")) - continue; - list_del(&oldap->link); break; } diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c index c7071d8165a..92873af4848 100644 --- a/drivers/mmc/rockchip_sdhci.c +++ b/drivers/mmc/rockchip_sdhci.c @@ -37,6 +37,12 @@ DECLARE_GLOBAL_DATA_PTR; #define PHYCTRL_FREQSEL_150M 0x3 /* Rockchip specific Registers */ +#define DWCMSHC_VER_ID 0x500 +#define DWCMSHC_VER_TYPE 0x504 +#define DWCMSHC_HOST_CTRL3 0x508 +#define DWCMSHC_EMMC_CONTROL 0x52c +#define DWCMSHC_EMMC_ATCTRL 0x540 + #define DWCMSHC_EMMC_DLL_CTRL 0x800 #define DWCMSHC_EMMC_DLL_RXCLK 0x804 #define DWCMSHC_EMMC_DLL_TXCLK 0x808 @@ -55,6 +61,8 @@ DECLARE_GLOBAL_DATA_PTR; #define DWCMSHC_EMMC_DLL_TIMEOUT BIT(9) #define DLL_RXCLK_NO_INVERTER 1 #define DLL_RXCLK_INVERTER 0 +#define DWCMSHC_EMMC_RST_N BIT(2) +#define DWCMSHC_EMMC_RST_N_OE BIT(3) #define DWCMSHC_ENHANCED_STROBE BIT(8) #define DLL_LOCK_WO_TMOUT(x) \ ((((x) & DWCMSHC_EMMC_DLL_LOCKED) == DWCMSHC_EMMC_DLL_LOCKED) && \ @@ -369,6 +377,24 @@ static int rk3568_emmc_get_phy(struct udevice *dev) return 0; } +static int rk3568_emmc_hw_reset(struct udevice *dev) +{ + struct rockchip_sdhc *prv = dev_get_priv(dev); + struct sdhci_host *host = &prv->host; + u32 extra; + + extra = sdhci_readl(host, DWCMSHC_EMMC_CONTROL); + extra |= DWCMSHC_EMMC_RST_N_OE; + extra &= ~DWCMSHC_EMMC_RST_N; + sdhci_writel(host, extra, DWCMSHC_EMMC_CONTROL); + udelay(20); + + extra |= DWCMSHC_EMMC_RST_N; + sdhci_writel(host, extra, DWCMSHC_EMMC_CONTROL); + udelay(300); + return 0; +} + static int arasan_sdhci_set_clock(struct sdhci_host *host, unsigned int clock) { struct rockchip_sdhc *priv = @@ -455,6 +481,9 @@ static int arasan_sdhci_probe(struct udevice *dev) host->mmc->dev = dev; upriv->mmc = host->mmc; + if (dev_read_bool(dev, "cap-mmc-hw-reset")) + rk3568_emmc_hw_reset(dev); + return sdhci_probe(dev); } diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c index 8dfa87cf264..d198d49ef53 100644 --- a/drivers/mtd/spi/spi-nor-ids.c +++ b/drivers/mtd/spi/spi-nor-ids.c @@ -174,6 +174,7 @@ const struct flash_info spi_nor_ids[] = { { INFO("mx25u12835f", 0xc22538, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { INFO("mx25l12855e", 0xc22618, 0, 64 * 1024, 256, 0) }, { INFO("mx25l25635e", 0xc22019, 0, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("mx25u12832f", 0xc22538, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, { INFO("mx25u25635f", 0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, { INFO("mx25l25655e", 0xc22619, 0, 64 * 1024, 512, 0) }, { INFO("mx66l51235l", 0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, diff --git a/drivers/rkflash/rksfc_base.c b/drivers/rkflash/rksfc_base.c index 2120c7802c2..3967f4d60e5 100644 --- a/drivers/rkflash/rksfc_base.c +++ b/drivers/rkflash/rksfc_base.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "rkflash_blk.h" @@ -139,6 +140,7 @@ UCLASS_DRIVER(rksfc) = { .id = UCLASS_SPI_FLASH, .name = "rksfc", .flags = DM_UC_FLAG_SEQ_ALIAS, + .per_device_auto_alloc_size = sizeof(struct spi_flash), }; static const struct udevice_id rockchip_sfc_ids[] = { diff --git a/drivers/video/drm/dw_hdmi.c b/drivers/video/drm/dw_hdmi.c index 10a593870a1..08f0024e380 100644 --- a/drivers/video/drm/dw_hdmi.c +++ b/drivers/video/drm/dw_hdmi.c @@ -1888,7 +1888,10 @@ void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate) static int dw_hdmi_hdcp_load_key(struct dw_hdmi *hdmi) { - int i, j, ret, val; + int i, j, val; +#if defined(CONFIG_ROCKCHIP_VENDOR_PARTITION) + int ret; +#endif struct hdcp_keys *hdcp_keys; val = sizeof(*hdcp_keys); @@ -1898,12 +1901,14 @@ static int dw_hdmi_hdcp_load_key(struct dw_hdmi *hdmi) memset(hdcp_keys, 0, val); +#if defined(CONFIG_ROCKCHIP_VENDOR_PARTITION) ret = vendor_storage_read(HDMI_HDCP1X_ID, hdcp_keys, val); if (ret < val) { printf("HDCP: read size %d\n", ret); free(hdcp_keys); return -EINVAL; } +#endif if (hdcp_keys->KSV[0] == 0x00 && hdcp_keys->KSV[1] == 0x00 && diff --git a/drivers/video/drm/rockchip_panel.c b/drivers/video/drm/rockchip_panel.c index 6e273649586..3cc417a56d4 100644 --- a/drivers/video/drm/rockchip_panel.c +++ b/drivers/video/drm/rockchip_panel.c @@ -532,6 +532,7 @@ static int rockchip_panel_probe(struct udevice *dev) static const struct udevice_id rockchip_panel_ids[] = { { .compatible = "simple-panel", }, { .compatible = "simple-panel-dsi", }, + { .compatible = "odroid,hj080be31ia1", }, {} }; diff --git a/drivers/video/drm/rockchip_vop2.c b/drivers/video/drm/rockchip_vop2.c index 58bddfc03f7..c00fd0bae59 100644 --- a/drivers/video/drm/rockchip_vop2.c +++ b/drivers/video/drm/rockchip_vop2.c @@ -1975,6 +1975,12 @@ static int rockchip_vop2_fixup_dts(struct display_state *state, void *blob) int vp_id = 0; int cursor_plane_id = -1; +#ifdef CONFIG_TARGET_ODROID_M1 + int chosen = fdt_path_offset(working_fdt, "/chosen"); + if (fdt_getprop(working_fdt, chosen, "disable-vop2-fixup", NULL)) + return 0; +#endif + if (vop_fix_dts) return 0; diff --git a/env/sf.c b/env/sf.c index e51b1ae1891..1582bedeb44 100644 --- a/env/sf.c +++ b/env/sf.c @@ -19,6 +19,10 @@ #include #include +#if defined(CONFIG_TARGET_ODROID_M1) +#undef CONFIG_DM_SPI_FLASH +#endif + #ifndef CONFIG_ENV_SPI_BUS # define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS #endif diff --git a/include/android_bootloader_message.h b/include/android_bootloader_message.h index 9fa8cf0d2e1..1ef9ab22717 100644 --- a/include/android_bootloader_message.h +++ b/include/android_bootloader_message.h @@ -2,7 +2,7 @@ * This is from the Android Project, * Repository: https://android.googlesource.com/platform/bootable/recovery/ * File: bootloader_message/include/bootloader_message/bootloader_message.h - * Commit: 8b309f6970ab3b7c53cc529c51a2cb44e1c7a7e1 + * Commit: See U-Boot commit description * * Copyright (C) 2008 The Android Open Source Project * @@ -12,23 +12,28 @@ #ifndef __ANDROID_BOOTLOADER_MESSAGE_H #define __ANDROID_BOOTLOADER_MESSAGE_H +#ifndef __UBOOT__ +#include +#include +#include +#else /* compiler.h defines the types that otherwise are included from stdint.h and * stddef.h */ #include +#endif -/* Spaces used by misc partition are as below: - * 0 - 2K Bootloader Message - * 2K - 16K Used by Vendor's bootloader (the 2K - 4K range may be optionally used - * as bootloader_message_ab struct) - * 16K - 32K Used by uncrypt and recovery to store wipe_package for A/B devices - * 32K - 64K System space, used for miscellaneous AOSP features (virtual A/B metadata). - * Note that these offsets are admitted by bootloader,recovery and uncrypt, so they - * are not configurable without changing all of them. - */ -static const size_t ANDROID_BOOTLOADER_MESSAGE_OFFSET_IN_MISC = 0; -static const size_t ANDROID_WIPE_PACKAGE_OFFSET_IN_MISC = 16 * 1024; -static const size_t ANDROID_VIRTUAL_AB_METADATA_OFFSET_IN_MISC = 32 * 1024; +// Spaces used by misc partition are as below: +// 0 - 2K For bootloader_message +// 2K - 16K Used by Vendor's bootloader (the 2K - 4K range may be optionally used +// as bootloader_message_ab struct) +// 16K - 32K Used by uncrypt and recovery to store wipe_package for A/B devices +// 32K - 64K System space, used for miscellaneous AOSP features (virtual A/B metadata). (Ver. Rockchip) +// Note that these offsets are admitted by bootloader,recovery and uncrypt, so they +// are not configurable without changing all of them. +static const size_t BOOTLOADER_MESSAGE_OFFSET_IN_MISC = 0; +static const size_t WIPE_PACKAGE_OFFSET_IN_MISC = 16 * 1024; +static const size_t VIRTUAL_AB_METADATA_OFFSET_IN_MISC = 32 * 1024; /* Bootloader Message (2-KiB) * @@ -58,22 +63,22 @@ static const size_t ANDROID_VIRTUAL_AB_METADATA_OFFSET_IN_MISC = 32 * 1024; * uncrypt. Move it into struct bootloader_message_ab to avoid the * issue. */ -struct android_bootloader_message { +struct bootloader_message { char command[32]; char status[32]; char recovery[768]; - /* The 'recovery' field used to be 1024 bytes. It has only ever - * been used to store the recovery command line, so 768 bytes - * should be plenty. We carve off the last 256 bytes to store the - * stage string (for multistage packages) and possible future - * expansion. */ + // The 'recovery' field used to be 1024 bytes. It has only ever + // been used to store the recovery command line, so 768 bytes + // should be plenty. We carve off the last 256 bytes to store the + // stage string (for multistage packages) and possible future + // expansion. char stage[32]; - /* The 'reserved' field used to be 224 bytes when it was initially - * carved off from the 1024-byte recovery field. Bump it up to - * 1184-byte so that the entire bootloader_message struct rounds up - * to 2048-byte. */ + // The 'reserved' field used to be 224 bytes when it was initially + // carved off from the 1024-byte recovery field. Bump it up to + // 1184-byte so that the entire bootloader_message struct rounds up + // to 2048-byte. char reserved[1184]; }; @@ -81,10 +86,12 @@ struct android_bootloader_message { * We must be cautious when changing the bootloader_message struct size, * because A/B-specific fields may end up with different offsets. */ +#ifndef __UBOOT__ #if (__STDC_VERSION__ >= 201112L) || defined(__cplusplus) -static_assert(sizeof(struct android_bootloader_message) == 2048, +static_assert(sizeof(struct bootloader_message) == 2048, "struct bootloader_message size changes, which may break A/B devices"); #endif +#endif /* __UBOOT__ */ /** * The A/B-specific bootloader message structure (4-KiB). @@ -102,38 +109,41 @@ static_assert(sizeof(struct android_bootloader_message) == 2048, * data past the first NUL-byte in this field. It is encouraged, but * not mandatory, to use 'struct bootloader_control' described below. */ -struct android_bootloader_message_ab { - struct android_bootloader_message message; +struct bootloader_message_ab { + struct bootloader_message message; char slot_suffix[32]; + char update_channel[128]; - /* Round up the entire struct to 4096-byte. */ - char reserved[2016]; + // Round up the entire struct to 4096-byte. + char reserved[1888]; }; /** * Be cautious about the struct size change, in case we put anything post * bootloader_message_ab struct (b/29159185). */ +#ifndef __UBOOT__ #if (__STDC_VERSION__ >= 201112L) || defined(__cplusplus) -static_assert(sizeof(struct android_bootloader_message_ab) == 4096, +static_assert(sizeof(struct bootloader_message_ab) == 4096, "struct bootloader_message_ab size changes"); #endif +#endif /* __UBOOT__ */ #define ANDROID_BOOT_CTRL_MAGIC 0x42414342 /* Bootloader Control AB */ #define ANDROID_BOOT_CTRL_VERSION 1 -struct android_slot_metadata { - /* Slot priority with 15 meaning highest priority, 1 lowest - * priority and 0 the slot is unbootable. */ +struct slot_metadata { + // Slot priority with 15 meaning highest priority, 1 lowest + // priority and 0 the slot is unbootable. uint8_t priority : 4; - /* Number of times left attempting to boot this slot. */ + // Number of times left attempting to boot this slot. uint8_t tries_remaining : 3; - /* 1 if this slot has booted successfully, 0 otherwise. */ + // 1 if this slot has booted successfully, 0 otherwise. uint8_t successful_boot : 1; - /* 1 if this slot is corrupted from a dm-verity corruption, 0 */ - /* otherwise. */ + // 1 if this slot is corrupted from a dm-verity corruption, 0 + // otherwise. uint8_t verity_corrupted : 1; - /* Reserved for further use. */ + // Reserved for further use. uint8_t reserved : 7; } __attribute__((packed)); @@ -145,32 +155,100 @@ struct android_slot_metadata { * 'bootloader_control' structure to store the A/B metadata, but not * mandatory. */ -struct android_bootloader_control { - /* NUL terminated active slot suffix. */ +struct bootloader_control { + // NUL terminated active slot suffix. char slot_suffix[4]; - /* Bootloader Control AB magic number (see BOOT_CTRL_MAGIC). */ + // Bootloader Control AB magic number (see BOOT_CTRL_MAGIC). uint32_t magic; - /* Version of struct being used (see BOOT_CTRL_VERSION). */ + // Version of struct being used (see BOOT_CTRL_VERSION). uint8_t version; - /* Number of slots being managed. */ + // Number of slots being managed. uint8_t nb_slot : 3; - /* Number of times left attempting to boot recovery. */ + // Number of times left attempting to boot recovery. uint8_t recovery_tries_remaining : 3; - /* Ensure 4-bytes alignment for slot_info field. */ + // Ensure 4-bytes alignment for slot_info field. uint8_t reserved0[2]; - /* Per-slot information. Up to 4 slots. */ - struct android_slot_metadata slot_info[4]; - /* Reserved for further use. */ + // Per-slot information. Up to 4 slots. + struct slot_metadata slot_info[4]; + // Reserved for further use. uint8_t reserved1[8]; - /* CRC32 of all 28 bytes preceding this field (little endian - * format). */ + // CRC32 of all 28 bytes preceding this field (little endian + // format). uint32_t crc32_le; } __attribute__((packed)); +#ifndef __UBOOT__ #if (__STDC_VERSION__ >= 201112L) || defined(__cplusplus) -static_assert(sizeof(struct android_bootloader_control) == - sizeof(((struct android_bootloader_message_ab *)0)->slot_suffix), +static_assert(sizeof(struct bootloader_control) == + sizeof(((struct bootloader_message_ab *)0)->slot_suffix), "struct bootloader_control has wrong size"); #endif +#endif /* __UBOOT__ */ + +#ifndef __UBOOT__ +#ifdef __cplusplus + +#include +#include + +// Return the block device name for the bootloader message partition and waits +// for the device for up to 10 seconds. In case of error returns the empty +// string. +std::string get_bootloader_message_blk_device(std::string* err); + +// Read bootloader message into boot. Error message will be set in err. +bool read_bootloader_message(bootloader_message* boot, std::string* err); + +// Read bootloader message from the specified misc device into boot. +bool read_bootloader_message_from(bootloader_message* boot, const std::string& misc_blk_device, + std::string* err); + +// Write bootloader message to BCB. +bool write_bootloader_message(const bootloader_message& boot, std::string* err); + +// Write bootloader message to the specified BCB device. +bool write_bootloader_message_to(const bootloader_message& boot, + const std::string& misc_blk_device, std::string* err); + +// Write bootloader message (boots into recovery with the options) to BCB. Will +// set the command and recovery fields, and reset the rest. +bool write_bootloader_message(const std::vector& options, std::string* err); + +// Write bootloader message (boots into recovery with the options) to the specific BCB device. Will +// set the command and recovery fields, and reset the rest. +bool write_bootloader_message_to(const std::vector& options, + const std::string& misc_blk_device, std::string* err); + +// Update bootloader message (boots into recovery with the options) to BCB. Will +// only update the command and recovery fields. +bool update_bootloader_message(const std::vector& options, std::string* err); + +// Update bootloader message (boots into recovery with the |options|) in |boot|. Will only update +// the command and recovery fields. +bool update_bootloader_message_in_struct(bootloader_message* boot, + const std::vector& options); + +// Clear BCB. +bool clear_bootloader_message(std::string* err); + +// Writes the reboot-bootloader reboot reason to the bootloader_message. +bool write_reboot_bootloader(std::string* err); + +// Read the wipe package from BCB (from offset WIPE_PACKAGE_OFFSET_IN_MISC). +bool read_wipe_package(std::string* package_data, size_t size, std::string* err); + +// Write the wipe package into BCB (to offset WIPE_PACKAGE_OFFSET_IN_MISC). +bool write_wipe_package(const std::string& package_data, std::string* err); + +#else + +#include + +// C Interface. +bool write_bootloader_message(const char* options); +bool write_reboot_bootloader(void); + +#endif // ifdef __cplusplus +#endif /* __UBOOT__ */ #endif /* __ANDROID_BOOTLOADER_MESSAGE_H */ diff --git a/include/boot_rkimg.h b/include/boot_rkimg.h index 4e9643b3b11..c288ee69dda 100644 --- a/include/boot_rkimg.h +++ b/include/boot_rkimg.h @@ -22,22 +22,6 @@ enum _boot_mode { BOOT_MODE_UNDEFINE, }; -struct bootloader_message { - char command[32]; - char status[32]; - char recovery[768]; - /* - * The 'recovery' field used to be 1024 bytes. It has only ever - * been used to store the recovery command line, so 768 bytes - * should be plenty. We carve off the last 256 bytes to store the - * stage string (for multistage packages) and possible future - * expansion. - */ - char stage[32]; - char slot_suffix[32]; - char reserved[192]; -}; - struct rockchip_image { uint32_t tag; uint32_t size; diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h index 9ed6b9892cd..f82458cd9b6 100644 --- a/include/config_distro_bootcmd.h +++ b/include/config_distro_bootcmd.h @@ -368,7 +368,7 @@ "\0" \ \ "scan_dev_for_boot_part=" \ - "part list ${devtype} ${devnum} -bootable devplist; " \ + "part list ${devtype} ${devnum} devplist; " \ "env exists devplist || setenv devplist 1; " \ "for distro_bootpart in ${devplist}; do " \ "if fstype ${devtype} " \ diff --git a/include/configs/odroid-m1.h b/include/configs/odroid-m1.h new file mode 100644 index 00000000000..d9067726f4c --- /dev/null +++ b/include/configs/odroid-m1.h @@ -0,0 +1,70 @@ +/* + * SPDX-License-Identifier: GPL-2.0+ + * + * Copyright (c) 2021 Hardkernel Co., Ltd + */ + +#ifndef __CONFIGS_ODROID_M1_H +#define __CONFIGS_ODROID_M1_H + +#include + +#define CONFIG_MISC_INIT_R + +#undef RKIMG_BOOTCOMMAND + +#ifndef CONFIG_SPL_BUILD + +#undef ROCKCHIP_DEVICE_SETTINGS +#define ROCKCHIP_DEVICE_SETTINGS \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + +#define CONFIG_SYS_MMC_ENV_DEV 0 +#define CONFIG_SUPPORT_EMMC_BOOT + +#define CONFIG_SET_DFU_ALT_INFO +#define DFU_ALT_BOOT_EMMC \ + "gpt raw 0x0 0x20000;" \ + "loader raw 0x20000 0xE0000;"\ + "uboot part uboot;" \ + "boot part boot;" \ + "rootfs partubi rootfs;" \ + "userdata partubi userdata\0" + +#define DFU_ALT_BOOT_MTD \ + "gpt raw 0x0 0x20000;" \ + "loader raw 0x20000 0xE0000;"\ + "vnvm part vnvm;" \ + "uboot part uboot;" \ + "boot part boot;" \ + "rootfs partubi rootfs;" \ + "userdata partubi userdata\0" + +#undef CONFIG_EXTRA_ENV_SETTINGS +#define CONFIG_EXTRA_ENV_SETTINGS \ + ENV_MEM_LAYOUT_SETTINGS \ + "partitions=" PARTS_RKIMG \ + ROCKCHIP_DEVICE_SETTINGS \ + RKIMG_DET_BOOTDEV \ + BOOTENV + +#define ENV_MEM_LAYOUT_SETTINGS1 \ + "cramfsaddr=0x0c000000\0" \ + "splashimage=0x05000000\0" \ + "loadaddr=0x02000000\0" + +#define CONFIG_ENV_SECT_SIZE 0x10000 + +#define CONFIG_BMP_16BPP +#define CONFIG_BMP_24BPP +#define CONFIG_BMP_32BPP +#define CONFIG_VIDEO_BMP_GZIP +#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((1920 * 1080 * 4) + 54) + +#define CONFIG_ENV_SPI_BUS 4 +#define CONFIG_ENV_SPI_CS 0 +#define CONFIG_ENV_SPI_MAX_HZ 200000000 + +#endif +#endif diff --git a/include/video_rockchip.h b/include/video_rockchip.h index 02a6178ff6d..67e942fba20 100644 --- a/include/video_rockchip.h +++ b/include/video_rockchip.h @@ -7,6 +7,8 @@ #ifndef VIDEO_ROCKCHIP_H #define VIDEO_ROCKCHIP_H +#define CONFIG_DRM_ROCKCHIP_VIDEO_FRAMEBUFFER + #ifdef CONFIG_DRM_ROCKCHIP_VIDEO_FRAMEBUFFER #define DRM_ROCKCHIP_FB_WIDTH 1920 #define DRM_ROCKCHIP_FB_HEIGHT 1080 diff --git a/make.sh b/make.sh index a882ced67a5..c130a353220 100755 --- a/make.sh +++ b/make.sh @@ -11,9 +11,12 @@ SUPPORT_LIST=`ls configs/*[r,p][x,v,k][0-9][0-9]*_defconfig` CMD_ARGS=$1 ########################################### User can modify ############################################# -RKBIN_TOOLS=../rkbin/tools -CROSS_COMPILE_ARM32=../prebuilts/gcc/linux-x86/arm/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -CROSS_COMPILE_ARM64=../prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- +RKBIN_TOOLS=$(pwd)/rkbin/tools +if grep -q '^CONFIG_ARM32=y' .config ; then + CROSS_COMPILE_ARM32=$(dirname $(which arm-linux-gnueabihf-gcc))/bin +else + CROSS_COMPILE_ARM64=$(dirname $(which aarch64-linux-gnu-gcc))/bin +fi ########################################### User not touch ############################################# # Declare global INI file searching index name for every chip, update in select_chip_info() RKCHIP= @@ -98,7 +101,7 @@ function prepare() absolute_path=$(cd `dirname ${RKBIN_TOOLS}`; pwd) RKBIN=${absolute_path} else - echo "ERROR: No ../rkbin repository" + echo "ERROR: No $(pwd)/rkbin repository" exit 1 fi @@ -344,7 +347,7 @@ function fixup_platform_configure() function select_ini_file() { # default - INI_LOADER=${RKBIN}/RKBOOT/${RKCHIP_LOADER}MINIALL.ini + INI_LOADER=${RKBIN}/RKBOOT/${RKCHIP_LOADER}-ODROIDM1.ini if [ "${ARM64_TRUSTZONE}" == "y" ]; then INI_TRUST=${RKBIN}/RKTRUST/${RKCHIP_TRUST}TRUST.ini else diff --git a/rkbin b/rkbin new file mode 160000 index 00000000000..bcab36925d6 --- /dev/null +++ b/rkbin @@ -0,0 +1 @@ +Subproject commit bcab36925d63303514de496dc46767760e8b4511 diff --git a/scripts/fit.sh b/scripts/fit.sh index 158659ea3a5..89348f6f82f 100755 --- a/scripts/fit.sh +++ b/scripts/fit.sh @@ -27,7 +27,7 @@ KERNEL_ADDR_PLACEHOLDER="0xffffff01" RAMDISK_ADDR_PLACEHOLDER="0xffffff02" # tools MKIMAGE="./tools/mkimage" -RK_SIGN_TOOL="../rkbin/tools/rk_sign_tool" +RK_SIGN_TOOL="rkbin/tools/rk_sign_tool" FIT_UNPACK="./scripts/fit-unpack.sh" CHECK_SIGN="./tools/fit_check_sign" # key @@ -298,7 +298,7 @@ function fit_gen_uboot_itb() if [ "${ARG_SPL_NEW}" == "y" ]; then ${CHECK_SIGN} -f ${ITB_UBOOT} -k ${SPL_DTB} -s else - spl_file="../rkbin/"`sed -n "/FlashBoot=/s/FlashBoot=//p" ${ARG_INI_LOADER} |tr -d '\r'` + spl_file="rkbin/"`sed -n "/FlashBoot=/s/FlashBoot=//p" ${ARG_INI_LOADER} |tr -d '\r'` offs=`fdtdump -s ${spl_file} | head -1 | awk -F ":" '{ print $2 }' | sed "s/ found fdt at offset //g" | tr -d " "` if [ -z ${offs} ]; then echo "ERROR: invalid ${spl_file} , unable to find fdt blob" diff --git a/scripts/pack_resource.sh b/scripts/pack_resource.sh index a6e7baef7c1..66de8357a51 100755 --- a/scripts/pack_resource.sh +++ b/scripts/pack_resource.sh @@ -11,7 +11,7 @@ RSCE_NEW=resource.img BOOT_OLD=$1 BOOT_NEW=boot.img -TOOL=../rkbin/tools/resource_tool +TOOL=rkbin/tools/resource_tool IMAGES=./tools/images/ TMP_DIR=.resource_tmp TMP_DIR2=.boot_tmp diff --git a/scripts/uboot.sh b/scripts/uboot.sh index eb9e6a887df..d5b7e193d9a 100755 --- a/scripts/uboot.sh +++ b/scripts/uboot.sh @@ -50,6 +50,6 @@ if [ ${BIN_KB} -gt ${MAX_KB} ]; then exit 1 fi -../rkbin/tools/loaderimage --pack --uboot u-boot.bin uboot.img ${LOAD_ADDR} ${SIZE} +rkbin/tools/loaderimage --pack --uboot u-boot.bin uboot.img ${LOAD_ADDR} ${SIZE} echo "pack uboot okay! Input: u-boot.bin" echo diff --git a/scripts/unpack_resource.sh b/scripts/unpack_resource.sh index 14fe4b26ccb..c97e6b08ff9 100755 --- a/scripts/unpack_resource.sh +++ b/scripts/unpack_resource.sh @@ -8,7 +8,7 @@ IMAGE_FILE=$1 OUTPUT_DIR=$2 -PACK_TOOL=../rkbin/tools/resource_tool +PACK_TOOL=rkbin/tools/resource_tool usage() { @@ -23,7 +23,7 @@ prepare() usage exit 0 elif [ ! -f "$PACK_TOOL" ];then - echo "Can't find '../rkbin/' Responsity, please download it before pack image!" + echo "Can't find 'rkbin/' Responsity, please download it before pack image!" echo "How to obtain? 3 ways:" echo " 1. Login your Rockchip gerrit account: \"Projects\" -> \"List\" -> search \"rk/rkbin\" Responsity" echo " 2. Github Responsity: https://github.com/rockchip-linux/rkbin"