From dc63241fc1b92f7cc5f8eda8f867c19d5c7344e9 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Tue, 8 Jun 2021 11:12:58 +0900 Subject: [PATCH 01/42] ODROID-COMMON: fix to use local toolchains to build U-boot $ export CROSS_COMPILE=/path/of/your/toolchain/bin/aarch-linux-gnu- $ ./make.sh Signed-off-by: Dongjin Kim Change-Id: I904624e252fea62bda0ec466ed8fbf63731455e2 --- make.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/make.sh b/make.sh index a882ced67a5..d072dc73226 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 From 430b1e3166e07f302c065d1de7c01c64dba652b5 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Wed, 2 Jun 2021 12:23:47 +0900 Subject: [PATCH 02/42] ODROID-COMMON: mtd: spi-nor-ids: Add Macronix mx25u12832f ID Signed-off-by: Dongjin Kim Change-Id: I2a9b9a8f6b7b5349e24f6daea9ecad7d6d7260e2 --- drivers/mtd/spi/spi-nor-ids.c | 1 + 1 file changed, 1 insertion(+) 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) }, From 86031e37dd614b45760699c922e5a7a0911d4ef0 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Thu, 10 Jun 2021 14:23:41 +0900 Subject: [PATCH 03/42] ODROID-COMMON: Revert "cmd: source: update terminal value" This reverts commit 11a331d232dea79e25443776ebc3044cbe91d259. Change-Id: Ida526013969076e5a0792883271ba021d2479608 --- cmd/source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 031bc403d14af2030c6c874e0b006e06a7a6ef73 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Thu, 17 Jun 2021 13:49:54 +0900 Subject: [PATCH 04/42] ODROID-COMMON: cmd: fix to support 'ini' command Signed-off-by: Dongjin Kim Change-Id: I01a6b35cd8d0ad95d2d216f6ca5d84dbd101cbcb --- cmd/Kconfig | 5 +++++ cmd/ini.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/Kconfig b/cmd/Kconfig index 051d3955fcb..71a20abd002 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -729,6 +729,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/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'; From 85a778994c2afaab0dce63a99bee4006030103c9 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Tue, 8 Jun 2021 10:54:48 +0900 Subject: [PATCH 05/42] ODROID-COMMON: add new git submodule to download 'rkbin/*' $ git submodule init $ git submodule update $ ./make.sh Signed-off-by: Dongjin Kim Signed-off-by: Luke go Change-Id: If9e02fbf73b2f81f461e78ccb738b81bf6c65f2e --- .gitignore | 2 ++ .gitmodules | 4 ++++ rkbin | 1 + scripts/fit.sh | 4 ++-- scripts/pack_resource.sh | 2 +- scripts/uboot.sh | 2 +- scripts/unpack_resource.sh | 4 ++-- 7 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 .gitmodules create mode 160000 rkbin 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..6079bdc6e9f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "rkbin"] + path = rkbin + url = ../../../rk/rkbin + branch = odroidm1-v2017.09 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" From 6c8796f0d242fd9971ea0d2c3d155ef29aeb5323 Mon Sep 17 00:00:00 2001 From: Eugeniu Rosca Date: Thu, 23 May 2019 17:32:22 +0200 Subject: [PATCH 06/42] ODROID-COMMON: cmd: Add 'bcb' command to read/modify/write BCB fields 'Bootloader Control Block' (BCB) is a well established term/acronym in the Android namespace which refers to a location in a dedicated raw (i.e. FS-unaware) flash (e.g. eMMC) partition, usually called "misc", which is used as media for exchanging messages between Android userspace (particularly recovery [1]) and an Android-capable bootloader. On higher level, this allows implementing a subset of Android Bootloader Requirements [2], amongst which is the Android-specific bootloader flow [3]. Regardless how the latter is implemented in U-Boot ([3] being the most memorable example), reading/writing/dumping the BCB fields in the development process from inside the U-Boot is a convenient feature. Hence, make it available to the users. Some usage examples of the new command recorded on R-Car H3ULCB-KF ('>>>' is an overlay on top of the original console output): => bcb bcb - Load/set/clear/test/dump/store Android BCB fields Usage: bcb load - load BCB from mmc : bcb set - set BCB to bcb clear [] - clear BCB or all fields bcb test - test BCB against bcb dump - dump BCB bcb store - store BCB back to mmc Legend: - MMC device index containing the BCB partition - MMC partition index or name containing the BCB - one of {command,status,recovery,stage,reserved} - the binary operator used in 'bcb test': '=' returns true if matches the string stored in '~' returns true if matches a subset of 's string - string/text provided as input to bcb {set,test} NOTE: any ':' character in will be replaced by line feed during 'bcb set' and used as separator by upper layers => bcb dump command Error: Please, load BCB first! >>> Users must specify mmc device and partition before any other call => bcb load 1 misc => bcb load 1 1 >>> The two calls are equivalent (assuming "misc" has index 1) => bcb dump command 00000000: 62 6f 6f 74 6f 6e 63 65 2d 73 68 65 6c 6c 00 72 bootonce-shell.r 00000010: 79 00 72 00 00 00 00 00 00 00 00 00 00 00 00 00 y.r............. >>> The output is in binary/string format for convenience >>> The output size matches the size of inspected BCB field >>> (32 bytes in case of 'command') => bcb test command = bootonce-shell && echo true true => bcb test command = bootonce-shell- && echo true => bcb test command = bootonce-shel && echo true >>> The '=' operator returns 'true' on perfect match => bcb test command ~ bootonce-shel && echo true true => bcb test command ~ bootonce-shell && echo true true >>> The '~' operator returns 'true' on substring match => bcb set command recovery => bcb dump command 00000000: 72 65 63 6f 76 65 72 79 00 73 68 65 6c 6c 00 72 recovery.shell.r 00000010: 79 00 72 00 00 00 00 00 00 00 00 00 00 00 00 00 y.r............. >>> The new value is NULL-terminated and stored in the BCB field => bcb set recovery "msg1:msg2:msg3" => bcb dump recovery 00000040: 6d 73 67 31 0a 6d 73 67 32 0a 6d 73 67 33 00 00 msg1.msg2.msg3.. 00000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ >>> --- snip --- >>> Every ':' is replaced by line-feed '\n' (0xA). The latter is used >>> as separator between individual commands by Android userspace => bcb store >>> Flush/store the BCB structure to MMC [1] https://android.googlesource.com/platform/bootable/recovery [2] https://source.android.com/devices/bootloader [3] https://patchwork.ozlabs.org/patch/746835/ ("[U-Boot,5/6] Initial support for the Android Bootloader flow") Signed-off-by: Eugeniu Rosca Change-Id: I0b994d6c7c4d3709ae6615924ac97995d6534a23 --- cmd/Kconfig | 17 +++ cmd/Makefile | 1 + cmd/bcb.c | 340 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 358 insertions(+) create mode 100644 cmd/bcb.c diff --git a/cmd/Kconfig b/cmd/Kconfig index 71a20abd002..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 diff --git a/cmd/Makefile b/cmd/Makefile index 7fe7a95cb6f..6c481810a91 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 diff --git a/cmd/bcb.c b/cmd/bcb.c new file mode 100644 index 00000000000..2bd5a744deb --- /dev/null +++ b/cmd/bcb.c @@ -0,0 +1,340 @@ +// 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 (!strncmp(cmd, "load", sizeof("load"))) + return BCB_CMD_LOAD; + if (!strncmp(cmd, "set", sizeof("set"))) + return BCB_CMD_FIELD_SET; + if (!strncmp(cmd, "clear", sizeof("clear"))) + return BCB_CMD_FIELD_CLEAR; + if (!strncmp(cmd, "test", sizeof("test"))) + return BCB_CMD_FIELD_TEST; + if (!strncmp(cmd, "store", sizeof("store"))) + return BCB_CMD_STORE; + if (!strncmp(cmd, "dump", sizeof("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: + if (argc != 3) + goto err; + break; + 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 **field, int *size) +{ + if (!strncmp(name, "command", sizeof("command"))) { + *field = bcb.command; + *size = sizeof(bcb.command); + } else if (!strncmp(name, "status", sizeof("status"))) { + *field = bcb.status; + *size = sizeof(bcb.status); + } else if (!strncmp(name, "recovery", sizeof("recovery"))) { + *field = bcb.recovery; + *size = sizeof(bcb.recovery); + } else if (!strncmp(name, "stage", sizeof("stage"))) { + *field = bcb.stage; + *size = sizeof(bcb.stage); + } else if (!strncmp(name, "reserved", sizeof("reserved"))) { + *field = bcb.reserved; + *size = 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_1; + + part = simple_strtoul(argv[2], &endp, 0); + if (*endp == '\0') { + ret = part_get_info(desc, part, &info); + if (ret) + goto err_1; + } else { + part = part_get_info_by_name(desc, argv[2], &info); + if (part < 0) { + ret = part; + goto err_1; + } + } + + cnt = DIV_ROUND_UP(sizeof(struct bootloader_message), info.blksz); + if (cnt > info.size) + goto err_2; + + if (blk_dread(desc, info.start, cnt, &bcb) != cnt) { + ret = -EIO; + goto err_1; + } + + 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_1: + printf("Error: mmc %s:%s read failed (%d)\n", argv[1], argv[2], ret); + goto err; +err_2: + 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" +); From 851d03c4dd57862a953e91492613e58e00ac88be Mon Sep 17 00:00:00 2001 From: Eugeniu Rosca Date: Fri, 19 Jul 2019 23:26:12 +0200 Subject: [PATCH 07/42] ODROID-COMMON: cmd: bcb: Fix duplicated handling in two case-branches Fix warning V1037 reported by PVS-Studio Static Analyzer: Two or more case-branches perform the same actions. Check lines: 49, 53 Fixes: db7b7a05b267 ("cmd: Add 'bcb' command to read/modify/write BCB fields") Signed-off-by: Eugeniu Rosca Reviewed-by: Igor Opaniuk Reviewed-by: Sam Protsenko Change-Id: Iccbd0208ac69eb181e8412cbdfb53fb896be7064 --- cmd/bcb.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmd/bcb.c b/cmd/bcb.c index 2bd5a744deb..3b1c7434e28 100644 --- a/cmd/bcb.c +++ b/cmd/bcb.c @@ -46,9 +46,6 @@ static int bcb_is_misused(int argc, char *const argv[]) switch (cmd) { case BCB_CMD_LOAD: - if (argc != 3) - goto err; - break; case BCB_CMD_FIELD_SET: if (argc != 3) goto err; From 8bc4a7b7a767f2f804b5e004f549ea507a09fd06 Mon Sep 17 00:00:00 2001 From: Eugeniu Rosca Date: Fri, 19 Jul 2019 23:26:13 +0200 Subject: [PATCH 08/42] ODROID-COMMON: cmd: bcb: Use strcmp() instead of strncmp() for string literals Quote from https://patchwork.ozlabs.org/patch/1104244/#2210814: ----------8<----------- strncmp() is chosen for the sake of paranoid/defensive programming. Indeed, strncmp() is not really needed when comparing a variable with a string literal. We expect strcmp() to behave safely even if the string variable is not NUL-terminated. In the same scenario, Linux v5.2-rc7 uses both strcmp() and strncmp(), but the frequency of strcmp() is higher: $ git --version git version 2.22.0 $ (Linux 5.2-rc7) git grep -En 'strncmp\([^"]*"[[:alnum:]]+"' | wc -l 1066 $ (Linux 5.2-rc7) git grep -En 'strcmp\([^"]*"[[:alnum:]]+"' | wc -l 1968 A quick "strcmp vs strncmp" object size test shows that strcmp() generates smaller memory footprint (gcc-8, x86_64): $ (U-Boot) size cmd/bcb-strncmp.o cmd/bcb-strcmp.o text data bss dec hex filename 3373 400 2048 5821 16bd cmd/bcb-strncmp.o 3314 400 2048 5762 1682 cmd/bcb-strcmp.o So, overall, I agree to use strcmp() whenever variables are compared with string literals. ----------8<----------- Fixes: db7b7a05b267 ("cmd: Add 'bcb' command to read/modify/write BCB fields") Reported-by: Simon Glass Signed-off-by: Eugeniu Rosca Reviewed-by: Sam Protsenko Reviewed-by: Igor Opaniuk Change-Id: Icda2c3e9b01821398f1dc8471d7584bb36e4bedd --- cmd/bcb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/bcb.c b/cmd/bcb.c index 3b1c7434e28..fa9fdeeb0df 100644 --- a/cmd/bcb.c +++ b/cmd/bcb.c @@ -24,17 +24,17 @@ static struct bootloader_message bcb = { { 0 } }; static int bcb_cmd_get(char *cmd) { - if (!strncmp(cmd, "load", sizeof("load"))) + if (!strcmp(cmd, "load")) return BCB_CMD_LOAD; - if (!strncmp(cmd, "set", sizeof("set"))) + if (!strcmp(cmd, "set")) return BCB_CMD_FIELD_SET; - if (!strncmp(cmd, "clear", sizeof("clear"))) + if (!strcmp(cmd, "clear")) return BCB_CMD_FIELD_CLEAR; - if (!strncmp(cmd, "test", sizeof("test"))) + if (!strcmp(cmd, "test")) return BCB_CMD_FIELD_TEST; - if (!strncmp(cmd, "store", sizeof("store"))) + if (!strcmp(cmd, "store")) return BCB_CMD_STORE; - if (!strncmp(cmd, "dump", sizeof("dump"))) + if (!strcmp(cmd, "dump")) return BCB_CMD_FIELD_DUMP; else return -1; @@ -85,19 +85,19 @@ static int bcb_is_misused(int argc, char *const argv[]) static int bcb_field_get(char *name, char **field, int *size) { - if (!strncmp(name, "command", sizeof("command"))) { + if (!strcmp(name, "command")) { *field = bcb.command; *size = sizeof(bcb.command); - } else if (!strncmp(name, "status", sizeof("status"))) { + } else if (!strcmp(name, "status")) { *field = bcb.status; *size = sizeof(bcb.status); - } else if (!strncmp(name, "recovery", sizeof("recovery"))) { + } else if (!strcmp(name, "recovery")) { *field = bcb.recovery; *size = sizeof(bcb.recovery); - } else if (!strncmp(name, "stage", sizeof("stage"))) { + } else if (!strcmp(name, "stage")) { *field = bcb.stage; *size = sizeof(bcb.stage); - } else if (!strncmp(name, "reserved", sizeof("reserved"))) { + } else if (!strcmp(name, "reserved")) { *field = bcb.reserved; *size = sizeof(bcb.reserved); } else { From 1bac869447532c26f53e5e4e2ea930a8922fa50f Mon Sep 17 00:00:00 2001 From: Eugeniu Rosca Date: Fri, 19 Jul 2019 23:26:14 +0200 Subject: [PATCH 09/42] ODROID-COMMON: cmd: bcb: Apply non-functional refinements These have been reported by Simon in [1] and fixed in [2]. However, since [1] has already been pushed to u-boot/master, the improvements incorporated in [2] are now extracted and resubmitted. The changes are in the area of coding style and best practices: * s/field/fieldp/, s/size/sizep/, to convey that the variables return an output to the caller * s/err_1/err_read_fail/, s/err_2/err_too_small/, to be more descriptive * Made sure 'static int do_bcb_load' appears on the same line * Placed a `/*` on top of multi-line comment [1] https://patchwork.ozlabs.org/patch/1104244/#2200259 [2] https://patchwork.ozlabs.org/cover/1128661/ ("[v4,0/4] Add 'bcb' command to read/modify/write Android BCB") Fixes: db7b7a05b267 ("cmd: Add 'bcb' command to read/modify/write BCB fields") Reported-by: Simon Glass Signed-off-by: Eugeniu Rosca Reviewed-by: Sam Protsenko Change-Id: I400d868ee437eff2773d2328b20adad5034f142f --- cmd/bcb.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/cmd/bcb.c b/cmd/bcb.c index fa9fdeeb0df..9626f2c69e3 100644 --- a/cmd/bcb.c +++ b/cmd/bcb.c @@ -83,23 +83,23 @@ static int bcb_is_misused(int argc, char *const argv[]) return -1; } -static int bcb_field_get(char *name, char **field, int *size) +static int bcb_field_get(char *name, char **fieldp, int *sizep) { if (!strcmp(name, "command")) { - *field = bcb.command; - *size = sizeof(bcb.command); + *fieldp = bcb.command; + *sizep = sizeof(bcb.command); } else if (!strcmp(name, "status")) { - *field = bcb.status; - *size = sizeof(bcb.status); + *fieldp = bcb.status; + *sizep = sizeof(bcb.status); } else if (!strcmp(name, "recovery")) { - *field = bcb.recovery; - *size = sizeof(bcb.recovery); + *fieldp = bcb.recovery; + *sizep = sizeof(bcb.recovery); } else if (!strcmp(name, "stage")) { - *field = bcb.stage; - *size = sizeof(bcb.stage); + *fieldp = bcb.stage; + *sizep = sizeof(bcb.stage); } else if (!strcmp(name, "reserved")) { - *field = bcb.reserved; - *size = sizeof(bcb.reserved); + *fieldp = bcb.reserved; + *sizep = sizeof(bcb.reserved); } else { printf("Error: Unknown bcb field '%s'\n", name); return -1; @@ -108,8 +108,8 @@ static int bcb_field_get(char *name, char **field, int *size) return 0; } -static int -do_bcb_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_bcb_load(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) { struct blk_desc *desc; disk_partition_t info; @@ -119,28 +119,28 @@ do_bcb_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ret = blk_get_device_by_str("mmc", argv[1], &desc); if (ret < 0) - goto err_1; + 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_1; + goto err_read_fail; } else { part = part_get_info_by_name(desc, argv[2], &info); if (part < 0) { ret = part; - goto err_1; + goto err_read_fail; } } cnt = DIV_ROUND_UP(sizeof(struct bootloader_message), info.blksz); if (cnt > info.size) - goto err_2; + goto err_too_small; if (blk_dread(desc, info.start, cnt, &bcb) != cnt) { ret = -EIO; - goto err_1; + goto err_read_fail; } bcb_dev = desc->devnum; @@ -148,10 +148,10 @@ do_bcb_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) debug("%s: Loaded from mmc %d:%d\n", __func__, bcb_dev, bcb_part); return CMD_RET_SUCCESS; -err_1: +err_read_fail: printf("Error: mmc %s:%s read failed (%d)\n", argv[1], argv[2], ret); goto err; -err_2: +err_too_small: printf("Error: mmc %s:%s too small!", argv[1], argv[2]); goto err; err: @@ -304,7 +304,8 @@ static int do_bcb(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) return CMD_RET_USAGE; if (bcb_is_misused(argc, argv)) { - /* We try to improve the user experience by reporting the + /* + * 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 */ From dde526ccf457d8fba53b00a035ec22df155f9e54 Mon Sep 17 00:00:00 2001 From: Luke go Date: Mon, 19 Jul 2021 17:03:25 +0900 Subject: [PATCH 10/42] ODROID-COMMON: add setbootdev command. - On the rockchip chip, boot device discriptor is fixed on boot time. But ODROID-M1 have to change the boot device discriptor. So add new command to change boot device discriptor, 'setbootdev'. Change-Id: I60065e0e69503c03b32f52de1d2f4ec515e1381f --- cmd/Makefile | 2 ++ cmd/setbootdev.c | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 cmd/setbootdev.c diff --git a/cmd/Makefile b/cmd/Makefile index 6c481810a91..ed11613d8e9 100644 --- a/cmd/Makefile +++ b/cmd/Makefile @@ -178,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/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", + " " +); From eec8e7803c46ca4a817879394c84a9b9000c1348 Mon Sep 17 00:00:00 2001 From: Luke go Date: Tue, 20 Jul 2021 10:13:13 +0900 Subject: [PATCH 11/42] ODROID-COMMON: renamed and replaced android_bootloader msg stuffs. - Rockchip used their's bootloader_message structures instead of original bootloader_message structures. This commit replaced it to original stuffs. Change-Id: I094622d4866287b6e5de1d2805319eb6fffc5aff --- arch/arm/mach-rockchip/boot_mode.c | 1 + arch/arm/mach-rockchip/boot_rkimg.c | 1 + arch/arm/mach-rockchip/spl.c | 1 + common/android_ab.c | 26 ++++++++++++------------- common/android_bootloader.c | 12 ++++++------ include/android_bootloader_message.h | 29 ++++++++++++++-------------- include/boot_rkimg.h | 16 --------------- 7 files changed, 37 insertions(+), 49 deletions(-) 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..1281b728333 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 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/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/include/android_bootloader_message.h b/include/android_bootloader_message.h index 9fa8cf0d2e1..c3c513b5328 100644 --- a/include/android_bootloader_message.h +++ b/include/android_bootloader_message.h @@ -26,9 +26,9 @@ * 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; +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,7 +58,7 @@ 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]; @@ -82,7 +82,7 @@ struct android_bootloader_message { * because A/B-specific fields may end up with different offsets. */ #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 @@ -102,12 +102,13 @@ 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]; + char reserved[1888]; }; /** @@ -115,14 +116,14 @@ struct android_bootloader_message_ab { * bootloader_message_ab struct (b/29159185). */ #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 #define ANDROID_BOOT_CTRL_MAGIC 0x42414342 /* Bootloader Control AB */ #define ANDROID_BOOT_CTRL_VERSION 1 -struct android_slot_metadata { +struct slot_metadata { /* Slot priority with 15 meaning highest priority, 1 lowest * priority and 0 the slot is unbootable. */ uint8_t priority : 4; @@ -145,7 +146,7 @@ struct android_slot_metadata { * 'bootloader_control' structure to store the A/B metadata, but not * mandatory. */ -struct android_bootloader_control { +struct bootloader_control { /* NUL terminated active slot suffix. */ char slot_suffix[4]; /* Bootloader Control AB magic number (see BOOT_CTRL_MAGIC). */ @@ -159,7 +160,7 @@ struct android_bootloader_control { /* 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]; + struct slot_metadata slot_info[4]; /* Reserved for further use. */ uint8_t reserved1[8]; /* CRC32 of all 28 bytes preceding this field (little endian @@ -168,8 +169,8 @@ struct android_bootloader_control { } __attribute__((packed)); #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 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; From fb6409dc1012f11d098ec260b6f284e4f69094a1 Mon Sep 17 00:00:00 2001 From: Eugeniu Rosca Date: Thu, 23 May 2019 17:32:21 +0200 Subject: [PATCH 12/42] ODROID-COMMON: include: android_bootloader_message.h: Minimize the diff to AOSP Perform the following updates: - Relocate the commit id from the file to the description of U-Boot commit. The AOSP commit is c784ce50e8c10eaf70e1f97e24e8324aef45faf5. This is done to avoid stale references in the file itself. The reasoning is in https://patchwork.ozlabs.org/patch/1098056/#2170209. - Minimize the diff to AOSP, to decrease the effort of the next AOSP backports. The background can be found in: https://patchwork.ozlabs.org/patch/1080394/#2168454. - Guard the static_assert() calls by #ifndef __UBOOT__ ... #endif, to avoid compilation failures of files including the header. Signed-off-by: Eugeniu Rosca Reviewed-by: Sam Protsenko Reviewed-by: Simon Glass Change-Id: I48de5bc6d3c44fa27d7874ea60c5bdced3acce84 --- include/android_bootloader_message.h | 151 ++++++++++++++++++++------- 1 file changed, 114 insertions(+), 37 deletions(-) diff --git a/include/android_bootloader_message.h b/include/android_bootloader_message.h index c3c513b5328..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,20 +12,25 @@ #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. - */ +// 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; @@ -63,17 +68,17 @@ struct bootloader_message { 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 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 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). @@ -107,7 +114,7 @@ struct bootloader_message_ab { char slot_suffix[32]; char update_channel[128]; - /* Round up the entire struct to 4096-byte. */ + // Round up the entire struct to 4096-byte. char reserved[1888]; }; @@ -115,26 +122,28 @@ struct bootloader_message_ab { * 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 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 slot_metadata { - /* Slot priority with 15 meaning highest priority, 1 lowest - * priority and 0 the slot is unbootable. */ + // 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)); @@ -147,31 +156,99 @@ struct slot_metadata { * mandatory. */ struct bootloader_control { - /* NUL terminated active slot suffix. */ + // 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. */ + // Per-slot information. Up to 4 slots. struct slot_metadata slot_info[4]; - /* Reserved for further use. */ + // 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 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 */ From fde5a2ba742b2adbff5ebbb4c3f0c6b88d7f8e3c Mon Sep 17 00:00:00 2001 From: Luke Go Date: Fri, 15 Oct 2021 10:10:18 +0900 Subject: [PATCH 13/42] ODROID-COMMON: Changed the dtb load method. - The rockchip load dtb file from resource image. but the odroid board load dtb file from the other methods like loading from dtb partition. - So Avoid rockchip's loading method. Before loading rockchip's resource image, check fdt header and avoid it. Change-Id: I2072b2a70939772c06e0319ccd07a21c89c73cce Signed-off-by: Luke Go --- arch/arm/mach-rockchip/resource_img.c | 3 +++ 1 file changed, 3 insertions(+) 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) { From e88f29a498d4bd80e55c7713d22ec0e3550502bc Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 26 Nov 2021 02:22:20 +0900 Subject: [PATCH 14/42] ODROID-COMMON: cmd/bmp: fix in the function 'gunzip_bmp' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch is to resolve two issues: 1) Compile error cmd/bmp.c: In function ‘gunzip_bmp’: cmd/bmp.c:61:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] bmp = (struct bmp_image *)((((unsigned int)dst + 1) & ~3) + 2); ^ cmd/bmp.c:61:8: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] bmp = (struct bmp_image *)((((unsigned int)dst + 1) & ~3) + 2); ^ 2) Return lenght of decompressed buffer to given arguemnt 'lenp' when decompression is success. Signed-off-by: Dongjin Kim Change-Id: I485ab72186f7130997fb6d0793c3b805efaa8b17 --- cmd/bmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From d444cff1e19d7b5e8855d6f0eadae042f3b0bd4b Mon Sep 17 00:00:00 2001 From: Luke Go Date: Fri, 29 Oct 2021 15:40:24 +0900 Subject: [PATCH 15/42] ODROID-COMMON: distro_bootcmd: Removed bootable args. - The odroid placed boot.scr file to the fat fs partition. But -bootable argument doesn't count this. So fat partition can't work with this args. So Removed this option to use distro_bootcmd. Change-Id: Ia42abbe62dc59687ddccacb9c25c6892f92a360c Signed-off-by: Luke Go --- include/config_distro_bootcmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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} " \ From acd93cf2444c1395dc57eb923e53f354b0e18e6d Mon Sep 17 00:00:00 2001 From: ckkim Date: Tue, 31 Aug 2021 12:03:25 +0900 Subject: [PATCH 16/42] ODROID-COMMON: drivers/mmc: Add support eMMC H/W reset If emmc rst_n function is not enabled, must execute this command in the u-boot shell. => mmc rst-function 0 1 Signed-off-by: ckkim Change-Id: I21a6ac376032cc2b7b699c889bc78d8f58301488 --- drivers/mmc/rockchip_sdhci.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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); } From 6bc3b9d969bfb3ca8ca501543d90d39ca8676f14 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Thu, 14 Oct 2021 13:03:16 +0900 Subject: [PATCH 17/42] ODROID-COMMON: arch/arm: fix to add missing header Fix to add missing header file for Android image when booting from SPI device. FIX to "[57504d998f rockchip: spl: support get boot mode]" Change-Id: I84abef71b5f797ce9e994e350df9c37a0dcfee7d --- arch/arm/mach-rockchip/spl_boot_mode.c | 1 + 1 file changed, 1 insertion(+) 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) { From 356906e6445378a45ac14ec184fc6e666b22338a Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Tue, 1 Jun 2021 15:45:22 +0900 Subject: [PATCH 18/42] ODROID-M1: add new board Hardkernel ODROID-M1 based on RK3568 Signed-off-by: Dongjin Kim Change-Id: Idfa765d9dfd6943cf2704844d5153d0363b174a0 --- arch/arm/dts/rk3568-odroid-m1.dts | 64 + arch/arm/mach-rockchip/boot_rkimg.c | 16 + arch/arm/mach-rockchip/rk3568/Kconfig | 7 + board/hardkernel/odroid-m1/Kconfig | 15 + board/hardkernel/odroid-m1/Makefile | 7 + board/hardkernel/odroid-m1/odroid-m1.c | 88 ++ configs/odroid_rk3568_defconfig | 1588 ++++++++++++++++++++++++ include/configs/odroid-m1.h | 57 + make.sh | 2 +- 9 files changed, 1843 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/rk3568-odroid-m1.dts create mode 100644 board/hardkernel/odroid-m1/Kconfig create mode 100644 board/hardkernel/odroid-m1/Makefile create mode 100644 board/hardkernel/odroid-m1/odroid-m1.c create mode 100644 configs/odroid_rk3568_defconfig create mode 100644 include/configs/odroid-m1.h diff --git a/arch/arm/dts/rk3568-odroid-m1.dts b/arch/arm/dts/rk3568-odroid-m1.dts new file mode 100644 index 00000000000..8662db94e7b --- /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 = &spi_nor, &sdhci, &sdmmc0; + }; + + /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/boot_rkimg.c b/arch/arm/mach-rockchip/boot_rkimg.c index 1281b728333..6d6199bb900 100644 --- a/arch/arm/mach-rockchip/boot_rkimg.c +++ b/arch/arm/mach-rockchip/boot_rkimg.c @@ -532,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; @@ -542,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/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/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..3bd23a96aee --- /dev/null +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -0,0 +1,88 @@ +/* + * SPDX-License-Identifier: GPL-2.0+ + * + * (C) Copyright 2020 Rockchip Electronics Co., Ltd + */ + +#include +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +#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) +{ + struct blk_desc *dev_desc; + 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")) { + dev_desc = rockchip_get_bootdev(); + if (dev_desc && (dev_desc->if_type == IF_TYPE_MTD + && dev_desc->devnum == 2)) + snprintf(buf, sizeof(buf), + "cramfsload $scriptaddr boot.scr;" + "source $scriptaddr;" + "%s", env_get("bootcmd")); + } + + env_set("bootcmd", buf); + + return 0; +} + +int board_early_init_r(void) +{ + struct blk_desc *dev_desc = rockchip_get_bootdev(); + if ((dev_desc->if_type == IF_TYPE_MTD) && (dev_desc->devnum == 2)) { + run_command_list( "sf probe\n" + "sf read $cramfsaddr 0x400000 0xc00000", + -1, 0); + } + + 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; + + return fdt_check_header(fdt_addr); +} diff --git a/configs/odroid_rk3568_defconfig b/configs/odroid_rk3568_defconfig new file mode 100644 index 00000000000..f821e219d4d --- /dev/null +++ b/configs/odroid_rk3568_defconfig @@ -0,0 +1,1588 @@ +# +# 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=y +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_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 +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_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_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_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 is not set + +# +# 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_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 is not set +# 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 is not set +CONFIG_DRM_ROCKCHIP=y +CONFIG_DRM_MEM_RESERVED_SIZE_MBYTES=32 +CONFIG_DRM_DP_HELPER=y +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=y +CONFIG_DRM_ROCKCHIP_LVDS=y +# 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_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 + +# +# 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/include/configs/odroid-m1.h b/include/configs/odroid-m1.h new file mode 100644 index 00000000000..1058122f608 --- /dev/null +++ b/include/configs/odroid-m1.h @@ -0,0 +1,57 @@ +/* + * SPDX-License-Identifier: GPL-2.0+ + * + * Copyright (c) 2021 Hardkernel Co., Ltd + */ + +#ifndef __CONFIGS_ODROID_M1_H +#define __CONFIGS_ODROID_M1_H + +#include + +#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" \ + "loadaddr=0x02000000\0" + +#define CONFIG_ENV_SECT_SIZE 0x10000 + +#endif +#endif diff --git a/make.sh b/make.sh index d072dc73226..c130a353220 100755 --- a/make.sh +++ b/make.sh @@ -347,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 From 518bbfe5457d501061f872757ad6eac02842f241 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 26 Nov 2021 21:23:32 +0900 Subject: [PATCH 19/42] ODROID-M1: add to load default splash image This patch is to load the default splash image from a dedicated partition in SPI flash memory and use it for a default U-Boot logo image after putting into resource pool. Change-Id: I640b9db5c841ef5dfbb73e72590342b20de4a691 Signed-off-by: Dongjin Kim --- board/hardkernel/odroid-m1/odroid-m1.c | 97 ++++++++++++++++++++++++++ include/configs/odroid-m1.h | 9 +++ include/video_rockchip.h | 2 + 3 files changed, 108 insertions(+) diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c index 3bd23a96aee..74e3e2ee6df 100644 --- a/board/hardkernel/odroid-m1/odroid-m1.c +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -10,6 +10,14 @@ #include #include #include +#include +#include +#include +#include "../../../drivers/video/drm/rockchip_display.h" + +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; @@ -86,3 +94,92 @@ int board_read_dtb_file(void *fdt_addr) 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; +} + +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 = 0x100000; + char str[80]; + int ret; + + snprintf(str, sizeof(str), + "mtd read nor0 0x%08x 0x300000 0x%08x", + loadaddr, (unsigned int)len); + ret = run_command(str, 0); + if (ret) + return 1; + + bmp = gunzip_bmp(loadaddr, &len, &decomp); + if (bmp) + set_bmp_logo("logo.bmp", bmp, 1); + + free(decomp); + + return 0; +} +#endif diff --git a/include/configs/odroid-m1.h b/include/configs/odroid-m1.h index 1058122f608..eec452c3282 100644 --- a/include/configs/odroid-m1.h +++ b/include/configs/odroid-m1.h @@ -9,6 +9,8 @@ #include +#define CONFIG_MISC_INIT_R + #undef RKIMG_BOOTCOMMAND #ifndef CONFIG_SPL_BUILD @@ -49,9 +51,16 @@ #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) + #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 From f9ec44d2b89a6124bb1af1ab40092a911415f98a Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Wed, 8 Sep 2021 09:48:53 +0800 Subject: [PATCH 20/42] ODROID-COMMON: Revert "rockchip: board: implement board_fdt_chosen_bootargs()" This reverts commit d87d52756a1f979d3d3d5ddeba9e873f2889dd6b. This patch is to use the unchanged 'bootargs' from U-Boot environment to the device tree, since Rockchip's patch replaces or merges with something else with given sources. Change-Id: I70187f1112c87867d0eb306920346f35d6e966f4 --- arch/arm/mach-rockchip/board.c | 89 ---------------------------------- 1 file changed, 89 deletions(-) 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 */ From 37ebf598c43ed04692481ffd4f1f196732b28254 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Mon, 13 Dec 2021 15:30:19 +0900 Subject: [PATCH 21/42] ODROID-M1: fix incorrect SPI flash access After applying the device tree from Kernel, not built-in one, SPI flash memory is mapped to different bus and this causes to access environmemnt in SPI flash memory due to failure creating MTD device. Change-Id: Ie6047b288093357f09e39fa01c2c02a61d75fe4b --- board/hardkernel/odroid-m1/odroid-m1.c | 4 ++-- env/sf.c | 4 ++++ include/configs/odroid-m1.h | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c index 74e3e2ee6df..866fa60faec 100644 --- a/board/hardkernel/odroid-m1/odroid-m1.c +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -54,7 +54,7 @@ int rk_board_late_init(void) if (strcmp(env_get("skip_spiboot"), "true")) { dev_desc = rockchip_get_bootdev(); if (dev_desc && (dev_desc->if_type == IF_TYPE_MTD - && dev_desc->devnum == 2)) + && dev_desc->devnum == 3)) snprintf(buf, sizeof(buf), "cramfsload $scriptaddr boot.scr;" "source $scriptaddr;" @@ -168,7 +168,7 @@ int misc_init_r(void) int ret; snprintf(str, sizeof(str), - "mtd read nor0 0x%08x 0x300000 0x%08x", + "sf read 0x%08x 0x300000 0x%08x", loadaddr, (unsigned int)len); ret = run_command(str, 0); if (ret) 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/configs/odroid-m1.h b/include/configs/odroid-m1.h index eec452c3282..d9067726f4c 100644 --- a/include/configs/odroid-m1.h +++ b/include/configs/odroid-m1.h @@ -62,5 +62,9 @@ #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 From 68e0027a9fbfc764639182125a4ca26d17601c54 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Wed, 15 Dec 2021 04:39:19 +0900 Subject: [PATCH 22/42] ODROID-M1: improve loading splash image Signed-off-by: Dongjin Kim Change-Id: I5917556711cf2d0761567d6ced91992f9759a1d5 --- board/hardkernel/odroid-m1/odroid-m1.c | 27 +++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c index 866fa60faec..638c9db8406 100644 --- a/board/hardkernel/odroid-m1/odroid-m1.c +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -163,22 +163,35 @@ 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 = 0x100000; + unsigned long len; char str[80]; int ret; + /* Try to load splash image from SPI flash memory */ snprintf(str, sizeof(str), - "sf read 0x%08x 0x300000 0x%08x", - loadaddr, (unsigned int)len); + "sf read 0x%08x 0x300000 0x100000", loadaddr); ret = run_command(str, 0); - if (ret) - return 1; + 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); - bmp = gunzip_bmp(loadaddr, &len, &decomp); if (bmp) set_bmp_logo("logo.bmp", bmp, 1); - free(decomp); + if (decomp) + free(decomp); return 0; } From ca5c344a875ac0d3106947a55b0cfde46578e3ae Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Thu, 30 Dec 2021 18:35:36 +0900 Subject: [PATCH 23/42] ODROID-COMMON: Revert "driver: core: reject all mmc device from kernel" This reverts commit 33273e09fd8c70f30afe5da51578283c35910fd7. This patch is to use MMC device from kernel device tree rather than U-Boot. After device tree for kernel is loaded, the phandle of the pin controls for MMC refers to U-Boot one and failed to initiated them when booting from SPI flash memory. Change-Id: I3fb82ac64bd8942da6da12f90c7d83f82bfc9644 --- drivers/core/device.c | 10 ---------- drivers/core/of_access.c | 4 ---- 2 files changed, 14 deletions(-) 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; } From 4880a4becd37a20124745a5f0a4c85388f13fce8 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Thu, 30 Dec 2021 18:45:17 +0900 Subject: [PATCH 24/42] ODROID-COMMON: Revert "board_r: skip mmc init when CONFIG_USING_KERNEL_DTB is enabled" This reverts commit 123c920622cc462fd3a11abea7b9647b03f48497. This commit is to initiated MMC hardwares when the kernel device tree is loaded, MMC is not initiated when booting from SPI flash memory. Change-Id: I3a37644e89a57a1ed96579f7626ebd9e14f0f3f4 --- common/board_r.c | 5 ----- 1 file changed, 5 deletions(-) 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 From 67023fa9ac2c405c77f2f3945259f0365d5b7b3b Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Thu, 23 Dec 2021 13:57:34 +0900 Subject: [PATCH 25/42] ODROID-M1: remove to use vendor partition feature from Rockchip ODROID-M1 does not use Rockchip's vendor partition. Signed-off-by: Dongjin Kim Change-Id: Ica3ec5a945a4ecb7f9b640de55eb370402875526 --- configs/odroid_rk3568_defconfig | 2 +- drivers/video/drm/dw_hdmi.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configs/odroid_rk3568_defconfig b/configs/odroid_rk3568_defconfig index f821e219d4d..07d14195ab3 100644 --- a/configs/odroid_rk3568_defconfig +++ b/configs/odroid_rk3568_defconfig @@ -183,7 +183,7 @@ 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=y +# CONFIG_ROCKCHIP_VENDOR_PARTITION=y CONFIG_USING_KERNEL_DTB=y CONFIG_EMBED_KERNEL_DTB_PATH="rk3568-odroid-m1.dtb" # CONFIG_EMBED_KERNEL_DTB_ALWAYS is not set 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 && From 361a4cf0092448bfbebbbdee50ac1a4aa3897436 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Thu, 27 Jan 2022 16:36:11 +0900 Subject: [PATCH 26/42] ODROID-M1: add not to apply display fixup When a device tree have a bool property 'disable-vop2-fixup', U-Boot wont' apply a device tree fixup for a display device. chosen { disable-vop2-fixup; ... }; Signed-off-by: Dongjin Kim Change-Id: I728b6b45799e5ca690693fa074df8fea1f9f65c2 --- drivers/video/drm/rockchip_vop2.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; From 2781478659c1d57ad67991febb74a8d78857ad93 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Wed, 9 Feb 2022 18:15:39 +0900 Subject: [PATCH 27/42] ODROID-M1: add to read 'ODROIDBIOS.BIN' when booted from SD Card Signed-off-by: Dongjin Kim Change-Id: I2d640db0e6de2efbf78289c486c0d9380164e621 --- board/hardkernel/odroid-m1/odroid-m1.c | 32 ++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c index 638c9db8406..4f0130d54ea 100644 --- a/board/hardkernel/odroid-m1/odroid-m1.c +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "../../../drivers/video/drm/rockchip_display.h" extern int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); @@ -45,20 +46,16 @@ int board_usb_init(int index, enum usb_init_type init) int rk_board_late_init(void) { - struct blk_desc *dev_desc; 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")) { - dev_desc = rockchip_get_bootdev(); - if (dev_desc && (dev_desc->if_type == IF_TYPE_MTD - && dev_desc->devnum == 3)) - snprintf(buf, sizeof(buf), - "cramfsload $scriptaddr boot.scr;" - "source $scriptaddr;" - "%s", env_get("bootcmd")); + snprintf(buf, sizeof(buf), + "cramfsload $scriptaddr boot.scr;" + "source $scriptaddr;" + "%s", env_get("bootcmd")); } env_set("bootcmd", buf); @@ -69,7 +66,24 @@ int rk_board_late_init(void) int board_early_init_r(void) { struct blk_desc *dev_desc = rockchip_get_bootdev(); - if ((dev_desc->if_type == IF_TYPE_MTD) && (dev_desc->devnum == 2)) { + int ret = -EINVAL; + char buf[16]; + int n; + + 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)) { + char cmd[256]; + snprintf(cmd, sizeof(cmd), + "load mmc %s $cramfsaddr ODROIDBIOS.BIN", buf); + ret = run_command(cmd, 0); + if (!ret) + break; + } + } + + if (ret) { run_command_list( "sf probe\n" "sf read $cramfsaddr 0x400000 0xc00000", -1, 0); From f158e436ae4b0ffffc6a455a9caca4afb241aa7f Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 4 Mar 2022 06:46:02 +0900 Subject: [PATCH 28/42] ODROID-M1: reorder boot devices (eMMC -> SD -> SPI) This patch is to load U-Boot blob from eMMC or SD card when it has a partition named 'uboot', this helps to use custom U-Boot blob or debug it rather than load from or reflash SPI flash memory. Signed-off-by: Dongjin Kim Change-Id: I934cd139146eb9226ad2e757be8dde4ab38212be --- arch/arm/dts/rk3568-odroid-m1.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/rk3568-odroid-m1.dts b/arch/arm/dts/rk3568-odroid-m1.dts index 8662db94e7b..2c9fc41ce84 100644 --- a/arch/arm/dts/rk3568-odroid-m1.dts +++ b/arch/arm/dts/rk3568-odroid-m1.dts @@ -19,7 +19,7 @@ chosen { stdout-path = &uart2; - u-boot,spl-boot-order = &spi_nor, &sdhci, &sdmmc0; + u-boot,spl-boot-order = &sdhci, &sdmmc0, &spi_nor; }; /delete-node/ adc-keys; From 7ee2a5ed2236055183f77c6138046440241d1ae8 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 4 Mar 2022 07:54:36 +0900 Subject: [PATCH 29/42] ODROID-M1: add to initiate SPI flash memory on booting This patch is to intiate SPI flash memory with default bus and cs on booting, this is only necessary when U-Boot blob is loaded from MMC device. Signed-off-by: Dongjin Kim Change-Id: I430ad1d9669329abf4e9acaf4dd2c81fce4b5530 --- board/hardkernel/odroid-m1/odroid-m1.c | 8 ++++++++ configs/odroid_rk3568_defconfig | 25 +++++++++++++++++++++++-- drivers/rkflash/rksfc_base.c | 2 ++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c index 4f0130d54ea..b0fc1088a05 100644 --- a/board/hardkernel/odroid-m1/odroid-m1.c +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -14,6 +14,9 @@ #include #include #include +#if defined(CONFIG_RKSFC_NOR) +#include +#endif #include "../../../drivers/video/drm/rockchip_display.h" extern int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); @@ -70,6 +73,11 @@ int board_early_init_r(void) char buf[16]; 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); diff --git a/configs/odroid_rk3568_defconfig b/configs/odroid_rk3568_defconfig index 07d14195ab3..7b885ca7918 100644 --- a/configs/odroid_rk3568_defconfig +++ b/configs/odroid_rk3568_defconfig @@ -183,7 +183,7 @@ 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=y +# 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 @@ -195,6 +195,7 @@ 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 @@ -349,6 +350,10 @@ CONFIG_DISPLAY_BOARDINFO=y # 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 @@ -590,6 +595,7 @@ CONFIG_CMD_PART=y # 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 @@ -618,6 +624,7 @@ 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 @@ -1212,6 +1219,7 @@ CONFIG_DM_REGULATOR=y 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 @@ -1244,7 +1252,14 @@ CONFIG_RESET_ROCKCHIP=y CONFIG_SPL_RESET_ROCKCHIP=y # CONFIG_RESET_SCMI is not set # CONFIG_RKNAND is not set -# CONFIG_RKFLASH 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 @@ -1342,6 +1357,7 @@ 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 @@ -1531,6 +1547,11 @@ CONFIG_RSA_E_SIZE=0x10 CONFIG_RSA_C_SIZE=0x20 # CONFIG_TPM is not set +# +# Boot Configuration +# +# CONFIG_XBC is not set + # # Hashing Support # 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[] = { From 34751fb83d30f2f750eb5b1f0df00499d27dcc67 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 4 Mar 2022 09:21:08 +0900 Subject: [PATCH 30/42] ODROID-M1: add to load boot splash image from MMC A default boot splash image can be stored in a partition of SPI flash memory, but maybe good to load from MMC for testing or larger splash image than the partition size in SPI flash memory. Signed-off-by: Dongjin Kim Change-Id: If17010d550be48a72b449cd11e9c5c71a27ae217 --- board/hardkernel/odroid-m1/odroid-m1.c | 44 ++++++++++++++++++++------ 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c index b0fc1088a05..497d4bfd774 100644 --- a/board/hardkernel/odroid-m1/odroid-m1.c +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -180,6 +180,25 @@ static int set_bmp_logo(const char *bmp_name, void *addr, int flip) 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; @@ -187,19 +206,24 @@ int misc_init_r(void) unsigned int loadaddr = (unsigned int)env_get_ulong("loadaddr", 16, 0); unsigned long len; char str[80]; - int ret; - /* 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 */ + 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), - "cramfsload 0x%08x boot-logo.bmp.gz", loadaddr); + "sf read 0x%08x 0x300000 0x100000", loadaddr); ret = run_command(str, 0); - if (ret) - return 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); From 88b784f02e6056b8a69e93a7494cd62fb4c221d5 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Thu, 14 Apr 2022 00:45:12 +0900 Subject: [PATCH 31/42] ODROID-M1: fix add 'variant' env variable as 'm1' Currently, we have only ODROID-M1 based on RK3568 so use "m1" and change it for others if we have more variant models. Signed-off-by: Dongjin Kim Change-Id: I4acacc1d7d6364bade8787de3097d0d270a5e7e3 --- board/hardkernel/odroid-m1/odroid-m1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c index 497d4bfd774..6fefc3d849c 100644 --- a/board/hardkernel/odroid-m1/odroid-m1.c +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -62,6 +62,7 @@ int rk_board_late_init(void) } env_set("bootcmd", buf); + env_set("variant", "m1"); /* FIXME: if we have variant model */ return 0; } From 09ffccce617877e1fcb3ab443a11c203b216d0ee Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Wed, 20 Apr 2022 23:51:32 +0900 Subject: [PATCH 32/42] ODROID-M1: Revert "gpt: return 1 directly when test the mbr sector" This reverts commit 3bdef7e642ae558d0e61ce26438d10b55b26ec9c. This commit blocks to boot from SD card, since it won't check it partition type properly and treats it's always EFI partition type. Change-Id: Ic5ae4fe70fdd61addc5cd8dfdb782928535fabea Signed-off-by: Dongjin Kim --- disk/part_efi.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/disk/part_efi.c b/disk/part_efi.c index 27f3e4dda31..32805f1e193 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -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; } /** @@ -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; From 0fd92ea4c6ef4f7f88baaf4b2c1741d5369c34f6 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 22 Apr 2022 14:59:26 +0900 Subject: [PATCH 33/42] ODROID-M1: load environment from SPI flash at very early In order to use an environment value at early stage in U-Boot procedure, specifically earlier than a kernel device tree blob is proceed, the environment value must be loaded and imported. Signed-off-by: Dongjin Kim Change-Id: I147b2b37f3d1706e22a27083549eff7a8815064e --- board/hardkernel/odroid-m1/odroid-m1.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c index 6fefc3d849c..212d48efcac 100644 --- a/board/hardkernel/odroid-m1/odroid-m1.c +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -18,6 +18,7 @@ #include #endif #include "../../../drivers/video/drm/rockchip_display.h" +#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); @@ -72,6 +73,8 @@ 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) @@ -83,7 +86,6 @@ int board_early_init_r(void) snprintf(buf, sizeof(buf), "%d:%d", dev_desc->devnum, n); if (file_exists("mmc", buf, "ODROIDBIOS.BIN", FS_TYPE_ANY)) { - char cmd[256]; snprintf(cmd, sizeof(cmd), "load mmc %s $cramfsaddr ODROIDBIOS.BIN", buf); ret = run_command(cmd, 0); @@ -92,11 +94,14 @@ int board_early_init_r(void) } } - if (ret) { - run_command_list( "sf probe\n" - "sf read $cramfsaddr 0x400000 0xc00000", - -1, 0); - } + 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_import(env, 1); return 0; } From 5dcb2afa933343198ecc38f0b96ce58dc38fdc9a Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Wed, 20 Apr 2022 08:33:39 +0900 Subject: [PATCH 34/42] ODROID-M1: load 'panel' environment value for DSI display The value of 'panel' stores a device tree overlay file for a DSI panel, so load it and apply to a kernel device tree. Signed-off-by: Dongjin Kim Change-Id: I2020f7048a2bdd38da5cfa472dc11acb1bca2c66 --- board/hardkernel/odroid-m1/odroid-m1.c | 40 ++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/board/hardkernel/odroid-m1/odroid-m1.c b/board/hardkernel/odroid-m1/odroid-m1.c index 212d48efcac..5062ca7d722 100644 --- a/board/hardkernel/odroid-m1/odroid-m1.c +++ b/board/hardkernel/odroid-m1/odroid-m1.c @@ -19,6 +19,7 @@ #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); @@ -26,6 +27,8 @@ 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, @@ -100,8 +103,27 @@ int board_early_init_r(void) 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_import(env, 1); + 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; } @@ -120,6 +142,20 @@ int board_read_dtb_file(void *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); } From 207f6883874e7d31789637aee60347255c8cf6ac Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 22 Apr 2022 15:06:08 +0900 Subject: [PATCH 35/42] ODROID-M1: add DSI lcd panel for 'ODROID-Vu8M' Signed-off-by: Dongjin Kim Change-Id: I0115b2b88333e9ba6a8bd97daa5b48a0a6a0eeea --- drivers/video/drm/rockchip_panel.c | 1 + 1 file changed, 1 insertion(+) 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", }, {} }; From d9b7946565a6fbccfe6b3c3c25c2d0a6655a2914 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 22 Apr 2022 16:25:55 +0900 Subject: [PATCH 36/42] ODROID-M1: Change configs for display subsystem Signed-off-by: Dongjin Kim Change-Id: Ic0bf78193e724af166ed6c1d16abf9165d2f8cee --- configs/odroid_rk3568_defconfig | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/configs/odroid_rk3568_defconfig b/configs/odroid_rk3568_defconfig index 7b885ca7918..4428e65bfff 100644 --- a/configs/odroid_rk3568_defconfig +++ b/configs/odroid_rk3568_defconfig @@ -1460,7 +1460,7 @@ CONFIG_SYS_WHITE_ON_BLACK=y # # TrueType Fonts # -# CONFIG_VIDCONSOLE_AS_LCD is not set +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 @@ -1468,10 +1468,15 @@ CONFIG_SYS_WHITE_ON_BLACK=y CONFIG_I2C_EDID=y CONFIG_DISPLAY=y # CONFIG_ATMEL_HLCD is not set -# CONFIG_VIDEO_ROCKCHIP 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_DP_HELPER=y CONFIG_DRM_ROCKCHIP_PANEL=y CONFIG_DRM_ROCKCHIP_DW_HDMI=y # CONFIG_DRM_ROCKCHIP_INNO_HDMI is not set @@ -1481,8 +1486,8 @@ CONFIG_DRM_ROCKCHIP_INNO_MIPI_PHY=y 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=y -CONFIG_DRM_ROCKCHIP_LVDS=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 @@ -1496,6 +1501,7 @@ CONFIG_VIDEO_BRIDGE=y # 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 # From 0677e140ba015b95ccd6d762ce51a4c6860a49ca Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 8 Apr 2022 15:42:06 +0900 Subject: [PATCH 37/42] ODROID-M1: disk/efi: suppress GPT error if disk is not EFI partition Change-Id: I3434af54aafa6814e7a792e5e9a5554aa04f68a9 Signed-off-by: Dongjin Kim --- disk/part_efi.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/disk/part_efi.c b/disk/part_efi.c index 32805f1e193..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 { @@ -857,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; } @@ -1117,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; } From 7ff3b5282cef5afccf3d4477066b407d0075b8f6 Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Sat, 28 May 2022 09:26:11 +0900 Subject: [PATCH 38/42] squash! ODROID-COMMON: add new git submodule to download 'rkbin/*' Fix to use Github URL of '/rkbin'" --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 6079bdc6e9f..42e54617152 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "rkbin"] path = rkbin - url = ../../../rk/rkbin + url = https://github.com/hardkernel/rk3568_rkbin branch = odroidm1-v2017.09 From f383d2d2f4afe17e7233a20d25bca8a74d337466 Mon Sep 17 00:00:00 2001 From: Mathieu CARBONNEAUX Date: Mon, 13 Jun 2022 08:27:27 +0000 Subject: [PATCH 39/42] add odroid_rk3568 travis build --- .travis.yml | 386 ++++++---------------------------------------------- 1 file changed, 44 insertions(+), 342 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0b7a0622bfd..2689c9dd8df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,354 +1,56 @@ -# 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: packages: - - cppcheck - - sloccount - - sparse - - bc - - build-essential - - libsdl1.2-dev - - python - - python-virtualenv - - swig - - libpython-dev - - gcc-powerpc-linux-gnu - - iasl - - grub-efi-ia32-bin - - rpm2cpio - - wget - - device-tree-compiler -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 - -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$" - -# TODO make it perfect ;-r + - make ${TARGET_BOARD}_defconfig + - make + +before_deploy: + - export RELEASE_VERSION="${TARGET_BOARD}-${TRAVIS_BUILD_NUMBER}" + - tar czf u-boot-${RELEASE_VERSION}.tar.gz sd_fuse/u-boot.bin sd_fuse/sd_fusing.sh + - 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} + +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 From df28b19ae27254c9ce7d7736ce3c382cd5112a7d Mon Sep 17 00:00:00 2001 From: Mathieu CARBONNEAUX Date: Mon, 13 Jun 2022 08:50:33 +0000 Subject: [PATCH 40/42] fix build script fix deploy script --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2689c9dd8df..41b5dd1dc6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,12 +32,11 @@ before_script: - 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: - - make ${TARGET_BOARD}_defconfig - - make + - ./make.sh ${TARGET_BOARD} before_deploy: - export RELEASE_VERSION="${TARGET_BOARD}-${TRAVIS_BUILD_NUMBER}" - - tar czf u-boot-${RELEASE_VERSION}.tar.gz sd_fuse/u-boot.bin sd_fuse/sd_fusing.sh + - 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` From 3176e1de1fe898d56fcdbfdf694e467852613d03 Mon Sep 17 00:00:00 2001 From: CARBONNEAUX Mathieu Date: Mon, 13 Jun 2022 10:58:49 +0200 Subject: [PATCH 41/42] Update .travis.yml --- .travis.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.travis.yml b/.travis.yml index 41b5dd1dc6f..a32cb8a5573 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,22 @@ matrix: addons: apt: packages: + - cppcheck + - sloccount + - sparse + - bc + - build-essential + - libsdl1.2-dev + - python + - python-virtualenv + - swig + - libpython-dev + - gcc-powerpc-linux-gnu + - iasl + - grub-efi-ia32-bin + - rpm2cpio + - wget + - device-tree-compiler git: depth: 1 From 331ef1dc05cfd59b89bfd1ed0d8843267c8aa7ad Mon Sep 17 00:00:00 2001 From: CARBONNEAUX Mathieu Date: Mon, 13 Jun 2022 11:04:23 +0200 Subject: [PATCH 42/42] Update .travis.yml --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a32cb8a5573..fa44b97d980 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,10 @@ addons: - grub-efi-ia32-bin - rpm2cpio - wget - - device-tree-compiler + - device-tree-compiler + - lzop + - gcc + - libncurses5-dev git: depth: 1