toradex: tdx-cfg-block: add Verdin iMX8M Mini/Nano support
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>
Tue, 28 Jan 2020 13:42:24 +0000 (14:42 +0100)
committerStefano Babic <sbabic@denx.de>
Sun, 9 Feb 2020 13:50:52 +0000 (14:50 +0100)
Add support for storing configuration for Verdin iMX8M Mini and
Nano SoMs in Toradex config block.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
board/toradex/common/tdx-cfg-block.c
board/toradex/common/tdx-cfg-block.h

index 4d7d2b218ccd47e5b70a4669ff75a4dc1833f9fd..1b6c91141865c50a29245b601b13cee4bc3036cb 100644 (file)
@@ -10,7 +10,9 @@
        defined(CONFIG_TARGET_APALIS_IMX8) || \
        defined(CONFIG_TARGET_APALIS_IMX8X) || \
        defined(CONFIG_TARGET_COLIBRI_IMX6) || \
-       defined(CONFIG_TARGET_COLIBRI_IMX8X)
+       defined(CONFIG_TARGET_COLIBRI_IMX8X) || \
+       defined(CONFIG_TARGET_VERDIN_IMX8MM) || \
+       defined(CONFIG_TARGET_VERDIN_IMX8MN)
 #include <asm/arch/sys_proto.h>
 #else
 #define is_cpu_type(cpu) (0)
@@ -115,6 +117,9 @@ const char * const toradex_modules[] = {
        [52] = "Colibri iMX8 DualX 1GB",
        [53] = "Apalis iMX8 QuadXPlus 2GB ECC IT",
        [54] = "Apalis iMX8 DualXPlus 1GB",
+       [55] = "Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT",
+       [56] = "Verdin iMX8M Nano SoloLite 1GB", /* not currently on sale */
+       [57] = "Verdin iMX8M Mini DualLite 1GB",
 };
 
 #ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC
@@ -297,17 +302,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) || !defined(CONFIG_TARGET_VERDIN_IMX8MN)
        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_APALIS_IMX8X) || \
@@ -361,6 +373,12 @@ 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_IMX8MMQ_WIFI_BT_IT;
+       else if (is_cpu_type(MXC_CPU_IMX8MMDL))
+               tdx_hw_tag.prodid = VERDIN_IMX8MMDL;
+       else if (is_cpu_type(MXC_CPU_IMX8MN))
+               tdx_hw_tag.prodid = VERDIN_IMX8MNSL;
        else if (is_cpu_type(MXC_CPU_IMX8QM)) {
                if (it == 'y' || it == 'Y') {
                        if (wb == 'y' || wb == 'Y')
index 99628d96dcd02a6c914ba8c3b8f8713199af1509..d8f3941f267e95736a603ae99038bbd6c17edc57 100644 (file)
@@ -75,6 +75,9 @@ enum {
        COLIBRI_IMX8DX,
        APALIS_IMX8QXP,
        APALIS_IMX8DXP,
+       VERDIN_IMX8MMQ_WIFI_BT_IT,
+       VERDIN_IMX8MNSL,
+       VERDIN_IMX8MMDL,
 };
 
 extern const char * const toradex_modules[];