Skip to contentSkip to conversation

toradex: Decouple from Toradex product ID table

PATCH In review Franz Schnyder 3 participants 11 messages Aug 14 – Aug 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover toradex: Decouple from Toradex product ID table

The sysinfo currently uses the Toradex product ID table to print a detailed board model string. With various new SoMs that are released by Toradex, the PID table grows and needs maintenance effort which can be avoided.

Rather than printing the board model based on the PID table, rely on the model property of the device tree and the data written to the config block during manufacturing, which already describes the HW correctly.

For example, the printed board model string will change from:
Model: Toradex 0075 Verdin AM62 Dual 1GB WB IT V1.2A Serial#: 15412798
and become:
Model: Toradex Verdin AM62 WB on Verdin Development Board Toradex SoM: 0075 V1.2A (00751200)
Serial#: 15412798

This removes detailed SKU information such as the number of cores, memory size, WB capability and temperature rating, but the PID4, PID8 and revision of the SoM are still printed. The detailed information of the SoM can still be looked up using the printed information on the official Toradex website.

Therefore, the 0243 Aquila iMX95 is the final entry in the Toradex product ID table.

The decoupling also leads to changes in the DTB selection of the Verdin family modules, which currently uses the Toradex product ID table to determine whether the SoM is a WiFi or a non-WiFi module. From now on, the WiFi DTB is set as the default.
This change is safe, as on non-WiFi modules this leaves the WiFi and BT devices unprobed. Further, the SDIO/UART signals are exposed to the edge connector on non-WiFi modules and can be used on the carrier. However, no Toradex carrier board makes use of these interfaces on the carrier and it can only be achieved with a customized board. For customized boards, it's expected to override the default selection by setting the 'fdtfile' env variable.

---
Franz Schnyder (8):
toradex: verdin-am62: Set WiFI DTB as default for new PIDs
toradex: verdin-am62p: Set WiFi DTB as default for new PIDs
toradex: verdin-imx95: Set WiFi DTB as default for new PIDs
toradex: verdin-imx8mp: Set WiFi DTB as default for new PIDs
toradex: verdin-imx8mm: Set WiFi DTB as default for new PIDs
toradex: common: Decouple board sysinfo from the product ID table
toradex: tdx-cfg-block: Remove validation against PID table
toradex: tdx-cfg-block: Remove product ID limitation

 board/toradex/common/tdx-cfg-block.c        | 41 ++++------------------
 board/toradex/common/tdx-cfg-block.h        |  1 -
 board/toradex/common/tdx-common.c           | 53 ++++++++++++++++++++++-------
 board/toradex/common/tdx-common.h           |  7 ++++
 board/toradex/verdin-am62/verdin-am62.c     | 11 +++---
 board/toradex/verdin-am62p/verdin-am62p.c   | 32 -----------------
 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 12 +++----
 board/toradex/verdin-imx8mp/verdin-imx8mp.c | 12 +++----
 board/toradex/verdin-imx95/verdin-imx95.c   |  6 ++--
 configs/verdin-am62p_a53_defconfig          |  3 +-
 10 files changed, 73 insertions(+), 105 deletions(-)

---
base-commit: 36c377b9859ffb53eb1e39ea31e8d96d1e0fe1e5
change-id: 20260811-get-rid-pid4-table-1eca3797ebf3

Best regards,

Signature · 1 line
Franz Schnyder <[email protected]>
#1 lore raw

PATCH 1/8 toradex: verdin-am62: Set WiFI DTB as default for new PIDs

From: Franz Schnyder <[email protected]>

Currently, the Verdin AM62 uses the Toradex product ID table to determine whether the module is a WiFi or a non-WiFi one and sets the DTB accordingly.

In the progress of decoupling from the Toradex product PID table, use the WiFi DTB as the default for new PIDs.
This change is safe, as on non-WiFi modules this leaves the WiFi and BT devices unprobed. Further, the SDIO/UART signals are exposed to the edge connector on non-WiFi modules and can be used on the carrier. However, no Toradex carrier board makes use of these interfaces on the carrier and it can only be achieved with a customized board. For customized boards, it's expected to override the default selection by setting the 'fdtfile' env variable.

