From: Marcel Ziswiler <marcel.ziswi...@toradex.com>

Add support for storing configuration for Verdin i.MX8MM SoM
in Toradex config block.

Signed-off-by: Marcel Ziswiler <marcel.ziswi...@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opan...@toradex.com>
---

 board/toradex/common/tdx-cfg-block.c | 17 +++++++++++++++--
 board/toradex/common/tdx-cfg-block.h |  1 +
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/board/toradex/common/tdx-cfg-block.c 
b/board/toradex/common/tdx-cfg-block.c
index 9c86230595..40bed3c9f4 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -9,7 +9,8 @@
 #if defined(CONFIG_TARGET_APALIS_IMX6) || \
        defined(CONFIG_TARGET_APALIS_IMX8) || \
        defined(CONFIG_TARGET_COLIBRI_IMX6) || \
-       defined(CONFIG_TARGET_COLIBRI_IMX8X)
+       defined(CONFIG_TARGET_COLIBRI_IMX8X) || \
+       defined(CONFIG_TARGET_VERDIN_IMX8MM)
 #include <asm/arch/sys_proto.h>
 #else
 #define is_cpu_type(cpu) (0)
@@ -112,6 +113,9 @@ const char * const toradex_modules[] = {
        [50] = "Colibri iMX8 QuadXPlus 2GB IT",
        [51] = "Colibri iMX8 DualX 1GB Wi-Fi / Bluetooth",
        [52] = "Colibri iMX8 DualX 1GB",
+       [53] = "Apalis iMX8 QuadXPlus 2GB ECC IT",
+       [54] = "Apalis iMX8 DualXPlus 1GB",
+       [55] = "Verdin iMX8M Mini 2GB Wi-Fi / BT IT",
 };
 
 #ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC
@@ -294,17 +298,24 @@ static int get_cfgblock_interactive(void)
        char *soc;
        char it = 'n';
        char wb = 'n';
-       int len;
+       int len = 0;
 
        /* Unknown module by default */
        tdx_hw_tag.prodid = 0;
 
        if (cpu_is_pxa27x())
                sprintf(message, "Is the module the 312 MHz version? [y/N] ");
+#if !defined(CONFIG_TARGET_VERDIN_IMX8MM)
        else
                sprintf(message, "Is the module an IT version? [y/N] ");
+
        len = cli_readline(message);
        it = console_buffer[0];
+#else
+       else
+               it = 'y';
+#endif
+
 
 #if defined(CONFIG_TARGET_APALIS_IMX8) || \
                defined(CONFIG_TARGET_COLIBRI_IMX6ULL) || \
@@ -357,6 +368,8 @@ static int get_cfgblock_interactive(void)
                tdx_hw_tag.prodid = COLIBRI_IMX7D;
        else if (!strcmp("imx7s", soc))
                tdx_hw_tag.prodid = COLIBRI_IMX7S;
+       else if (is_cpu_type(MXC_CPU_IMX8MM))
+               tdx_hw_tag.prodid = VERDIN_IMX8MM;
        else if (is_cpu_type(MXC_CPU_IMX8QM)) {
                if (it == 'y' || it == 'Y') {
                        if (wb == 'y' || wb == 'Y')
diff --git a/board/toradex/common/tdx-cfg-block.h 
b/board/toradex/common/tdx-cfg-block.h
index bfdc8b7f70..9443a6a2fd 100644
--- a/board/toradex/common/tdx-cfg-block.h
+++ b/board/toradex/common/tdx-cfg-block.h
@@ -73,6 +73,7 @@ enum {
        COLIBRI_IMX8QXP_IT, /* 50 */
        COLIBRI_IMX8DX_WIFI_BT,
        COLIBRI_IMX8DX,
+       VERDIN_IMX8MM,
 };
 
 extern const char * const toradex_modules[];
-- 
2.17.1

Reply via email to