Skip to contentSkip to conversation

toradex: fix reset and hardware detection regressions

PATCH Superseded Francesco Dolcini 5 participants 17 messages Feb 20, 2024 – Feb 23, 2024

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover toradex: fix reset and hardware detection regressions

From: Francesco Dolcini <[email protected]>

This series fixes two regressions affecting multiple Toradex boards (i.MX, TI and TEGRA based) and targets the current master, e.g. v2024.04 release.

U-Boot reset command is broken on all Tordex i.MX6* based SoMs since v2023.07, this series fixes it enabling the wdt-reboot driver.

Since v2024.04-rc1 reading the Toradex configuration block is not working properly anymore, the serial number and the hardware version are not read correctly, preventing the board from functioning correctly (wrong mac address, wrong DT, ...). This is fixed by reading the config block in EVT_SETTINGS_R and adding a toradex sysinfo driver. In addition to that, we now use a random mac address in case the config block is invalid.

Emanuele Ghidoli (6):
toradex: Fix recursive call to checkboard
toradex: Remove not necessary model prints from checkboard()
toradex: common: Use SETTINGS_R event to read toradex config block
arm: dts: Refactor device trees using "&{/aliases}" syntax
toradex: common: Add sysinfo driver
toradex: common: Use random mac address if toradex config block is
missing

Parth Pancholi (1):
toradex: imx6*: fix reset using wdt-reboot driver

 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |   6 +
 arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |   6 +
 .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  28 +++-
 arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  36 +++--
 .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  14 ++
 .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  14 +-
 .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  16 +-
 .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  16 +-
 .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |   4 +
 arch/arm/dts/tegra124-apalis-u-boot.dtsi      |  12 ++
 arch/arm/dts/tegra20-colibri-u-boot.dtsi      |  12 ++
 arch/arm/dts/tegra30-apalis-u-boot.dtsi       |  12 ++
 arch/arm/dts/tegra30-colibri-u-boot.dtsi      |  12 ++
 .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |   4 +
 board/toradex/apalis-imx8/apalis-imx8.c       |  10 --
 board/toradex/apalis-tk1/apalis-tk1.c         |   7 -
 board/toradex/apalis_imx6/apalis_imx6.c       |  21 ---
 board/toradex/apalis_t30/apalis_t30.c         |   8 -
 .../toradex/colibri-imx6ull/colibri-imx6ull.c |   7 -
 board/toradex/colibri-imx8x/colibri-imx8x.c   |  10 --
 board/toradex/colibri_imx6/colibri_imx6.c     |  20 ---
 board/toradex/colibri_imx7/colibri_imx7.c     |   8 -
 board/toradex/colibri_t20/colibri_t20.c       |  10 --
 board/toradex/colibri_t30/colibri_t30.c       |   7 -
 board/toradex/colibri_vf/colibri_vf.c         |  10 --
 board/toradex/common/Kconfig                  |   1 +
 board/toradex/common/tdx-common.c             | 137 +++++++++++++-----
 board/toradex/common/tdx-common.h             |   1 -
 configs/apalis-imx8_defconfig                 |   1 +
 configs/apalis-tk1_defconfig                  |   1 +
 configs/apalis_imx6_defconfig                 |   4 +
 configs/apalis_t30_defconfig                  |   1 +
 configs/colibri-imx6ull-emmc_defconfig        |   4 +
 configs/colibri-imx6ull_defconfig             |   4 +
 configs/colibri-imx8x_defconfig               |   1 +
 configs/colibri_imx6_defconfig                |   4 +
 configs/colibri_imx7_defconfig                |   1 +
 configs/colibri_imx7_emmc_defconfig           |   1 +
 configs/colibri_t20_defconfig                 |   1 +
 configs/colibri_t30_defconfig                 |   1 +
 configs/colibri_vf_defconfig                  |   1 +
 configs/verdin-am62_a53_defconfig             |   1 +
 configs/verdin-am62_r5_defconfig              |   1 +
 configs/verdin-imx8mm_defconfig               |   1 +
 configs/verdin-imx8mp_defconfig               |   1 +
 45 files changed, 284 insertions(+), 194 deletions(-)
 create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/7 toradex: Fix recursive call to checkboard

From: Emanuele Ghidoli <[email protected]>

Since checkboard() is used instead of show_board_info(), in case toradex config block is missing or malformed, checkboard is recursively called. It prints a long list of "MISSING TORADEX CONFIG BLOCK" till the stack is full.

Fixes edb0ecd18708 ("toradex: Use checkboard() instead of show_board_info()")
---
 board/toradex/common/tdx-common.c | 1 -
 1 file changed, 1 deletion(-)
board/toradex/common/tdx-common.c +0 -1
index ed8f0a6a4756..ddc4a175da68 100644
@@ -103,7 +103,6 @@ int tdx_checkboard(void)
 	if (read_tdx_cfg_block()) {
 		printf("MISSING TORADEX CONFIG BLOCK\n");
 		get_mac_from_serial(tdx_serial, &tdx_eth_addr);
-		checkboard();
 	} else {
 		snprintf(tdx_serial_str, sizeof(tdx_serial_str),
 			 "%08u", tdx_serial);
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/7 toradex: Remove not necessary model prints from checkboard()

In reply to Francesco Dolcini

From: Emanuele Ghidoli <[email protected]>

Sysinfo prints the model obtained from device tree, checkboard() take info from hardware and tdx_checkboard() use the model retrieved by toradex config block.

Remove the print from checkboard() function because the model obtained from toradex config block is the most complete.
If toradex config block is missing the model info from device tree is enough.

---
 board/toradex/apalis-imx8/apalis-imx8.c       | 10 ---------
 board/toradex/apalis-tk1/apalis-tk1.c         |  7 -------
 board/toradex/apalis_imx6/apalis_imx6.c       | 21 -------------------
 board/toradex/apalis_t30/apalis_t30.c         |  8 -------
 .../toradex/colibri-imx6ull/colibri-imx6ull.c |  7 -------
 board/toradex/colibri-imx8x/colibri-imx8x.c   | 10 ---------
 board/toradex/colibri_imx6/colibri_imx6.c     | 20 ------------------
 board/toradex/colibri_imx7/colibri_imx7.c     |  8 -------
 board/toradex/colibri_t20/colibri_t20.c       | 10 ---------
 board/toradex/colibri_t30/colibri_t30.c       |  7 -------
 board/toradex/colibri_vf/colibri_vf.c         | 10 ---------
 board/toradex/common/tdx-common.c             |  9 +++++++-
 board/toradex/common/tdx-common.h             |  1 -
 13 files changed, 8 insertions(+), 120 deletions(-)
board/toradex/apalis-imx8/apalis-imx8.c +0 -10
index b351ce64abfc..2483a63c6733 100644
@@ -208,16 +208,6 @@ void board_preboot_os(void)
 	gpio_direction_output(BKL1_GPIO, 0);
 }
 
-int checkboard(void)
-{
-	puts("Model: Toradex Apalis iMX8\n");
-
-	build_info();
-	print_bootinfo();
-
-	return tdx_checkboard();
-}
-
 static enum pcb_rev_t get_pcb_revision(void)
 {
 	unsigned int pcb_vers = 0;
board/toradex/apalis-tk1/apalis-tk1.c +0 -7
index 79a1c92da0a0..ee87d9f4145f 100644
@@ -91,13 +91,6 @@ int arch_misc_init(void)
 	return 0;
 }
 
-int checkboard(void)
-{
-	puts("Model: Toradex Apalis TK1 2GB\n");
-
-	return tdx_checkboard();
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
board/toradex/apalis_imx6/apalis_imx6.c +0 -21
index 164fcc41f550..0da245374a0d 100644
@@ -716,27 +716,6 @@ int board_late_init(void)
 }
 #endif /* CONFIG_BOARD_LATE_INIT */
 
-int checkboard(void)
-{
-	char it[] = " IT";
-	int minc, maxc;
-
-	switch (get_cpu_temp_grade(&minc, &maxc)) {
-	case TEMP_AUTOMOTIVE:
-	case TEMP_INDUSTRIAL:
-		break;
-	case TEMP_EXTCOMMERCIAL:
-	default:
-		it[0] = 0;
-	};
-	printf("Model: Toradex Apalis iMX6 %s %s%s\n",
-	       is_cpu_type(MXC_CPU_MX6D) ? "Dual" : "Quad",
-	       (gd->ram_size == 0x80000000) ? "2GB" :
-	       (gd->ram_size == 0x40000000) ? "1GB" : "512MB", it);
-
-	return tdx_checkboard();
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
board/toradex/apalis_t30/apalis_t30.c +0 -8
index b9a2af33f19f..b10beb447965 100644
@@ -45,14 +45,6 @@ int arch_misc_init(void)
 	return 0;
 }
 
-int checkboard(void)
-{
-	printf("Model: Toradex Apalis T30 %dGB\n",
-	       (gd->ram_size == 0x40000000) ? 1 : 2);
-
-	return tdx_checkboard();
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
board/toradex/colibri-imx6ull/colibri-imx6ull.c +0 -7
index a775f54eb3f4..9b9fb342c9d9 100644
@@ -205,13 +205,6 @@ int board_late_init(void)
 	return 0;
 }
 