---
 board/toradex/verdin-am62/verdin-am62.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
board/toradex/verdin-am62/verdin-am62.c +5 -6
index 6d55638b44b..6e664f40b43 100644
@@ -74,18 +74,17 @@ static void select_dt_from_module_version(void)
 {
 	char variant[32];
 	char *env_variant = env_get("variant");
-	int is_wifi = 0;
+	bool is_wifi = true;
 
 	if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK)) {
 		/*
 		 * If we have a valid config block and it says we are a module with
 		 * Wi-Fi/Bluetooth make sure we use the -wifi device tree.
 		 */
-		is_wifi = (tdx_hw_tag.prodid == VERDIN_AM62Q_WIFI_BT_IT) ||
-			  (tdx_hw_tag.prodid == VERDIN_AM62S_512MB_WIFI_BT_IT) ||
-			  (tdx_hw_tag.prodid == VERDIN_AM62D_1G_WIFI_BT_IT) ||
-			  (tdx_hw_tag.prodid == VERDIN_AM62Q_2G_WIFI_BT_IT) ||
-			  (tdx_hw_tag.prodid == VERDIN_AM62D_1G_WIFI_BT_ET);
+		is_wifi = !((tdx_hw_tag.prodid == VERDIN_AM62S_512MB) ||
+			    (tdx_hw_tag.prodid == VERDIN_AM62D_1G_ET) ||
+			    (tdx_hw_tag.prodid == VERDIN_AM62D_1G_IT) ||
+			    (tdx_hw_tag.prodid == VERDIN_AM62D_1G_ET_GPU_NODSI));
 	}
 
 	if (is_wifi)
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/8 toradex: verdin-am62p: Set WiFi DTB as default for new PIDs

In reply to Franz Schnyder

From: Franz Schnyder <[email protected]>

Currently, the Verdin AM62P uses the Toradex product ID table to determine whether the module is a WiFi or a non-WiFi one and sets the DTB accordingly.

In the progress of decoupling from the Toradex product PID table, use the WiFi DTB as the default for new PIDs.
This change is safe, as on non-WiFi modules this leaves the WiFi and BT devices unprobed. Further, the SDIO/UART signals are exposed to the edge connector on non-WiFi modules and can be used on the carrier. However, no Toradex carrier board makes use of these interfaces on the carrier and it can only be achieved with a customized board. For customized boards, it's expected to override the default selection by setting the 'fdtfile' env variable.

Since there is only one Verdin AM62P PID, completely remove the PID based late selection.

---
 board/toradex/verdin-am62p/verdin-am62p.c | 32 -------------------------------
 configs/verdin-am62p_a53_defconfig        |  3 +--
 2 files changed, 1 insertion(+), 34 deletions(-)
board/toradex/verdin-am62p/verdin-am62p.c +0 -32
index 1e7fcc9fd9d..7c680b46c92 100644
@@ -103,38 +103,6 @@ void ft_board_setup_ex(void *blob, struct bd_info *bd)
 }
 #endif
 
