From 2636f877f2c136dec023cd85c4ae2c7c7c45eb90 Mon Sep 17 00:00:00 2001 From: Francesco Dolcini Date: Wed, 27 Jul 2022 09:48:38 +0200 Subject: u-boot: Update patches adding config block refactoring Update U-Boot v2022.07 patches, backport `board/toradex` patches from current denx/master git. This updates the config block interactive creation procedure. Related-to: ELB-4626 Signed-off-by: Francesco Dolcini --- ...x-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch | 17 +- ...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 ++ recipes-bsp/u-boot/u-boot_%.bbappend | 7 + 9 files changed, 853 insertions(+), 8 deletions(-) create mode 100644 recipes-bsp/u-boot/u-boot/0006-toradex-common-Remove-stale-comments-about-modules-a.patch create mode 100644 recipes-bsp/u-boot/u-boot/0007-toradex-common-Use-ARRAY_SIZE-macro.patch create mode 100644 recipes-bsp/u-boot/u-boot/0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch create mode 100644 recipes-bsp/u-boot/u-boot/0009-toradex-common-Remove-stale-function-declaration.patch create mode 100644 recipes-bsp/u-boot/u-boot/0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch create mode 100644 recipes-bsp/u-boot/u-boot/0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch create mode 100644 recipes-bsp/u-boot/u-boot/0012-toradex-common-Improve-product-serial-print-during-b.patch (limited to 'recipes-bsp') 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 index ff6ad15..3a597ac 100644 --- 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 @@ -1,7 +1,7 @@ -From 1ec0e02d1641050b3143ff72bb3f0ae833113106 Mon Sep 17 00:00:00 2001 +From a2da29a4e2a0adac38dba2ebbb539ce52898d078 Mon Sep 17 00:00:00 2001 From: Philippe Schenker -Date: Mon, 20 Jun 2022 19:49:24 +0200 -Subject: [PATCH 5/5] toradex: tdx-cfg-block: add 0068 i.mx 8m mini sku +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. @@ -10,9 +10,10 @@ Add new i.MX 8M Mini SKU to ConfigBlock handling. This SKU is identical to 0055 but without CAN. Mention this in the name so those modules can be distinguished. -Upstream-Status: Submitted [https://lore.kernel.org/u-boot/20220706121505.448579-1-dev@pschenker.ch/] +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 + @@ -20,7 +21,7 @@ Reviewed-by: Francesco Dolcini 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 9305709a3c0..53302925dc2 100644 +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,7 +66,7 @@ index 9305709a3c0..53302925dc2 100644 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 17906984863..79cd09c78d0 100644 +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 { @@ -77,7 +78,7 @@ index 17906984863..79cd09c78d0 100644 enum { diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c -index c51c99b5156..7597cd81f94 100644 +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) @@ -91,5 +92,5 @@ index c51c99b5156..7597cd81f94 100644 switch (get_pcb_revision()) { -- -2.20.1 +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 new file mode 100644 index 0000000..1ac7a3e --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/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/0007-toradex-common-Use-ARRAY_SIZE-macro.patch b/recipes-bsp/u-boot/u-boot/0007-toradex-common-Use-ARRAY_SIZE-macro.patch new file mode 100644 index 0000000..cb7fea8 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/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/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 new file mode 100644 index 0000000..7668e83 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/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/0009-toradex-common-Remove-stale-function-declaration.patch b/recipes-bsp/u-boot/u-boot/0009-toradex-common-Remove-stale-function-declaration.patch new file mode 100644 index 0000000..d0a49a4 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/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/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 new file mode 100644 index 0000000..af02b2b --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/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/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 new file mode 100644 index 0000000..e74877e --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/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/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 new file mode 100644 index 0000000..f9bdeab --- /dev/null +++ b/recipes-bsp/u-boot/u-boot/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_%.bbappend b/recipes-bsp/u-boot/u-boot_%.bbappend index 3c3ff7a..c972fee 100644 --- a/recipes-bsp/u-boot/u-boot_%.bbappend +++ b/recipes-bsp/u-boot/u-boot_%.bbappend @@ -14,6 +14,13 @@ TDX_PATCHES = " \ file://0003-toradex-tdx-cfg-block-extend-assembly-version.patch \ file://0004-toradex-tdx-cfg-block-add-new-toradex-oui-range.patch \ file://0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch \ + file://0006-toradex-common-Remove-stale-comments-about-modules-a.patch \ + file://0007-toradex-common-Use-ARRAY_SIZE-macro.patch \ + file://0008-toradex-tdx-cfg-block-Cleanup-interactive-cfg-block-.patch \ + file://0009-toradex-common-Remove-stale-function-declaration.patch \ + file://0010-toradex-common-Remove-ifdef-usage-for-2nd-ethaddr.patch \ + file://0011-toradex-tdx-cfg-block-Use-official-SKU-names.patch \ + file://0012-toradex-common-Improve-product-serial-print-during-b.patch \ " # patches which are not (yet) in the latest master TDX_PATCHES:use-head-next = " \ -- cgit v1.2.3