-int checkboard(void)
-{
-	printf("Model: Toradex Colibri iMX6ULL\n");
-
-	return tdx_checkboard();
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
board/toradex/colibri-imx8x/colibri-imx8x.c +0 -10
index d8cc72f323c5..2c673a4a6b06 100644
@@ -114,16 +114,6 @@ int board_phy_config(struct phy_device *phydev)
 }
 #endif
 
-int checkboard(void)
-{
-	puts("Model: Toradex Colibri iMX8X\n");
-
-	build_info();
-	print_bootinfo();
-
-	return tdx_checkboard();
-}
-
 static void select_dt_from_module_version(void)
 {
 	/*
board/toradex/colibri_imx6/colibri_imx6.c +0 -20
index 784ca7f65f7b..ce19a9c79752 100644
@@ -636,26 +636,6 @@ int board_late_init(void)
 }
 #endif /* CONFIG_BOARD_LATE_INIT */
 
-int checkboard(void)
-{
-	char it[] = " IT";
-	int minc, maxc;
-
-	switch (get_cpu_temp_grade(&minc, &maxc)) {
-	case TEMP_AUTOMOTIVE:
-	case TEMP_INDUSTRIAL:
-		break;
-	case TEMP_EXTCOMMERCIAL:
-	default:
-		it[0] = 0;
-	};
-	printf("Model: Toradex Colibri iMX6 %s %sMB%s\n",
-	       is_cpu_type(MXC_CPU_MX6DL) ? "DualLite" : "Solo",
-	       (gd->ram_size == 0x20000000) ? "512" : "256", it);
-
-	return tdx_checkboard();
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
board/toradex/colibri_imx7/colibri_imx7.c +0 -8
index 2e5b02f72675..c37c5e0af6d9 100644
@@ -273,14 +273,6 @@ void reset_cpu(void)
 }
 #endif
 
-int checkboard(void)
-{
-	printf("Model: Toradex Colibri iMX7%c\n",
-	       is_cpu_type(MXC_CPU_MX7D) ? 'D' : 'S');
-
-	return tdx_checkboard();
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
board/toradex/colibri_t20/colibri_t20.c +0 -10
index 5861cf7dc93e..97e33d00f0d6 100644
@@ -70,16 +70,6 @@ int arch_misc_init(void)
 	return 0;
 }
 
-int checkboard(void)
-{
-	printf("Model: Toradex Colibri T20 %dMB V%s\n",
-	       (gd->ram_size == 0x10000000) ? 256 : 512,
-	       (get_nand_dev_by_index(0)->erasesize >> 10 == 512) ?
-	       ((gd->ram_size == 0x10000000) ? "1.1B" : "1.1C") : "1.2A");
-
-	return tdx_checkboard();
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
board/toradex/colibri_t30/colibri_t30.c +0 -7
index 8cef098c8e59..0da247de98f9 100644
@@ -28,13 +28,6 @@ int arch_misc_init(void)
 	return 0;
 }
 
-int checkboard(void)
-{
-	puts("Model: Toradex Colibri T30 1GB\n");
-
-	return tdx_checkboard();
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
board/toradex/colibri_vf/colibri_vf.c +0 -10
index af9f2d379cf4..35920008805f 100644
@@ -366,16 +366,6 @@ int board_init(void)
 	return 0;
 }
 
-int checkboard(void)
-{
-	if (is_colibri_vf61())
-		puts("Model: Toradex Colibri VF61\n");
-	else
-		puts("Model: Toradex Colibri VF50\n");
-
-	return tdx_checkboard();
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
board/toradex/common/tdx-common.c +8 -1
index ddc4a175da68..cdf645b14177 100644
@@ -96,7 +96,12 @@ static const char *get_board_assembly(u16 ver_assembly)
 	return ver_name;
 }
 
-int tdx_checkboard(void)
+__weak int print_bootinfo(void)
+{
+	return 0;
+}
+
+int checkboard(void)
 {
 	unsigned char ethaddr[6];
 
@@ -144,6 +149,8 @@ int tdx_checkboard(void)
 #endif
 	}
 
+	print_bootinfo();
+
 	/*
 	 * Check if environment contains a valid MAC address,
 	 * set the one from config block if not
board/toradex/common/tdx-common.h +0 -1
index 44234dc49cd7..d446e9f1d5ca 100644
@@ -11,6 +11,5 @@
 
 int ft_common_board_setup(void *blob, struct bd_info *bd);
 u32 get_board_revision(void);
-int tdx_checkboard(void);
 
 #endif /* _TDX_COMMON_H */
Signature · 1 line
2.39.2
#3 lore raw

PATCH 3/7 toradex: common: Use SETTINGS_R event to read toradex config block

In reply to Francesco Dolcini

From: Emanuele Ghidoli <[email protected]>

Use SETTINGS_R event to read toradex config block and checkboard() to print board info.

---
 board/toradex/common/tdx-common.c | 92 ++++++++++++++++++-------------
 1 file changed, 54 insertions(+), 38 deletions(-)
board/toradex/common/tdx-common.c +54 -38
index cdf645b14177..6084436b48b4 100644
@@ -103,54 +103,69 @@ __weak int print_bootinfo(void)
 
 int checkboard(void)
 {
-	unsigned char ethaddr[6];
-
-	if (read_tdx_cfg_block()) {
-		printf("MISSING TORADEX CONFIG BLOCK\n");
-		get_mac_from_serial(tdx_serial, &tdx_eth_addr);
-	} else {
-		snprintf(tdx_serial_str, sizeof(tdx_serial_str),
-			 "%08u", tdx_serial);
-		snprintf(tdx_board_rev_str, sizeof(tdx_board_rev_str),
-			 "V%1d.%1d%s",
-			 tdx_hw_tag.ver_major,
-			 tdx_hw_tag.ver_minor,
-			 get_board_assembly(tdx_hw_tag.ver_assembly));
-
-		env_set("serial#", tdx_serial_str);
-
+	if (valid_cfgblock) {
 		printf("Model: Toradex %04d %s %s\n",
 		       tdx_hw_tag.prodid,
 		       toradex_modules[tdx_hw_tag.prodid].name,
 		       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");
-			try_migrate_tdx_cfg_block_carrier();
-		} else {
-			tdx_carrier_board_name =
-				get_toradex_carrier_boards(tdx_car_hw_tag.prodid);
-
-			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%s",
-				 tdx_car_hw_tag.ver_major,
-				 tdx_car_hw_tag.ver_minor,
-				 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",
-			       tdx_carrier_board_name,
-			       tdx_car_rev_str,
-			       tdx_car_serial_str);
-		}
+	if (tdx_carrier_board_name)
+		printf("Carrier: Toradex %s %s, Serial# %s\n",
+		       tdx_carrier_board_name,
+		       tdx_car_rev_str,
+		       tdx_car_serial_str);
 #endif
-	}
 
 	print_bootinfo();
 
+	return 0;
+}
+
+static int settings_r(void)
+{
+	unsigned char ethaddr[6];
+
+	if (read_tdx_cfg_block()) {
+		printf("MISSING TORADEX CONFIG BLOCK\n");
+		get_mac_from_serial(tdx_serial, &tdx_eth_addr);
+
+		/* Board can run even if config block is not present */
+		return 0;
+	}
+
+	snprintf(tdx_serial_str, sizeof(tdx_serial_str),
+		 "%08u", tdx_serial);
+	snprintf(tdx_board_rev_str, sizeof(tdx_board_rev_str),
+		 "V%1d.%1d%s",
+		 tdx_hw_tag.ver_major,
+		 tdx_hw_tag.ver_minor,
+		 get_board_assembly(tdx_hw_tag.ver_assembly));
+
+	env_set("serial#", tdx_serial_str);
+
+#ifdef CONFIG_TDX_CFG_BLOCK_EXTRA
+	if (read_tdx_cfg_block_carrier()) {
+		printf("MISSING TORADEX CARRIER CONFIG BLOCKS\n");
+		try_migrate_tdx_cfg_block_carrier();
+	} else {
+		tdx_carrier_board_name =
+			get_toradex_carrier_boards(tdx_car_hw_tag.prodid);
+
+		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%s",
+			 tdx_car_hw_tag.ver_major,
+			 tdx_car_hw_tag.ver_minor,
+			 get_board_assembly(tdx_car_hw_tag.ver_assembly));
+
+		env_set("carrier_serial#", tdx_car_serial_str);
+	}
+#endif
+
 	/*
 	 * Check if environment contains a valid MAC address,
 	 * set the one from config block if not
@@ -171,6 +186,7 @@ int checkboard(void)
 
 	return 0;
 }
+EVENT_SPY_SIMPLE(EVT_SETTINGS_R, settings_r);
 
 #ifdef CONFIG_TDX_CFG_BLOCK_USB_GADGET_PID
 int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
Signature · 1 line
2.39.2
#4 lore raw

PATCH 4/7 arm: dts: Refactor device trees using "&{/aliases}" syntax

In reply to Francesco Dolcini

From: Emanuele Ghidoli <[email protected]>

Use the common syntax to define aliases.

---
 .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    | 18 ++++++++-----
 arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    | 26 ++++++++++---------
 .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi | 10 ++++---
 .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    | 12 ++++-----
 .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    | 12 ++++-----
 5 files changed, 43 insertions(+), 35 deletions(-)
arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi +11 -7
index 31f3a48dd9f0..0eea4d1862ae 100644
@@ -5,13 +5,17 @@
 
 #include "imx6qdl-u-boot.dtsi"
 
-&{/aliases} {
-	/* U-Boot won't find PMIC otherwise */
-	i2c0 = &i2c3;
-	i2c1 = &i2c2;
-	/* SDHCI instance order: eMMC, 4-bit SD/MMC (U-Boot won't find ConfigBlock otherwise) */
-	mmc0 = &usdhc3;
-	mmc1 = &usdhc1;
+/ {
+	aliases {
+		/* U-Boot won't find PMIC otherwise */
+		i2c0 = &i2c3;
+		i2c1 = &i2c2;
+		/* SDHCI instance order: eMMC, 4-bit SD/MMC
+		 * (U-Boot won't find ConfigBlock otherwise)
+		 */
+		mmc0 = &usdhc3;
+		mmc1 = &usdhc1;
+	};
 };
 
 &wdog1 {
arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi +14 -12
index 3d19796cb698..3c6e503d043b 100644
@@ -5,18 +5,20 @@
 
 #include "imx6qdl-u-boot.dtsi"
 
-&{/aliases} {
-	/* U-Boot won't find PMIC otherwise */
-	i2c0 = &i2c1;
-	i2c1 = &i2c2;
-	i2c2 = &i2c3;
-	/*
-	 * SDHCI instance order: eMMC, 8-bit SD/MMC, 4-bit SD
-	 * (U-Boot won't find ConfigBlock otherwise)
-	 */
-	mmc0 = &usdhc3;
-	mmc1 = &usdhc1;
-	mmc2 = &usdhc2;
+/ {
+	aliases {
+		/* U-Boot won't find PMIC otherwise */
+		i2c0 = &i2c1;
+		i2c1 = &i2c2;
+		i2c2 = &i2c3;
+		/*
+		 * SDHCI instance order: eMMC, 8-bit SD/MMC, 4-bit SD
+		 * (U-Boot won't find ConfigBlock otherwise)
+		 */
+		mmc0 = &usdhc3;
+		mmc1 = &usdhc1;
+		mmc2 = &usdhc2;
+	};
 };
 
 &wdog1 {
arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi +6 -4
index 57ca28edb70d..b2c12a413daf 100644
@@ -5,10 +5,12 @@
 
 #include "imx7s-u-boot.dtsi"
 
-&{/aliases} {
-	/* SDHCI instance order: eMMC, SD/MMC */
-	mmc0 = &usdhc3;
-	mmc1 = &usdhc1;
+/ {
+	aliases {
+		/* SDHCI instance order: eMMC, SD/MMC */
+		mmc0 = &usdhc3;
+		mmc1 = &usdhc1;
+	};
 };
 
 &lcdif {
arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi +6 -6
index 8efa4ddc734a..515f195ab759 100644
@@ -6,6 +6,12 @@
 #include "imx8mm-u-boot.dtsi"
 
 / {
+	aliases {
+		eeprom0 = &eeprom_module;
+		eeprom1 = &eeprom_carrier_board;
+		eeprom2 = &eeprom_display_adapter;
+	};
+
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		bootph-pre-ram;
@@ -13,12 +19,6 @@
 	};
 };
 
-&{/aliases} {
-	eeprom0 = &eeprom_module;
-	eeprom1 = &eeprom_carrier_board;
-	eeprom2 = &eeprom_display_adapter;
-};
-
 &{/soc@0/bus@30800000/i2c@30a20000/pmic@25} {
 	bootph-pre-ram;
 };
arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi +6 -6
index 2a1aa1935a76..67f1d45ce269 100644
@@ -6,6 +6,12 @@
 #include "imx8mp-u-boot.dtsi"
 
 / {
+	aliases {
+		eeprom0 = &eeprom_module;
+		eeprom1 = &eeprom_carrier_board;
+		eeprom2 = &eeprom_display_adapter;
+	};
+
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		bootph-pre-ram;
@@ -13,12 +19,6 @@
 	};
 };
 
-&{/aliases} {
-	eeprom0 = &eeprom_module;
-	eeprom1 = &eeprom_carrier_board;
-	eeprom2 = &eeprom_display_adapter;
-};
-
 &clk {
 	bootph-all;
 	bootph-pre-ram;
Signature · 1 line
2.39.2
#5 lore raw

PATCH 5/7 toradex: common: Add sysinfo driver

In reply to Francesco Dolcini

From: Emanuele Ghidoli <[email protected]>

This commit introduces support for the Toradex sysinfo driver in U-Boot, which uses information from Toradex config block to print correct board model.
In case the Toradex config block is not present sysinfo prints the model of the board provided by device tree removing per board specific prints.

---
 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |  6 +++
 arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |  6 +++
 .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  4 ++
 arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  4 ++
 .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  4 ++
 .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  4 ++
 .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  4 ++
 .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  4 ++
 .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  4 ++
 arch/arm/dts/tegra124-apalis-u-boot.dtsi      | 12 +++++
 arch/arm/dts/tegra20-colibri-u-boot.dtsi      | 12 +++++
 arch/arm/dts/tegra30-apalis-u-boot.dtsi       | 12 +++++
 arch/arm/dts/tegra30-colibri-u-boot.dtsi      | 12 +++++
 .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |  4 ++
 board/toradex/common/Kconfig                  |  1 +
 board/toradex/common/tdx-common.c             | 50 ++++++++++++++++---
 16 files changed, 136 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi
arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi +6 -0
index c54a59e89c5d..d73be74d2112 100644
@@ -3,6 +3,12 @@
  * Copyright 2019 Toradex AG
  */
 
+/ {
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
+};
+
 &mu {
 	bootph-some-ram;
 };
arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi +6 -0
index 6ab6b1f9ee69..60c4cd6fc01f 100644
@@ -3,6 +3,12 @@
  * Copyright 2019 Toradex AG
  */
 
+/ {
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
+};
+
 &{/imx8qx-pm} {
 
 	bootph-some-ram;
arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi +4 -0
index 0eea4d1862ae..5a91d0aca204 100644
@@ -16,6 +16,10 @@
 		mmc0 = &usdhc3;
 		mmc1 = &usdhc1;
 	};
+
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
 };
 
 &wdog1 {
arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi +4 -0
index 3c6e503d043b..59412635420a 100644
@@ -19,6 +19,10 @@
 		mmc1 = &usdhc1;
 		mmc2 = &usdhc2;
 	};
+
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
 };
 
 &wdog1 {
arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi +4 -0
index 6823b42d4514..731814216e1f 100644
@@ -9,6 +9,10 @@
 		usb0 = &usbotg1; /* required for ums */
 		display0 = &lcdif;
 	};
+
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
 };
 
 &pinctrl_uart1 {
arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi +4 -0
index b2c12a413daf..68142769d360 100644
@@ -11,6 +11,10 @@
 		mmc0 = &usdhc3;
 		mmc1 = &usdhc1;
 	};
+
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
 };
 
 &lcdif {
arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi +4 -0
index 515f195ab759..38db56059d69 100644
@@ -12,6 +12,10 @@
 		eeprom2 = &eeprom_display_adapter;
 	};
 
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
+
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		bootph-pre-ram;
arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi +4 -0
index 67f1d45ce269..03f211d5f7d3 100644
@@ -12,6 +12,10 @@
 		eeprom2 = &eeprom_display_adapter;
 	};
 
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
+
 	wdt-reboot {
 		compatible = "wdt-reboot";
 		bootph-pre-ram;
arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi +4 -0
index 02f34c90c6d7..28b697b67ae0 100644
@@ -19,6 +19,10 @@
 	memory@80000000 {
 		bootph-all;
 	};
+
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
 };
 
 &main_timer0 {
arch/arm/dts/tegra124-apalis-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..a3614d279439
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra124-u-boot.dtsi"
+
+/ {
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
+};
arch/arm/dts/tegra20-colibri-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..d4a669a288d8
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra20-u-boot.dtsi"
+
+/ {
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
+};
arch/arm/dts/tegra30-apalis-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..37cbfbcc3506
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra30-u-boot.dtsi"
+
+/ {
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
+};
arch/arm/dts/tegra30-colibri-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..37cbfbcc3506
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra30-u-boot.dtsi"
+
+/ {
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
+};
arch/arm/dts/vf610-colibri-eval-v3-u-boot.dtsi +4 -0
index 572d40877ef9..8c3b86c201fa 100644
@@ -7,6 +7,10 @@
 	soc {
 		bootph-all;
 	};
+
+	sysinfo {
+		compatible = "toradex,sysinfo";
+	};
 };
 
 &aips0 {
board/toradex/common/Kconfig +1 -0
index 1f6a5e4db561..b85893ab44e4 100644
@@ -4,6 +4,7 @@
 menuconfig TDX_CFG_BLOCK
 	bool "Enable Toradex config block support"
 	select OF_BOARD_SETUP
+	select SYSINFO
 	help
 	  The Toradex config block stored production data on the on-module
 	  flash device (NAND, NOR or eMMC). The area is normally preserved by
board/toradex/common/tdx-common.c +43 -7

77 lines not on this page · raw message

Signature · 1 line
2.39.2
#6 lore raw

Re: [PATCH v1 5/7] toradex: common: Add sysinfo driver

вт, 20 лют. 2024 р. о 20:29 Francesco Dolcini <[email protected]> пише:

Quoted 25 lines

From: Emanuele Ghidoli <[email protected]>

This commit introduces support for the Toradex sysinfo driver in U-Boot, which uses information from Toradex config block to print correct board model.
In case the Toradex config block is not present sysinfo prints the model of the board provided by device tree removing per board specific prints.

---
 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |  6 +++
 arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |  6 +++
 .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  4 ++
 arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  4 ++
 .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  4 ++
 .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  4 ++
 .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  4 ++
 .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  4 ++
 .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  4 ++
 arch/arm/dts/tegra124-apalis-u-boot.dtsi      | 12 +++++
 arch/arm/dts/tegra20-colibri-u-boot.dtsi      | 12 +++++
 arch/arm/dts/tegra30-apalis-u-boot.dtsi       | 12 +++++
 arch/arm/dts/tegra30-colibri-u-boot.dtsi      | 12 +++++
Quoted 9 lines
 .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |  4 ++
 board/toradex/common/Kconfig                  |  1 +
 board/toradex/common/tdx-common.c             | 50 ++++++++++++++++---
 16 files changed, 136 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi

Greetings! Thank you for contribution but may you at split patches according to SoC vendor at least? For imx, tegra and ti since it would be hard to both review and pick them to correct custodian trees.

Quoted 325 lines
arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi +6 -0
index c54a59e89c5d..d73be74d2112 100644
@@ -3,6 +3,12 @@
  * Copyright 2019 Toradex AG
  */
 
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
+
 &mu {
        bootph-some-ram;
 };
arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi +6 -0
index 6ab6b1f9ee69..60c4cd6fc01f 100644
@@ -3,6 +3,12 @@
  * Copyright 2019 Toradex AG
  */
 
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
+
 &{/imx8qx-pm} {
 
        bootph-some-ram;
arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi +4 -0
index 0eea4d1862ae..5a91d0aca204 100644
@@ -16,6 +16,10 @@
                mmc0 = &usdhc3;
                mmc1 = &usdhc1;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &wdog1 {
arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi +4 -0
index 3c6e503d043b..59412635420a 100644
@@ -19,6 +19,10 @@
                mmc1 = &usdhc1;
                mmc2 = &usdhc2;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &wdog1 {
arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi +4 -0
index 6823b42d4514..731814216e1f 100644
@@ -9,6 +9,10 @@
                usb0 = &usbotg1; /* required for ums */
                display0 = &lcdif;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &pinctrl_uart1 {
arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi +4 -0
index b2c12a413daf..68142769d360 100644
@@ -11,6 +11,10 @@
                mmc0 = &usdhc3;
                mmc1 = &usdhc1;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &lcdif {
arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi +4 -0
index 515f195ab759..38db56059d69 100644
@@ -12,6 +12,10 @@
                eeprom2 = &eeprom_display_adapter;
        };
 
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+
        wdt-reboot {
                compatible = "wdt-reboot";
                bootph-pre-ram;
arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi +4 -0
index 67f1d45ce269..03f211d5f7d3 100644
@@ -12,6 +12,10 @@
                eeprom2 = &eeprom_display_adapter;
        };
 
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+
        wdt-reboot {
                compatible = "wdt-reboot";
                bootph-pre-ram;
arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi +4 -0
index 02f34c90c6d7..28b697b67ae0 100644
@@ -19,6 +19,10 @@
        memory@80000000 {
                bootph-all;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &main_timer0 {
arch/arm/dts/tegra124-apalis-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..a3614d279439
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra124-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/tegra20-colibri-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..d4a669a288d8
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra20-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/tegra30-apalis-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..37cbfbcc3506
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra30-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/tegra30-colibri-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..37cbfbcc3506
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra30-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/vf610-colibri-eval-v3-u-boot.dtsi +4 -0
index 572d40877ef9..8c3b86c201fa 100644
@@ -7,6 +7,10 @@
        soc {
                bootph-all;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &aips0 {
board/toradex/common/Kconfig +1 -0
index 1f6a5e4db561..b85893ab44e4 100644
@@ -4,6 +4,7 @@
 menuconfig TDX_CFG_BLOCK
        bool "Enable Toradex config block support"
        select OF_BOARD_SETUP
+       select SYSINFO
        help
          The Toradex config block stored production data on the on-module
          flash device (NAND, NOR or eMMC). The area is normally preserved by
board/toradex/common/tdx-common.c +43 -8
index 6084436b48b4..1f3253f4222e 100644
@@ -3,15 +3,16 @@
  * Copyright (c) 2016 Toradex, Inc.
  */
 
+#include <dm.h>
 #include <common.h>
 #include <env.h>
 #include <g_dnl.h>
 #include <init.h>
 #include <linux/libfdt.h>
+#include <sysinfo.h>
 
 #ifdef CONFIG_VIDEO
 #include <bmp_logo.h>
-#include <dm.h>
 #include <splash.h>
 #include <video.h>
 #endif
@@ -103,13 +104,8 @@ __weak int print_bootinfo(void)
 
 int checkboard(void)
 {
-       if (valid_cfgblock) {
-               printf("Model: Toradex %04d %s %s\n",
-                      tdx_hw_tag.prodid,
-                      toradex_modules[tdx_hw_tag.prodid].name,
-                      tdx_board_rev_str);
+       if (valid_cfgblock)
                printf("Serial#: %s\n", tdx_serial_str);
-       }
 
 #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA
        if (tdx_carrier_board_name)
@@ -188,6 +184,46 @@ static int settings_r(void)
 }
 EVENT_SPY_SIMPLE(EVT_SETTINGS_R, settings_r);
 
+static int tdx_detect(struct udevice *dev)
+{
+       return valid_cfgblock ? 0 : -EINVAL;
+}
+
+static int tdx_get_str(struct udevice *dev, int id, size_t size, char *val)
+{
+       int ret = -ENOTSUPP;
+
+       switch (id) {
+       case SYSINFO_ID_BOARD_MODEL:
+               snprintf(val, size,
+                        "Toradex %04d %s %s",
+                        tdx_hw_tag.prodid,
+                        toradex_modules[tdx_hw_tag.prodid].name,
+                        tdx_board_rev_str);
+
+               ret = 0;
+       }
+
+       return ret;
+}
+
+static const struct udevice_id sysinfo_tdx_ids[] = {
+       { .compatible = "toradex,sysinfo" },
+       { /* sentinel */ }
+};
+
+static const struct sysinfo_ops sysinfo_tdx_ops = {
+       .detect         = tdx_detect,
+       .get_str        = tdx_get_str,
+};
+
+U_BOOT_DRIVER(sysinfo_toradex) = {
+       .name           = "sysinfo_toradex",
+       .id             = UCLASS_SYSINFO,
+       .of_match       = sysinfo_tdx_ids,
+       .ops            = &sysinfo_tdx_ops,
+};
+
 #ifdef CONFIG_TDX_CFG_BLOCK_USB_GADGET_PID
 int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 {
--

2.39.2

#7 lore raw

Re: [PATCH v1 5/7] toradex: common: Add sysinfo driver

Quoted 36 lines · Svyatoslav Ryhel

вт, 20 лют. 2024 р. о 20:29 Francesco Dolcini <[email protected]> пише:

Quoted 28 lines

From: Emanuele Ghidoli <[email protected]>

This commit introduces support for the Toradex sysinfo driver in U-Boot, which uses information from Toradex config block to print correct board model.
In case the Toradex config block is not present sysinfo prints the model of the board provided by device tree removing per board specific prints.

---
 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |  6 +++ arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |  6 +++ .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  4 ++ arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  4 ++ .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  4 ++ .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  4 ++ .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  4 ++ .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  4 ++ .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  4 ++ arch/arm/dts/tegra124-apalis-u-boot.dtsi      | 12 +++++ arch/arm/dts/tegra20-colibri-u-boot.dtsi      | 12 +++++ arch/arm/dts/tegra30-apalis-u-boot.dtsi       | 12 +++++ arch/arm/dts/tegra30-colibri-u-boot.dtsi      | 12 +++++ .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |  4 ++ board/toradex/common/Kconfig                  |  1 + board/toradex/common/tdx-common.c             | 50 ++++++++++++++++---

Quoted 6 lines
 16 files changed, 136 insertions(+), 7 deletions(-)

 create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi

Quoted 4 lines

Greetings! Thank you for contribution but may you at split patches according to SoC vendor at least? For imx, tegra and ti since it would be hard to both review and pick them to correct custodian trees.

I would assume for those urgent fixes to go through Tom directly to master. Thanks!

Quoted 331 lines
Quoted 331 lines
arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi +6 -0
index c54a59e89c5d..d73be74d2112 100644
@@ -3,6 +3,12 @@
   * Copyright 2019 Toradex AG
   */
 
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
+
  &mu {
         bootph-some-ram;
  };
arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi +6 -0
index 6ab6b1f9ee69..60c4cd6fc01f 100644
@@ -3,6 +3,12 @@
   * Copyright 2019 Toradex AG
   */
 
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
+
  &{/imx8qx-pm} {
 
         bootph-some-ram;
arch/arm/dts/imx6dl-colibri-eval-v3-u- renamed from arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi +0 -0

boot.dtsi
index 0eea4d1862ae..5a91d0aca204 100644

arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi +4 -0
@@ -16,6 +16,10 @@
                 mmc0 = &usdhc3;
                 mmc1 = &usdhc1;
         };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
  };
 
  &wdog1 {
arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi +4 -0
index 3c6e503d043b..59412635420a 100644
@@ -19,6 +19,10 @@
                 mmc1 = &usdhc1;
                 mmc2 = &usdhc2;
         };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
  };
 
  &wdog1 {
arch/arm/dts/imx6ull-colibri-eval-v3-u- renamed from arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi +0 -0

boot.dtsi
index 6823b42d4514..731814216e1f 100644

arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi +0 -0
@@ -9,6 +9,10 @@

                usb0 = &usbotg1; /* required for ums */ display0 = &lcdif;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo"; +       };
 };

 &pinctrl_uart1 {

arch/arm/dts/imx7d-colibri-eval-v3-u- renamed from arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi +0 -0

boot.dtsi
index b2c12a413daf..68142769d360 100644

arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi +4 -0
@@ -11,6 +11,10 @@
                 mmc0 = &usdhc3;
                 mmc1 = &usdhc1;
         };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
  };
 
  &lcdif {
arch/arm/dts/imx8mm-verdin-wifi-dev-u- renamed from arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi +0 -0

boot.dtsi
index 515f195ab759..38db56059d69 100644

arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi +4 -0
@@ -12,6 +12,10 @@
                 eeprom2 = &eeprom_display_adapter;
         };
 
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+
         wdt-reboot {
                 compatible = "wdt-reboot";
                 bootph-pre-ram;
arch/arm/dts/imx8mp-verdin-wifi-dev-u- renamed from arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi +0 -0

boot.dtsi
index 67f1d45ce269..03f211d5f7d3 100644

arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi +4 -0
@@ -12,6 +12,10 @@
                 eeprom2 = &eeprom_display_adapter;
         };
 
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+
         wdt-reboot {
                 compatible = "wdt-reboot";
                 bootph-pre-ram;
arch/arm/dts/k3-am625-verdin-wifi-dev-u- renamed from arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi +0 -0

boot.dtsi
index 02f34c90c6d7..28b697b67ae0 100644

arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi +4 -0
@@ -19,6 +19,10 @@
         memory@80000000 {
                 bootph-all;
         };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
  };
 
  &main_timer0 {
arch/arm/dts/tegra124-apalis-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..a3614d279439
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra124-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/tegra20-colibri-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..d4a669a288d8
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra20-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/tegra30-apalis-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..37cbfbcc3506
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra30-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/tegra30-colibri-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..37cbfbcc3506
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra30-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/vf610-colibri-eval-v3-u- renamed from arch/arm/dts/vf610-colibri-eval-v3-u-boot.dtsi +0 -0

boot.dtsi
index 572d40877ef9..8c3b86c201fa 100644

arch/arm/dts/vf610-colibri-eval-v3-u-boot.dtsi +4 -0
@@ -7,6 +7,10 @@
         soc {
                 bootph-all;
         };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
  };
 
  &aips0 {
board/toradex/common/Kconfig +0 -0
index 1f6a5e4db561..b85893ab44e4 100644
@@ -4,6 +4,7 @@

 menuconfig TDX_CFG_BLOCK
        bool "Enable Toradex config block support"
        select OF_BOARD_SETUP
+       select SYSINFO
        help
          The Toradex config block stored production data on the on-module flash device (NAND, NOR or eMMC). The area is normally preserved by

board/toradex/common/tdx-common.c +43 -8
index 6084436b48b4..1f3253f4222e 100644
@@ -3,15 +3,16 @@
   * Copyright (c) 2016 Toradex, Inc.
   */
 
+#include <dm.h>
  #include <common.h>
  #include <env.h>
  #include <g_dnl.h>
  #include <init.h>
  #include <linux/libfdt.h>
+#include <sysinfo.h>
 
  #ifdef CONFIG_VIDEO
  #include <bmp_logo.h>
-#include <dm.h>
  #include <splash.h>
  #include <video.h>
  #endif
@@ -103,13 +104,8 @@ __weak int print_bootinfo(void)
 
  int checkboard(void)
  {
-       if (valid_cfgblock) {
-               printf("Model: Toradex %04d %s %s\n",
-                      tdx_hw_tag.prodid,
-                      toradex_modules[tdx_hw_tag.prodid].name,
-                      tdx_board_rev_str);
+       if (valid_cfgblock)
                 printf("Serial#: %s\n", tdx_serial_str);
-       }
 
  #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA
         if (tdx_carrier_board_name)
@@ -188,6 +184,46 @@ static int settings_r(void)
  }
  EVENT_SPY_SIMPLE(EVT_SETTINGS_R, settings_r);
 
+static int tdx_detect(struct udevice *dev)
+{
+       return valid_cfgblock ? 0 : -EINVAL;
+}
+
+static int tdx_get_str(struct udevice *dev, int id, size_t size, char *val)
+{
+       int ret = -ENOTSUPP;
+
+       switch (id) {
+       case SYSINFO_ID_BOARD_MODEL:
+               snprintf(val, size,
+                        "Toradex %04d %s %s",
+                        tdx_hw_tag.prodid,
+                        toradex_modules[tdx_hw_tag.prodid].name,
+                        tdx_board_rev_str);
+
+               ret = 0;
+       }
+
+       return ret;
+}
+
+static const struct udevice_id sysinfo_tdx_ids[] = {
+       { .compatible = "toradex,sysinfo" },
+       { /* sentinel */ }
+};
+
+static const struct sysinfo_ops sysinfo_tdx_ops = {
+       .detect         = tdx_detect,
+       .get_str        = tdx_get_str,
+};
+
+U_BOOT_DRIVER(sysinfo_toradex) = {
+       .name           = "sysinfo_toradex",
+       .id             = UCLASS_SYSINFO,
+       .of_match       = sysinfo_tdx_ids,
+       .ops            = &sysinfo_tdx_ops,
+};
+
  #ifdef CONFIG_TDX_CFG_BLOCK_USB_GADGET_PID
  int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
  {
--

2.39.2

#8 lore raw

Re: [PATCH v1 5/7] toradex: common: Add sysinfo driver

Quoted 37 lines · Marcel Ziswiler
Quoted 36 lines · Svyatoslav Ryhel

вт, 20 лют. 2024 р. о 20:29 Francesco Dolcini <[email protected]> пише:

Quoted 34 lines

From: Emanuele Ghidoli <[email protected]>

This commit introduces support for the Toradex sysinfo driver in U-Boot, which uses information from Toradex config block to print correct board model.
In case the Toradex config block is not present sysinfo prints the model of the board provided by device tree removing per board specific prints.

---
 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |  6 +++ arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |  6 +++ .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  4 ++ arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  4 ++ .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  4 ++ .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  4 ++ .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  4 ++ .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  4 ++ .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  4 ++ arch/arm/dts/tegra124-apalis-u-boot.dtsi      | 12 +++++ arch/arm/dts/tegra20-colibri-u-boot.dtsi      | 12 +++++ arch/arm/dts/tegra30-apalis-u-boot.dtsi       | 12 +++++ arch/arm/dts/tegra30-colibri-u-boot.dtsi      | 12 +++++ .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |  4 ++ board/toradex/common/Kconfig                  |  1 + board/toradex/common/tdx-common.c             | 50 ++++++++++++++++---

 16 files changed, 136 insertions(+), 7 deletions(-)

 create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi

Quoted 6 lines
Quoted 4 lines

Greetings! Thank you for contribution but may you at split patches according to SoC vendor at least? For imx, tegra and ti since it would be hard to both review and pick them to correct custodian trees.

I would assume for those urgent fixes to go through Tom directly to master. Thanks!

So this is a series we need for v2024.04 then?

Signature · 1 line
Tom
#9 lore raw

Re: [PATCH v1 5/7] toradex: common: Add sysinfo driver

Hi Tom

Quoted 38 lines · Tom Rini
Quoted 37 lines · Marcel Ziswiler
Quoted 36 lines · Svyatoslav Ryhel

вт, 20 лют. 2024 р. о 20:29 Francesco Dolcini <[email protected]> пише:

Quoted 34 lines

From: Emanuele Ghidoli <[email protected]>

This commit introduces support for the Toradex sysinfo driver in U-Boot, which uses information from Toradex config block to print correct board model.
In case the Toradex config block is not present sysinfo prints the model of the board provided by device tree removing per board specific prints.

---
 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |  6 +++ arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |  6 +++ .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  4 ++ arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  4 ++ .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  4 ++ .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  4 ++ .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  4 ++ .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  4 ++ .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  4 ++ arch/arm/dts/tegra124-apalis-u-boot.dtsi      | 12 +++++ arch/arm/dts/tegra20-colibri-u-boot.dtsi      | 12 +++++ arch/arm/dts/tegra30-apalis-u-boot.dtsi       | 12 +++++ arch/arm/dts/tegra30-colibri-u-boot.dtsi      | 12 +++++ .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |  4 ++ board/toradex/common/Kconfig                  |  1 + board/toradex/common/tdx-common.c             | 50 ++++++++++++++++---

 16 files changed, 136 insertions(+), 7 deletions(-)

 create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Greetings! Thank you for contribution but may you at split patches according to SoC vendor at least? For imx, tegra and ti since it would be hard to both review and pick them to correct custodian trees.

I would assume for those urgent fixes to go through Tom directly to master. Thanks!

So this is a series we need for v2024.04 then?

Yes, please. From the cover letter:

Quoted 1 line

This series fixes two regressions affecting multiple Toradex boards (i.MX, TI and TEGRA based) and targets

the current master, e.g. v2024.04 release.

Thanks!

Cheers

Marcel

#10 lore raw

Re: [PATCH v1 5/7] toradex: common: Add sysinfo driver

Quoted 46 lines · Marcel Ziswiler

Hi Tom

Quoted 43 lines · Tom Rini
Quoted 42 lines · Marcel Ziswiler
Quoted 40 lines · Svyatoslav Ryhel

вт, 20 лют. 2024 р. о 20:29 Francesco Dolcini <[email protected]> пише:

Quoted 28 lines

From: Emanuele Ghidoli <[email protected]>

This commit introduces support for the Toradex sysinfo driver in U-Boot, which uses information from Toradex config block to print correct board model.
In case the Toradex config block is not present sysinfo prints the model of the board provided by device tree removing per board specific prints.

---
 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |  6 +++ arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |  6 +++ .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  4 ++ arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  4 ++ .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  4 ++ .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  4 ++ .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  4 ++ .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  4 ++ .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  4 ++ arch/arm/dts/tegra124-apalis-u-boot.dtsi      | 12 +++++ arch/arm/dts/tegra20-colibri-u-boot.dtsi      | 12 +++++ arch/arm/dts/tegra30-apalis-u-boot.dtsi       | 12 +++++ arch/arm/dts/tegra30-colibri-u-boot.dtsi      | 12 +++++ .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |  4 ++ board/toradex/common/Kconfig                  |  1 + board/toradex/common/tdx-common.c             | 50 ++++++++++++++++---

Quoted 6 lines
 16 files changed, 136 insertions(+), 7 deletions(-)

 create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi

Greetings! Thank you for contribution but may you at split patches according to SoC vendor at least? For imx, tegra and ti since it would be hard to both review and pick them to correct custodian trees.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

I would assume for those urgent fixes to go through Tom directly to master. Thanks!

So this is a series we need for v2024.04 then?

Yes, please. From the cover letter:

Quoted 1 line

This series fixes two regressions affecting multiple Toradex boards (i.MX, TI and TEGRA based) and targets

the current master, e.g. v2024.04 release.

OK, thanks. I'll wait a bit more for further feedback on the contents themselves.

Signature · 1 line
Tom
#11 lore raw

Re: [PATCH v1 5/7] toradex: common: Add sysinfo driver

In reply to Francesco Dolcini

Hello Francesco,

Quoted 133 lines · Francesco Dolcini

From: Emanuele Ghidoli <[email protected]>

This commit introduces support for the Toradex sysinfo driver in U-Boot, which uses information from Toradex config block to print correct board model.
In case the Toradex config block is not present sysinfo prints the model of the board provided by device tree removing per board specific prints.

---
 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |  6 +++
 arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |  6 +++
 .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  4 ++
 arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  4 ++
 .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  4 ++
 .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  4 ++
 .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  4 ++
 .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  4 ++
 .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |  4 ++
 arch/arm/dts/tegra124-apalis-u-boot.dtsi      | 12 +++++
 arch/arm/dts/tegra20-colibri-u-boot.dtsi      | 12 +++++
 arch/arm/dts/tegra30-apalis-u-boot.dtsi       | 12 +++++
 arch/arm/dts/tegra30-colibri-u-boot.dtsi      | 12 +++++
 .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |  4 ++
 board/toradex/common/Kconfig                  |  1 +
 board/toradex/common/tdx-common.c             | 50 ++++++++++++++++---
 16 files changed, 136 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi
 create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi
arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi +6 -0
index c54a59e89c5d..d73be74d2112 100644
@@ -3,6 +3,12 @@
  * Copyright 2019 Toradex AG
  */
 
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
+
 &mu {
        bootph-some-ram;
 };
arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi +6 -0
index 6ab6b1f9ee69..60c4cd6fc01f 100644
@@ -3,6 +3,12 @@
  * Copyright 2019 Toradex AG
  */
 
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
+
 &{/imx8qx-pm} {
 
        bootph-some-ram;
arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi +4 -0
index 0eea4d1862ae..5a91d0aca204 100644
@@ -16,6 +16,10 @@
                mmc0 = &usdhc3;
                mmc1 = &usdhc1;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &wdog1 {
arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi +4 -0
index 3c6e503d043b..59412635420a 100644
@@ -19,6 +19,10 @@
                mmc1 = &usdhc1;
                mmc2 = &usdhc2;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &wdog1 {
arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi +4 -0
index 6823b42d4514..731814216e1f 100644
@@ -9,6 +9,10 @@
                usb0 = &usbotg1; /* required for ums */
                display0 = &lcdif;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &pinctrl_uart1 {
arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi +4 -0
index b2c12a413daf..68142769d360 100644
@@ -11,6 +11,10 @@
                mmc0 = &usdhc3;
                mmc1 = &usdhc1;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &lcdif {
arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi +0 -0
index 515f195ab759..38db56059d69 100644

arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi line 18

Quoted 7 lines
arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi +4 -0
@@ -12,6 +12,10 @@
                eeprom2 = &eeprom_display_adapter;
        };
 
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+

Have you considered introducing some common *-u-boot.dtsi include and putting such nodes there just to avoid code duplication?

Quoted 219 lines
arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi +0 -0
        wdt-reboot {
                compatible = "wdt-reboot";
                bootph-pre-ram;
arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi +4 -0
index 67f1d45ce269..03f211d5f7d3 100644
@@ -12,6 +12,10 @@
                eeprom2 = &eeprom_display_adapter;
        };
 
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+
        wdt-reboot {
                compatible = "wdt-reboot";
                bootph-pre-ram;
arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi +4 -0
index 02f34c90c6d7..28b697b67ae0 100644
@@ -19,6 +19,10 @@
        memory@80000000 {
                bootph-all;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &main_timer0 {
arch/arm/dts/tegra124-apalis-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..a3614d279439
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra124-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/tegra20-colibri-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..d4a669a288d8
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra20-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/tegra30-apalis-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..37cbfbcc3506
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra30-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/tegra30-colibri-u-boot.dtsi new file +12 -0
new file mode 100644
index 000000000000..37cbfbcc3506
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2023 Toradex
+ */
+
+#include "tegra30-u-boot.dtsi"
+
+/ {
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+};
arch/arm/dts/vf610-colibri-eval-v3-u-boot.dtsi +4 -0
index 572d40877ef9..8c3b86c201fa 100644
@@ -7,6 +7,10 @@
        soc {
                bootph-all;
        };
+
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
 };
 
 &aips0 {
board/toradex/common/Kconfig +1 -0
index 1f6a5e4db561..b85893ab44e4 100644
@@ -4,6 +4,7 @@
 menuconfig TDX_CFG_BLOCK
        bool "Enable Toradex config block support"
        select OF_BOARD_SETUP
+       select SYSINFO
        help
          The Toradex config block stored production data on the on-module
          flash device (NAND, NOR or eMMC). The area is normally preserved by
board/toradex/common/tdx-common.c +43 -8
index 6084436b48b4..1f3253f4222e 100644
@@ -3,15 +3,16 @@
  * Copyright (c) 2016 Toradex, Inc.
  */
 
+#include <dm.h>
 #include <common.h>
 #include <env.h>
 #include <g_dnl.h>
 #include <init.h>
 #include <linux/libfdt.h>
+#include <sysinfo.h>
 
 #ifdef CONFIG_VIDEO
 #include <bmp_logo.h>
-#include <dm.h>
 #include <splash.h>
 #include <video.h>
 #endif
@@ -103,13 +104,8 @@ __weak int print_bootinfo(void)
 
 int checkboard(void)
 {
-       if (valid_cfgblock) {
-               printf("Model: Toradex %04d %s %s\n",
-                      tdx_hw_tag.prodid,
-                      toradex_modules[tdx_hw_tag.prodid].name,
-                      tdx_board_rev_str);
+       if (valid_cfgblock)
                printf("Serial#: %s\n", tdx_serial_str);
-       }
 
 #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA
        if (tdx_carrier_board_name)
@@ -188,6 +184,46 @@ static int settings_r(void)
 }
 EVENT_SPY_SIMPLE(EVT_SETTINGS_R, settings_r);
 
+static int tdx_detect(struct udevice *dev)
+{
+       return valid_cfgblock ? 0 : -EINVAL;
+}
+
+static int tdx_get_str(struct udevice *dev, int id, size_t size, char *val)
+{
+       int ret = -ENOTSUPP;
+
+       switch (id) {
+       case SYSINFO_ID_BOARD_MODEL:
+               snprintf(val, size,
+                        "Toradex %04d %s %s",
+                        tdx_hw_tag.prodid,
+                        toradex_modules[tdx_hw_tag.prodid].name,
+                        tdx_board_rev_str);
+
+               ret = 0;
+       }
+
+       return ret;
+}
+
+static const struct udevice_id sysinfo_tdx_ids[] = {
+       { .compatible = "toradex,sysinfo" },
+       { /* sentinel */ }
+};
+
+static const struct sysinfo_ops sysinfo_tdx_ops = {
+       .detect         = tdx_detect,
+       .get_str        = tdx_get_str,
+};
+
+U_BOOT_DRIVER(sysinfo_toradex) = {
+       .name           = "sysinfo_toradex",
+       .id             = UCLASS_SYSINFO,
+       .of_match       = sysinfo_tdx_ids,
+       .ops            = &sysinfo_tdx_ops,
+};
+
 #ifdef CONFIG_TDX_CFG_BLOCK_USB_GADGET_PID
 int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 {
--

2.39.2

Signature · 7 lines
Best regards - Atentamente - Meilleures salutations

Igor Opaniuk

mailto: [email protected]
skype: igor.opanyuk
http://ua.linkedin.com/in/iopaniuk
#12 lore raw

Re: [PATCH v1 5/7] toradex: common: Add sysinfo driver

Quoted 8 lines · Igor Opaniuk

arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi line 11

Quoted 5 lines · Francesco Dolcini
arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi +4 -0
+       sysinfo {
+               compatible = "toradex,sysinfo";
+       };
+

Have you considered introducing some common *-u-boot.dtsi include and putting such nodes there just to avoid code duplication?

Yes, we discussed internally about this. In pratice it was a trade off between one line with a well defined and transparent meaning with an opaque include, we concluded that the current proposal is the best approach.

Francesco

#13 lore raw

PATCH 6/7 toradex: common: Use random mac address if toradex config block is missing

In reply to Francesco Dolcini

From: Emanuele Ghidoli <[email protected]>

Set CONFIG_NET_RANDOM_ETHADDR=y, which sets random eth address in case there is no toradex config block programmed.
In case of missing toradex config block the generated mac address was always the same, linked to serial number 0.
Use random generated mac address instead.

---
 board/toradex/common/tdx-common.c      | 1 -
 configs/apalis-imx8_defconfig          | 1 +
 configs/apalis-tk1_defconfig           | 1 +
 configs/apalis_imx6_defconfig          | 1 +
 configs/apalis_t30_defconfig           | 1 +
 configs/colibri-imx6ull-emmc_defconfig | 1 +
 configs/colibri-imx6ull_defconfig      | 1 +
 configs/colibri-imx8x_defconfig        | 1 +
 configs/colibri_imx6_defconfig         | 1 +
 configs/colibri_imx7_defconfig         | 1 +
 configs/colibri_imx7_emmc_defconfig    | 1 +
 configs/colibri_t20_defconfig          | 1 +
 configs/colibri_t30_defconfig          | 1 +
 configs/colibri_vf_defconfig           | 1 +
 configs/verdin-am62_a53_defconfig      | 1 +
 configs/verdin-am62_r5_defconfig       | 1 +
 configs/verdin-imx8mm_defconfig        | 1 +
 configs/verdin-imx8mp_defconfig        | 1 +
 18 files changed, 17 insertions(+), 1 deletion(-)
board/toradex/common/tdx-common.c +0 -1
index 1f3253f4222e..9f09788137d5 100644
@@ -126,7 +126,6 @@ static int settings_r(void)
 
 	if (read_tdx_cfg_block()) {
 		printf("MISSING TORADEX CONFIG BLOCK\n");
-		get_mac_from_serial(tdx_serial, &tdx_eth_addr);
 
 		/* Board can run even if config block is not present */
 		return 0;
configs/apalis-imx8_defconfig +1 -0
index 982098d81420..da3b0e254899 100644
@@ -52,6 +52,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_TFTP_TSIZE=y
configs/apalis-tk1_defconfig +1 -0
index 6ed3898b60c3..20c9c06cdeac 100644
@@ -52,6 +52,7 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_TFTP_TSIZE=y
configs/apalis_imx6_defconfig +1 -0
index 05ff6fa115ce..492550607035 100644
@@ -75,6 +75,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_USE_IPADDR=y
configs/apalis_t30_defconfig +1 -0
index 0a27509a97e6..03a1f2c23906 100644
@@ -45,6 +45,7 @@ CONFIG_OF_LIVE=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=1
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_TFTP_TSIZE=y
configs/colibri-imx6ull-emmc_defconfig +1 -0
index 285fed9e4faf..2b04855770ab 100644
@@ -51,6 +51,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_TFTP_TSIZE=y
configs/colibri-imx6ull_defconfig +1 -0
index a8a633063d00..959930cf2e31 100644
@@ -60,6 +60,7 @@ CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_TFTP_TSIZE=y
configs/colibri-imx8x_defconfig +1 -0
index aa18d28d3e6d..88928b0e4bc5 100644
@@ -52,6 +52,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_TFTP_TSIZE=y
configs/colibri_imx6_defconfig +1 -0
index 70cb79531e92..55c71a000d00 100644
@@ -74,6 +74,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_USE_IPADDR=y
configs/colibri_imx7_defconfig +1 -0
index d5c8604f7097..58eb4317857b 100644
@@ -60,6 +60,7 @@ CONFIG_ENV_IS_IN_NAND=y
 CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_USE_IPADDR=y
configs/colibri_imx7_emmc_defconfig +1 -0
index ae8406f70de5..3382371d40de 100644
@@ -51,6 +51,7 @@ CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_USE_IPADDR=y
configs/colibri_t20_defconfig +1 -0
index 3c506ffb6877..3405e02ad347 100644
@@ -50,6 +50,7 @@ CONFIG_OF_LIVE=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=1536
 CONFIG_TFTP_TSIZE=y
configs/colibri_t30_defconfig +1 -0
index c7012031c0a8..394d656a1260 100644
@@ -43,6 +43,7 @@ CONFIG_OF_LIVE=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SYS_MMC_ENV_PART=1
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
 CONFIG_TFTP_TSIZE=y
configs/colibri_vf_defconfig +1 -0
index 3d1319cf812e..891637dee741 100644
@@ -66,6 +66,7 @@ CONFIG_ENV_RANGE=0x80000
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_USE_IPADDR=y
 CONFIG_IPADDR="192.168.10.2"
 CONFIG_USE_NETMASK=y
configs/verdin-am62_a53_defconfig +1 -0
index 956e3a1ad75e..63e75474ca71 100644
@@ -104,6 +104,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_USE_ETHPRIME=y
 CONFIG_ETHPRIME="eth0"
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_SPL_DM=y
configs/verdin-am62_r5_defconfig +1 -0
index a3febdcb6941..910340ea5a41 100644
@@ -65,6 +65,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_REGMAP=y
configs/verdin-imx8mm_defconfig +1 -0
index 0c88982f75c8..4e00fb4008dc 100644
@@ -90,6 +90,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_USE_ETHPRIME=y
 CONFIG_ETHPRIME="eth0"
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_SPL_DM=y
configs/verdin-imx8mp_defconfig +1 -0
index 22b8a334dfaf..a95edff961b2 100644
@@ -99,6 +99,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_USE_ETHPRIME=y
 CONFIG_ETHPRIME="eth0"
 CONFIG_VERSION_VARIABLE=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_SPL_DM=y
Signature · 1 line
2.39.2
#14 lore raw

Re: [PATCH v1 6/7] toradex: common: Use random mac address if toradex config block is missing

Quoted 30 lines · Francesco Dolcini

From: Emanuele Ghidoli <[email protected]>

Set CONFIG_NET_RANDOM_ETHADDR=y, which sets random eth address in case there is no toradex config block programmed.
In case of missing toradex config block the generated mac address was always the same, linked to serial number 0.
Use random generated mac address instead.

---
 board/toradex/common/tdx-common.c      | 1 -
 configs/apalis-imx8_defconfig          | 1 +
 configs/apalis-tk1_defconfig           | 1 +
 configs/apalis_imx6_defconfig          | 1 +
 configs/apalis_t30_defconfig           | 1 +
 configs/colibri-imx6ull-emmc_defconfig | 1 +
 configs/colibri-imx6ull_defconfig      | 1 +
 configs/colibri-imx8x_defconfig        | 1 +
 configs/colibri_imx6_defconfig         | 1 +
 configs/colibri_imx7_defconfig         | 1 +
 configs/colibri_imx7_emmc_defconfig    | 1 +
 configs/colibri_t20_defconfig          | 1 +
 configs/colibri_t30_defconfig          | 1 +
 configs/colibri_vf_defconfig           | 1 +
 configs/verdin-am62_a53_defconfig      | 1 +
 configs/verdin-am62_r5_defconfig       | 1 +
 configs/verdin-imx8mm_defconfig        | 1 +
 configs/verdin-imx8mp_defconfig        | 1 +
 18 files changed, 17 insertions(+), 1 deletion(-)

...

configs/verdin-am62_r5_defconfig CONFIG_SPL_OF_CONTROL=y · line 71

Quoted 12 lines
configs/verdin-am62_r5_defconfig +1 -0
index a3febdcb6941..910340ea5a41 100644
@@ -65,6 +65,7 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_REGMAP=y

This change here is not required, it has no effect since there is no network available on the verdin am62 r5, however it is just confusing to have it enabled.

I will send a v2 with this removed.

Francesco

#15 lore raw

PATCH 7/7 toradex: imx6*: fix reset using wdt-reboot driver

In reply to Francesco Dolcini

From: Parth Pancholi <[email protected]>

commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") introduced a regression that 'reset' command unable to reset imx6 and imx6ull based Toradex's modules in the u-boot.

This change enables a watchdog-based sysreset driver for Toradex's colibri-imx6, colibri-imx6ull (with nand and emmc) and apalis-imx6 which solves the reset command regression on these modules.

Fixes 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()")
---
 arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi  |  6 ++++++
 arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi       |  6 ++++++
 arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi | 10 ++++++++++
 configs/apalis_imx6_defconfig                    |  3 +++
 configs/colibri-imx6ull-emmc_defconfig           |  3 +++
 configs/colibri-imx6ull_defconfig                |  3 +++
 configs/colibri_imx6_defconfig                   |  3 +++
 7 files changed, 34 insertions(+)
arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi +6 -0
index 5a91d0aca204..44baaa803243 100644
@@ -20,6 +20,12 @@
 	sysinfo {
 		compatible = "toradex,sysinfo";
 	};
+
+	wdt-reboot {
+		compatible = "wdt-reboot";
+		wdt = <&wdog1>;
+		bootph-pre-ram;
+	};
 };
 
 &wdog1 {
arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi +6 -0
index 59412635420a..103605ac930d 100644
@@ -23,6 +23,12 @@
 	sysinfo {
 		compatible = "toradex,sysinfo";
 	};
+
+	wdt-reboot {
+		compatible = "wdt-reboot";
+		wdt = <&wdog1>;
+		bootph-pre-ram;
+	};
 };
 
 &wdog1 {
arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi +10 -0
index 731814216e1f..8494b1a2c603 100644
@@ -13,6 +13,12 @@
 	sysinfo {
 		compatible = "toradex,sysinfo";
 	};
+
+	wdt-reboot {
+		compatible = "wdt-reboot";
+		wdt = <&wdog1>;
+		bootph-pre-ram;
+	};
 };
 
 &pinctrl_uart1 {
@@ -58,3 +64,7 @@
 		};
 	};
 };
+
+&wdog1 {
+	bootph-pre-ram;
+};
configs/apalis_imx6_defconfig +3 -0
index 492550607035..fae3dc322471 100644
@@ -96,6 +96,8 @@ CONFIG_DM_I2C=y
 CONFIG_SPL_SYS_I2C_LEGACY=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_SYS_MXC_I2C3_SPEED=400000
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_PHYLIB=y
@@ -113,6 +115,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_SCSI=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_USB=y
 CONFIG_SPL_USB_HOST=y
 CONFIG_USB_MAX_CONTROLLER_COUNT=2
configs/colibri-imx6ull-emmc_defconfig +3 -0
index 2b04855770ab..c4ecdc03e2a8 100644
@@ -69,6 +69,8 @@ CONFIG_FASTBOOT_BUF_ADDR=0x81100000
 CONFIG_FASTBOOT_UUU_SUPPORT=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MXC=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_PHYLIB=y
@@ -83,6 +85,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Toradex"
configs/colibri-imx6ull_defconfig +3 -0
index 959930cf2e31..9c68d96b2fd7 100644
@@ -80,6 +80,8 @@ CONFIG_FASTBOOT_BUF_ADDR=0x81100000
 CONFIG_FASTBOOT_UUU_SUPPORT=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MXC=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_FSL_USDHC=y
 CONFIG_MTD=y
 CONFIG_DM_MTD=y
@@ -100,6 +102,7 @@ CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_USB=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="Toradex"
configs/colibri_imx6_defconfig +3 -0
index 55c71a000d00..74c54011989c 100644
@@ -22,6 +22,8 @@ CONFIG_SYS_MONITOR_LEN=409600
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_CMD_HDMIDETECT=y
 CONFIG_SYS_LOAD_ADDR=0x14200000
 CONFIG_SYS_MEMTEST_START=0x10000000
@@ -109,6 +111,7 @@ CONFIG_DM_REGULATOR_PFUZE100=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_MXC_UART=y
 CONFIG_IMX_THERMAL=y
+CONFIG_IMX_WATCHDOG=y
 CONFIG_USB=y
 CONFIG_SPL_USB_HOST=y
 CONFIG_USB_MAX_CONTROLLER_COUNT=2
Signature · 1 line
2.39.2
Acked-by Tested-by on the v1 series
#16 lore raw
In reply to Francesco Dolcini
Quoted 16 lines · Francesco Dolcini

From: Francesco Dolcini <[email protected]>

This series fixes two regressions affecting multiple Toradex boards (i.MX, TI and TEGRA based) and targets the current master, e.g. v2024.04 release.

U-Boot reset command is broken on all Tordex i.MX6* based SoMs since v2023.07, this series fixes it enabling the wdt-reboot driver.

Since v2024.04-rc1 reading the Toradex configuration block is not working properly anymore, the serial number and the hardware version are not read correctly, preventing the board from functioning correctly (wrong mac address, wrong DT, ...). This is fixed by reading the config block in EVT_SETTINGS_R and adding a toradex sysinfo driver. In addition to that, we now use a random mac address in case the config block is invalid.

Quoted 6 lines

For the whole series:

Quoted 62 lines

Emanuele Ghidoli (6):
  toradex: Fix recursive call to checkboard
  toradex: Remove not necessary model prints from checkboard()
  toradex: common: Use SETTINGS_R event to read toradex config block
  arm: dts: Refactor device trees using "&{/aliases}" syntax
  toradex: common: Add sysinfo driver
  toradex: common: Use random mac address if toradex config block is missing

Parth Pancholi (1):
  toradex: imx6*: fix reset using wdt-reboot driver

 arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi    |   6 + arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi  |   6 + .../dts/imx6dl-colibri-eval-v3-u-boot.dtsi    |  28 +++- arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi    |  36 +++-- .../dts/imx6ull-colibri-eval-v3-u-boot.dtsi   |  14 ++ .../arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi |  14 +- .../dts/imx8mm-verdin-wifi-dev-u-boot.dtsi    |  16 +- .../dts/imx8mp-verdin-wifi-dev-u-boot.dtsi    |  16 +- .../dts/k3-am625-verdin-wifi-dev-u-boot.dtsi  |   4 + arch/arm/dts/tegra124-apalis-u-boot.dtsi      |  12 ++ arch/arm/dts/tegra20-colibri-u-boot.dtsi      |  12 ++ arch/arm/dts/tegra30-apalis-u-boot.dtsi       |  12 ++ arch/arm/dts/tegra30-colibri-u-boot.dtsi      |  12 ++ .../arm/dts/vf610-colibri-eval-v3-u-boot.dtsi |   4 + board/toradex/apalis-imx8/apalis-imx8.c       |  10 -- board/toradex/apalis-tk1/apalis-tk1.c         |   7 - board/toradex/apalis_imx6/apalis_imx6.c       |  21 --- board/toradex/apalis_t30/apalis_t30.c         |   8 - .../toradex/colibri-imx6ull/colibri-imx6ull.c |   7 - board/toradex/colibri-imx8x/colibri-imx8x.c   |  10 -- board/toradex/colibri_imx6/colibri_imx6.c     |  20 --- board/toradex/colibri_imx7/colibri_imx7.c     |   8 - board/toradex/colibri_t20/colibri_t20.c       |  10 -- board/toradex/colibri_t30/colibri_t30.c       |   7 - board/toradex/colibri_vf/colibri_vf.c         |  10 -- board/toradex/common/Kconfig                  |   1 + board/toradex/common/tdx-common.c             | 137 +++++++++++++----- board/toradex/common/tdx-common.h             |   1 - configs/apalis-imx8_defconfig                 |   1 + configs/apalis-tk1_defconfig                  |   1 + configs/apalis_imx6_defconfig                 |   4 + configs/apalis_t30_defconfig                  |   1 + configs/colibri-imx6ull-emmc_defconfig        |   4 + configs/colibri-imx6ull_defconfig             |   4 + configs/colibri-imx8x_defconfig               |   1 + configs/colibri_imx6_defconfig                |   4 + configs/colibri_imx7_defconfig                |   1 + configs/colibri_imx7_emmc_defconfig           |   1 + configs/colibri_t20_defconfig                 |   1 + configs/colibri_t30_defconfig                 |   1 + configs/colibri_vf_defconfig                  |   1 + configs/verdin-am62_a53_defconfig             |   1 + configs/verdin-am62_r5_defconfig              |   1 + configs/verdin-imx8mm_defconfig               |   1 + configs/verdin-imx8mp_defconfig               |   1 +

 45 files changed, 284 insertions(+), 194 deletions(-)

 create mode 100644 arch/arm/dts/tegra124-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra20-colibri-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-apalis-u-boot.dtsi create mode 100644 arch/arm/dts/tegra30-colibri-u-boot.dtsi