-static void select_dt_from_module_version(void)
-{
-	char variant[32];
-	char *env_variant = env_get("variant");
-	int is_wifi = 0;
-
-	if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK)) {
-		/*
-		 * If we have a valid config block and it says we are a module with
-		 * Wi-Fi/Bluetooth make sure we use the -wifi device tree.
-		 */
-		is_wifi = (tdx_hw_tag.prodid == VERDIN_AM62PQ_2G_WIFI_BT_IT);
-	}
-
-	if (is_wifi)
-		strlcpy(&variant[0], "wifi", sizeof(variant));
-	else
-		strlcpy(&variant[0], "nonwifi", sizeof(variant));
-
-	if (!env_variant || strcmp(variant, env_variant)) {
-		printf("Setting variant to %s\n", variant);
-		env_set("variant", variant);
-	}
-}
-
-int board_late_init(void)
-{
-	select_dt_from_module_version();
-
-	return 0;
-}
-
 #if IS_ENABLED(CONFIG_XPL_BUILD)
 void spl_perform_board_fixups(struct spl_image_info *spl_image)
 {
configs/verdin-am62p_a53_defconfig +1 -2
index a397684dbd8..70a9f2389f4 100644
@@ -35,12 +35,11 @@ CONFIG_BOOTDELAY=1
 CONFIG_OF_BOARD_SETUP_EXTENDED=y
 CONFIG_BOOTCOMMAND="bootflow scan -b"
 CONFIG_USE_PREBOOT=y
-CONFIG_PREBOOT="test -n \"${fdtfile}\" || setenv fdtfile k3-am62p5-verdin-${variant}-${fdt_board}.dtb"
+CONFIG_PREBOOT="test -n \"${fdtfile}\" || setenv fdtfile k3-am62p5-verdin-wifi-${fdt_board}.dtb"
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 # CONFIG_BOARD_INIT is not set
-CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x80000
 CONFIG_SPL_SYS_REPORT_STACK_F_USAGE=y
 CONFIG_SPL_BOARD_INIT=y
Signature · 1 line
2.43.0
#3 lore raw

PATCH 3/8 toradex: verdin-imx95: Set WiFi DTB as default for new PIDs

In reply to Franz Schnyder

From: Franz Schnyder <[email protected]>

Currently, the Verdin iMX95 uses the Toradex product ID table to determine whether the module is a WiFi or a non-WiFi one and sets the DTB accordingly.

In the progress of decoupling from the Toradex product PID table, use the WiFi DTB as the default for new PIDs.
This change is safe, as on non-WiFi modules this leaves the WiFi and BT devices unprobed. Further, the SDIO/UART signals are exposed to the edge connector on non-WiFi modules and can be used on the carrier. However, no Toradex carrier board makes use of these interfaces on the carrier and it can only be achieved with a customized board. For customized boards, it's expected to override the default selection by setting the 'fdtfile' env variable.

---
 board/toradex/verdin-imx95/verdin-imx95.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
board/toradex/verdin-imx95/verdin-imx95.c +3 -3
index 7c0804c1d1c..2651d3dd871 100644
@@ -19,7 +19,7 @@ static void select_dt_from_module_version(void)
 {
 	char variant[32];
 	char *env_variant = env_get("variant");
-	bool is_wifi = false;
+	bool is_wifi = true;
 
 	if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK)) {
 		/*
@@ -27,8 +27,8 @@ static void select_dt_from_module_version(void)
 		 * module with Wi-Fi/Bluetooth make sure we use the -wifi
 		 * device tree.
 		 */
-		is_wifi = (tdx_hw_tag.prodid == VERDIN_IMX95H_8G_WIFI_BT_IT) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX95H_4G_WB_IT);
+		is_wifi = !((tdx_hw_tag.prodid == VERDIN_IMX95H_4G_ET) ||
+			    (tdx_hw_tag.prodid == VERDIN_IMX95H_16G_IT));
 	}
 
 	if (is_wifi)
Signature · 1 line
2.43.0
#4 lore raw

PATCH 4/8 toradex: verdin-imx8mp: Set WiFi DTB as default for new PIDs

In reply to Franz Schnyder

From: Franz Schnyder <[email protected]>

Currently, the Verdin iMX8MP uses the Toradex product ID table to determine whether the module is a WiFi or a non-WiFi one and sets the DTB accordingly.

In the progress of decoupling from the Toradex product PID table, use the WiFi DTB as the default for new PIDs.
This change is safe, as on non-WiFi modules this leaves the WiFi and BT devices unprobed. Further, the SDIO/UART signals are exposed to the edge connector on non-WiFi modules and can be used on the carrier. However, no Toradex carrier board makes use of these interfaces on the carrier and it can only be achieved with a customized board. For customized boards, it's expected to override the default selection by setting the 'fdtfile' env variable.

