From a3ad7977d6c76af9fb0c7a8cd69e18cc8f641059 Mon Sep 17 00:00:00 2001 From: Francesco Dolcini Date: Mon, 29 Aug 2022 22:52:25 +0200 Subject: u-boot-toradex: move patches in the correct directory Fix build issue with patches not found Relates-to: ELB-4680 Fixes: 7ad862bbbaaf ("u-boot: convert bbappend into our own recipe") Signed-off-by: Francesco Dolcini --- ...bri_imx7-boot-linux-kernel-in-secure-mode.patch | 31 ++ ...1-toradex-tdx-cfg-block-use-only-snprintf.patch | 71 ++++ ...x-cfg-block-use-defines-for-string-length.patch | 45 ++ ...dex-tdx-cfg-block-extend-assembly-version.patch | 181 +++++++++ ...x-tdx-cfg-block-add-new-toradex-oui-range.patch | 129 ++++++ ...x-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch | 96 +++++ ...mon-Remove-stale-comments-about-modules-a.patch | 63 +++ .../0007-toradex-common-Use-ARRAY_SIZE-macro.patch | 41 ++ ...-cfg-block-Cleanup-interactive-cfg-block-.patch | 451 +++++++++++++++++++++ ...-common-Remove-stale-function-declaration.patch | 30 ++ ...common-Remove-ifdef-usage-for-2nd-ethaddr.patch | 40 ++ ...adex-tdx-cfg-block-Use-official-SKU-names.patch | 171 ++++++++ ...mon-Improve-product-serial-print-during-b.patch | 41 ++ ...configs-colibri-imx7-Enable-bootd-command.patch | 44 ++ ...bri_imx7-boot-linux-kernel-in-secure-mode.patch | 31 ++ ...bri_imx7-boot-linux-kernel-in-secure-mode.patch | 31 -- ...1-toradex-tdx-cfg-block-use-only-snprintf.patch | 71 ---- ...x-cfg-block-use-defines-for-string-length.patch | 45 -- ...dex-tdx-cfg-block-extend-assembly-version.patch | 181 --------- ...x-tdx-cfg-block-add-new-toradex-oui-range.patch | 129 ------ ...x-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch | 96 ----- ...mon-Remove-stale-comments-about-modules-a.patch | 63 --- .../0007-toradex-common-Use-ARRAY_SIZE-macro.patch | 41 -- ...-cfg-block-Cleanup-interactive-cfg-block-.patch | 451 --------------------- ...-common-Remove-stale-function-declaration.patch | 30 -- ...common-Remove-ifdef-usage-for-2nd-ethaddr.patch | 40 -- ...adex-tdx-cfg-block-Use-official-SKU-names.patch | 171 -------- ...mon-Improve-product-serial-print-during-b.patch | 41 -- ...configs-colibri-imx7-Enable-bootd-command.patch | 44 -- ...bri_imx7-boot-linux-kernel-in-secure-mode.patch | 31 -- 30 files changed, 1465 insertions(+), 1465 deletions(-) create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0001-toradex-tdx-cfg-block-use-only-snprintf.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0002-toradex-tdx-cfg-block-use-defines-for-string-length.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0003-toradex-tdx-cfg-block-extend-assembly-version.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0004-toradex-tdx-cfg-block-add-new-toradex-oui-range.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0006-toradex-common-Remove-stale-comments-about-modules-a.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0007-toradex-common-Use-ARRAY_SIZE-macro.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0009-toradex-common-Remove-stale-function-declaration.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0012-toradex-common-Improve-product-serial-print-during-b.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/0013-configs-colibri-imx7-Enable-bootd-command.patch create mode 100644 recipes-bsp/u-boot/u-boot-toradex/use-head-next/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0001-toradex-tdx-cfg-block-use-only-snprintf.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0002-toradex-tdx-cfg-block-use-defines-for-string-length.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0003-toradex-tdx-cfg-block-extend-assembly-version.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0004-toradex-tdx-cfg-block-add-new-toradex-oui-range.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0006-toradex-common-Remove-stale-comments-about-modules-a.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0007-toradex-common-Use-ARRAY_SIZE-macro.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0009-toradex-common-Remove-stale-function-declaration.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0012-toradex-common-Improve-product-serial-print-during-b.patch delete mode 100644 recipes-bsp/u-boot/u-boot/0013-configs-colibri-imx7-Enable-bootd-command.patch delete mode 100644 recipes-bsp/u-boot/u-boot/use-head-next/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch (limited to 'recipes-bsp') diff --git a/recipes-bsp/u-boot/u-boot-toradex/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch b/recipes-bsp/u-boot/u-boot-toradex/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch new file mode 100644 index 0000000..4a19cd0 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch @@ -0,0 +1,31 @@ +From 645496d7a35ce78f4057f5668ed210204c7acef0 Mon Sep 17 00:00:00 2001 +From: Marcel Ziswiler +Date: Wed, 30 Sep 2020 16:37:54 +0200 +Subject: [PATCH] colibri_imx7: boot linux kernel in secure mode + +While NXP i.MX 7 downstream requires the Linux kernel to boot in secure +mode mainline/upstream requires non-secure mode instead, as it properly +uses PSCI to control further cores. + +Signed-off-by: Marcel Ziswiler +Reworked for mainline U-Boot. +Signed-off-by: Max Krummenacher +--- + include/configs/colibri_imx7.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h +index ac188ee3ac..82b3ff9323 100644 +--- a/include/configs/colibri_imx7.h ++++ b/include/configs/colibri_imx7.h +@@ -142,6 +142,7 @@ + MODULE_EXTRA_ENV_SETTINGS \ + UBOOT_UPDATE \ + "boot_file=zImage\0" \ ++ "bootm_boot_mode=sec\0" \ + "bootubipart=ubi\0" \ + "console=ttymxc0\0" \ + "defargs=\0" \ +-- +2.20.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0001-toradex-tdx-cfg-block-use-only-snprintf.patch b/recipes-bsp/u-boot/u-boot-toradex/0001-toradex-tdx-cfg-block-use-only-snprintf.patch new file mode 100644 index 0000000..bd03630 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0001-toradex-tdx-cfg-block-use-only-snprintf.patch @@ -0,0 +1,71 @@ +From e97bff4bdac99b0ba5251275551741f4039b23e0 Mon Sep 17 00:00:00 2001 +From: Philippe Schenker +Date: Mon, 13 Jun 2022 19:35:21 +0200 +Subject: [PATCH 1/5] toradex: tdx-cfg-block: use only snprintf + +Prevent memory issues that could appear with sprintf. Replace all +sprintf occurences with snprintf. + +Upstream-Status: Backport [39ff0624bc5ad287fced0f60be9b977d07b1813a] +Signed-off-by: Philippe Schenker +Reviewed-by: Francesco Dolcini +Acked-by: Marcel Ziswiler +--- + board/toradex/common/tdx-common.c | 27 +++++++++++++++------------ + 1 file changed, 15 insertions(+), 12 deletions(-) + +diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c +index 9db4553e0f7..2207818447a 100644 +--- a/board/toradex/common/tdx-common.c ++++ b/board/toradex/common/tdx-common.c +@@ -89,11 +89,13 @@ int show_board_info(void) + tdx_eth_addr.nic = htonl(tdx_serial << 8); + checkboard(); + } else { +- sprintf(tdx_serial_str, "%08u", tdx_serial); +- sprintf(tdx_board_rev_str, "V%1d.%1d%c", +- tdx_hw_tag.ver_major, +- tdx_hw_tag.ver_minor, +- (char)tdx_hw_tag.ver_assembly + 'A'); ++ snprintf(tdx_serial_str, sizeof(tdx_serial_str), ++ "%08u", tdx_serial); ++ snprintf(tdx_board_rev_str, sizeof(tdx_board_rev_str), ++ "V%1d.%1d%c", ++ tdx_hw_tag.ver_major, ++ tdx_hw_tag.ver_minor, ++ (char)tdx_hw_tag.ver_assembly + 'A'); + + env_set("serial#", tdx_serial_str); + +@@ -109,12 +111,13 @@ int show_board_info(void) + tdx_carrier_board_name = (char *) + toradex_carrier_boards[tdx_car_hw_tag.prodid]; + +- sprintf(tdx_car_serial_str, "%08u", tdx_car_serial); +- sprintf(tdx_car_rev_str, "V%1d.%1d%c", +- tdx_car_hw_tag.ver_major, +- tdx_car_hw_tag.ver_minor, +- (char)tdx_car_hw_tag.ver_assembly + +- 'A'); ++ snprintf(tdx_car_serial_str, sizeof(tdx_car_serial_str), ++ "%08u", tdx_car_serial); ++ snprintf(tdx_car_rev_str, sizeof(tdx_car_rev_str), ++ "V%1d.%1d%c", ++ tdx_car_hw_tag.ver_major, ++ tdx_car_hw_tag.ver_minor, ++ (char)tdx_car_hw_tag.ver_assembly + 'A'); + + env_set("carrier_serial#", tdx_car_serial_str); + printf("Carrier: Toradex %s %s, Serial# %s\n", +@@ -170,7 +173,7 @@ int ft_common_board_setup(void *blob, struct bd_info *bd) + if (tdx_hw_tag.ver_major) { + char prod_id[5]; + +- sprintf(prod_id, "%04u", tdx_hw_tag.prodid); ++ snprintf(prod_id, sizeof(prod_id), "%04u", tdx_hw_tag.prodid); + fdt_setprop(blob, 0, "toradex,product-id", prod_id, 5); + + fdt_setprop(blob, 0, "toradex,board-rev", tdx_board_rev_str, +-- +2.20.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0002-toradex-tdx-cfg-block-use-defines-for-string-length.patch b/recipes-bsp/u-boot/u-boot-toradex/0002-toradex-tdx-cfg-block-use-defines-for-string-length.patch new file mode 100644 index 0000000..4a6fd83 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0002-toradex-tdx-cfg-block-use-defines-for-string-length.patch @@ -0,0 +1,45 @@ +From 44c266438be85e0431a490a60a4ab3f174ecca77 Mon Sep 17 00:00:00 2001 +From: Philippe Schenker +Date: Mon, 13 Jun 2022 19:35:22 +0200 +Subject: [PATCH 2/5] toradex: tdx-cfg-block: use defines for string length + +With those defines the length can be reused and is in one place +extendable. + +Upstream-Status: Backport [494ef10c3bf7859e7d21d9e1d608dc0b634451c2] +Signed-off-by: Philippe Schenker +Reviewed-by: Francesco Dolcini +Acked-by: Marcel Ziswiler +--- + board/toradex/common/tdx-common.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c +index 2207818447a..94e603c14f4 100644 +--- a/board/toradex/common/tdx-common.c ++++ b/board/toradex/common/tdx-common.c +@@ -22,13 +22,17 @@ + + #define TORADEX_OUI 0x00142dUL + ++#define SERIAL_STR_LEN 8 ++#define MODULE_VER_STR_LEN 4 // V1.1 ++#define MODULE_REV_STR_LEN 1 // [A-Z] ++ + #ifdef CONFIG_TDX_CFG_BLOCK +-static char tdx_serial_str[9]; +-static char tdx_board_rev_str[6]; ++static char tdx_serial_str[SERIAL_STR_LEN + 1]; ++static char tdx_board_rev_str[MODULE_VER_STR_LEN + MODULE_REV_STR_LEN + 1]; + + #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA +-static char tdx_car_serial_str[9]; +-static char tdx_car_rev_str[6]; ++static char tdx_car_serial_str[SERIAL_STR_LEN + 1]; ++static char tdx_car_rev_str[MODULE_VER_STR_LEN + MODULE_REV_STR_LEN + 1]; + static char *tdx_carrier_board_name; + #endif + +-- +2.20.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0003-toradex-tdx-cfg-block-extend-assembly-version.patch b/recipes-bsp/u-boot/u-boot-toradex/0003-toradex-tdx-cfg-block-extend-assembly-version.patch new file mode 100644 index 0000000..a92a535 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0003-toradex-tdx-cfg-block-extend-assembly-version.patch @@ -0,0 +1,181 @@ +From a7021f904505da69155257612c8cb011be735290 Mon Sep 17 00:00:00 2001 +From: Philippe Schenker +Date: Mon, 13 Jun 2022 19:35:23 +0200 +Subject: [PATCH 3/5] toradex: tdx-cfg-block: extend assembly version + +There are two decimal digits reserved to encode the module version and +revision. This code so far implemented A-Z which used 0-25 of this +range. +This commit extends the range to make use of all 99 numbers. After +capital letters the form with a hashtag and number (e.g. #26) is used. + +Examples: + +If the assembly version is between zero and 25 the numbering is as follows, +as it also has been before this commit: +0: V0.0A +1: V0.0B +... +25: V0.0Z + +New numbering of assembly version: +If the number is between 26 and 99 the new assembly version name is: +26: V0.0#26 +27: V0.0#27 +... +99: V0.0#99 + +Upstream-Status: Backport [7e27ce16c5d289e5b9712a179e798ea4eb831816] +Signed-off-by: Philippe Schenker +Reviewed-by: Francesco Dolcini +Acked-by: Marcel Ziswiler +--- + board/toradex/common/tdx-cfg-block.c | 32 ++++++++++++++++++++++++---- + board/toradex/common/tdx-common.c | 25 +++++++++++++++++----- + 2 files changed, 48 insertions(+), 9 deletions(-) + +diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c +index 6c8cf4592d1..678d4e07c21 100644 +--- a/board/toradex/common/tdx-cfg-block.c ++++ b/board/toradex/common/tdx-cfg-block.c +@@ -354,6 +354,18 @@ out: + return ret; + } + ++static int parse_assembly_string(char *string_to_parse, u16 *assembly) ++{ ++ if (string_to_parse[3] >= 'A' && string_to_parse[3] <= 'Z') ++ *assembly = string_to_parse[3] - 'A'; ++ else if (string_to_parse[3] == '#') ++ *assembly = dectoul(&string_to_parse[4], NULL); ++ else ++ return -EINVAL; ++ ++ return 0; ++} ++ + static int get_cfgblock_interactive(void) + { + char message[CONFIG_SYS_CBSIZE]; +@@ -362,6 +374,7 @@ static int get_cfgblock_interactive(void) + char wb = 'n'; + char mem8g = 'n'; + int len = 0; ++ int ret = 0; + + /* Unknown module by default */ + tdx_hw_tag.prodid = 0; +@@ -545,13 +558,18 @@ static int get_cfgblock_interactive(void) + } + + while (len < 4) { +- sprintf(message, "Enter the module version (e.g. V1.1B): V"); ++ sprintf(message, "Enter the module version (e.g. V1.1B or V1.1#26): V"); + len = cli_readline(message); + } + + tdx_hw_tag.ver_major = console_buffer[0] - '0'; + tdx_hw_tag.ver_minor = console_buffer[2] - '0'; +- tdx_hw_tag.ver_assembly = console_buffer[3] - 'A'; ++ ++ ret = parse_assembly_string(console_buffer, &tdx_hw_tag.ver_assembly); ++ if (ret) { ++ printf("Parsing module version failed\n"); ++ return ret; ++ } + + while (len < 8) { + sprintf(message, "Enter module serial number: "); +@@ -754,6 +772,7 @@ static int get_cfgblock_carrier_interactive(void) + { + char message[CONFIG_SYS_CBSIZE]; + int len; ++ int ret = 0; + + printf("Supported carrier boards:\n"); + printf("CARRIER BOARD NAME\t\t [ID]\n"); +@@ -767,13 +786,18 @@ static int get_cfgblock_carrier_interactive(void) + tdx_car_hw_tag.prodid = dectoul(console_buffer, NULL); + + do { +- sprintf(message, "Enter carrier board version (e.g. V1.1B): V"); ++ sprintf(message, "Enter carrier board version (e.g. V1.1B or V1.1#26): V"); + len = cli_readline(message); + } while (len < 4); + + tdx_car_hw_tag.ver_major = console_buffer[0] - '0'; + tdx_car_hw_tag.ver_minor = console_buffer[2] - '0'; +- tdx_car_hw_tag.ver_assembly = console_buffer[3] - 'A'; ++ ++ ret = parse_assembly_string(console_buffer, &tdx_car_hw_tag.ver_assembly); ++ if (ret) { ++ printf("Parsing module version failed\n"); ++ return ret; ++ } + + while (len < 8) { + sprintf(message, "Enter carrier board serial number: "); +diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c +index 94e603c14f4..5ad5d00a0d9 100644 +--- a/board/toradex/common/tdx-common.c ++++ b/board/toradex/common/tdx-common.c +@@ -24,7 +24,7 @@ + + #define SERIAL_STR_LEN 8 + #define MODULE_VER_STR_LEN 4 // V1.1 +-#define MODULE_REV_STR_LEN 1 // [A-Z] ++#define MODULE_REV_STR_LEN 3 // [A-Z] or #[26-99] + + #ifdef CONFIG_TDX_CFG_BLOCK + static char tdx_serial_str[SERIAL_STR_LEN + 1]; +@@ -83,6 +83,21 @@ void get_board_serial(struct tag_serialnr *serialnr) + } + #endif /* CONFIG_SERIAL_TAG */ + ++static const char *get_board_assembly(u16 ver_assembly) ++{ ++ static char ver_name[MODULE_REV_STR_LEN + 1]; ++ ++ if (ver_assembly < 26) { ++ ver_name[0] = (char)ver_assembly + 'A'; ++ ver_name[1] = '\0'; ++ } else { ++ snprintf(ver_name, sizeof(ver_name), ++ "#%u", ver_assembly); ++ } ++ ++ return ver_name; ++} ++ + int show_board_info(void) + { + unsigned char ethaddr[6]; +@@ -96,10 +111,10 @@ int show_board_info(void) + snprintf(tdx_serial_str, sizeof(tdx_serial_str), + "%08u", tdx_serial); + snprintf(tdx_board_rev_str, sizeof(tdx_board_rev_str), +- "V%1d.%1d%c", ++ "V%1d.%1d%s", + tdx_hw_tag.ver_major, + tdx_hw_tag.ver_minor, +- (char)tdx_hw_tag.ver_assembly + 'A'); ++ get_board_assembly(tdx_hw_tag.ver_assembly)); + + env_set("serial#", tdx_serial_str); + +@@ -118,10 +133,10 @@ int show_board_info(void) + snprintf(tdx_car_serial_str, sizeof(tdx_car_serial_str), + "%08u", tdx_car_serial); + snprintf(tdx_car_rev_str, sizeof(tdx_car_rev_str), +- "V%1d.%1d%c", ++ "V%1d.%1d%s", + tdx_car_hw_tag.ver_major, + tdx_car_hw_tag.ver_minor, +- (char)tdx_car_hw_tag.ver_assembly + 'A'); ++ get_board_assembly(tdx_car_hw_tag.ver_assembly)); + + env_set("carrier_serial#", tdx_car_serial_str); + printf("Carrier: Toradex %s %s, Serial# %s\n", +-- +2.20.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0004-toradex-tdx-cfg-block-add-new-toradex-oui-range.patch b/recipes-bsp/u-boot/u-boot-toradex/0004-toradex-tdx-cfg-block-add-new-toradex-oui-range.patch new file mode 100644 index 0000000..a7f0ba3 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0004-toradex-tdx-cfg-block-add-new-toradex-oui-range.patch @@ -0,0 +1,129 @@ +From 7a969112a87c8c6037f07e952213e8696af41c35 Mon Sep 17 00:00:00 2001 +From: Philippe Schenker +Date: Mon, 20 Jun 2022 16:57:45 +0200 +Subject: [PATCH 4/5] toradex: tdx-cfg-block: add new toradex oui range + +Add new Toradex MAC OUI (8c:06:cb), to the config block. With this change +we extend the possible serial-numbers as follows: + +For serial-numbers 00000000-16777215 OUI 00:14:2d is taken +For serial-numbers 16777216-33554431 OUI 8c:06:cb is taken + +Lower 24-bit of the serial number are used in the NIC part of the +MAC address, the complete serial number can be calculated using the OUI. + +Upstream-Status: Backport [1cf4e79f5776e9cc451b7f4affec7e47db9533f9] +Signed-off-by: Philippe Schenker +Reviewed-by: Francesco Dolcini +Reviewed-by: Fabio Estevam +Acked-by: Marcel Ziswiler +--- + board/toradex/common/tdx-cfg-block.c | 42 +++++++++++++++++++++++++--- + board/toradex/common/tdx-cfg-block.h | 2 ++ + board/toradex/common/tdx-common.c | 5 +--- + 3 files changed, 41 insertions(+), 8 deletions(-) + +diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c +index 678d4e07c21..9305709a3c0 100644 +--- a/board/toradex/common/tdx-cfg-block.c ++++ b/board/toradex/common/tdx-cfg-block.c +@@ -159,6 +159,42 @@ const char * const toradex_display_adapters[] = { + [159] = "Verdin DSI to LVDS Adapter", + }; + ++const u32 toradex_ouis[] = { ++ [0] = 0x00142dUL, ++ [1] = 0x8c06cbUL, ++}; ++ ++static u32 get_serial_from_mac(struct toradex_eth_addr *eth_addr) ++{ ++ int i; ++ u32 oui = ntohl(eth_addr->oui) >> 8; ++ u32 nic = ntohl(eth_addr->nic) >> 8; ++ ++ for (i = 0; i < ARRAY_SIZE(toradex_ouis); i++) { ++ if (toradex_ouis[i] == oui) ++ break; ++ } ++ ++ return (u32)((i << 24) + nic); ++} ++ ++void get_mac_from_serial(u32 tdx_serial, struct toradex_eth_addr *eth_addr) ++{ ++ u8 oui_index = tdx_serial >> 24; ++ u32 nic = tdx_serial & GENMASK(23, 0); ++ u32 oui; ++ ++ if (oui_index >= ARRAY_SIZE(toradex_ouis)) { ++ puts("Can't find OUI for this serial#\n"); ++ oui_index = 0; ++ } ++ ++ oui = toradex_ouis[oui_index]; ++ ++ eth_addr->oui = htonl(oui << 8); ++ eth_addr->nic = htonl(nic << 8); ++} ++ + #ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC + static int tdx_cfg_block_mmc_storage(u8 *config_block, int write) + { +@@ -331,8 +367,7 @@ int read_tdx_cfg_block(void) + memcpy(&tdx_eth_addr, config_block + offset, + 6); + +- /* NIC part of MAC address is serial number */ +- tdx_serial = ntohl(tdx_eth_addr.nic) >> 8; ++ tdx_serial = get_serial_from_mac(&tdx_eth_addr); + break; + case TAG_HW: + memcpy(&tdx_hw_tag, config_block + offset, 8); +@@ -974,8 +1009,7 @@ static int do_cfgblock_create(struct cmd_tbl *cmdtp, int flag, int argc, + } + + /* Convert serial number to MAC address (the storage format) */ +- tdx_eth_addr.oui = htonl(0x00142dUL << 8); +- tdx_eth_addr.nic = htonl(tdx_serial << 8); ++ get_mac_from_serial(tdx_serial, &tdx_eth_addr); + + /* Valid Tag */ + write_tag(config_block, &offset, TAG_VALID, NULL, 0); +diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h +index 43e662e41da..17906984863 100644 +--- a/board/toradex/common/tdx-cfg-block.h ++++ b/board/toradex/common/tdx-cfg-block.h +@@ -114,4 +114,6 @@ int read_tdx_cfg_block_carrier(void); + + int try_migrate_tdx_cfg_block_carrier(void); + ++void get_mac_from_serial(u32 tdx_serial, struct toradex_eth_addr *eth_addr); ++ + #endif /* _TDX_CFG_BLOCK_H */ +diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c +index 5ad5d00a0d9..3798bf95378 100644 +--- a/board/toradex/common/tdx-common.c ++++ b/board/toradex/common/tdx-common.c +@@ -20,8 +20,6 @@ + #include + #include "tdx-common.h" + +-#define TORADEX_OUI 0x00142dUL +- + #define SERIAL_STR_LEN 8 + #define MODULE_VER_STR_LEN 4 // V1.1 + #define MODULE_REV_STR_LEN 3 // [A-Z] or #[26-99] +@@ -104,8 +102,7 @@ int show_board_info(void) + + if (read_tdx_cfg_block()) { + printf("MISSING TORADEX CONFIG BLOCK\n"); +- tdx_eth_addr.oui = htonl(TORADEX_OUI << 8); +- tdx_eth_addr.nic = htonl(tdx_serial << 8); ++ get_mac_from_serial(tdx_serial, &tdx_eth_addr); + checkboard(); + } else { + snprintf(tdx_serial_str, sizeof(tdx_serial_str), +-- +2.20.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch b/recipes-bsp/u-boot/u-boot-toradex/0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch new file mode 100644 index 0000000..3a597ac --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch @@ -0,0 +1,96 @@ +From a2da29a4e2a0adac38dba2ebbb539ce52898d078 Mon Sep 17 00:00:00 2001 +From: Philippe Schenker +Date: Thu, 21 Jul 2022 15:17:31 +0200 +Subject: [PATCH 05/12] toradex: tdx-cfg-block: add 0068 i.mx 8m mini sku + +Add new i.MX 8M Mini SKU to ConfigBlock handling. + +0068: Verdin iMX8M Mini Quad 2GB WB IT No CAN + +This SKU is identical to 0055 but without CAN. Mention this in the name +so those modules can be distinguished. + +Upstream-Status: Backport [a2da29a4e2a0adac38dba2ebbb539ce52898d078] +Signed-off-by: Philippe Schenker +Reviewed-by: Francesco Dolcini +Signed-off-by: Francesco Dolcini +--- + board/toradex/common/tdx-cfg-block.c | 13 ++++++++++++- + board/toradex/common/tdx-cfg-block.h | 1 + + board/toradex/verdin-imx8mm/verdin-imx8mm.c | 3 ++- + 3 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c +index 9305709a3c0d..53302925dc24 100644 +--- a/board/toradex/common/tdx-cfg-block.c ++++ b/board/toradex/common/tdx-cfg-block.c +@@ -145,6 +145,7 @@ const char * const toradex_modules[] = { + [65] = "Verdin iMX8M Plus QuadLite 1GB IT", + [66] = "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT", + [67] = "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT", ++ [68] = "Verdin iMX8M Mini Quad 2GB WB IT No CAN", + }; + + const char * const toradex_carrier_boards[] = { +@@ -408,6 +409,7 @@ static int get_cfgblock_interactive(void) + char it = 'n'; + char wb = 'n'; + char mem8g = 'n'; ++ char can = 'y'; + int len = 0; + int ret = 0; + +@@ -435,6 +437,13 @@ static int get_cfgblock_interactive(void) + mem8g = console_buffer[0]; + } + #endif ++#if defined(CONFIG_TARGET_VERDIN_IMX8MM) ++ if (is_cpu_type(MXC_CPU_IMX8MM) && (wb == 'y' || wb == 'Y')) { ++ sprintf(message, "Does your module have CAN? [y/N] "); ++ len = cli_readline(message); ++ can = console_buffer[0]; ++ } ++#endif + #endif + + soc = env_get("soc"); +@@ -522,7 +531,9 @@ static int get_cfgblock_interactive(void) + else + tdx_hw_tag.prodid = VERDIN_IMX8MMDL; + } else if (is_cpu_type(MXC_CPU_IMX8MM)) { +- if (wb == 'y' || wb == 'Y') ++ if (can == 'n' || can == 'N') ++ tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN; ++ else if (wb == 'y' || wb == 'Y') + tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT; + else + tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT; +diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h +index 179069848639..79cd09c78d00 100644 +--- a/board/toradex/common/tdx-cfg-block.h ++++ b/board/toradex/common/tdx-cfg-block.h +@@ -88,6 +88,7 @@ enum { + VERDIN_IMX8MPQL_IT, /* 65 */ + VERDIN_IMX8MPQ_8GB_WIFI_BT, + APALIS_IMX8QM_8GB_WIFI_BT_IT, ++ VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN, + }; + + enum { +diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c +index c51c99b5156c..7597cd81f945 100644 +--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c ++++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c +@@ -83,7 +83,8 @@ static void select_dt_from_module_version(void) + * device tree. + */ + is_wifi = (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_WIFI_BT_IT) || +- (tdx_hw_tag.prodid == VERDIN_IMX8MMDL_WIFI_BT_IT); ++ (tdx_hw_tag.prodid == VERDIN_IMX8MMDL_WIFI_BT_IT) || ++ (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN); + } + + switch (get_pcb_revision()) { +-- +2.25.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0006-toradex-common-Remove-stale-comments-about-modules-a.patch b/recipes-bsp/u-boot/u-boot-toradex/0006-toradex-common-Remove-stale-comments-about-modules-a.patch new file mode 100644 index 0000000..1ac7a3e --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0006-toradex-common-Remove-stale-comments-about-modules-a.patch @@ -0,0 +1,63 @@ +From ea1dc32f318903340a5ddaa8dc655503d1b4599e Mon Sep 17 00:00:00 2001 +From: Francesco Dolcini +Date: Thu, 21 Jul 2022 15:17:32 +0200 +Subject: [PATCH 06/12] toradex: common: Remove stale comments about modules + availability + +Remove comment "not currently on sale" on specific SKUs, this +information does not belong to the code and will never be accurate. + +Upstream-Status: Backport [ea1dc32f318903340a5ddaa8dc655503d1b4599e] +Signed-off-by: Francesco Dolcini +--- + board/toradex/common/tdx-cfg-block.c | 4 ++-- + board/toradex/common/tdx-cfg-block.h | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c +index 53302925dc24..67d007827be6 100644 +--- a/board/toradex/common/tdx-cfg-block.c ++++ b/board/toradex/common/tdx-cfg-block.c +@@ -87,7 +87,7 @@ const char * const toradex_modules[] = { + [7] = "Colibri PXA300 208MHz XT", + [8] = "Colibri PXA270 312MHz", + [9] = "Colibri PXA270 520MHz", +- [10] = "Colibri VF50 128MB", /* not currently on sale */ ++ [10] = "Colibri VF50 128MB", + [11] = "Colibri VF61 256MB", + [12] = "Colibri VF61 256MB IT", + [13] = "Colibri VF50 128MB IT", +@@ -133,7 +133,7 @@ const char * const toradex_modules[] = { + [53] = "Apalis iMX8 QuadXPlus 2GB ECC IT", + [54] = "Apalis iMX8 DualXPlus 1GB", + [55] = "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", +- [56] = "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", /* not currently on sale */ ++ [56] = "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", + [57] = "Verdin iMX8M Mini DualLite 1GB", + [58] = "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", + [59] = "Verdin iMX8M Mini Quad 2GB IT", +diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h +index 79cd09c78d00..028e6b12735f 100644 +--- a/board/toradex/common/tdx-cfg-block.h ++++ b/board/toradex/common/tdx-cfg-block.h +@@ -31,7 +31,7 @@ enum { + COLIBRI_PXA270_312MHZ, + COLIBRI_PXA270_520MHZ, + COLIBRI_VF50, /* 10 */ +- COLIBRI_VF61, /* not currently on sale */ ++ COLIBRI_VF61, + COLIBRI_VF61_IT, + COLIBRI_VF50_IT, + COLIBRI_IMX6S, +@@ -62,7 +62,7 @@ enum { + COLIBRI_IMX7D_EMMC, + COLIBRI_IMX6ULL_WIFI_BT_IT, /* 40 */ + COLIBRI_IMX7D_EPDC, +- APALIS_TK1_4GB, /* not currently on sale */ ++ APALIS_TK1_4GB, + COLIBRI_T20_512MB_IT_SETEK, + COLIBRI_IMX6ULL_IT, + COLIBRI_IMX6ULL_WIFI_BT, /* 45 */ +-- +2.25.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0007-toradex-common-Use-ARRAY_SIZE-macro.patch b/recipes-bsp/u-boot/u-boot-toradex/0007-toradex-common-Use-ARRAY_SIZE-macro.patch new file mode 100644 index 0000000..cb7fea8 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0007-toradex-common-Use-ARRAY_SIZE-macro.patch @@ -0,0 +1,41 @@ +From cdc39c6aaea33a9a47657f7798090ca973053a2f Mon Sep 17 00:00:00 2001 +From: Francesco Dolcini +Date: Thu, 21 Jul 2022 15:17:33 +0200 +Subject: [PATCH 07/12] toradex: common: Use ARRAY_SIZE macro + +Use generally available ARRAY_SIZE macro, instead of hand-coding it +every time is needed. + +Upstream-Status: Backport [cdc39c6aaea33a9a47657f7798090ca973053a2f] +Signed-off-by: Francesco Dolcini +--- + board/toradex/common/tdx-cfg-block.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c +index 67d007827be6..26596199a381 100644 +--- a/board/toradex/common/tdx-cfg-block.c ++++ b/board/toradex/common/tdx-cfg-block.c +@@ -381,8 +381,7 @@ int read_tdx_cfg_block(void) + } + + /* Cap product id to avoid issues with a yet unknown one */ +- if (tdx_hw_tag.prodid >= (sizeof(toradex_modules) / +- sizeof(toradex_modules[0]))) ++ if (tdx_hw_tag.prodid >= ARRAY_SIZE(toradex_modules)) + tdx_hw_tag.prodid = 0; + + out: +@@ -822,8 +821,7 @@ static int get_cfgblock_carrier_interactive(void) + + printf("Supported carrier boards:\n"); + printf("CARRIER BOARD NAME\t\t [ID]\n"); +- for (int i = 0; i < sizeof(toradex_carrier_boards) / +- sizeof(toradex_carrier_boards[0]); i++) ++ for (int i = 0; i < ARRAY_SIZE(toradex_carrier_boards); i++) + if (toradex_carrier_boards[i]) + printf("%s \t\t [%d]\n", toradex_carrier_boards[i], i); + +-- +2.25.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch b/recipes-bsp/u-boot/u-boot-toradex/0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch new file mode 100644 index 0000000..7668e83 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch @@ -0,0 +1,451 @@ +From 8b6dc5d3943c269892acb2a426ad4a46a7f7fc49 Mon Sep 17 00:00:00 2001 +From: Francesco Dolcini +Date: Thu, 21 Jul 2022 15:17:34 +0200 +Subject: [PATCH 08/12] toradex: tdx-cfg-block: Cleanup interactive cfg block + creation + +Simplify interactive config block creation code, instead of having a +a long list of questions and a complex tree of preprocessor directive to +guess the exact SKU, just ask the user to select it from a list. + +The modules list is filtered out to include only SKUs that are supported +by the specific u-boot binary in execution. + +Upstream-Status: Backport [8b6dc5d3943c269892acb2a426ad4a46a7f7fc49] +Signed-off-by: Francesco Dolcini +--- + board/toradex/common/tdx-cfg-block.c | 355 +++++++-------------------- + board/toradex/common/tdx-cfg-block.h | 7 +- + board/toradex/common/tdx-common.c | 2 +- + 3 files changed, 92 insertions(+), 272 deletions(-) + +diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c +index 26596199a381..b7c7301af8f7 100644 +--- a/board/toradex/common/tdx-cfg-block.c ++++ b/board/toradex/common/tdx-cfg-block.c +@@ -11,17 +11,6 @@ + #include + #include + +-#if defined(CONFIG_TARGET_APALIS_IMX6) || \ +- defined(CONFIG_TARGET_APALIS_IMX8) || \ +- defined(CONFIG_TARGET_COLIBRI_IMX6) || \ +- defined(CONFIG_TARGET_COLIBRI_IMX8X) || \ +- defined(CONFIG_TARGET_VERDIN_IMX8MM) || \ +- defined(CONFIG_TARGET_VERDIN_IMX8MN) || \ +- defined(CONFIG_TARGET_VERDIN_IMX8MP) +-#include +-#else +-#define is_cpu_type(cpu) (0) +-#endif + #include + #include + #include +@@ -76,76 +65,78 @@ bool valid_cfgblock_carrier; + struct toradex_hw tdx_car_hw_tag; + #endif + +-const char * const toradex_modules[] = { +- [0] = "UNKNOWN MODULE", +- [1] = "Colibri PXA270 312MHz", +- [2] = "Colibri PXA270 520MHz", +- [3] = "Colibri PXA320 806MHz", +- [4] = "Colibri PXA300 208MHz", +- [5] = "Colibri PXA310 624MHz", +- [6] = "Colibri PXA320 806MHz IT", +- [7] = "Colibri PXA300 208MHz XT", +- [8] = "Colibri PXA270 312MHz", +- [9] = "Colibri PXA270 520MHz", +- [10] = "Colibri VF50 128MB", +- [11] = "Colibri VF61 256MB", +- [12] = "Colibri VF61 256MB IT", +- [13] = "Colibri VF50 128MB IT", +- [14] = "Colibri iMX6 Solo 256MB", +- [15] = "Colibri iMX6 DualLite 512MB", +- [16] = "Colibri iMX6 Solo 256MB IT", +- [17] = "Colibri iMX6 DualLite 512MB IT", +- [18] = "UNKNOWN MODULE", +- [19] = "UNKNOWN MODULE", +- [20] = "Colibri T20 256MB", +- [21] = "Colibri T20 512MB", +- [22] = "Colibri T20 512MB IT", +- [23] = "Colibri T30 1GB", +- [24] = "Colibri T20 256MB IT", +- [25] = "Apalis T30 2GB", +- [26] = "Apalis T30 1GB", +- [27] = "Apalis iMX6 Quad 1GB", +- [28] = "Apalis iMX6 Quad 2GB IT", +- [29] = "Apalis iMX6 Dual 512MB", +- [30] = "Colibri T30 1GB IT", +- [31] = "Apalis T30 1GB IT", +- [32] = "Colibri iMX7 Solo 256MB", +- [33] = "Colibri iMX7 Dual 512MB", +- [34] = "Apalis TK1 2GB", +- [35] = "Apalis iMX6 Dual 1GB IT", +- [36] = "Colibri iMX6ULL 256MB", +- [37] = "Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT", +- [38] = "Colibri iMX8 QuadXPlus 2GB Wi-Fi / BT IT", +- [39] = "Colibri iMX7 Dual 1GB (eMMC)", +- [40] = "Colibri iMX6ULL 512MB Wi-Fi / BT IT", +- [41] = "Colibri iMX7 Dual 512MB EPDC", +- [42] = "Apalis TK1 4GB", +- [43] = "Colibri T20 512MB IT SETEK", +- [44] = "Colibri iMX6ULL 512MB IT", +- [45] = "Colibri iMX6ULL 512MB Wi-Fi / Bluetooth", +- [46] = "Apalis iMX8 QuadXPlus 2GB Wi-Fi / BT IT", +- [47] = "Apalis iMX8 QuadMax 4GB IT", +- [48] = "Apalis iMX8 QuadPlus 2GB Wi-Fi / BT", +- [49] = "Apalis iMX8 QuadPlus 2GB", +- [50] = "Colibri iMX8 QuadXPlus 2GB IT", +- [51] = "Colibri iMX8 DualX 1GB Wi-Fi / Bluetooth", +- [52] = "Colibri iMX8 DualX 1GB", +- [53] = "Apalis iMX8 QuadXPlus 2GB ECC IT", +- [54] = "Apalis iMX8 DualXPlus 1GB", +- [55] = "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", +- [56] = "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", +- [57] = "Verdin iMX8M Mini DualLite 1GB", +- [58] = "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", +- [59] = "Verdin iMX8M Mini Quad 2GB IT", +- [60] = "Verdin iMX8M Mini DualLite 1GB WB IT", +- [61] = "Verdin iMX8M Plus Quad 2GB", +- [62] = "Colibri iMX6ULL 1GB IT (eMMC)", +- [63] = "Verdin iMX8M Plus Quad 4GB IT", +- [64] = "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT", +- [65] = "Verdin iMX8M Plus QuadLite 1GB IT", +- [66] = "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT", +- [67] = "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT", +- [68] = "Verdin iMX8M Mini Quad 2GB WB IT No CAN", ++#define TARGET_IS_ENABLED(x) IS_ENABLED(CONFIG_TARGET_ ## x) ++ ++const struct toradex_som toradex_modules[] = { ++ [0] = { "UNKNOWN MODULE", 0 }, ++ [1] = { "Colibri PXA270 312MHz", 0 }, ++ [2] = { "Colibri PXA270 520MHz", 0 }, ++ [3] = { "Colibri PXA320 806MHz", 0 }, ++ [4] = { "Colibri PXA300 208MHz", 0 }, ++ [5] = { "Colibri PXA310 624MHz", 0 }, ++ [6] = { "Colibri PXA320 806MHz IT", 0 }, ++ [7] = { "Colibri PXA300 208MHz XT", 0 }, ++ [8] = { "Colibri PXA270 312MHz", 0 }, ++ [9] = { "Colibri PXA270 520MHz", 0 }, ++ [10] = { "Colibri VF50 128MB", TARGET_IS_ENABLED(COLIBRI_VF) }, ++ [11] = { "Colibri VF61 256MB", TARGET_IS_ENABLED(COLIBRI_VF) }, ++ [12] = { "Colibri VF61 256MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, ++ [13] = { "Colibri VF50 128MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, ++ [14] = { "Colibri iMX6 Solo 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, ++ [15] = { "Colibri iMX6 DualLite 512MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, ++ [16] = { "Colibri iMX6 Solo 256MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, ++ [17] = { "Colibri iMX6 DualLite 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, ++ [18] = { "UNKNOWN MODULE", 0 }, ++ [19] = { "UNKNOWN MODULE", 0 }, ++ [20] = { "Colibri T20 256MB", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [21] = { "Colibri T20 512MB", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [22] = { "Colibri T20 512MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [23] = { "Colibri T30 1GB", TARGET_IS_ENABLED(COLIBRI_T30) }, ++ [24] = { "Colibri T20 256MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [25] = { "Apalis T30 2GB", TARGET_IS_ENABLED(APALIS_T30) }, ++ [26] = { "Apalis T30 1GB", TARGET_IS_ENABLED(APALIS_T30) }, ++ [27] = { "Apalis iMX6 Quad 1GB", TARGET_IS_ENABLED(APALIS_IMX6) }, ++ [28] = { "Apalis iMX6 Quad 2GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, ++ [29] = { "Apalis iMX6 Dual 512MB", TARGET_IS_ENABLED(APALIS_IMX6) }, ++ [30] = { "Colibri T30 1GB IT", TARGET_IS_ENABLED(COLIBRI_T30) }, ++ [31] = { "Apalis T30 1GB IT", TARGET_IS_ENABLED(APALIS_T30) }, ++ [32] = { "Colibri iMX7 Solo 256MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, ++ [33] = { "Colibri iMX7 Dual 512MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, ++ [34] = { "Apalis TK1 2GB", TARGET_IS_ENABLED(APALIS_TK1) }, ++ [35] = { "Apalis iMX6 Dual 1GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, ++ [36] = { "Colibri iMX6ULL 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [37] = { "Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [38] = { "Colibri iMX8 QuadXPlus 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, ++ [39] = { "Colibri iMX7 Dual 1GB (eMMC)", TARGET_IS_ENABLED(COLIBRI_IMX7) }, ++ [40] = { "Colibri iMX6ULL 512MB Wi-Fi / BT IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [41] = { "Colibri iMX7 Dual 512MB EPDC", TARGET_IS_ENABLED(COLIBRI_IMX7) }, ++ [42] = { "Apalis TK1 4GB", TARGET_IS_ENABLED(APALIS_TK1) }, ++ [43] = { "Colibri T20 512MB IT SETEK", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [44] = { "Colibri iMX6ULL 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [45] = { "Colibri iMX6ULL 512MB Wi-Fi / Bluetooth", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [46] = { "Apalis iMX8 QuadXPlus 2GB Wi-Fi / BT IT", 0 }, ++ [47] = { "Apalis iMX8 QuadMax 4GB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [48] = { "Apalis iMX8 QuadPlus 2GB Wi-Fi / BT", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [49] = { "Apalis iMX8 QuadPlus 2GB", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [50] = { "Colibri iMX8 QuadXPlus 2GB IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, ++ [51] = { "Colibri iMX8 DualX 1GB Wi-Fi / Bluetooth", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, ++ [52] = { "Colibri iMX8 DualX 1GB", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, ++ [53] = { "Apalis iMX8 QuadXPlus 2GB ECC IT", 0 }, ++ [54] = { "Apalis iMX8 DualXPlus 1GB", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [55] = { "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, ++ [56] = { "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", 0 }, ++ [57] = { "Verdin iMX8M Mini DualLite 1GB", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, ++ [58] = { "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [59] = { "Verdin iMX8M Mini Quad 2GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, ++ [60] = { "Verdin iMX8M Mini DualLite 1GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, ++ [61] = { "Verdin iMX8M Plus Quad 2GB", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [62] = { "Colibri iMX6ULL 1GB IT (eMMC)", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [63] = { "Verdin iMX8M Plus Quad 4GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [64] = { "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [65] = { "Verdin iMX8M Plus QuadLite 1GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [66] = { "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [67] = { "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [68] = { "Verdin iMX8M Mini Quad 2GB WB IT No CAN", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, + }; + + const char * const toradex_carrier_boards[] = { +@@ -404,204 +395,28 @@ static int parse_assembly_string(char *string_to_parse, u16 *assembly) + static int get_cfgblock_interactive(void) + { + char message[CONFIG_SYS_CBSIZE]; +- char *soc; +- char it = 'n'; +- char wb = 'n'; +- char mem8g = 'n'; +- char can = 'y'; + int len = 0; + int ret = 0; ++ unsigned int prodid; ++ int i; + +- /* Unknown module by default */ +- tdx_hw_tag.prodid = 0; +- +- sprintf(message, "Is the module an IT version? [y/N] "); +- +- len = cli_readline(message); +- it = console_buffer[0]; +- +-#if defined(CONFIG_TARGET_APALIS_IMX8) || \ +- defined(CONFIG_TARGET_COLIBRI_IMX6ULL) || \ +- defined(CONFIG_TARGET_COLIBRI_IMX8X) || \ +- defined(CONFIG_TARGET_VERDIN_IMX8MM) || \ +- defined(CONFIG_TARGET_VERDIN_IMX8MP) +- sprintf(message, "Does the module have Wi-Fi / Bluetooth? [y/N] "); +- len = cli_readline(message); +- wb = console_buffer[0]; +- +-#if defined(CONFIG_TARGET_APALIS_IMX8) +- if ((wb == 'y' || wb == 'Y') && (it == 'y' || it == 'Y')) { +- sprintf(message, "Does your module have 8GB of RAM? [y/N] "); +- len = cli_readline(message); +- mem8g = console_buffer[0]; ++ printf("Enabled modules:\n"); ++ for (i = 0; i < ARRAY_SIZE(toradex_modules); i++) { ++ if (toradex_modules[i].is_enabled) ++ printf(" %04d %s\n", i, toradex_modules[i].name); + } +-#endif +-#if defined(CONFIG_TARGET_VERDIN_IMX8MM) +- if (is_cpu_type(MXC_CPU_IMX8MM) && (wb == 'y' || wb == 'Y')) { +- sprintf(message, "Does your module have CAN? [y/N] "); +- len = cli_readline(message); +- can = console_buffer[0]; +- } +-#endif +-#endif + +- soc = env_get("soc"); +- if (!strcmp("mx6", soc)) { +-#ifdef CONFIG_TARGET_APALIS_IMX6 +- if (it == 'y' || it == 'Y') { +- if (is_cpu_type(MXC_CPU_MX6Q)) +- tdx_hw_tag.prodid = APALIS_IMX6Q_IT; +- else +- tdx_hw_tag.prodid = APALIS_IMX6D_IT; +- } else { +- if (is_cpu_type(MXC_CPU_MX6Q)) +- tdx_hw_tag.prodid = APALIS_IMX6Q; +- else +- tdx_hw_tag.prodid = APALIS_IMX6D; +- } +-#elif CONFIG_TARGET_COLIBRI_IMX6 +- if (it == 'y' || it == 'Y') { +- if (is_cpu_type(MXC_CPU_MX6DL)) +- tdx_hw_tag.prodid = COLIBRI_IMX6DL_IT; +- else if (is_cpu_type(MXC_CPU_MX6SOLO)) +- tdx_hw_tag.prodid = COLIBRI_IMX6S_IT; +- } else { +- if (is_cpu_type(MXC_CPU_MX6DL)) +- tdx_hw_tag.prodid = COLIBRI_IMX6DL; +- else if (is_cpu_type(MXC_CPU_MX6SOLO)) +- tdx_hw_tag.prodid = COLIBRI_IMX6S; +- } +-#elif CONFIG_TARGET_COLIBRI_IMX6ULL +- if (it == 'y' || it == 'Y') { +- if (wb == 'y' || wb == 'Y') +- tdx_hw_tag.prodid = COLIBRI_IMX6ULL_WIFI_BT_IT; +- else +- if (gd->ram_size == 0x20000000) +- tdx_hw_tag.prodid = COLIBRI_IMX6ULL_IT; +- else +- tdx_hw_tag.prodid = COLIBRI_IMX6ULL_IT_EMMC; +- } else { +- if (wb == 'y' || wb == 'Y') +- tdx_hw_tag.prodid = COLIBRI_IMX6ULL_WIFI_BT; +- else +- tdx_hw_tag.prodid = COLIBRI_IMX6ULL; +- } +-#endif +- } else if (!strcmp("imx7d", soc)) +- if (gd->ram_size == 0x20000000) +- tdx_hw_tag.prodid = COLIBRI_IMX7D; +- else +- tdx_hw_tag.prodid = COLIBRI_IMX7D_EMMC; +- else if (!strcmp("imx7s", soc)) +- tdx_hw_tag.prodid = COLIBRI_IMX7S; +- else if (is_cpu_type(MXC_CPU_IMX8QM)) { +- if (it == 'y' || it == 'Y') { +- if (wb == 'y' || wb == 'Y') { +- if (mem8g == 'y' || mem8g == 'Y') +- tdx_hw_tag.prodid = APALIS_IMX8QM_8GB_WIFI_BT_IT; +- else +- tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT; +- } +- else +- tdx_hw_tag.prodid = APALIS_IMX8QM_IT; +- } else { +- if (wb == 'y' || wb == 'Y') +- tdx_hw_tag.prodid = APALIS_IMX8QP_WIFI_BT; +- else +- tdx_hw_tag.prodid = APALIS_IMX8QP; +- } +- } else if (is_cpu_type(MXC_CPU_IMX8QXP)) { +-#ifdef CONFIG_TARGET_COLIBRI_IMX8X +- if (it == 'y' || it == 'Y') { +- if (wb == 'y' || wb == 'Y') +- tdx_hw_tag.prodid = COLIBRI_IMX8QXP_WIFI_BT_IT; +- else +- tdx_hw_tag.prodid = COLIBRI_IMX8QXP_IT; +- } else { +- if (wb == 'y' || wb == 'Y') +- tdx_hw_tag.prodid = COLIBRI_IMX8DX_WIFI_BT; +- else +- tdx_hw_tag.prodid = COLIBRI_IMX8DX; +- } +-#endif +- } else if (is_cpu_type(MXC_CPU_IMX8MMDL)) { +- if (wb == 'y' || wb == 'Y') +- tdx_hw_tag.prodid = VERDIN_IMX8MMDL_WIFI_BT_IT; +- else +- tdx_hw_tag.prodid = VERDIN_IMX8MMDL; +- } else if (is_cpu_type(MXC_CPU_IMX8MM)) { +- if (can == 'n' || can == 'N') +- tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN; +- else if (wb == 'y' || wb == 'Y') +- tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT; +- else +- tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT; +- } else if (is_cpu_type(MXC_CPU_IMX8MN)) { +- tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; +- } else if (is_cpu_type(MXC_CPU_IMX8MPL)) { +- tdx_hw_tag.prodid = VERDIN_IMX8MPQL_IT; +- } else if (is_cpu_type(MXC_CPU_IMX8MP)) { +- if (wb == 'y' || wb == 'Y') +- if (gd->ram_size == 0x80000000) +- tdx_hw_tag.prodid = VERDIN_IMX8MPQ_2GB_WIFI_BT_IT; +- else if (gd->ram_size == 0x200000000) +- tdx_hw_tag.prodid = VERDIN_IMX8MPQ_8GB_WIFI_BT; +- else +- tdx_hw_tag.prodid = VERDIN_IMX8MPQ_WIFI_BT_IT; +- else +- if (it == 'y' || it == 'Y') +- tdx_hw_tag.prodid = VERDIN_IMX8MPQ_IT; +- else +- tdx_hw_tag.prodid = VERDIN_IMX8MPQ; +- } else if (!strcmp("tegra20", soc)) { +- if (it == 'y' || it == 'Y') +- if (gd->ram_size == 0x10000000) +- tdx_hw_tag.prodid = COLIBRI_T20_256MB_IT; +- else +- tdx_hw_tag.prodid = COLIBRI_T20_512MB_IT; +- else +- if (gd->ram_size == 0x10000000) +- tdx_hw_tag.prodid = COLIBRI_T20_256MB; +- else +- tdx_hw_tag.prodid = COLIBRI_T20_512MB; +- } +-#if defined(CONFIG_TARGET_APALIS_T30) || defined(CONFIG_TARGET_COLIBRI_T30) +- else if (!strcmp("tegra30", soc)) { +-#ifdef CONFIG_TARGET_APALIS_T30 +- if (it == 'y' || it == 'Y') +- tdx_hw_tag.prodid = APALIS_T30_IT; +- else +- if (gd->ram_size == 0x40000000) +- tdx_hw_tag.prodid = APALIS_T30_1GB; +- else +- tdx_hw_tag.prodid = APALIS_T30_2GB; +-#else +- if (it == 'y' || it == 'Y') +- tdx_hw_tag.prodid = COLIBRI_T30_IT; +- else +- tdx_hw_tag.prodid = COLIBRI_T30; +-#endif +- } +-#endif /* CONFIG_TARGET_APALIS_T30 || CONFIG_TARGET_COLIBRI_T30 */ +- else if (!strcmp("tegra124", soc)) { +- tdx_hw_tag.prodid = APALIS_TK1_2GB; +- } else if (!strcmp("vf500", soc)) { +- if (it == 'y' || it == 'Y') +- tdx_hw_tag.prodid = COLIBRI_VF50_IT; +- else +- tdx_hw_tag.prodid = COLIBRI_VF50; +- } else if (!strcmp("vf610", soc)) { +- if (it == 'y' || it == 'Y') +- tdx_hw_tag.prodid = COLIBRI_VF61_IT; +- else +- tdx_hw_tag.prodid = COLIBRI_VF61; +- } ++ sprintf(message, "Enter the module ID: "); ++ len = cli_readline(message); + +- if (!tdx_hw_tag.prodid) { +- printf("Module type not detectable due to unknown SoC\n"); ++ prodid = dectoul(console_buffer, NULL); ++ if (prodid >= ARRAY_SIZE(toradex_modules) || !toradex_modules[prodid].is_enabled) { ++ printf("Parsing module id failed\n"); + return -1; + } ++ tdx_hw_tag.prodid = prodid; + ++ len = 0; + while (len < 4) { + sprintf(message, "Enter the module version (e.g. V1.1B or V1.1#26): V"); + len = cli_readline(message); +diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h +index 028e6b12735f..32e4c6f6879f 100644 +--- a/board/toradex/common/tdx-cfg-block.h ++++ b/board/toradex/common/tdx-cfg-block.h +@@ -20,6 +20,11 @@ struct toradex_eth_addr { + u32 nic:24; + } __attribute__((__packed__)); + ++struct toradex_som { ++ const char *name; ++ int is_enabled; ++}; ++ + enum { + COLIBRI_PXA270_V1_312MHZ = 1, + COLIBRI_PXA270_V1_520MHZ, +@@ -101,7 +106,7 @@ enum { + VERDIN_DSI_TO_LVDS_ADAPTER = 159, + }; + +-extern const char * const toradex_modules[]; ++extern const struct toradex_som toradex_modules[]; + extern const char * const toradex_carrier_boards[]; + extern bool valid_cfgblock; + extern struct toradex_hw tdx_hw_tag; +diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c +index 3798bf95378e..3643ebbb1632 100644 +--- a/board/toradex/common/tdx-common.c ++++ b/board/toradex/common/tdx-common.c +@@ -116,7 +116,7 @@ int show_board_info(void) + env_set("serial#", tdx_serial_str); + + printf("Model: Toradex %s %s, Serial# %s\n", +- toradex_modules[tdx_hw_tag.prodid], ++ toradex_modules[tdx_hw_tag.prodid].name, + tdx_board_rev_str, + tdx_serial_str); + #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA +-- +2.25.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0009-toradex-common-Remove-stale-function-declaration.patch b/recipes-bsp/u-boot/u-boot-toradex/0009-toradex-common-Remove-stale-function-declaration.patch new file mode 100644 index 0000000..d0a49a4 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0009-toradex-common-Remove-stale-function-declaration.patch @@ -0,0 +1,30 @@ +From 0d4b692c807881253ec6954970ccbb0f717ae10a Mon Sep 17 00:00:00 2001 +From: Francesco Dolcini +Date: Thu, 21 Jul 2022 15:17:35 +0200 +Subject: [PATCH 09/12] toradex: common: Remove stale function declaration + +Remove stale show_boot_logo() declaration, not used anywhere. + +Upstream-Status: Backport [0d4b692c807881253ec6954970ccbb0f717ae10a] +Fixes: e6fd30dd9eef ("toradex: drop legacy show_boot_logo function and use splashscreen") +Signed-off-by: Francesco Dolcini +--- + board/toradex/common/tdx-common.h | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/board/toradex/common/tdx-common.h b/board/toradex/common/tdx-common.h +index c96e8754e9e2..d446e9f1d5ca 100644 +--- a/board/toradex/common/tdx-common.h ++++ b/board/toradex/common/tdx-common.h +@@ -12,8 +12,4 @@ + int ft_common_board_setup(void *blob, struct bd_info *bd); + u32 get_board_revision(void); + +-#if defined(CONFIG_DM_VIDEO) +-int show_boot_logo(void); +-#endif +- + #endif /* _TDX_COMMON_H */ +-- +2.25.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch b/recipes-bsp/u-boot/u-boot-toradex/0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch new file mode 100644 index 0000000..af02b2b --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch @@ -0,0 +1,40 @@ +From 9762fbeea451f4d81ec88788e7680e37a1ee5beb Mon Sep 17 00:00:00 2001 +From: Francesco Dolcini +Date: Thu, 21 Jul 2022 15:17:36 +0200 +Subject: [PATCH 10/12] toradex: common: Remove #ifdef usage for 2nd ethaddr + +Fix checkpatch warn, use `IS_ENABLED(CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR)` +instead of `#ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR`. + +Upstream-Status: Backport [9762fbeea451f4d81ec88788e7680e37a1ee5beb] +Signed-off-by: Francesco Dolcini +--- + board/toradex/common/tdx-common.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c +index 3643ebbb1632..2284fcddb510 100644 +--- a/board/toradex/common/tdx-common.c ++++ b/board/toradex/common/tdx-common.c +@@ -151,8 +151,8 @@ int show_board_info(void) + if (!eth_env_get_enetaddr("ethaddr", ethaddr)) + eth_env_set_enetaddr("ethaddr", (u8 *)&tdx_eth_addr); + +-#ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR +- if (!eth_env_get_enetaddr("eth1addr", ethaddr)) { ++ if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR) && ++ !eth_env_get_enetaddr("eth1addr", ethaddr)) { + /* + * Secondary MAC address is allocated from block + * 0x100000 higher then the first MAC address +@@ -161,7 +161,6 @@ int show_board_info(void) + ethaddr[3] += 0x10; + eth_env_set_enetaddr("eth1addr", ethaddr); + } +-#endif + + return 0; + } +-- +2.25.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch b/recipes-bsp/u-boot/u-boot-toradex/0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch new file mode 100644 index 0000000..e74877e --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch @@ -0,0 +1,171 @@ +From 4f0c33c46d946beb5e3430ce694d86ff86adbfcd Mon Sep 17 00:00:00 2001 +From: Francesco Dolcini +Date: Thu, 21 Jul 2022 15:17:37 +0200 +Subject: [PATCH 11/12] toradex: tdx-cfg-block: Use official SKU names + +Up to now in the code we named Toradex SKUs in a slightly different way +compared to the official product name, start using the official names +from now on to avoid misunderstanding. + +This has also the nice benefit of the string being shorter, allowing +to fit nicely in 80 columns even adding the product ID when printing +the hardware information. + +Upstream-Status: Backport [4f0c33c46d946beb5e3430ce694d86ff86adbfcd] +Signed-off-by: Francesco Dolcini +--- + board/toradex/common/tdx-cfg-block.c | 138 +++++++++++++-------------- + 1 file changed, 69 insertions(+), 69 deletions(-) + +diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c +index b7c7301af8f7..7cf2dfae9746 100644 +--- a/board/toradex/common/tdx-cfg-block.c ++++ b/board/toradex/common/tdx-cfg-block.c +@@ -68,75 +68,75 @@ struct toradex_hw tdx_car_hw_tag; + #define TARGET_IS_ENABLED(x) IS_ENABLED(CONFIG_TARGET_ ## x) + + const struct toradex_som toradex_modules[] = { +- [0] = { "UNKNOWN MODULE", 0 }, +- [1] = { "Colibri PXA270 312MHz", 0 }, +- [2] = { "Colibri PXA270 520MHz", 0 }, +- [3] = { "Colibri PXA320 806MHz", 0 }, +- [4] = { "Colibri PXA300 208MHz", 0 }, +- [5] = { "Colibri PXA310 624MHz", 0 }, +- [6] = { "Colibri PXA320 806MHz IT", 0 }, +- [7] = { "Colibri PXA300 208MHz XT", 0 }, +- [8] = { "Colibri PXA270 312MHz", 0 }, +- [9] = { "Colibri PXA270 520MHz", 0 }, +- [10] = { "Colibri VF50 128MB", TARGET_IS_ENABLED(COLIBRI_VF) }, +- [11] = { "Colibri VF61 256MB", TARGET_IS_ENABLED(COLIBRI_VF) }, +- [12] = { "Colibri VF61 256MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, +- [13] = { "Colibri VF50 128MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, +- [14] = { "Colibri iMX6 Solo 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, +- [15] = { "Colibri iMX6 DualLite 512MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, +- [16] = { "Colibri iMX6 Solo 256MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, +- [17] = { "Colibri iMX6 DualLite 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, +- [18] = { "UNKNOWN MODULE", 0 }, +- [19] = { "UNKNOWN MODULE", 0 }, +- [20] = { "Colibri T20 256MB", TARGET_IS_ENABLED(COLIBRI_T20) }, +- [21] = { "Colibri T20 512MB", TARGET_IS_ENABLED(COLIBRI_T20) }, +- [22] = { "Colibri T20 512MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, +- [23] = { "Colibri T30 1GB", TARGET_IS_ENABLED(COLIBRI_T30) }, +- [24] = { "Colibri T20 256MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, +- [25] = { "Apalis T30 2GB", TARGET_IS_ENABLED(APALIS_T30) }, +- [26] = { "Apalis T30 1GB", TARGET_IS_ENABLED(APALIS_T30) }, +- [27] = { "Apalis iMX6 Quad 1GB", TARGET_IS_ENABLED(APALIS_IMX6) }, +- [28] = { "Apalis iMX6 Quad 2GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, +- [29] = { "Apalis iMX6 Dual 512MB", TARGET_IS_ENABLED(APALIS_IMX6) }, +- [30] = { "Colibri T30 1GB IT", TARGET_IS_ENABLED(COLIBRI_T30) }, +- [31] = { "Apalis T30 1GB IT", TARGET_IS_ENABLED(APALIS_T30) }, +- [32] = { "Colibri iMX7 Solo 256MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, +- [33] = { "Colibri iMX7 Dual 512MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, +- [34] = { "Apalis TK1 2GB", TARGET_IS_ENABLED(APALIS_TK1) }, +- [35] = { "Apalis iMX6 Dual 1GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, +- [36] = { "Colibri iMX6ULL 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, +- [37] = { "Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT", TARGET_IS_ENABLED(APALIS_IMX8) }, +- [38] = { "Colibri iMX8 QuadXPlus 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, +- [39] = { "Colibri iMX7 Dual 1GB (eMMC)", TARGET_IS_ENABLED(COLIBRI_IMX7) }, +- [40] = { "Colibri iMX6ULL 512MB Wi-Fi / BT IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, +- [41] = { "Colibri iMX7 Dual 512MB EPDC", TARGET_IS_ENABLED(COLIBRI_IMX7) }, +- [42] = { "Apalis TK1 4GB", TARGET_IS_ENABLED(APALIS_TK1) }, +- [43] = { "Colibri T20 512MB IT SETEK", TARGET_IS_ENABLED(COLIBRI_T20) }, +- [44] = { "Colibri iMX6ULL 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, +- [45] = { "Colibri iMX6ULL 512MB Wi-Fi / Bluetooth", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, +- [46] = { "Apalis iMX8 QuadXPlus 2GB Wi-Fi / BT IT", 0 }, +- [47] = { "Apalis iMX8 QuadMax 4GB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, +- [48] = { "Apalis iMX8 QuadPlus 2GB Wi-Fi / BT", TARGET_IS_ENABLED(APALIS_IMX8) }, +- [49] = { "Apalis iMX8 QuadPlus 2GB", TARGET_IS_ENABLED(APALIS_IMX8) }, +- [50] = { "Colibri iMX8 QuadXPlus 2GB IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, +- [51] = { "Colibri iMX8 DualX 1GB Wi-Fi / Bluetooth", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, +- [52] = { "Colibri iMX8 DualX 1GB", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, +- [53] = { "Apalis iMX8 QuadXPlus 2GB ECC IT", 0 }, +- [54] = { "Apalis iMX8 DualXPlus 1GB", TARGET_IS_ENABLED(APALIS_IMX8) }, +- [55] = { "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, +- [56] = { "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", 0 }, +- [57] = { "Verdin iMX8M Mini DualLite 1GB", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, +- [58] = { "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, +- [59] = { "Verdin iMX8M Mini Quad 2GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, +- [60] = { "Verdin iMX8M Mini DualLite 1GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, +- [61] = { "Verdin iMX8M Plus Quad 2GB", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, +- [62] = { "Colibri iMX6ULL 1GB IT (eMMC)", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, +- [63] = { "Verdin iMX8M Plus Quad 4GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, +- [64] = { "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, +- [65] = { "Verdin iMX8M Plus QuadLite 1GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, +- [66] = { "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, +- [67] = { "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT", TARGET_IS_ENABLED(APALIS_IMX8) }, +- [68] = { "Verdin iMX8M Mini Quad 2GB WB IT No CAN", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, ++ [0] = { "UNKNOWN MODULE", 0 }, ++ [1] = { "Colibri PXA270 312MHz", 0 }, ++ [2] = { "Colibri PXA270 520MHz", 0 }, ++ [3] = { "Colibri PXA320 806MHz", 0 }, ++ [4] = { "Colibri PXA300 208MHz", 0 }, ++ [5] = { "Colibri PXA310 624MHz", 0 }, ++ [6] = { "Colibri PXA320IT 806MHz", 0 }, ++ [7] = { "Colibri PXA300 208MHz XT", 0 }, ++ [8] = { "Colibri PXA270 312MHz", 0 }, ++ [9] = { "Colibri PXA270 520MHz", 0 }, ++ [10] = { "Colibri VF50 128MB", TARGET_IS_ENABLED(COLIBRI_VF) }, ++ [11] = { "Colibri VF61 256MB", TARGET_IS_ENABLED(COLIBRI_VF) }, ++ [12] = { "Colibri VF61 256MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, ++ [13] = { "Colibri VF50 128MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, ++ [14] = { "Colibri iMX6S 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, ++ [15] = { "Colibri iMX6DL 512MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, ++ [16] = { "Colibri iMX6S 256MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, ++ [17] = { "Colibri iMX6DL 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, ++ [18] = { "UNKNOWN MODULE", 0 }, ++ [19] = { "UNKNOWN MODULE", 0 }, ++ [20] = { "Colibri T20 256MB", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [21] = { "Colibri T20 512MB", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [22] = { "Colibri T20 512MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [23] = { "Colibri T30 1GB", TARGET_IS_ENABLED(COLIBRI_T30) }, ++ [24] = { "Colibri T20 256MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [25] = { "Apalis T30 2GB", TARGET_IS_ENABLED(APALIS_T30) }, ++ [26] = { "Apalis T30 1GB", TARGET_IS_ENABLED(APALIS_T30) }, ++ [27] = { "Apalis iMX6Q 1GB", TARGET_IS_ENABLED(APALIS_IMX6) }, ++ [28] = { "Apalis iMX6Q 2GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, ++ [29] = { "Apalis iMX6D 512MB", TARGET_IS_ENABLED(APALIS_IMX6) }, ++ [30] = { "Colibri T30 1GB IT", TARGET_IS_ENABLED(COLIBRI_T30) }, ++ [31] = { "Apalis T30 1GB IT", TARGET_IS_ENABLED(APALIS_T30) }, ++ [32] = { "Colibri iMX7S 256MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, ++ [33] = { "Colibri iMX7D 512MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, ++ [34] = { "Apalis TK1 2GB", TARGET_IS_ENABLED(APALIS_TK1) }, ++ [35] = { "Apalis iMX6D 1GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, ++ [36] = { "Colibri iMX6ULL 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [37] = { "Apalis iMX8QM 4GB WB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [38] = { "Colibri iMX8QXP 2GB WB IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, ++ [39] = { "Colibri iMX7D 1GB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, ++ [40] = { "Colibri iMX6ULL 512MB WB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [41] = { "Colibri iMX7D 512MB EPDC", TARGET_IS_ENABLED(COLIBRI_IMX7) }, ++ [42] = { "Apalis TK1 4GB", TARGET_IS_ENABLED(APALIS_TK1) }, ++ [43] = { "Colibri T20 512MB IT SETEK", TARGET_IS_ENABLED(COLIBRI_T20) }, ++ [44] = { "Colibri iMX6ULL 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [45] = { "Colibri iMX6ULL 512MB WB", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [46] = { "Apalis iMX8QXP 2GB WB IT", 0 }, ++ [47] = { "Apalis iMX8QM 4GB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [48] = { "Apalis iMX8QP 2GB WB", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [49] = { "Apalis iMX8QP 2GB", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [50] = { "Colibri iMX8QXP 2GB IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, ++ [51] = { "Colibri iMX8DX 1GB WB", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, ++ [52] = { "Colibri iMX8DX 1GB", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, ++ [53] = { "Apalis iMX8QXP 2GB ECC IT", 0 }, ++ [54] = { "Apalis iMX8DXP 1GB", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [55] = { "Verdin iMX8M Mini Quad 2GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, ++ [56] = { "Verdin iMX8M Nano Quad 1GB WB", 0 }, ++ [57] = { "Verdin iMX8M Mini DualLite 1GB", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, ++ [58] = { "Verdin iMX8M Plus Quad 4GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [59] = { "Verdin iMX8M Mini Quad 2GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, ++ [60] = { "Verdin iMX8M Mini DualLite 1GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, ++ [61] = { "Verdin iMX8M Plus Quad 2GB", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [62] = { "Colibri iMX6ULL 1GB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, ++ [63] = { "Verdin iMX8M Plus Quad 4GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [64] = { "Verdin iMX8M Plus Quad 2GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [65] = { "Verdin iMX8M Plus QuadLite 1GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [66] = { "Verdin iMX8M Plus Quad 8GB WB", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, ++ [67] = { "Apalis iMX8QM 8GB WB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, ++ [68] = { "Verdin iMX8M Mini Quad 2GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, + }; + + const char * const toradex_carrier_boards[] = { +-- +2.25.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0012-toradex-common-Improve-product-serial-print-during-b.patch b/recipes-bsp/u-boot/u-boot-toradex/0012-toradex-common-Improve-product-serial-print-during-b.patch new file mode 100644 index 0000000..f9bdeab --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0012-toradex-common-Improve-product-serial-print-during-b.patch @@ -0,0 +1,41 @@ +From abe52f58bc54efa9a9849ad4246666ae0be94d38 Mon Sep 17 00:00:00 2001 +From: Francesco Dolcini +Date: Thu, 21 Jul 2022 15:17:38 +0200 +Subject: [PATCH 12/12] toradex: common: Improve product/serial print during + boot + +Add product id print in show_board_info(), with an increasing number of +Toradex SKUs available with small differences it makes sense to print it. + +Move serial number print to a dedicated line, this prevents the previous +line with the product name to overflow the 80 columns with any +reasonable product name length. + +Upstream-Status: Backport [abe52f58bc54efa9a9849ad4246666ae0be94d38] +Signed-off-by: Francesco Dolcini +--- + board/toradex/common/tdx-common.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c +index 2284fcddb510..fadbe455419c 100644 +--- a/board/toradex/common/tdx-common.c ++++ b/board/toradex/common/tdx-common.c +@@ -115,10 +115,11 @@ int show_board_info(void) + + env_set("serial#", tdx_serial_str); + +- printf("Model: Toradex %s %s, Serial# %s\n", ++ printf("Model: Toradex %04d %s %s\n", ++ tdx_hw_tag.prodid, + toradex_modules[tdx_hw_tag.prodid].name, +- tdx_board_rev_str, +- tdx_serial_str); ++ tdx_board_rev_str); ++ printf("Serial#: %s\n", tdx_serial_str); + #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA + if (read_tdx_cfg_block_carrier()) { + printf("MISSING TORADEX CARRIER CONFIG BLOCKS\n"); +-- +2.25.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/0013-configs-colibri-imx7-Enable-bootd-command.patch b/recipes-bsp/u-boot/u-boot-toradex/0013-configs-colibri-imx7-Enable-bootd-command.patch new file mode 100644 index 0000000..c7b17c2 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/0013-configs-colibri-imx7-Enable-bootd-command.patch @@ -0,0 +1,44 @@ +From 76cc934ba0ee5e374b673f62a3442daca74e6f44 Mon Sep 17 00:00:00 2001 +From: Francesco Dolcini +Date: Wed, 27 Jul 2022 17:40:46 +0200 +Subject: [PATCH] configs: colibri-imx7: Enable bootd command + +Enable boot/bootd command in toradex colibri-imx7 defconfig, +it's just convenient to have it in and every other toradex board +already includes it. + +Upstream-Status: Submitted [https://lore.kernel.org/all/20220803112009.271563-1-francesco.dolcini@toradex.com/] +Signed-off-by: Francesco Dolcini +Acked-by: Marcel Ziswiler +--- + configs/colibri_imx7_defconfig | 1 - + configs/colibri_imx7_emmc_defconfig | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig +index 973afc1a2b4b..e0de7f1ab18d 100644 +--- a/configs/colibri_imx7_defconfig ++++ b/configs/colibri_imx7_defconfig +@@ -25,7 +25,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y + CONFIG_DISPLAY_BOARDINFO_LATE=y + CONFIG_BOARD_LATE_INIT=y + CONFIG_SYS_PROMPT="Colibri iMX7 # " +-# CONFIG_CMD_BOOTD is not set + # CONFIG_BOOTM_PLAN9 is not set + # CONFIG_BOOTM_RTEMS is not set + # CONFIG_CMD_IMI is not set +diff --git a/configs/colibri_imx7_emmc_defconfig b/configs/colibri_imx7_emmc_defconfig +index 01b1cb8b5520..e4083b55c3a8 100644 +--- a/configs/colibri_imx7_emmc_defconfig ++++ b/configs/colibri_imx7_emmc_defconfig +@@ -24,7 +24,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y + CONFIG_DISPLAY_BOARDINFO_LATE=y + CONFIG_BOARD_LATE_INIT=y + CONFIG_SYS_PROMPT="Colibri iMX7 # " +-# CONFIG_CMD_BOOTD is not set + # CONFIG_BOOTM_PLAN9 is not set + # CONFIG_BOOTM_RTEMS is not set + # CONFIG_CMD_IMI is not set +-- +2.25.1 + diff --git a/recipes-bsp/u-boot/u-boot-toradex/use-head-next/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch b/recipes-bsp/u-boot/u-boot-toradex/use-head-next/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch new file mode 100644 index 0000000..dbcfa32 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-toradex/use-head-next/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch @@ -0,0 +1,31 @@ +From a936c63690098b19c12acb7a9f106e023129ed99 Mon Sep 17 00:00:00 2001 +From: Marcel Ziswiler +Date: Wed, 30 Sep 2020 16:37:54 +0200 +Subject: [PATCH] colibri_imx7: boot linux kernel in secure mode + +While NXP i.MX 7 downstream requires the Linux kernel to boot in secure +mode mainline/upstream requires non-secure mode instead, as it properly +uses PSCI to control further cores. + +Signed-off-by: Marcel Ziswiler +Reworked for mainline U-Boot. +Signed-off-by: Max Krummenacher +--- + include/configs/colibri_imx7.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h +index 9543e0233e..e33d066328 100644 +--- a/include/configs/colibri_imx7.h ++++ b/include/configs/colibri_imx7.h +@@ -130,6 +130,7 @@ + UBOOT_UPDATE \ + "boot_file=zImage\0" \ + "boot_script_dhcp=boot.scr\0" \ ++ "bootm_boot_mode=sec\0" \ + "console=ttymxc0\0" \ + "defargs=\0" \ + "fdt_board=eval-v3\0" \ +-- +2.20.1 + diff --git a/recipes-bsp/u-boot/u-boot/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch b/recipes-bsp/u-boot/u-boot/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch deleted file mode 100644 index 4a19cd0..0000000 --- a/recipes-bsp/u-boot/u-boot/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 645496d7a35ce78f4057f5668ed210204c7acef0 Mon Sep 17 00:00:00 2001 -From: Marcel Ziswiler -Date: Wed, 30 Sep 2020 16:37:54 +0200 -Subject: [PATCH] colibri_imx7: boot linux kernel in secure mode - -While NXP i.MX 7 downstream requires the Linux kernel to boot in secure -mode mainline/upstream requires non-secure mode instead, as it properly -uses PSCI to control further cores. - -Signed-off-by: Marcel Ziswiler -Reworked for mainline U-Boot. -Signed-off-by: Max Krummenacher ---- - include/configs/colibri_imx7.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h -index ac188ee3ac..82b3ff9323 100644 ---- a/include/configs/colibri_imx7.h -+++ b/include/configs/colibri_imx7.h -@@ -142,6 +142,7 @@ - MODULE_EXTRA_ENV_SETTINGS \ - UBOOT_UPDATE \ - "boot_file=zImage\0" \ -+ "bootm_boot_mode=sec\0" \ - "bootubipart=ubi\0" \ - "console=ttymxc0\0" \ - "defargs=\0" \ --- -2.20.1 - diff --git a/recipes-bsp/u-boot/u-boot/0001-toradex-tdx-cfg-block-use-only-snprintf.patch b/recipes-bsp/u-boot/u-boot/0001-toradex-tdx-cfg-block-use-only-snprintf.patch deleted file mode 100644 index bd03630..0000000 --- a/recipes-bsp/u-boot/u-boot/0001-toradex-tdx-cfg-block-use-only-snprintf.patch +++ /dev/null @@ -1,71 +0,0 @@ -From e97bff4bdac99b0ba5251275551741f4039b23e0 Mon Sep 17 00:00:00 2001 -From: Philippe Schenker -Date: Mon, 13 Jun 2022 19:35:21 +0200 -Subject: [PATCH 1/5] toradex: tdx-cfg-block: use only snprintf - -Prevent memory issues that could appear with sprintf. Replace all -sprintf occurences with snprintf. - -Upstream-Status: Backport [39ff0624bc5ad287fced0f60be9b977d07b1813a] -Signed-off-by: Philippe Schenker -Reviewed-by: Francesco Dolcini -Acked-by: Marcel Ziswiler ---- - board/toradex/common/tdx-common.c | 27 +++++++++++++++------------ - 1 file changed, 15 insertions(+), 12 deletions(-) - -diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c -index 9db4553e0f7..2207818447a 100644 ---- a/board/toradex/common/tdx-common.c -+++ b/board/toradex/common/tdx-common.c -@@ -89,11 +89,13 @@ int show_board_info(void) - tdx_eth_addr.nic = htonl(tdx_serial << 8); - checkboard(); - } else { -- sprintf(tdx_serial_str, "%08u", tdx_serial); -- sprintf(tdx_board_rev_str, "V%1d.%1d%c", -- tdx_hw_tag.ver_major, -- tdx_hw_tag.ver_minor, -- (char)tdx_hw_tag.ver_assembly + 'A'); -+ snprintf(tdx_serial_str, sizeof(tdx_serial_str), -+ "%08u", tdx_serial); -+ snprintf(tdx_board_rev_str, sizeof(tdx_board_rev_str), -+ "V%1d.%1d%c", -+ tdx_hw_tag.ver_major, -+ tdx_hw_tag.ver_minor, -+ (char)tdx_hw_tag.ver_assembly + 'A'); - - env_set("serial#", tdx_serial_str); - -@@ -109,12 +111,13 @@ int show_board_info(void) - tdx_carrier_board_name = (char *) - toradex_carrier_boards[tdx_car_hw_tag.prodid]; - -- sprintf(tdx_car_serial_str, "%08u", tdx_car_serial); -- sprintf(tdx_car_rev_str, "V%1d.%1d%c", -- tdx_car_hw_tag.ver_major, -- tdx_car_hw_tag.ver_minor, -- (char)tdx_car_hw_tag.ver_assembly + -- 'A'); -+ snprintf(tdx_car_serial_str, sizeof(tdx_car_serial_str), -+ "%08u", tdx_car_serial); -+ snprintf(tdx_car_rev_str, sizeof(tdx_car_rev_str), -+ "V%1d.%1d%c", -+ tdx_car_hw_tag.ver_major, -+ tdx_car_hw_tag.ver_minor, -+ (char)tdx_car_hw_tag.ver_assembly + 'A'); - - env_set("carrier_serial#", tdx_car_serial_str); - printf("Carrier: Toradex %s %s, Serial# %s\n", -@@ -170,7 +173,7 @@ int ft_common_board_setup(void *blob, struct bd_info *bd) - if (tdx_hw_tag.ver_major) { - char prod_id[5]; - -- sprintf(prod_id, "%04u", tdx_hw_tag.prodid); -+ snprintf(prod_id, sizeof(prod_id), "%04u", tdx_hw_tag.prodid); - fdt_setprop(blob, 0, "toradex,product-id", prod_id, 5); - - fdt_setprop(blob, 0, "toradex,board-rev", tdx_board_rev_str, --- -2.20.1 - diff --git a/recipes-bsp/u-boot/u-boot/0002-toradex-tdx-cfg-block-use-defines-for-string-length.patch b/recipes-bsp/u-boot/u-boot/0002-toradex-tdx-cfg-block-use-defines-for-string-length.patch deleted file mode 100644 index 4a6fd83..0000000 --- a/recipes-bsp/u-boot/u-boot/0002-toradex-tdx-cfg-block-use-defines-for-string-length.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 44c266438be85e0431a490a60a4ab3f174ecca77 Mon Sep 17 00:00:00 2001 -From: Philippe Schenker -Date: Mon, 13 Jun 2022 19:35:22 +0200 -Subject: [PATCH 2/5] toradex: tdx-cfg-block: use defines for string length - -With those defines the length can be reused and is in one place -extendable. - -Upstream-Status: Backport [494ef10c3bf7859e7d21d9e1d608dc0b634451c2] -Signed-off-by: Philippe Schenker -Reviewed-by: Francesco Dolcini -Acked-by: Marcel Ziswiler ---- - board/toradex/common/tdx-common.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c -index 2207818447a..94e603c14f4 100644 ---- a/board/toradex/common/tdx-common.c -+++ b/board/toradex/common/tdx-common.c -@@ -22,13 +22,17 @@ - - #define TORADEX_OUI 0x00142dUL - -+#define SERIAL_STR_LEN 8 -+#define MODULE_VER_STR_LEN 4 // V1.1 -+#define MODULE_REV_STR_LEN 1 // [A-Z] -+ - #ifdef CONFIG_TDX_CFG_BLOCK --static char tdx_serial_str[9]; --static char tdx_board_rev_str[6]; -+static char tdx_serial_str[SERIAL_STR_LEN + 1]; -+static char tdx_board_rev_str[MODULE_VER_STR_LEN + MODULE_REV_STR_LEN + 1]; - - #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA --static char tdx_car_serial_str[9]; --static char tdx_car_rev_str[6]; -+static char tdx_car_serial_str[SERIAL_STR_LEN + 1]; -+static char tdx_car_rev_str[MODULE_VER_STR_LEN + MODULE_REV_STR_LEN + 1]; - static char *tdx_carrier_board_name; - #endif - --- -2.20.1 - diff --git a/recipes-bsp/u-boot/u-boot/0003-toradex-tdx-cfg-block-extend-assembly-version.patch b/recipes-bsp/u-boot/u-boot/0003-toradex-tdx-cfg-block-extend-assembly-version.patch deleted file mode 100644 index a92a535..0000000 --- a/recipes-bsp/u-boot/u-boot/0003-toradex-tdx-cfg-block-extend-assembly-version.patch +++ /dev/null @@ -1,181 +0,0 @@ -From a7021f904505da69155257612c8cb011be735290 Mon Sep 17 00:00:00 2001 -From: Philippe Schenker -Date: Mon, 13 Jun 2022 19:35:23 +0200 -Subject: [PATCH 3/5] toradex: tdx-cfg-block: extend assembly version - -There are two decimal digits reserved to encode the module version and -revision. This code so far implemented A-Z which used 0-25 of this -range. -This commit extends the range to make use of all 99 numbers. After -capital letters the form with a hashtag and number (e.g. #26) is used. - -Examples: - -If the assembly version is between zero and 25 the numbering is as follows, -as it also has been before this commit: -0: V0.0A -1: V0.0B -... -25: V0.0Z - -New numbering of assembly version: -If the number is between 26 and 99 the new assembly version name is: -26: V0.0#26 -27: V0.0#27 -... -99: V0.0#99 - -Upstream-Status: Backport [7e27ce16c5d289e5b9712a179e798ea4eb831816] -Signed-off-by: Philippe Schenker -Reviewed-by: Francesco Dolcini -Acked-by: Marcel Ziswiler ---- - board/toradex/common/tdx-cfg-block.c | 32 ++++++++++++++++++++++++---- - board/toradex/common/tdx-common.c | 25 +++++++++++++++++----- - 2 files changed, 48 insertions(+), 9 deletions(-) - -diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c -index 6c8cf4592d1..678d4e07c21 100644 ---- a/board/toradex/common/tdx-cfg-block.c -+++ b/board/toradex/common/tdx-cfg-block.c -@@ -354,6 +354,18 @@ out: - return ret; - } - -+static int parse_assembly_string(char *string_to_parse, u16 *assembly) -+{ -+ if (string_to_parse[3] >= 'A' && string_to_parse[3] <= 'Z') -+ *assembly = string_to_parse[3] - 'A'; -+ else if (string_to_parse[3] == '#') -+ *assembly = dectoul(&string_to_parse[4], NULL); -+ else -+ return -EINVAL; -+ -+ return 0; -+} -+ - static int get_cfgblock_interactive(void) - { - char message[CONFIG_SYS_CBSIZE]; -@@ -362,6 +374,7 @@ static int get_cfgblock_interactive(void) - char wb = 'n'; - char mem8g = 'n'; - int len = 0; -+ int ret = 0; - - /* Unknown module by default */ - tdx_hw_tag.prodid = 0; -@@ -545,13 +558,18 @@ static int get_cfgblock_interactive(void) - } - - while (len < 4) { -- sprintf(message, "Enter the module version (e.g. V1.1B): V"); -+ sprintf(message, "Enter the module version (e.g. V1.1B or V1.1#26): V"); - len = cli_readline(message); - } - - tdx_hw_tag.ver_major = console_buffer[0] - '0'; - tdx_hw_tag.ver_minor = console_buffer[2] - '0'; -- tdx_hw_tag.ver_assembly = console_buffer[3] - 'A'; -+ -+ ret = parse_assembly_string(console_buffer, &tdx_hw_tag.ver_assembly); -+ if (ret) { -+ printf("Parsing module version failed\n"); -+ return ret; -+ } - - while (len < 8) { - sprintf(message, "Enter module serial number: "); -@@ -754,6 +772,7 @@ static int get_cfgblock_carrier_interactive(void) - { - char message[CONFIG_SYS_CBSIZE]; - int len; -+ int ret = 0; - - printf("Supported carrier boards:\n"); - printf("CARRIER BOARD NAME\t\t [ID]\n"); -@@ -767,13 +786,18 @@ static int get_cfgblock_carrier_interactive(void) - tdx_car_hw_tag.prodid = dectoul(console_buffer, NULL); - - do { -- sprintf(message, "Enter carrier board version (e.g. V1.1B): V"); -+ sprintf(message, "Enter carrier board version (e.g. V1.1B or V1.1#26): V"); - len = cli_readline(message); - } while (len < 4); - - tdx_car_hw_tag.ver_major = console_buffer[0] - '0'; - tdx_car_hw_tag.ver_minor = console_buffer[2] - '0'; -- tdx_car_hw_tag.ver_assembly = console_buffer[3] - 'A'; -+ -+ ret = parse_assembly_string(console_buffer, &tdx_car_hw_tag.ver_assembly); -+ if (ret) { -+ printf("Parsing module version failed\n"); -+ return ret; -+ } - - while (len < 8) { - sprintf(message, "Enter carrier board serial number: "); -diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c -index 94e603c14f4..5ad5d00a0d9 100644 ---- a/board/toradex/common/tdx-common.c -+++ b/board/toradex/common/tdx-common.c -@@ -24,7 +24,7 @@ - - #define SERIAL_STR_LEN 8 - #define MODULE_VER_STR_LEN 4 // V1.1 --#define MODULE_REV_STR_LEN 1 // [A-Z] -+#define MODULE_REV_STR_LEN 3 // [A-Z] or #[26-99] - - #ifdef CONFIG_TDX_CFG_BLOCK - static char tdx_serial_str[SERIAL_STR_LEN + 1]; -@@ -83,6 +83,21 @@ void get_board_serial(struct tag_serialnr *serialnr) - } - #endif /* CONFIG_SERIAL_TAG */ - -+static const char *get_board_assembly(u16 ver_assembly) -+{ -+ static char ver_name[MODULE_REV_STR_LEN + 1]; -+ -+ if (ver_assembly < 26) { -+ ver_name[0] = (char)ver_assembly + 'A'; -+ ver_name[1] = '\0'; -+ } else { -+ snprintf(ver_name, sizeof(ver_name), -+ "#%u", ver_assembly); -+ } -+ -+ return ver_name; -+} -+ - int show_board_info(void) - { - unsigned char ethaddr[6]; -@@ -96,10 +111,10 @@ int show_board_info(void) - snprintf(tdx_serial_str, sizeof(tdx_serial_str), - "%08u", tdx_serial); - snprintf(tdx_board_rev_str, sizeof(tdx_board_rev_str), -- "V%1d.%1d%c", -+ "V%1d.%1d%s", - tdx_hw_tag.ver_major, - tdx_hw_tag.ver_minor, -- (char)tdx_hw_tag.ver_assembly + 'A'); -+ get_board_assembly(tdx_hw_tag.ver_assembly)); - - env_set("serial#", tdx_serial_str); - -@@ -118,10 +133,10 @@ int show_board_info(void) - snprintf(tdx_car_serial_str, sizeof(tdx_car_serial_str), - "%08u", tdx_car_serial); - snprintf(tdx_car_rev_str, sizeof(tdx_car_rev_str), -- "V%1d.%1d%c", -+ "V%1d.%1d%s", - tdx_car_hw_tag.ver_major, - tdx_car_hw_tag.ver_minor, -- (char)tdx_car_hw_tag.ver_assembly + 'A'); -+ get_board_assembly(tdx_car_hw_tag.ver_assembly)); - - env_set("carrier_serial#", tdx_car_serial_str); - printf("Carrier: Toradex %s %s, Serial# %s\n", --- -2.20.1 - diff --git a/recipes-bsp/u-boot/u-boot/0004-toradex-tdx-cfg-block-add-new-toradex-oui-range.patch b/recipes-bsp/u-boot/u-boot/0004-toradex-tdx-cfg-block-add-new-toradex-oui-range.patch deleted file mode 100644 index a7f0ba3..0000000 --- a/recipes-bsp/u-boot/u-boot/0004-toradex-tdx-cfg-block-add-new-toradex-oui-range.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 7a969112a87c8c6037f07e952213e8696af41c35 Mon Sep 17 00:00:00 2001 -From: Philippe Schenker -Date: Mon, 20 Jun 2022 16:57:45 +0200 -Subject: [PATCH 4/5] toradex: tdx-cfg-block: add new toradex oui range - -Add new Toradex MAC OUI (8c:06:cb), to the config block. With this change -we extend the possible serial-numbers as follows: - -For serial-numbers 00000000-16777215 OUI 00:14:2d is taken -For serial-numbers 16777216-33554431 OUI 8c:06:cb is taken - -Lower 24-bit of the serial number are used in the NIC part of the -MAC address, the complete serial number can be calculated using the OUI. - -Upstream-Status: Backport [1cf4e79f5776e9cc451b7f4affec7e47db9533f9] -Signed-off-by: Philippe Schenker -Reviewed-by: Francesco Dolcini -Reviewed-by: Fabio Estevam -Acked-by: Marcel Ziswiler ---- - board/toradex/common/tdx-cfg-block.c | 42 +++++++++++++++++++++++++--- - board/toradex/common/tdx-cfg-block.h | 2 ++ - board/toradex/common/tdx-common.c | 5 +--- - 3 files changed, 41 insertions(+), 8 deletions(-) - -diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c -index 678d4e07c21..9305709a3c0 100644 ---- a/board/toradex/common/tdx-cfg-block.c -+++ b/board/toradex/common/tdx-cfg-block.c -@@ -159,6 +159,42 @@ const char * const toradex_display_adapters[] = { - [159] = "Verdin DSI to LVDS Adapter", - }; - -+const u32 toradex_ouis[] = { -+ [0] = 0x00142dUL, -+ [1] = 0x8c06cbUL, -+}; -+ -+static u32 get_serial_from_mac(struct toradex_eth_addr *eth_addr) -+{ -+ int i; -+ u32 oui = ntohl(eth_addr->oui) >> 8; -+ u32 nic = ntohl(eth_addr->nic) >> 8; -+ -+ for (i = 0; i < ARRAY_SIZE(toradex_ouis); i++) { -+ if (toradex_ouis[i] == oui) -+ break; -+ } -+ -+ return (u32)((i << 24) + nic); -+} -+ -+void get_mac_from_serial(u32 tdx_serial, struct toradex_eth_addr *eth_addr) -+{ -+ u8 oui_index = tdx_serial >> 24; -+ u32 nic = tdx_serial & GENMASK(23, 0); -+ u32 oui; -+ -+ if (oui_index >= ARRAY_SIZE(toradex_ouis)) { -+ puts("Can't find OUI for this serial#\n"); -+ oui_index = 0; -+ } -+ -+ oui = toradex_ouis[oui_index]; -+ -+ eth_addr->oui = htonl(oui << 8); -+ eth_addr->nic = htonl(nic << 8); -+} -+ - #ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC - static int tdx_cfg_block_mmc_storage(u8 *config_block, int write) - { -@@ -331,8 +367,7 @@ int read_tdx_cfg_block(void) - memcpy(&tdx_eth_addr, config_block + offset, - 6); - -- /* NIC part of MAC address is serial number */ -- tdx_serial = ntohl(tdx_eth_addr.nic) >> 8; -+ tdx_serial = get_serial_from_mac(&tdx_eth_addr); - break; - case TAG_HW: - memcpy(&tdx_hw_tag, config_block + offset, 8); -@@ -974,8 +1009,7 @@ static int do_cfgblock_create(struct cmd_tbl *cmdtp, int flag, int argc, - } - - /* Convert serial number to MAC address (the storage format) */ -- tdx_eth_addr.oui = htonl(0x00142dUL << 8); -- tdx_eth_addr.nic = htonl(tdx_serial << 8); -+ get_mac_from_serial(tdx_serial, &tdx_eth_addr); - - /* Valid Tag */ - write_tag(config_block, &offset, TAG_VALID, NULL, 0); -diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h -index 43e662e41da..17906984863 100644 ---- a/board/toradex/common/tdx-cfg-block.h -+++ b/board/toradex/common/tdx-cfg-block.h -@@ -114,4 +114,6 @@ int read_tdx_cfg_block_carrier(void); - - int try_migrate_tdx_cfg_block_carrier(void); - -+void get_mac_from_serial(u32 tdx_serial, struct toradex_eth_addr *eth_addr); -+ - #endif /* _TDX_CFG_BLOCK_H */ -diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c -index 5ad5d00a0d9..3798bf95378 100644 ---- a/board/toradex/common/tdx-common.c -+++ b/board/toradex/common/tdx-common.c -@@ -20,8 +20,6 @@ - #include - #include "tdx-common.h" - --#define TORADEX_OUI 0x00142dUL -- - #define SERIAL_STR_LEN 8 - #define MODULE_VER_STR_LEN 4 // V1.1 - #define MODULE_REV_STR_LEN 3 // [A-Z] or #[26-99] -@@ -104,8 +102,7 @@ int show_board_info(void) - - if (read_tdx_cfg_block()) { - printf("MISSING TORADEX CONFIG BLOCK\n"); -- tdx_eth_addr.oui = htonl(TORADEX_OUI << 8); -- tdx_eth_addr.nic = htonl(tdx_serial << 8); -+ get_mac_from_serial(tdx_serial, &tdx_eth_addr); - checkboard(); - } else { - snprintf(tdx_serial_str, sizeof(tdx_serial_str), --- -2.20.1 - diff --git a/recipes-bsp/u-boot/u-boot/0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch b/recipes-bsp/u-boot/u-boot/0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch deleted file mode 100644 index 3a597ac..0000000 --- a/recipes-bsp/u-boot/u-boot/0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch +++ /dev/null @@ -1,96 +0,0 @@ -From a2da29a4e2a0adac38dba2ebbb539ce52898d078 Mon Sep 17 00:00:00 2001 -From: Philippe Schenker -Date: Thu, 21 Jul 2022 15:17:31 +0200 -Subject: [PATCH 05/12] toradex: tdx-cfg-block: add 0068 i.mx 8m mini sku - -Add new i.MX 8M Mini SKU to ConfigBlock handling. - -0068: Verdin iMX8M Mini Quad 2GB WB IT No CAN - -This SKU is identical to 0055 but without CAN. Mention this in the name -so those modules can be distinguished. - -Upstream-Status: Backport [a2da29a4e2a0adac38dba2ebbb539ce52898d078] -Signed-off-by: Philippe Schenker -Reviewed-by: Francesco Dolcini -Signed-off-by: Francesco Dolcini ---- - board/toradex/common/tdx-cfg-block.c | 13 ++++++++++++- - board/toradex/common/tdx-cfg-block.h | 1 + - board/toradex/verdin-imx8mm/verdin-imx8mm.c | 3 ++- - 3 files changed, 15 insertions(+), 2 deletions(-) - -diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c -index 9305709a3c0d..53302925dc24 100644 ---- a/board/toradex/common/tdx-cfg-block.c -+++ b/board/toradex/common/tdx-cfg-block.c -@@ -145,6 +145,7 @@ const char * const toradex_modules[] = { - [65] = "Verdin iMX8M Plus QuadLite 1GB IT", - [66] = "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT", - [67] = "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT", -+ [68] = "Verdin iMX8M Mini Quad 2GB WB IT No CAN", - }; - - const char * const toradex_carrier_boards[] = { -@@ -408,6 +409,7 @@ static int get_cfgblock_interactive(void) - char it = 'n'; - char wb = 'n'; - char mem8g = 'n'; -+ char can = 'y'; - int len = 0; - int ret = 0; - -@@ -435,6 +437,13 @@ static int get_cfgblock_interactive(void) - mem8g = console_buffer[0]; - } - #endif -+#if defined(CONFIG_TARGET_VERDIN_IMX8MM) -+ if (is_cpu_type(MXC_CPU_IMX8MM) && (wb == 'y' || wb == 'Y')) { -+ sprintf(message, "Does your module have CAN? [y/N] "); -+ len = cli_readline(message); -+ can = console_buffer[0]; -+ } -+#endif - #endif - - soc = env_get("soc"); -@@ -522,7 +531,9 @@ static int get_cfgblock_interactive(void) - else - tdx_hw_tag.prodid = VERDIN_IMX8MMDL; - } else if (is_cpu_type(MXC_CPU_IMX8MM)) { -- if (wb == 'y' || wb == 'Y') -+ if (can == 'n' || can == 'N') -+ tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN; -+ else if (wb == 'y' || wb == 'Y') - tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT; - else - tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT; -diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h -index 179069848639..79cd09c78d00 100644 ---- a/board/toradex/common/tdx-cfg-block.h -+++ b/board/toradex/common/tdx-cfg-block.h -@@ -88,6 +88,7 @@ enum { - VERDIN_IMX8MPQL_IT, /* 65 */ - VERDIN_IMX8MPQ_8GB_WIFI_BT, - APALIS_IMX8QM_8GB_WIFI_BT_IT, -+ VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN, - }; - - enum { -diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c -index c51c99b5156c..7597cd81f945 100644 ---- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c -+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c -@@ -83,7 +83,8 @@ static void select_dt_from_module_version(void) - * device tree. - */ - is_wifi = (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_WIFI_BT_IT) || -- (tdx_hw_tag.prodid == VERDIN_IMX8MMDL_WIFI_BT_IT); -+ (tdx_hw_tag.prodid == VERDIN_IMX8MMDL_WIFI_BT_IT) || -+ (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN); - } - - switch (get_pcb_revision()) { --- -2.25.1 - diff --git a/recipes-bsp/u-boot/u-boot/0006-toradex-common-Remove-stale-comments-about-modules-a.patch b/recipes-bsp/u-boot/u-boot/0006-toradex-common-Remove-stale-comments-about-modules-a.patch deleted file mode 100644 index 1ac7a3e..0000000 --- a/recipes-bsp/u-boot/u-boot/0006-toradex-common-Remove-stale-comments-about-modules-a.patch +++ /dev/null @@ -1,63 +0,0 @@ -From ea1dc32f318903340a5ddaa8dc655503d1b4599e Mon Sep 17 00:00:00 2001 -From: Francesco Dolcini -Date: Thu, 21 Jul 2022 15:17:32 +0200 -Subject: [PATCH 06/12] toradex: common: Remove stale comments about modules - availability - -Remove comment "not currently on sale" on specific SKUs, this -information does not belong to the code and will never be accurate. - -Upstream-Status: Backport [ea1dc32f318903340a5ddaa8dc655503d1b4599e] -Signed-off-by: Francesco Dolcini ---- - board/toradex/common/tdx-cfg-block.c | 4 ++-- - board/toradex/common/tdx-cfg-block.h | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c -index 53302925dc24..67d007827be6 100644 ---- a/board/toradex/common/tdx-cfg-block.c -+++ b/board/toradex/common/tdx-cfg-block.c -@@ -87,7 +87,7 @@ const char * const toradex_modules[] = { - [7] = "Colibri PXA300 208MHz XT", - [8] = "Colibri PXA270 312MHz", - [9] = "Colibri PXA270 520MHz", -- [10] = "Colibri VF50 128MB", /* not currently on sale */ -+ [10] = "Colibri VF50 128MB", - [11] = "Colibri VF61 256MB", - [12] = "Colibri VF61 256MB IT", - [13] = "Colibri VF50 128MB IT", -@@ -133,7 +133,7 @@ const char * const toradex_modules[] = { - [53] = "Apalis iMX8 QuadXPlus 2GB ECC IT", - [54] = "Apalis iMX8 DualXPlus 1GB", - [55] = "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", -- [56] = "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", /* not currently on sale */ -+ [56] = "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", - [57] = "Verdin iMX8M Mini DualLite 1GB", - [58] = "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", - [59] = "Verdin iMX8M Mini Quad 2GB IT", -diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h -index 79cd09c78d00..028e6b12735f 100644 ---- a/board/toradex/common/tdx-cfg-block.h -+++ b/board/toradex/common/tdx-cfg-block.h -@@ -31,7 +31,7 @@ enum { - COLIBRI_PXA270_312MHZ, - COLIBRI_PXA270_520MHZ, - COLIBRI_VF50, /* 10 */ -- COLIBRI_VF61, /* not currently on sale */ -+ COLIBRI_VF61, - COLIBRI_VF61_IT, - COLIBRI_VF50_IT, - COLIBRI_IMX6S, -@@ -62,7 +62,7 @@ enum { - COLIBRI_IMX7D_EMMC, - COLIBRI_IMX6ULL_WIFI_BT_IT, /* 40 */ - COLIBRI_IMX7D_EPDC, -- APALIS_TK1_4GB, /* not currently on sale */ -+ APALIS_TK1_4GB, - COLIBRI_T20_512MB_IT_SETEK, - COLIBRI_IMX6ULL_IT, - COLIBRI_IMX6ULL_WIFI_BT, /* 45 */ --- -2.25.1 - diff --git a/recipes-bsp/u-boot/u-boot/0007-toradex-common-Use-ARRAY_SIZE-macro.patch b/recipes-bsp/u-boot/u-boot/0007-toradex-common-Use-ARRAY_SIZE-macro.patch deleted file mode 100644 index cb7fea8..0000000 --- a/recipes-bsp/u-boot/u-boot/0007-toradex-common-Use-ARRAY_SIZE-macro.patch +++ /dev/null @@ -1,41 +0,0 @@ -From cdc39c6aaea33a9a47657f7798090ca973053a2f Mon Sep 17 00:00:00 2001 -From: Francesco Dolcini -Date: Thu, 21 Jul 2022 15:17:33 +0200 -Subject: [PATCH 07/12] toradex: common: Use ARRAY_SIZE macro - -Use generally available ARRAY_SIZE macro, instead of hand-coding it -every time is needed. - -Upstream-Status: Backport [cdc39c6aaea33a9a47657f7798090ca973053a2f] -Signed-off-by: Francesco Dolcini ---- - board/toradex/common/tdx-cfg-block.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c -index 67d007827be6..26596199a381 100644 ---- a/board/toradex/common/tdx-cfg-block.c -+++ b/board/toradex/common/tdx-cfg-block.c -@@ -381,8 +381,7 @@ int read_tdx_cfg_block(void) - } - - /* Cap product id to avoid issues with a yet unknown one */ -- if (tdx_hw_tag.prodid >= (sizeof(toradex_modules) / -- sizeof(toradex_modules[0]))) -+ if (tdx_hw_tag.prodid >= ARRAY_SIZE(toradex_modules)) - tdx_hw_tag.prodid = 0; - - out: -@@ -822,8 +821,7 @@ static int get_cfgblock_carrier_interactive(void) - - printf("Supported carrier boards:\n"); - printf("CARRIER BOARD NAME\t\t [ID]\n"); -- for (int i = 0; i < sizeof(toradex_carrier_boards) / -- sizeof(toradex_carrier_boards[0]); i++) -+ for (int i = 0; i < ARRAY_SIZE(toradex_carrier_boards); i++) - if (toradex_carrier_boards[i]) - printf("%s \t\t [%d]\n", toradex_carrier_boards[i], i); - --- -2.25.1 - diff --git a/recipes-bsp/u-boot/u-boot/0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch b/recipes-bsp/u-boot/u-boot/0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch deleted file mode 100644 index 7668e83..0000000 --- a/recipes-bsp/u-boot/u-boot/0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch +++ /dev/null @@ -1,451 +0,0 @@ -From 8b6dc5d3943c269892acb2a426ad4a46a7f7fc49 Mon Sep 17 00:00:00 2001 -From: Francesco Dolcini -Date: Thu, 21 Jul 2022 15:17:34 +0200 -Subject: [PATCH 08/12] toradex: tdx-cfg-block: Cleanup interactive cfg block - creation - -Simplify interactive config block creation code, instead of having a -a long list of questions and a complex tree of preprocessor directive to -guess the exact SKU, just ask the user to select it from a list. - -The modules list is filtered out to include only SKUs that are supported -by the specific u-boot binary in execution. - -Upstream-Status: Backport [8b6dc5d3943c269892acb2a426ad4a46a7f7fc49] -Signed-off-by: Francesco Dolcini ---- - board/toradex/common/tdx-cfg-block.c | 355 +++++++-------------------- - board/toradex/common/tdx-cfg-block.h | 7 +- - board/toradex/common/tdx-common.c | 2 +- - 3 files changed, 92 insertions(+), 272 deletions(-) - -diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c -index 26596199a381..b7c7301af8f7 100644 ---- a/board/toradex/common/tdx-cfg-block.c -+++ b/board/toradex/common/tdx-cfg-block.c -@@ -11,17 +11,6 @@ - #include - #include - --#if defined(CONFIG_TARGET_APALIS_IMX6) || \ -- defined(CONFIG_TARGET_APALIS_IMX8) || \ -- defined(CONFIG_TARGET_COLIBRI_IMX6) || \ -- defined(CONFIG_TARGET_COLIBRI_IMX8X) || \ -- defined(CONFIG_TARGET_VERDIN_IMX8MM) || \ -- defined(CONFIG_TARGET_VERDIN_IMX8MN) || \ -- defined(CONFIG_TARGET_VERDIN_IMX8MP) --#include --#else --#define is_cpu_type(cpu) (0) --#endif - #include - #include - #include -@@ -76,76 +65,78 @@ bool valid_cfgblock_carrier; - struct toradex_hw tdx_car_hw_tag; - #endif - --const char * const toradex_modules[] = { -- [0] = "UNKNOWN MODULE", -- [1] = "Colibri PXA270 312MHz", -- [2] = "Colibri PXA270 520MHz", -- [3] = "Colibri PXA320 806MHz", -- [4] = "Colibri PXA300 208MHz", -- [5] = "Colibri PXA310 624MHz", -- [6] = "Colibri PXA320 806MHz IT", -- [7] = "Colibri PXA300 208MHz XT", -- [8] = "Colibri PXA270 312MHz", -- [9] = "Colibri PXA270 520MHz", -- [10] = "Colibri VF50 128MB", -- [11] = "Colibri VF61 256MB", -- [12] = "Colibri VF61 256MB IT", -- [13] = "Colibri VF50 128MB IT", -- [14] = "Colibri iMX6 Solo 256MB", -- [15] = "Colibri iMX6 DualLite 512MB", -- [16] = "Colibri iMX6 Solo 256MB IT", -- [17] = "Colibri iMX6 DualLite 512MB IT", -- [18] = "UNKNOWN MODULE", -- [19] = "UNKNOWN MODULE", -- [20] = "Colibri T20 256MB", -- [21] = "Colibri T20 512MB", -- [22] = "Colibri T20 512MB IT", -- [23] = "Colibri T30 1GB", -- [24] = "Colibri T20 256MB IT", -- [25] = "Apalis T30 2GB", -- [26] = "Apalis T30 1GB", -- [27] = "Apalis iMX6 Quad 1GB", -- [28] = "Apalis iMX6 Quad 2GB IT", -- [29] = "Apalis iMX6 Dual 512MB", -- [30] = "Colibri T30 1GB IT", -- [31] = "Apalis T30 1GB IT", -- [32] = "Colibri iMX7 Solo 256MB", -- [33] = "Colibri iMX7 Dual 512MB", -- [34] = "Apalis TK1 2GB", -- [35] = "Apalis iMX6 Dual 1GB IT", -- [36] = "Colibri iMX6ULL 256MB", -- [37] = "Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT", -- [38] = "Colibri iMX8 QuadXPlus 2GB Wi-Fi / BT IT", -- [39] = "Colibri iMX7 Dual 1GB (eMMC)", -- [40] = "Colibri iMX6ULL 512MB Wi-Fi / BT IT", -- [41] = "Colibri iMX7 Dual 512MB EPDC", -- [42] = "Apalis TK1 4GB", -- [43] = "Colibri T20 512MB IT SETEK", -- [44] = "Colibri iMX6ULL 512MB IT", -- [45] = "Colibri iMX6ULL 512MB Wi-Fi / Bluetooth", -- [46] = "Apalis iMX8 QuadXPlus 2GB Wi-Fi / BT IT", -- [47] = "Apalis iMX8 QuadMax 4GB IT", -- [48] = "Apalis iMX8 QuadPlus 2GB Wi-Fi / BT", -- [49] = "Apalis iMX8 QuadPlus 2GB", -- [50] = "Colibri iMX8 QuadXPlus 2GB IT", -- [51] = "Colibri iMX8 DualX 1GB Wi-Fi / Bluetooth", -- [52] = "Colibri iMX8 DualX 1GB", -- [53] = "Apalis iMX8 QuadXPlus 2GB ECC IT", -- [54] = "Apalis iMX8 DualXPlus 1GB", -- [55] = "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", -- [56] = "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", -- [57] = "Verdin iMX8M Mini DualLite 1GB", -- [58] = "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", -- [59] = "Verdin iMX8M Mini Quad 2GB IT", -- [60] = "Verdin iMX8M Mini DualLite 1GB WB IT", -- [61] = "Verdin iMX8M Plus Quad 2GB", -- [62] = "Colibri iMX6ULL 1GB IT (eMMC)", -- [63] = "Verdin iMX8M Plus Quad 4GB IT", -- [64] = "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT", -- [65] = "Verdin iMX8M Plus QuadLite 1GB IT", -- [66] = "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT", -- [67] = "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT", -- [68] = "Verdin iMX8M Mini Quad 2GB WB IT No CAN", -+#define TARGET_IS_ENABLED(x) IS_ENABLED(CONFIG_TARGET_ ## x) -+ -+const struct toradex_som toradex_modules[] = { -+ [0] = { "UNKNOWN MODULE", 0 }, -+ [1] = { "Colibri PXA270 312MHz", 0 }, -+ [2] = { "Colibri PXA270 520MHz", 0 }, -+ [3] = { "Colibri PXA320 806MHz", 0 }, -+ [4] = { "Colibri PXA300 208MHz", 0 }, -+ [5] = { "Colibri PXA310 624MHz", 0 }, -+ [6] = { "Colibri PXA320 806MHz IT", 0 }, -+ [7] = { "Colibri PXA300 208MHz XT", 0 }, -+ [8] = { "Colibri PXA270 312MHz", 0 }, -+ [9] = { "Colibri PXA270 520MHz", 0 }, -+ [10] = { "Colibri VF50 128MB", TARGET_IS_ENABLED(COLIBRI_VF) }, -+ [11] = { "Colibri VF61 256MB", TARGET_IS_ENABLED(COLIBRI_VF) }, -+ [12] = { "Colibri VF61 256MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, -+ [13] = { "Colibri VF50 128MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, -+ [14] = { "Colibri iMX6 Solo 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -+ [15] = { "Colibri iMX6 DualLite 512MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -+ [16] = { "Colibri iMX6 Solo 256MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -+ [17] = { "Colibri iMX6 DualLite 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -+ [18] = { "UNKNOWN MODULE", 0 }, -+ [19] = { "UNKNOWN MODULE", 0 }, -+ [20] = { "Colibri T20 256MB", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [21] = { "Colibri T20 512MB", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [22] = { "Colibri T20 512MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [23] = { "Colibri T30 1GB", TARGET_IS_ENABLED(COLIBRI_T30) }, -+ [24] = { "Colibri T20 256MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [25] = { "Apalis T30 2GB", TARGET_IS_ENABLED(APALIS_T30) }, -+ [26] = { "Apalis T30 1GB", TARGET_IS_ENABLED(APALIS_T30) }, -+ [27] = { "Apalis iMX6 Quad 1GB", TARGET_IS_ENABLED(APALIS_IMX6) }, -+ [28] = { "Apalis iMX6 Quad 2GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, -+ [29] = { "Apalis iMX6 Dual 512MB", TARGET_IS_ENABLED(APALIS_IMX6) }, -+ [30] = { "Colibri T30 1GB IT", TARGET_IS_ENABLED(COLIBRI_T30) }, -+ [31] = { "Apalis T30 1GB IT", TARGET_IS_ENABLED(APALIS_T30) }, -+ [32] = { "Colibri iMX7 Solo 256MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -+ [33] = { "Colibri iMX7 Dual 512MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -+ [34] = { "Apalis TK1 2GB", TARGET_IS_ENABLED(APALIS_TK1) }, -+ [35] = { "Apalis iMX6 Dual 1GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, -+ [36] = { "Colibri iMX6ULL 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [37] = { "Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [38] = { "Colibri iMX8 QuadXPlus 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -+ [39] = { "Colibri iMX7 Dual 1GB (eMMC)", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -+ [40] = { "Colibri iMX6ULL 512MB Wi-Fi / BT IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [41] = { "Colibri iMX7 Dual 512MB EPDC", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -+ [42] = { "Apalis TK1 4GB", TARGET_IS_ENABLED(APALIS_TK1) }, -+ [43] = { "Colibri T20 512MB IT SETEK", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [44] = { "Colibri iMX6ULL 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [45] = { "Colibri iMX6ULL 512MB Wi-Fi / Bluetooth", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [46] = { "Apalis iMX8 QuadXPlus 2GB Wi-Fi / BT IT", 0 }, -+ [47] = { "Apalis iMX8 QuadMax 4GB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [48] = { "Apalis iMX8 QuadPlus 2GB Wi-Fi / BT", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [49] = { "Apalis iMX8 QuadPlus 2GB", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [50] = { "Colibri iMX8 QuadXPlus 2GB IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -+ [51] = { "Colibri iMX8 DualX 1GB Wi-Fi / Bluetooth", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -+ [52] = { "Colibri iMX8 DualX 1GB", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -+ [53] = { "Apalis iMX8 QuadXPlus 2GB ECC IT", 0 }, -+ [54] = { "Apalis iMX8 DualXPlus 1GB", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [55] = { "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -+ [56] = { "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", 0 }, -+ [57] = { "Verdin iMX8M Mini DualLite 1GB", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -+ [58] = { "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [59] = { "Verdin iMX8M Mini Quad 2GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -+ [60] = { "Verdin iMX8M Mini DualLite 1GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -+ [61] = { "Verdin iMX8M Plus Quad 2GB", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [62] = { "Colibri iMX6ULL 1GB IT (eMMC)", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [63] = { "Verdin iMX8M Plus Quad 4GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [64] = { "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [65] = { "Verdin iMX8M Plus QuadLite 1GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [66] = { "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [67] = { "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [68] = { "Verdin iMX8M Mini Quad 2GB WB IT No CAN", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, - }; - - const char * const toradex_carrier_boards[] = { -@@ -404,204 +395,28 @@ static int parse_assembly_string(char *string_to_parse, u16 *assembly) - static int get_cfgblock_interactive(void) - { - char message[CONFIG_SYS_CBSIZE]; -- char *soc; -- char it = 'n'; -- char wb = 'n'; -- char mem8g = 'n'; -- char can = 'y'; - int len = 0; - int ret = 0; -+ unsigned int prodid; -+ int i; - -- /* Unknown module by default */ -- tdx_hw_tag.prodid = 0; -- -- sprintf(message, "Is the module an IT version? [y/N] "); -- -- len = cli_readline(message); -- it = console_buffer[0]; -- --#if defined(CONFIG_TARGET_APALIS_IMX8) || \ -- defined(CONFIG_TARGET_COLIBRI_IMX6ULL) || \ -- defined(CONFIG_TARGET_COLIBRI_IMX8X) || \ -- defined(CONFIG_TARGET_VERDIN_IMX8MM) || \ -- defined(CONFIG_TARGET_VERDIN_IMX8MP) -- sprintf(message, "Does the module have Wi-Fi / Bluetooth? [y/N] "); -- len = cli_readline(message); -- wb = console_buffer[0]; -- --#if defined(CONFIG_TARGET_APALIS_IMX8) -- if ((wb == 'y' || wb == 'Y') && (it == 'y' || it == 'Y')) { -- sprintf(message, "Does your module have 8GB of RAM? [y/N] "); -- len = cli_readline(message); -- mem8g = console_buffer[0]; -+ printf("Enabled modules:\n"); -+ for (i = 0; i < ARRAY_SIZE(toradex_modules); i++) { -+ if (toradex_modules[i].is_enabled) -+ printf(" %04d %s\n", i, toradex_modules[i].name); - } --#endif --#if defined(CONFIG_TARGET_VERDIN_IMX8MM) -- if (is_cpu_type(MXC_CPU_IMX8MM) && (wb == 'y' || wb == 'Y')) { -- sprintf(message, "Does your module have CAN? [y/N] "); -- len = cli_readline(message); -- can = console_buffer[0]; -- } --#endif --#endif - -- soc = env_get("soc"); -- if (!strcmp("mx6", soc)) { --#ifdef CONFIG_TARGET_APALIS_IMX6 -- if (it == 'y' || it == 'Y') { -- if (is_cpu_type(MXC_CPU_MX6Q)) -- tdx_hw_tag.prodid = APALIS_IMX6Q_IT; -- else -- tdx_hw_tag.prodid = APALIS_IMX6D_IT; -- } else { -- if (is_cpu_type(MXC_CPU_MX6Q)) -- tdx_hw_tag.prodid = APALIS_IMX6Q; -- else -- tdx_hw_tag.prodid = APALIS_IMX6D; -- } --#elif CONFIG_TARGET_COLIBRI_IMX6 -- if (it == 'y' || it == 'Y') { -- if (is_cpu_type(MXC_CPU_MX6DL)) -- tdx_hw_tag.prodid = COLIBRI_IMX6DL_IT; -- else if (is_cpu_type(MXC_CPU_MX6SOLO)) -- tdx_hw_tag.prodid = COLIBRI_IMX6S_IT; -- } else { -- if (is_cpu_type(MXC_CPU_MX6DL)) -- tdx_hw_tag.prodid = COLIBRI_IMX6DL; -- else if (is_cpu_type(MXC_CPU_MX6SOLO)) -- tdx_hw_tag.prodid = COLIBRI_IMX6S; -- } --#elif CONFIG_TARGET_COLIBRI_IMX6ULL -- if (it == 'y' || it == 'Y') { -- if (wb == 'y' || wb == 'Y') -- tdx_hw_tag.prodid = COLIBRI_IMX6ULL_WIFI_BT_IT; -- else -- if (gd->ram_size == 0x20000000) -- tdx_hw_tag.prodid = COLIBRI_IMX6ULL_IT; -- else -- tdx_hw_tag.prodid = COLIBRI_IMX6ULL_IT_EMMC; -- } else { -- if (wb == 'y' || wb == 'Y') -- tdx_hw_tag.prodid = COLIBRI_IMX6ULL_WIFI_BT; -- else -- tdx_hw_tag.prodid = COLIBRI_IMX6ULL; -- } --#endif -- } else if (!strcmp("imx7d", soc)) -- if (gd->ram_size == 0x20000000) -- tdx_hw_tag.prodid = COLIBRI_IMX7D; -- else -- tdx_hw_tag.prodid = COLIBRI_IMX7D_EMMC; -- else if (!strcmp("imx7s", soc)) -- tdx_hw_tag.prodid = COLIBRI_IMX7S; -- else if (is_cpu_type(MXC_CPU_IMX8QM)) { -- if (it == 'y' || it == 'Y') { -- if (wb == 'y' || wb == 'Y') { -- if (mem8g == 'y' || mem8g == 'Y') -- tdx_hw_tag.prodid = APALIS_IMX8QM_8GB_WIFI_BT_IT; -- else -- tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT; -- } -- else -- tdx_hw_tag.prodid = APALIS_IMX8QM_IT; -- } else { -- if (wb == 'y' || wb == 'Y') -- tdx_hw_tag.prodid = APALIS_IMX8QP_WIFI_BT; -- else -- tdx_hw_tag.prodid = APALIS_IMX8QP; -- } -- } else if (is_cpu_type(MXC_CPU_IMX8QXP)) { --#ifdef CONFIG_TARGET_COLIBRI_IMX8X -- if (it == 'y' || it == 'Y') { -- if (wb == 'y' || wb == 'Y') -- tdx_hw_tag.prodid = COLIBRI_IMX8QXP_WIFI_BT_IT; -- else -- tdx_hw_tag.prodid = COLIBRI_IMX8QXP_IT; -- } else { -- if (wb == 'y' || wb == 'Y') -- tdx_hw_tag.prodid = COLIBRI_IMX8DX_WIFI_BT; -- else -- tdx_hw_tag.prodid = COLIBRI_IMX8DX; -- } --#endif -- } else if (is_cpu_type(MXC_CPU_IMX8MMDL)) { -- if (wb == 'y' || wb == 'Y') -- tdx_hw_tag.prodid = VERDIN_IMX8MMDL_WIFI_BT_IT; -- else -- tdx_hw_tag.prodid = VERDIN_IMX8MMDL; -- } else if (is_cpu_type(MXC_CPU_IMX8MM)) { -- if (can == 'n' || can == 'N') -- tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN; -- else if (wb == 'y' || wb == 'Y') -- tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT; -- else -- tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT; -- } else if (is_cpu_type(MXC_CPU_IMX8MN)) { -- tdx_hw_tag.prodid = VERDIN_IMX8MNQ_WIFI_BT; -- } else if (is_cpu_type(MXC_CPU_IMX8MPL)) { -- tdx_hw_tag.prodid = VERDIN_IMX8MPQL_IT; -- } else if (is_cpu_type(MXC_CPU_IMX8MP)) { -- if (wb == 'y' || wb == 'Y') -- if (gd->ram_size == 0x80000000) -- tdx_hw_tag.prodid = VERDIN_IMX8MPQ_2GB_WIFI_BT_IT; -- else if (gd->ram_size == 0x200000000) -- tdx_hw_tag.prodid = VERDIN_IMX8MPQ_8GB_WIFI_BT; -- else -- tdx_hw_tag.prodid = VERDIN_IMX8MPQ_WIFI_BT_IT; -- else -- if (it == 'y' || it == 'Y') -- tdx_hw_tag.prodid = VERDIN_IMX8MPQ_IT; -- else -- tdx_hw_tag.prodid = VERDIN_IMX8MPQ; -- } else if (!strcmp("tegra20", soc)) { -- if (it == 'y' || it == 'Y') -- if (gd->ram_size == 0x10000000) -- tdx_hw_tag.prodid = COLIBRI_T20_256MB_IT; -- else -- tdx_hw_tag.prodid = COLIBRI_T20_512MB_IT; -- else -- if (gd->ram_size == 0x10000000) -- tdx_hw_tag.prodid = COLIBRI_T20_256MB; -- else -- tdx_hw_tag.prodid = COLIBRI_T20_512MB; -- } --#if defined(CONFIG_TARGET_APALIS_T30) || defined(CONFIG_TARGET_COLIBRI_T30) -- else if (!strcmp("tegra30", soc)) { --#ifdef CONFIG_TARGET_APALIS_T30 -- if (it == 'y' || it == 'Y') -- tdx_hw_tag.prodid = APALIS_T30_IT; -- else -- if (gd->ram_size == 0x40000000) -- tdx_hw_tag.prodid = APALIS_T30_1GB; -- else -- tdx_hw_tag.prodid = APALIS_T30_2GB; --#else -- if (it == 'y' || it == 'Y') -- tdx_hw_tag.prodid = COLIBRI_T30_IT; -- else -- tdx_hw_tag.prodid = COLIBRI_T30; --#endif -- } --#endif /* CONFIG_TARGET_APALIS_T30 || CONFIG_TARGET_COLIBRI_T30 */ -- else if (!strcmp("tegra124", soc)) { -- tdx_hw_tag.prodid = APALIS_TK1_2GB; -- } else if (!strcmp("vf500", soc)) { -- if (it == 'y' || it == 'Y') -- tdx_hw_tag.prodid = COLIBRI_VF50_IT; -- else -- tdx_hw_tag.prodid = COLIBRI_VF50; -- } else if (!strcmp("vf610", soc)) { -- if (it == 'y' || it == 'Y') -- tdx_hw_tag.prodid = COLIBRI_VF61_IT; -- else -- tdx_hw_tag.prodid = COLIBRI_VF61; -- } -+ sprintf(message, "Enter the module ID: "); -+ len = cli_readline(message); - -- if (!tdx_hw_tag.prodid) { -- printf("Module type not detectable due to unknown SoC\n"); -+ prodid = dectoul(console_buffer, NULL); -+ if (prodid >= ARRAY_SIZE(toradex_modules) || !toradex_modules[prodid].is_enabled) { -+ printf("Parsing module id failed\n"); - return -1; - } -+ tdx_hw_tag.prodid = prodid; - -+ len = 0; - while (len < 4) { - sprintf(message, "Enter the module version (e.g. V1.1B or V1.1#26): V"); - len = cli_readline(message); -diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h -index 028e6b12735f..32e4c6f6879f 100644 ---- a/board/toradex/common/tdx-cfg-block.h -+++ b/board/toradex/common/tdx-cfg-block.h -@@ -20,6 +20,11 @@ struct toradex_eth_addr { - u32 nic:24; - } __attribute__((__packed__)); - -+struct toradex_som { -+ const char *name; -+ int is_enabled; -+}; -+ - enum { - COLIBRI_PXA270_V1_312MHZ = 1, - COLIBRI_PXA270_V1_520MHZ, -@@ -101,7 +106,7 @@ enum { - VERDIN_DSI_TO_LVDS_ADAPTER = 159, - }; - --extern const char * const toradex_modules[]; -+extern const struct toradex_som toradex_modules[]; - extern const char * const toradex_carrier_boards[]; - extern bool valid_cfgblock; - extern struct toradex_hw tdx_hw_tag; -diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c -index 3798bf95378e..3643ebbb1632 100644 ---- a/board/toradex/common/tdx-common.c -+++ b/board/toradex/common/tdx-common.c -@@ -116,7 +116,7 @@ int show_board_info(void) - env_set("serial#", tdx_serial_str); - - printf("Model: Toradex %s %s, Serial# %s\n", -- toradex_modules[tdx_hw_tag.prodid], -+ toradex_modules[tdx_hw_tag.prodid].name, - tdx_board_rev_str, - tdx_serial_str); - #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA --- -2.25.1 - diff --git a/recipes-bsp/u-boot/u-boot/0009-toradex-common-Remove-stale-function-declaration.patch b/recipes-bsp/u-boot/u-boot/0009-toradex-common-Remove-stale-function-declaration.patch deleted file mode 100644 index d0a49a4..0000000 --- a/recipes-bsp/u-boot/u-boot/0009-toradex-common-Remove-stale-function-declaration.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0d4b692c807881253ec6954970ccbb0f717ae10a Mon Sep 17 00:00:00 2001 -From: Francesco Dolcini -Date: Thu, 21 Jul 2022 15:17:35 +0200 -Subject: [PATCH 09/12] toradex: common: Remove stale function declaration - -Remove stale show_boot_logo() declaration, not used anywhere. - -Upstream-Status: Backport [0d4b692c807881253ec6954970ccbb0f717ae10a] -Fixes: e6fd30dd9eef ("toradex: drop legacy show_boot_logo function and use splashscreen") -Signed-off-by: Francesco Dolcini ---- - board/toradex/common/tdx-common.h | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/board/toradex/common/tdx-common.h b/board/toradex/common/tdx-common.h -index c96e8754e9e2..d446e9f1d5ca 100644 ---- a/board/toradex/common/tdx-common.h -+++ b/board/toradex/common/tdx-common.h -@@ -12,8 +12,4 @@ - int ft_common_board_setup(void *blob, struct bd_info *bd); - u32 get_board_revision(void); - --#if defined(CONFIG_DM_VIDEO) --int show_boot_logo(void); --#endif -- - #endif /* _TDX_COMMON_H */ --- -2.25.1 - diff --git a/recipes-bsp/u-boot/u-boot/0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch b/recipes-bsp/u-boot/u-boot/0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch deleted file mode 100644 index af02b2b..0000000 --- a/recipes-bsp/u-boot/u-boot/0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 9762fbeea451f4d81ec88788e7680e37a1ee5beb Mon Sep 17 00:00:00 2001 -From: Francesco Dolcini -Date: Thu, 21 Jul 2022 15:17:36 +0200 -Subject: [PATCH 10/12] toradex: common: Remove #ifdef usage for 2nd ethaddr - -Fix checkpatch warn, use `IS_ENABLED(CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR)` -instead of `#ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR`. - -Upstream-Status: Backport [9762fbeea451f4d81ec88788e7680e37a1ee5beb] -Signed-off-by: Francesco Dolcini ---- - board/toradex/common/tdx-common.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c -index 3643ebbb1632..2284fcddb510 100644 ---- a/board/toradex/common/tdx-common.c -+++ b/board/toradex/common/tdx-common.c -@@ -151,8 +151,8 @@ int show_board_info(void) - if (!eth_env_get_enetaddr("ethaddr", ethaddr)) - eth_env_set_enetaddr("ethaddr", (u8 *)&tdx_eth_addr); - --#ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR -- if (!eth_env_get_enetaddr("eth1addr", ethaddr)) { -+ if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR) && -+ !eth_env_get_enetaddr("eth1addr", ethaddr)) { - /* - * Secondary MAC address is allocated from block - * 0x100000 higher then the first MAC address -@@ -161,7 +161,6 @@ int show_board_info(void) - ethaddr[3] += 0x10; - eth_env_set_enetaddr("eth1addr", ethaddr); - } --#endif - - return 0; - } --- -2.25.1 - diff --git a/recipes-bsp/u-boot/u-boot/0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch b/recipes-bsp/u-boot/u-boot/0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch deleted file mode 100644 index e74877e..0000000 --- a/recipes-bsp/u-boot/u-boot/0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch +++ /dev/null @@ -1,171 +0,0 @@ -From 4f0c33c46d946beb5e3430ce694d86ff86adbfcd Mon Sep 17 00:00:00 2001 -From: Francesco Dolcini -Date: Thu, 21 Jul 2022 15:17:37 +0200 -Subject: [PATCH 11/12] toradex: tdx-cfg-block: Use official SKU names - -Up to now in the code we named Toradex SKUs in a slightly different way -compared to the official product name, start using the official names -from now on to avoid misunderstanding. - -This has also the nice benefit of the string being shorter, allowing -to fit nicely in 80 columns even adding the product ID when printing -the hardware information. - -Upstream-Status: Backport [4f0c33c46d946beb5e3430ce694d86ff86adbfcd] -Signed-off-by: Francesco Dolcini ---- - board/toradex/common/tdx-cfg-block.c | 138 +++++++++++++-------------- - 1 file changed, 69 insertions(+), 69 deletions(-) - -diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c -index b7c7301af8f7..7cf2dfae9746 100644 ---- a/board/toradex/common/tdx-cfg-block.c -+++ b/board/toradex/common/tdx-cfg-block.c -@@ -68,75 +68,75 @@ struct toradex_hw tdx_car_hw_tag; - #define TARGET_IS_ENABLED(x) IS_ENABLED(CONFIG_TARGET_ ## x) - - const struct toradex_som toradex_modules[] = { -- [0] = { "UNKNOWN MODULE", 0 }, -- [1] = { "Colibri PXA270 312MHz", 0 }, -- [2] = { "Colibri PXA270 520MHz", 0 }, -- [3] = { "Colibri PXA320 806MHz", 0 }, -- [4] = { "Colibri PXA300 208MHz", 0 }, -- [5] = { "Colibri PXA310 624MHz", 0 }, -- [6] = { "Colibri PXA320 806MHz IT", 0 }, -- [7] = { "Colibri PXA300 208MHz XT", 0 }, -- [8] = { "Colibri PXA270 312MHz", 0 }, -- [9] = { "Colibri PXA270 520MHz", 0 }, -- [10] = { "Colibri VF50 128MB", TARGET_IS_ENABLED(COLIBRI_VF) }, -- [11] = { "Colibri VF61 256MB", TARGET_IS_ENABLED(COLIBRI_VF) }, -- [12] = { "Colibri VF61 256MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, -- [13] = { "Colibri VF50 128MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, -- [14] = { "Colibri iMX6 Solo 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -- [15] = { "Colibri iMX6 DualLite 512MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -- [16] = { "Colibri iMX6 Solo 256MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -- [17] = { "Colibri iMX6 DualLite 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -- [18] = { "UNKNOWN MODULE", 0 }, -- [19] = { "UNKNOWN MODULE", 0 }, -- [20] = { "Colibri T20 256MB", TARGET_IS_ENABLED(COLIBRI_T20) }, -- [21] = { "Colibri T20 512MB", TARGET_IS_ENABLED(COLIBRI_T20) }, -- [22] = { "Colibri T20 512MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, -- [23] = { "Colibri T30 1GB", TARGET_IS_ENABLED(COLIBRI_T30) }, -- [24] = { "Colibri T20 256MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, -- [25] = { "Apalis T30 2GB", TARGET_IS_ENABLED(APALIS_T30) }, -- [26] = { "Apalis T30 1GB", TARGET_IS_ENABLED(APALIS_T30) }, -- [27] = { "Apalis iMX6 Quad 1GB", TARGET_IS_ENABLED(APALIS_IMX6) }, -- [28] = { "Apalis iMX6 Quad 2GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, -- [29] = { "Apalis iMX6 Dual 512MB", TARGET_IS_ENABLED(APALIS_IMX6) }, -- [30] = { "Colibri T30 1GB IT", TARGET_IS_ENABLED(COLIBRI_T30) }, -- [31] = { "Apalis T30 1GB IT", TARGET_IS_ENABLED(APALIS_T30) }, -- [32] = { "Colibri iMX7 Solo 256MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -- [33] = { "Colibri iMX7 Dual 512MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -- [34] = { "Apalis TK1 2GB", TARGET_IS_ENABLED(APALIS_TK1) }, -- [35] = { "Apalis iMX6 Dual 1GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, -- [36] = { "Colibri iMX6ULL 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -- [37] = { "Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT", TARGET_IS_ENABLED(APALIS_IMX8) }, -- [38] = { "Colibri iMX8 QuadXPlus 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -- [39] = { "Colibri iMX7 Dual 1GB (eMMC)", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -- [40] = { "Colibri iMX6ULL 512MB Wi-Fi / BT IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -- [41] = { "Colibri iMX7 Dual 512MB EPDC", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -- [42] = { "Apalis TK1 4GB", TARGET_IS_ENABLED(APALIS_TK1) }, -- [43] = { "Colibri T20 512MB IT SETEK", TARGET_IS_ENABLED(COLIBRI_T20) }, -- [44] = { "Colibri iMX6ULL 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -- [45] = { "Colibri iMX6ULL 512MB Wi-Fi / Bluetooth", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -- [46] = { "Apalis iMX8 QuadXPlus 2GB Wi-Fi / BT IT", 0 }, -- [47] = { "Apalis iMX8 QuadMax 4GB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, -- [48] = { "Apalis iMX8 QuadPlus 2GB Wi-Fi / BT", TARGET_IS_ENABLED(APALIS_IMX8) }, -- [49] = { "Apalis iMX8 QuadPlus 2GB", TARGET_IS_ENABLED(APALIS_IMX8) }, -- [50] = { "Colibri iMX8 QuadXPlus 2GB IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -- [51] = { "Colibri iMX8 DualX 1GB Wi-Fi / Bluetooth", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -- [52] = { "Colibri iMX8 DualX 1GB", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -- [53] = { "Apalis iMX8 QuadXPlus 2GB ECC IT", 0 }, -- [54] = { "Apalis iMX8 DualXPlus 1GB", TARGET_IS_ENABLED(APALIS_IMX8) }, -- [55] = { "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -- [56] = { "Verdin iMX8M Nano Quad 1GB Wi-Fi / BT", 0 }, -- [57] = { "Verdin iMX8M Mini DualLite 1GB", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -- [58] = { "Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -- [59] = { "Verdin iMX8M Mini Quad 2GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -- [60] = { "Verdin iMX8M Mini DualLite 1GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -- [61] = { "Verdin iMX8M Plus Quad 2GB", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -- [62] = { "Colibri iMX6ULL 1GB IT (eMMC)", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -- [63] = { "Verdin iMX8M Plus Quad 4GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -- [64] = { "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -- [65] = { "Verdin iMX8M Plus QuadLite 1GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -- [66] = { "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -- [67] = { "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT", TARGET_IS_ENABLED(APALIS_IMX8) }, -- [68] = { "Verdin iMX8M Mini Quad 2GB WB IT No CAN", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -+ [0] = { "UNKNOWN MODULE", 0 }, -+ [1] = { "Colibri PXA270 312MHz", 0 }, -+ [2] = { "Colibri PXA270 520MHz", 0 }, -+ [3] = { "Colibri PXA320 806MHz", 0 }, -+ [4] = { "Colibri PXA300 208MHz", 0 }, -+ [5] = { "Colibri PXA310 624MHz", 0 }, -+ [6] = { "Colibri PXA320IT 806MHz", 0 }, -+ [7] = { "Colibri PXA300 208MHz XT", 0 }, -+ [8] = { "Colibri PXA270 312MHz", 0 }, -+ [9] = { "Colibri PXA270 520MHz", 0 }, -+ [10] = { "Colibri VF50 128MB", TARGET_IS_ENABLED(COLIBRI_VF) }, -+ [11] = { "Colibri VF61 256MB", TARGET_IS_ENABLED(COLIBRI_VF) }, -+ [12] = { "Colibri VF61 256MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, -+ [13] = { "Colibri VF50 128MB IT", TARGET_IS_ENABLED(COLIBRI_VF) }, -+ [14] = { "Colibri iMX6S 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -+ [15] = { "Colibri iMX6DL 512MB", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -+ [16] = { "Colibri iMX6S 256MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -+ [17] = { "Colibri iMX6DL 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6) }, -+ [18] = { "UNKNOWN MODULE", 0 }, -+ [19] = { "UNKNOWN MODULE", 0 }, -+ [20] = { "Colibri T20 256MB", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [21] = { "Colibri T20 512MB", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [22] = { "Colibri T20 512MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [23] = { "Colibri T30 1GB", TARGET_IS_ENABLED(COLIBRI_T30) }, -+ [24] = { "Colibri T20 256MB IT", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [25] = { "Apalis T30 2GB", TARGET_IS_ENABLED(APALIS_T30) }, -+ [26] = { "Apalis T30 1GB", TARGET_IS_ENABLED(APALIS_T30) }, -+ [27] = { "Apalis iMX6Q 1GB", TARGET_IS_ENABLED(APALIS_IMX6) }, -+ [28] = { "Apalis iMX6Q 2GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, -+ [29] = { "Apalis iMX6D 512MB", TARGET_IS_ENABLED(APALIS_IMX6) }, -+ [30] = { "Colibri T30 1GB IT", TARGET_IS_ENABLED(COLIBRI_T30) }, -+ [31] = { "Apalis T30 1GB IT", TARGET_IS_ENABLED(APALIS_T30) }, -+ [32] = { "Colibri iMX7S 256MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -+ [33] = { "Colibri iMX7D 512MB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -+ [34] = { "Apalis TK1 2GB", TARGET_IS_ENABLED(APALIS_TK1) }, -+ [35] = { "Apalis iMX6D 1GB IT", TARGET_IS_ENABLED(APALIS_IMX6) }, -+ [36] = { "Colibri iMX6ULL 256MB", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [37] = { "Apalis iMX8QM 4GB WB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [38] = { "Colibri iMX8QXP 2GB WB IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -+ [39] = { "Colibri iMX7D 1GB", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -+ [40] = { "Colibri iMX6ULL 512MB WB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [41] = { "Colibri iMX7D 512MB EPDC", TARGET_IS_ENABLED(COLIBRI_IMX7) }, -+ [42] = { "Apalis TK1 4GB", TARGET_IS_ENABLED(APALIS_TK1) }, -+ [43] = { "Colibri T20 512MB IT SETEK", TARGET_IS_ENABLED(COLIBRI_T20) }, -+ [44] = { "Colibri iMX6ULL 512MB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [45] = { "Colibri iMX6ULL 512MB WB", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [46] = { "Apalis iMX8QXP 2GB WB IT", 0 }, -+ [47] = { "Apalis iMX8QM 4GB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [48] = { "Apalis iMX8QP 2GB WB", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [49] = { "Apalis iMX8QP 2GB", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [50] = { "Colibri iMX8QXP 2GB IT", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -+ [51] = { "Colibri iMX8DX 1GB WB", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -+ [52] = { "Colibri iMX8DX 1GB", TARGET_IS_ENABLED(COLIBRI_IMX8X) }, -+ [53] = { "Apalis iMX8QXP 2GB ECC IT", 0 }, -+ [54] = { "Apalis iMX8DXP 1GB", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [55] = { "Verdin iMX8M Mini Quad 2GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -+ [56] = { "Verdin iMX8M Nano Quad 1GB WB", 0 }, -+ [57] = { "Verdin iMX8M Mini DualLite 1GB", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -+ [58] = { "Verdin iMX8M Plus Quad 4GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [59] = { "Verdin iMX8M Mini Quad 2GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -+ [60] = { "Verdin iMX8M Mini DualLite 1GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, -+ [61] = { "Verdin iMX8M Plus Quad 2GB", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [62] = { "Colibri iMX6ULL 1GB IT", TARGET_IS_ENABLED(COLIBRI_IMX6ULL) }, -+ [63] = { "Verdin iMX8M Plus Quad 4GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [64] = { "Verdin iMX8M Plus Quad 2GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [65] = { "Verdin iMX8M Plus QuadLite 1GB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [66] = { "Verdin iMX8M Plus Quad 8GB WB", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, -+ [67] = { "Apalis iMX8QM 8GB WB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, -+ [68] = { "Verdin iMX8M Mini Quad 2GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, - }; - - const char * const toradex_carrier_boards[] = { --- -2.25.1 - diff --git a/recipes-bsp/u-boot/u-boot/0012-toradex-common-Improve-product-serial-print-during-b.patch b/recipes-bsp/u-boot/u-boot/0012-toradex-common-Improve-product-serial-print-during-b.patch deleted file mode 100644 index f9bdeab..0000000 --- a/recipes-bsp/u-boot/u-boot/0012-toradex-common-Improve-product-serial-print-during-b.patch +++ /dev/null @@ -1,41 +0,0 @@ -From abe52f58bc54efa9a9849ad4246666ae0be94d38 Mon Sep 17 00:00:00 2001 -From: Francesco Dolcini -Date: Thu, 21 Jul 2022 15:17:38 +0200 -Subject: [PATCH 12/12] toradex: common: Improve product/serial print during - boot - -Add product id print in show_board_info(), with an increasing number of -Toradex SKUs available with small differences it makes sense to print it. - -Move serial number print to a dedicated line, this prevents the previous -line with the product name to overflow the 80 columns with any -reasonable product name length. - -Upstream-Status: Backport [abe52f58bc54efa9a9849ad4246666ae0be94d38] -Signed-off-by: Francesco Dolcini ---- - board/toradex/common/tdx-common.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c -index 2284fcddb510..fadbe455419c 100644 ---- a/board/toradex/common/tdx-common.c -+++ b/board/toradex/common/tdx-common.c -@@ -115,10 +115,11 @@ int show_board_info(void) - - env_set("serial#", tdx_serial_str); - -- printf("Model: Toradex %s %s, Serial# %s\n", -+ printf("Model: Toradex %04d %s %s\n", -+ tdx_hw_tag.prodid, - toradex_modules[tdx_hw_tag.prodid].name, -- tdx_board_rev_str, -- tdx_serial_str); -+ tdx_board_rev_str); -+ printf("Serial#: %s\n", tdx_serial_str); - #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA - if (read_tdx_cfg_block_carrier()) { - printf("MISSING TORADEX CARRIER CONFIG BLOCKS\n"); --- -2.25.1 - diff --git a/recipes-bsp/u-boot/u-boot/0013-configs-colibri-imx7-Enable-bootd-command.patch b/recipes-bsp/u-boot/u-boot/0013-configs-colibri-imx7-Enable-bootd-command.patch deleted file mode 100644 index c7b17c2..0000000 --- a/recipes-bsp/u-boot/u-boot/0013-configs-colibri-imx7-Enable-bootd-command.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 76cc934ba0ee5e374b673f62a3442daca74e6f44 Mon Sep 17 00:00:00 2001 -From: Francesco Dolcini -Date: Wed, 27 Jul 2022 17:40:46 +0200 -Subject: [PATCH] configs: colibri-imx7: Enable bootd command - -Enable boot/bootd command in toradex colibri-imx7 defconfig, -it's just convenient to have it in and every other toradex board -already includes it. - -Upstream-Status: Submitted [https://lore.kernel.org/all/20220803112009.271563-1-francesco.dolcini@toradex.com/] -Signed-off-by: Francesco Dolcini -Acked-by: Marcel Ziswiler ---- - configs/colibri_imx7_defconfig | 1 - - configs/colibri_imx7_emmc_defconfig | 1 - - 2 files changed, 2 deletions(-) - -diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig -index 973afc1a2b4b..e0de7f1ab18d 100644 ---- a/configs/colibri_imx7_defconfig -+++ b/configs/colibri_imx7_defconfig -@@ -25,7 +25,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y - CONFIG_DISPLAY_BOARDINFO_LATE=y - CONFIG_BOARD_LATE_INIT=y - CONFIG_SYS_PROMPT="Colibri iMX7 # " --# CONFIG_CMD_BOOTD is not set - # CONFIG_BOOTM_PLAN9 is not set - # CONFIG_BOOTM_RTEMS is not set - # CONFIG_CMD_IMI is not set -diff --git a/configs/colibri_imx7_emmc_defconfig b/configs/colibri_imx7_emmc_defconfig -index 01b1cb8b5520..e4083b55c3a8 100644 ---- a/configs/colibri_imx7_emmc_defconfig -+++ b/configs/colibri_imx7_emmc_defconfig -@@ -24,7 +24,6 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y - CONFIG_DISPLAY_BOARDINFO_LATE=y - CONFIG_BOARD_LATE_INIT=y - CONFIG_SYS_PROMPT="Colibri iMX7 # " --# CONFIG_CMD_BOOTD is not set - # CONFIG_BOOTM_PLAN9 is not set - # CONFIG_BOOTM_RTEMS is not set - # CONFIG_CMD_IMI is not set --- -2.25.1 - diff --git a/recipes-bsp/u-boot/u-boot/use-head-next/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch b/recipes-bsp/u-boot/u-boot/use-head-next/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch deleted file mode 100644 index dbcfa32..0000000 --- a/recipes-bsp/u-boot/u-boot/use-head-next/0001-colibri_imx7-boot-linux-kernel-in-secure-mode.patch +++ /dev/null @@ -1,31 +0,0 @@ -From a936c63690098b19c12acb7a9f106e023129ed99 Mon Sep 17 00:00:00 2001 -From: Marcel Ziswiler -Date: Wed, 30 Sep 2020 16:37:54 +0200 -Subject: [PATCH] colibri_imx7: boot linux kernel in secure mode - -While NXP i.MX 7 downstream requires the Linux kernel to boot in secure -mode mainline/upstream requires non-secure mode instead, as it properly -uses PSCI to control further cores. - -Signed-off-by: Marcel Ziswiler -Reworked for mainline U-Boot. -Signed-off-by: Max Krummenacher ---- - include/configs/colibri_imx7.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/configs/colibri_imx7.h b/include/configs/colibri_imx7.h -index 9543e0233e..e33d066328 100644 ---- a/include/configs/colibri_imx7.h -+++ b/include/configs/colibri_imx7.h -@@ -130,6 +130,7 @@ - UBOOT_UPDATE \ - "boot_file=zImage\0" \ - "boot_script_dhcp=boot.scr\0" \ -+ "bootm_boot_mode=sec\0" \ - "console=ttymxc0\0" \ - "defargs=\0" \ - "fdt_board=eval-v3\0" \ --- -2.20.1 - -- cgit v1.2.3