Merge patch series "toradex: fix reset and hardware detection regressions"
Francesco Dolcini <francesco.dolcini@toradex.com> says:
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.
Reported-by: Sahaj Sarup <sahaj.sarup@linaro.org>
Closes: https://lore.kernel.org/all/CAKZ1LvM45MB8N0CqgU+C7i9=Bjb6kqNTxWo2Tv407HKLWtCMkA@mail.gmail.com/
Reported-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Closes: https://lore.kernel.org/all/e40ed93bd8f371ec56b8fc451dcb458f3ce6dcba.camel@toradex.com/
Reported-by: Francesco Dolcini <francesco@dolcini.it>
Closes: https://lore.kernel.org/all/ZY2ZDWAQuTlRjV9H@francesco-nb/
diff --git a/arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi b/arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi
index c54a59e..d73be74 100644
--- a/arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi
+++ b/arch/arm/dts/fsl-imx8qm-apalis-u-boot.dtsi
@@ -3,6 +3,12 @@
* Copyright 2019 Toradex AG
*/
+/ {
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
+};
+
&mu {
bootph-some-ram;
};
diff --git a/arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi b/arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi
index 6ab6b1f..60c4cd6 100644
--- a/arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi
+++ b/arch/arm/dts/fsl-imx8qxp-colibri-u-boot.dtsi
@@ -3,6 +3,12 @@
* Copyright 2019 Toradex AG
*/
+/ {
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
+};
+
&{/imx8qx-pm} {
bootph-some-ram;
diff --git a/arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi b/arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi
index 31f3a48..44baaa8 100644
--- a/arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi
+++ b/arch/arm/dts/imx6dl-colibri-eval-v3-u-boot.dtsi
@@ -5,13 +5,27 @@
#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;
+ };
+
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
+
+ wdt-reboot {
+ compatible = "wdt-reboot";
+ wdt = <&wdog1>;
+ bootph-pre-ram;
+ };
};
&wdog1 {
diff --git a/arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi b/arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi
index 3d19796..103605a 100644
--- a/arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi
+++ b/arch/arm/dts/imx6q-apalis-eval-u-boot.dtsi
@@ -5,18 +5,30 @@
#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;
+ };
+
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
+
+ wdt-reboot {
+ compatible = "wdt-reboot";
+ wdt = <&wdog1>;
+ bootph-pre-ram;
+ };
};
&wdog1 {
diff --git a/arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi b/arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi
index 6823b42..8494b1a 100644
--- a/arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi
+++ b/arch/arm/dts/imx6ull-colibri-eval-v3-u-boot.dtsi
@@ -9,6 +9,16 @@
usb0 = &usbotg1; /* required for ums */
display0 = &lcdif;
};
+
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
+
+ wdt-reboot {
+ compatible = "wdt-reboot";
+ wdt = <&wdog1>;
+ bootph-pre-ram;
+ };
};
&pinctrl_uart1 {
@@ -54,3 +64,7 @@
};
};
};
+
+&wdog1 {
+ bootph-pre-ram;
+};
diff --git a/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi b/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi
index 57ca28e..6814276 100644
--- a/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi
+++ b/arch/arm/dts/imx7d-colibri-eval-v3-u-boot.dtsi
@@ -5,10 +5,16 @@
#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;
+ };
+
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
};
&lcdif {
diff --git a/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi b/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi
index 8efa4dd..38db560 100644
--- a/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-verdin-wifi-dev-u-boot.dtsi
@@ -6,6 +6,16 @@
#include "imx8mm-u-boot.dtsi"
/ {
+ aliases {
+ eeprom0 = &eeprom_module;
+ eeprom1 = &eeprom_carrier_board;
+ eeprom2 = &eeprom_display_adapter;
+ };
+
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
+
wdt-reboot {
compatible = "wdt-reboot";
bootph-pre-ram;
@@ -13,12 +23,6 @@
};
};
-&{/aliases} {
- eeprom0 = &eeprom_module;
- eeprom1 = &eeprom_carrier_board;
- eeprom2 = &eeprom_display_adapter;
-};
-
&{/soc@0/bus@30800000/i2c@30a20000/pmic@25} {
bootph-pre-ram;
};
diff --git a/arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi b/arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi
index 2a1aa19..03f211d 100644
--- a/arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi
+++ b/arch/arm/dts/imx8mp-verdin-wifi-dev-u-boot.dtsi
@@ -6,6 +6,16 @@
#include "imx8mp-u-boot.dtsi"
/ {
+ aliases {
+ eeprom0 = &eeprom_module;
+ eeprom1 = &eeprom_carrier_board;
+ eeprom2 = &eeprom_display_adapter;
+ };
+
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
+
wdt-reboot {
compatible = "wdt-reboot";
bootph-pre-ram;
@@ -13,12 +23,6 @@
};
};
-&{/aliases} {
- eeprom0 = &eeprom_module;
- eeprom1 = &eeprom_carrier_board;
- eeprom2 = &eeprom_display_adapter;
-};
-
&clk {
bootph-all;
bootph-pre-ram;
diff --git a/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi b/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
index 02f34c9..28b697b 100644
--- a/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
+++ b/arch/arm/dts/k3-am625-verdin-wifi-dev-u-boot.dtsi
@@ -19,6 +19,10 @@
memory@80000000 {
bootph-all;
};
+
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
};
&main_timer0 {
diff --git a/arch/arm/dts/tegra124-apalis-u-boot.dtsi b/arch/arm/dts/tegra124-apalis-u-boot.dtsi
new file mode 100644
index 0000000..a3614d2
--- /dev/null
+++ b/arch/arm/dts/tegra124-apalis-u-boot.dtsi
@@ -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";
+ };
+};
diff --git a/arch/arm/dts/tegra20-colibri-u-boot.dtsi b/arch/arm/dts/tegra20-colibri-u-boot.dtsi
new file mode 100644
index 0000000..d4a669a
--- /dev/null
+++ b/arch/arm/dts/tegra20-colibri-u-boot.dtsi
@@ -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";
+ };
+};
diff --git a/arch/arm/dts/tegra30-apalis-u-boot.dtsi b/arch/arm/dts/tegra30-apalis-u-boot.dtsi
new file mode 100644
index 0000000..37cbfbc
--- /dev/null
+++ b/arch/arm/dts/tegra30-apalis-u-boot.dtsi
@@ -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";
+ };
+};
diff --git a/arch/arm/dts/tegra30-colibri-u-boot.dtsi b/arch/arm/dts/tegra30-colibri-u-boot.dtsi
new file mode 100644
index 0000000..37cbfbc
--- /dev/null
+++ b/arch/arm/dts/tegra30-colibri-u-boot.dtsi
@@ -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";
+ };
+};
diff --git a/arch/arm/dts/vf610-colibri-eval-v3-u-boot.dtsi b/arch/arm/dts/vf610-colibri-eval-v3-u-boot.dtsi
index 572d408..8c3b86c 100644
--- a/arch/arm/dts/vf610-colibri-eval-v3-u-boot.dtsi
+++ b/arch/arm/dts/vf610-colibri-eval-v3-u-boot.dtsi
@@ -7,6 +7,10 @@
soc {
bootph-all;
};
+
+ sysinfo {
+ compatible = "toradex,sysinfo";
+ };
};
&aips0 {
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c
index b351ce6..2483a63 100644
--- a/board/toradex/apalis-imx8/apalis-imx8.c
+++ b/board/toradex/apalis-imx8/apalis-imx8.c
@@ -208,16 +208,6 @@
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;
diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c
index 79a1c92..ee87d9f 100644
--- a/board/toradex/apalis-tk1/apalis-tk1.c
+++ b/board/toradex/apalis-tk1/apalis-tk1.c
@@ -91,13 +91,6 @@
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)
{
diff --git a/board/toradex/apalis_imx6/apalis_imx6.c b/board/toradex/apalis_imx6/apalis_imx6.c
index 164fcc4..0da2453 100644
--- a/board/toradex/apalis_imx6/apalis_imx6.c
+++ b/board/toradex/apalis_imx6/apalis_imx6.c
@@ -716,27 +716,6 @@
}
#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)
{
diff --git a/board/toradex/apalis_t30/apalis_t30.c b/board/toradex/apalis_t30/apalis_t30.c
index b9a2af3..b10beb4 100644
--- a/board/toradex/apalis_t30/apalis_t30.c
+++ b/board/toradex/apalis_t30/apalis_t30.c
@@ -45,14 +45,6 @@
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)
{
diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
index a775f54..9b9fb34 100644
--- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
@@ -205,13 +205,6 @@
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)
{
diff --git a/board/toradex/colibri-imx8x/colibri-imx8x.c b/board/toradex/colibri-imx8x/colibri-imx8x.c
index d8cc72f..2c673a4 100644
--- a/board/toradex/colibri-imx8x/colibri-imx8x.c
+++ b/board/toradex/colibri-imx8x/colibri-imx8x.c
@@ -114,16 +114,6 @@
}
#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)
{
/*
diff --git a/board/toradex/colibri_imx6/colibri_imx6.c b/board/toradex/colibri_imx6/colibri_imx6.c
index 784ca7f..ce19a9c 100644
--- a/board/toradex/colibri_imx6/colibri_imx6.c
+++ b/board/toradex/colibri_imx6/colibri_imx6.c
@@ -636,26 +636,6 @@
}
#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)
{
diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c
index 2e5b02f..c37c5e0 100644
--- a/board/toradex/colibri_imx7/colibri_imx7.c
+++ b/board/toradex/colibri_imx7/colibri_imx7.c
@@ -273,14 +273,6 @@
}
#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)
{
diff --git a/board/toradex/colibri_t20/colibri_t20.c b/board/toradex/colibri_t20/colibri_t20.c
index 5861cf7..97e33d0 100644
--- a/board/toradex/colibri_t20/colibri_t20.c
+++ b/board/toradex/colibri_t20/colibri_t20.c
@@ -70,16 +70,6 @@
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)
{
diff --git a/board/toradex/colibri_t30/colibri_t30.c b/board/toradex/colibri_t30/colibri_t30.c
index 8cef098..0da247d 100644
--- a/board/toradex/colibri_t30/colibri_t30.c
+++ b/board/toradex/colibri_t30/colibri_t30.c
@@ -28,13 +28,6 @@
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)
{
diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c
index af9f2d3..3592000 100644
--- a/board/toradex/colibri_vf/colibri_vf.c
+++ b/board/toradex/colibri_vf/colibri_vf.c
@@ -366,16 +366,6 @@
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)
{
diff --git a/board/toradex/common/Kconfig b/board/toradex/common/Kconfig
index 1f6a5e4..b85893a 100644
--- a/board/toradex/common/Kconfig
+++ b/board/toradex/common/Kconfig
@@ -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
diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c
index ed8f0a6..9f09788 100644
--- a/board/toradex/common/tdx-common.c
+++ b/board/toradex/common/tdx-common.c
@@ -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
@@ -96,55 +97,70 @@
return ver_name;
}
-int tdx_checkboard(void)
+__weak int print_bootinfo(void)
+{
+ return 0;
+}
+
+int checkboard(void)
+{
+ if (valid_cfgblock)
+ printf("Serial#: %s\n", tdx_serial_str);
+
+#ifdef CONFIG_TDX_CFG_BLOCK_EXTRA
+ 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);
- checkboard();
- } 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);
-
- 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);
- }
-#endif
+ /* 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
@@ -165,6 +181,47 @@
return 0;
}
+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)
diff --git a/board/toradex/common/tdx-common.h b/board/toradex/common/tdx-common.h
index 44234dc..d446e9f 100644
--- a/board/toradex/common/tdx-common.h
+++ b/board/toradex/common/tdx-common.h
@@ -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 */
diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig
index f50d34d..e9fb4c7 100644
--- a/configs/apalis-imx8_defconfig
+++ b/configs/apalis-imx8_defconfig
@@ -51,6 +51,7 @@
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
diff --git a/configs/apalis-tk1_defconfig b/configs/apalis-tk1_defconfig
index 6ed3898..20c9c06 100644
--- a/configs/apalis-tk1_defconfig
+++ b/configs/apalis-tk1_defconfig
@@ -52,6 +52,7 @@
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
diff --git a/configs/apalis_imx6_defconfig b/configs/apalis_imx6_defconfig
index 05ff6fa..fae3dc3 100644
--- a/configs/apalis_imx6_defconfig
+++ b/configs/apalis_imx6_defconfig
@@ -75,6 +75,7 @@
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
@@ -95,6 +96,8 @@
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
@@ -112,6 +115,7 @@
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
diff --git a/configs/apalis_t30_defconfig b/configs/apalis_t30_defconfig
index 0a27509..03a1f2c 100644
--- a/configs/apalis_t30_defconfig
+++ b/configs/apalis_t30_defconfig
@@ -45,6 +45,7 @@
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
diff --git a/configs/colibri-imx6ull-emmc_defconfig b/configs/colibri-imx6ull-emmc_defconfig
index 285fed9..c4ecdc0 100644
--- a/configs/colibri-imx6ull-emmc_defconfig
+++ b/configs/colibri-imx6ull-emmc_defconfig
@@ -51,6 +51,7 @@
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
@@ -68,6 +69,8 @@
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
@@ -82,6 +85,7 @@
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"
diff --git a/configs/colibri-imx6ull_defconfig b/configs/colibri-imx6ull_defconfig
index a8a6330..9c68d96 100644
--- a/configs/colibri-imx6ull_defconfig
+++ b/configs/colibri-imx6ull_defconfig
@@ -60,6 +60,7 @@
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
@@ -79,6 +80,8 @@
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
@@ -99,6 +102,7 @@
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"
diff --git a/configs/colibri-imx8x_defconfig b/configs/colibri-imx8x_defconfig
index dff32ab..e76373e 100644
--- a/configs/colibri-imx8x_defconfig
+++ b/configs/colibri-imx8x_defconfig
@@ -51,6 +51,7 @@
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
diff --git a/configs/colibri_imx6_defconfig b/configs/colibri_imx6_defconfig
index 70cb795..74c5401 100644
--- a/configs/colibri_imx6_defconfig
+++ b/configs/colibri_imx6_defconfig
@@ -22,6 +22,8 @@
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
@@ -74,6 +76,7 @@
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
@@ -108,6 +111,7 @@
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
diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig
index d5c8604..58eb431 100644
--- a/configs/colibri_imx7_defconfig
+++ b/configs/colibri_imx7_defconfig
@@ -60,6 +60,7 @@
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
diff --git a/configs/colibri_imx7_emmc_defconfig b/configs/colibri_imx7_emmc_defconfig
index ae8406f..3382371 100644
--- a/configs/colibri_imx7_emmc_defconfig
+++ b/configs/colibri_imx7_emmc_defconfig
@@ -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_NET_RANDOM_ETHADDR=y
CONFIG_IP_DEFRAG=y
CONFIG_TFTP_BLOCKSIZE=16352
CONFIG_USE_IPADDR=y
diff --git a/configs/colibri_t20_defconfig b/configs/colibri_t20_defconfig
index 161443b..8d8423a 100644
--- a/configs/colibri_t20_defconfig
+++ b/configs/colibri_t20_defconfig
@@ -49,6 +49,7 @@
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
diff --git a/configs/colibri_t30_defconfig b/configs/colibri_t30_defconfig
index c701203..394d656 100644
--- a/configs/colibri_t30_defconfig
+++ b/configs/colibri_t30_defconfig
@@ -43,6 +43,7 @@
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
diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig
index bbf6a1c..a5e6bcb 100644
--- a/configs/colibri_vf_defconfig
+++ b/configs/colibri_vf_defconfig
@@ -65,6 +65,7 @@
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
diff --git a/configs/verdin-am62_a53_defconfig b/configs/verdin-am62_a53_defconfig
index 60e39e4..f56617d 100644
--- a/configs/verdin-am62_a53_defconfig
+++ b/configs/verdin-am62_a53_defconfig
@@ -103,6 +103,7 @@
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
diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
index 4c4c247..afa42c1 100644
--- a/configs/verdin-imx8mm_defconfig
+++ b/configs/verdin-imx8mm_defconfig
@@ -88,6 +88,7 @@
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
diff --git a/configs/verdin-imx8mp_defconfig b/configs/verdin-imx8mp_defconfig
index f2d03f8..7ac5e65 100644
--- a/configs/verdin-imx8mp_defconfig
+++ b/configs/verdin-imx8mp_defconfig
@@ -98,6 +98,7 @@
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