---
 board/toradex/verdin-imx8mp/verdin-imx8mp.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
board/toradex/verdin-imx8mp/verdin-imx8mp.c +5 -7
index 1209da593f8..343e56bf755 100644
@@ -69,19 +69,17 @@ static void select_dt_from_module_version(void)
 {
 	char variant[32];
 	char *env_variant = env_get("variant");
-	int is_wifi = 0;
+	bool is_wifi = true;
 
 	if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK)) {
 		/*
 		 * If we have a valid config block and it says we are a module with
 		 * Wi-Fi/Bluetooth make sure we use the -wifi device tree.
 		 */
-		is_wifi = (tdx_hw_tag.prodid == VERDIN_IMX8MPQ_WIFI_BT_IT) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX8MPQ_2GB_WIFI_BT_IT) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX8MPQ_8GB_WIFI_BT) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX8MPQ_8GB_WIFI_BT_IT) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX8MPQ_4GB_WIFI_BT_IT_64G) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX8MPQ_8GB_WIFI_BT_IT_64G);
+		is_wifi = !((tdx_hw_tag.prodid == VERDIN_IMX8MPQ) ||
+			    (tdx_hw_tag.prodid == VERDIN_IMX8MPQ_IT) ||
+			    (tdx_hw_tag.prodid == VERDIN_IMX8MPQL_IT) ||
+			    (tdx_hw_tag.prodid == VERDIN_IMX8MPQ_4GB_IT_64G));
 	}
 
 	if (is_wifi)
Signature · 1 line
2.43.0
#5 lore raw

PATCH 5/8 toradex: verdin-imx8mm: Set WiFi DTB as default for new PIDs

In reply to Franz Schnyder

From: Franz Schnyder <[email protected]>

Currently, the Verdin iMX8MM uses the Toradex product ID table to determine whether the module is a WiFi or a non-WiFi one and sets the DTB accordingly.

In the progress of decoupling from the Toradex product PID table, use the WiFi DTB as the default for new PIDs.
This change is safe, as on non-WiFi modules this leaves the WiFi and BT devices unprobed. Further, the SDIO/UART signals are exposed to the edge connector on non-WiFi modules and can be used on the carrier. However, no Toradex carrier board makes use of these interfaces on the carrier and it can only be achieved with a customized board. For customized boards, it's expected to override the default selection by setting the 'fdtfile' env variable.

---
 board/toradex/verdin-imx8mm/verdin-imx8mm.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
board/toradex/verdin-imx8mm/verdin-imx8mm.c +5 -7
index 4e308084968..93c26476081 100644
@@ -71,7 +71,7 @@ static void select_dt_from_module_version(void)
 {
 	char variant[32];
 	char *env_variant = env_get("variant");
-	int is_wifi = 0;
+	bool is_wifi = true;
 
 	if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK)) {
 		/*
@@ -79,12 +79,10 @@ static void select_dt_from_module_version(void)
 		 * module with Wi-Fi/Bluetooth make sure we use the -wifi
 		 * 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_IMX8MMQ_WIFI_BT_IT_NO_CAN) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_4G_WIFI_BT_ET) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_WB_IT_64G) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_2G_WIFI_BT_IT_64G);
+		is_wifi = !((tdx_hw_tag.prodid == VERDIN_IMX8MMDL) ||
+			    (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_IT) ||
+			    (tdx_hw_tag.prodid == VERDIN_IMX8MMDL_2G_IT) ||
+			    (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_2G_IT_NO_CAN));
 	}
 
 	switch (get_pcb_revision()) {
Signature · 1 line
2.43.0
#6 lore raw

PATCH 6/8 toradex: common: Decouple board sysinfo from the product ID table

In reply to Franz Schnyder

From: Franz Schnyder <[email protected]>

The sysinfo currently uses the Toradex product ID table to print a detailed board model string. With various new SoMs that are released by Toradex, the PID table grows and needs maintenance effort which can be avoided.

Rather than printing the board model based on the PID table, rely on the model property of the device tree and the data written to the config block during manufacturing, which already describes the HW correctly.

For example, the printed board model string will change from:
Model: Toradex 0075 Verdin AM62 Dual 1GB WB IT V1.2A Serial#: 15412798
and become:
Model: Toradex Verdin AM62 WB on Verdin Development Board Toradex SoM: 0075 V1.2A (00751200)
Serial#: 15412798

This removes detailed SKU information such as the number of cores, memory size, WB capability and temperature rating, but the PID4, PID8 and revision of the SoM are still printed. The detailed information of the SoM can still be looked up using the printed information on the official Toradex website.

Decouple board sysinfo from the Toradex product ID table, making the 0243 Aquila iMX95 the last entry being made to it.

---
 board/toradex/common/tdx-common.c | 53 +++++++++++++++++++++++++++++----------
 board/toradex/common/tdx-common.h |  7 ++++++
 2 files changed, 47 insertions(+), 13 deletions(-)
board/toradex/common/tdx-common.c +40 -13
index 81f7fa09002..2a8589f5e41 100644
@@ -104,8 +104,25 @@ __weak int print_bootinfo(void)
 
 int checkboard(void)
 {
-	if (valid_cfgblock)
-		printf("Serial#: %s\n", tdx_serial_str);
+	struct udevice *sysinfo;
+	int ret;
+
+	if (valid_cfgblock) {
+		char str[96], str2[96];
+
+		ret = sysinfo_get_and_detect(&sysinfo);
+		if (ret) {
+			log_debug("Failed to get sysinfo data: %d\n", ret);
+			return ret;
+		}
+
+		if (!sysinfo_get_str(sysinfo, SYSID_TDX_PID8, sizeof(str), str) &&
+		    !sysinfo_get_str(sysinfo, SYSID_TDX_BOARD_REV, sizeof(str2), str2))
+			printf("Toradex SoM: %s (%s)\n", str2, str);
+
+		if (!sysinfo_get_str(sysinfo, SYSID_TDX_SERIAL, sizeof(str), str))
+			printf("Serial#: %s\n", str);
+	}
 
 #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA
 	if (tdx_carrier_board_name)
@@ -202,23 +219,33 @@ static int tdx_detect(struct udevice *dev)
 
 static int tdx_get_str(struct udevice *dev, int id, size_t size, char *val)
 {
-	int ret = -ENOTSUPP;
-	int idx;
-
 	switch (id) {
 	case SYSID_BOARD_MODEL:
-		idx = get_toradex_modules_idx(tdx_hw_tag.prodid);
+		const char *model;
 
-		snprintf(val, size,
-			 "Toradex %04d %s %s",
-			 tdx_hw_tag.prodid,
-			 toradex_modules[idx].name,
-			 tdx_board_rev_str);
+		model = fdt_getprop(gd->fdt_blob, 0, "model", NULL);
+		if (!model)
+			return -ENODATA;
 
-		ret = 0;
+		strlcpy(val, model, size);
+		return 0;
+
+	case SYSID_TDX_BOARD_REV:
+		snprintf(val, size, "%04d %s", tdx_hw_tag.prodid, tdx_board_rev_str);
+		return 0;
+
+	case SYSID_TDX_PID8:
+		snprintf(val, size, "%04d%0d%0d%02d", tdx_hw_tag.prodid,
+			 tdx_hw_tag.ver_major, tdx_hw_tag.ver_minor,
+			 tdx_hw_tag.ver_assembly);
+		return 0;
+
+	case SYSID_TDX_SERIAL:
+		strlcpy(val, tdx_serial_str, size);
+		return 0;
 	}
 
-	return ret;
+	return -EOPNOTSUPP;
 }
 
 static const struct udevice_id sysinfo_tdx_ids[] = {
board/toradex/common/tdx-common.h +7 -0
index db3369a8f9e..7fb1cc8ecc8 100644
@@ -7,6 +7,7 @@
 #define _TDX_COMMON_H
 
 #include <asm-generic/u-boot.h>
+#include <sysinfo.h>
 
 #define TORADEX_USB_PRODUCT_NUM_OFFSET	0x4000
 #define TDX_USB_VID			0x1B67
@@ -14,4 +15,10 @@
 int ft_common_board_setup(void *blob, struct bd_info *bd);
 u32 get_board_revision(void);
 
+enum {
+	SYSID_TDX_BOARD_REV = SYSID_USER,
+	SYSID_TDX_PID8,
+	SYSID_TDX_SERIAL,
+};
+
 #endif /* _TDX_COMMON_H */
Signature · 1 line
2.43.0
#7 lore raw

PATCH 7/8 toradex: tdx-cfg-block: Remove validation against PID table

In reply to Franz Schnyder

From: Franz Schnyder <[email protected]>

As no new entries will be made to the Toradex product ID table, interactive config block creating should no longer depend on that table to accept a module ID.

Remove the interactive lookup against the product ID table and prompt directly for the module PID4 instead. Only check that the entered module ID does not exceed four digits.

---
 board/toradex/common/tdx-cfg-block.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)
board/toradex/common/tdx-cfg-block.c +6 -14
index 0b1798dc812..9ddb944fc42 100644
@@ -512,24 +512,16 @@ static int get_cfgblock_interactive(void)
 	int len = 0;
 	int ret = 0;
 	unsigned int prodid;
-	int i, idx;
 
-	printf("Enabled modules:\n");
-	for (i = 0; i < ARRAY_SIZE(toradex_modules); i++) {
-		if (toradex_modules[i].is_enabled)
-			printf(" %04d %s\n", toradex_modules[i].pid4,
-			       toradex_modules[i].name);
-	}
-
-	snprintf(message, sizeof(message), "Enter the module ID: ");
+	snprintf(message, sizeof(message), "Enter the module PID4: ");
 	len = cli_readline(message);
 
-	prodid = dectoul(console_buffer, NULL);
-	idx = get_toradex_modules_idx(prodid);
-	if (!toradex_modules[idx].pid4 || !toradex_modules[idx].is_enabled) {
-		printf("Parsing module id failed\n");
-		return -1;
+	if (len > 4) {
+		printf("Invalid module PID4. Too many digits\n");
+		return -EINVAL;
 	}
+
+	prodid = dectoul(console_buffer, NULL);
 	tdx_hw_tag.prodid = prodid;
 
 	len = 0;
Signature · 1 line
2.43.0
#8 lore raw

PATCH 8/8 toradex: tdx-cfg-block: Remove product ID limitation

In reply to Franz Schnyder

From: Franz Schnyder <[email protected]>

In the progress of decoupling from the Toradex product ID table, the implemented product ID limitation is now obsolete, as no new entries will be made to the table. Therefore, the implemented limitation logic needs to be removed, as otherwise new PID's written to the config block will be assigned as unknown.

This also means that get_toradex_modules_idx() is now obsolete and can be dropped.

---
 board/toradex/common/tdx-cfg-block.c | 21 +--------------------
 board/toradex/common/tdx-cfg-block.h |  1 -
 2 files changed, 1 insertion(+), 21 deletions(-)
board/toradex/common/tdx-cfg-block.c +1 -20
index 9ddb944fc42..f01f3ea68f8 100644
@@ -229,20 +229,6 @@ const u32 toradex_ouis[] = {
 	[1] = 0x8c06cbUL,
 };
 
-int get_toradex_modules_idx(int pid4)
-{
-	int i, index = 0;
-
-	for (i = 1; i < ARRAY_SIZE(toradex_modules); i++) {
-		if (pid4 == toradex_modules[i].pid4) {
-			index = i;
-			break;
-		}
-	}
-
-	return index;
-}
-
 const char * const get_toradex_carrier_boards(int pid4)
 {
 	int i, index = 0;
@@ -416,7 +402,7 @@ static int write_tdx_cfg_block_to_eeprom(unsigned char *config_block)
 
 int read_tdx_cfg_block(void)
 {
-	int idx, ret = 0;
+	int ret = 0;
 	u8 *config_block = NULL;
 	struct toradex_tag *tag;
 	size_t size = TDX_CFG_BLOCK_MAX_SIZE;
@@ -484,11 +470,6 @@ int read_tdx_cfg_block(void)
 		offset += tag->len * 4;
 	}
 
-	/* Cap product id to avoid issues with a yet unknown one */
-	idx = get_toradex_modules_idx(tdx_hw_tag.prodid);
-	if (!toradex_modules[idx].pid4)
-		tdx_hw_tag.prodid = 0;
-
 out:
 	free(config_block);
 	return ret;
board/toradex/common/tdx-cfg-block.h +0 -1
index 32305c61c83..c712fad30ac 100644
@@ -188,7 +188,6 @@ extern u32 tdx_car_serial;
 
 int read_tdx_cfg_block(void);
 int read_tdx_cfg_block_carrier(void);
-int get_toradex_modules_idx(int pid4);
 const char * const get_toradex_carrier_boards(int pid4);
 const char * const get_toradex_display_adapters(int pid4);
 int try_migrate_tdx_cfg_block_carrier(void);
Signature · 1 line
2.43.0
Reviewed-by on the v1 series
#9 lore raw
In reply to Franz Schnyder
Quoted 9 lines · Franz Schnyder

The sysinfo currently uses the Toradex product ID table to print a detailed board model string. With various new SoMs that are released by Toradex, the PID table grows and needs maintenance effort which can be avoided.

Rather than printing the board model based on the PID table, rely on the model property of the device tree and the data written to the config block during manufacturing, which already describes the HW correctly.

Quoted 7 lines

For example, the printed board model string will change from:
Model: Toradex 0075 Verdin AM62 Dual 1GB WB IT V1.2A Serial#: 15412798
and become:
Model: Toradex Verdin AM62 WB on Verdin Development Board Toradex SoM: 0075 V1.2A (00751200)
Serial#: 15412798

#10 lore raw
In reply to Franz Schnyder
Quoted 10 lines · Franz Schnyder

The sysinfo currently uses the Toradex product ID table to print a detailed board model string. With various new SoMs that are released by Toradex, the PID table grows and needs maintenance effort which can be avoided.

Rather than printing the board model based on the PID table, rely on the model property of the device tree and the data written to the config block during manufacturing, which already describes the HW correctly.

[...]

Applied to u-boot/next, thanks!

[1/8] toradex: verdin-am62: Set WiFI DTB as default for new PIDs

      commit: 83a35efca58c12b2f7686970b42071cd7c1a720f
[2/8] toradex: verdin-am62p: Set WiFi DTB as default for new PIDs
      commit: 54efe43bf87398996574fd49bcff837f464c4b9b
[3/8] toradex: verdin-imx95: Set WiFi DTB as default for new PIDs
      commit: 951f0d802a9b6896079119430e967671a2bcaf55
[4/8] toradex: verdin-imx8mp: Set WiFi DTB as default for new PIDs
      commit: 330d967aab8dea0c22030036ba0017759f45886c
[5/8] toradex: verdin-imx8mm: Set WiFi DTB as default for new PIDs
      commit: 0d95b64ceb466f85ce5c72e6513e79cf3cab936b
[6/8] toradex: common: Decouple board sysinfo from the product ID table
      commit: c19981ab9acb50c987211b1f28c3fb9681a85bed
[7/8] toradex: tdx-cfg-block: Remove validation against PID table
      commit: 073d55b2ad7900c31d039cda70ef1fb1292a6593
[8/8] toradex: tdx-cfg-block: Remove product ID limitation
      commit: 7239c5a6b5e4d24803b4a71ad8c0402a5de75f55
Signature · 1 line
Tom