diff mbox series

[v2,4/8] toradex: tdx-cfg-block: add Verdin iMX8M Mini support

Message ID 20200126035522.510799-5-marcel@ziswiler.com
State Superseded
Headers show
Series board: toradex: prepare and add Verdin iMX8M Mini support | expand

Commit Message

Marcel Ziswiler Jan. 26, 2020, 3:55 a.m. UTC
From: Marcel Ziswiler <marcel.ziswiler at toradex.com>

Add support for storing configuration for Verdin iMX8M Mini SoM
in Toradex config block.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>
Signed-off-by: Igor Opaniuk <igor.opaniuk at toradex.com>

---

Changes in v2:
- Split Apalis iMX8X off from this one as suggested by Oleksandr.

 board/toradex/common/tdx-cfg-block.c | 19 +++++++++++++++++--
 board/toradex/common/tdx-cfg-block.h |  3 +++
 2 files changed, 20 insertions(+), 2 deletions(-)

Comments

Oleksandr Suvorov Jan. 27, 2020, 1:53 p.m. UTC | #1
On Sun, Jan 26, 2020 at 5:56 AM Marcel Ziswiler <marcel at ziswiler.com> wrote:
>
> From: Marcel Ziswiler <marcel.ziswiler at toradex.com>
>
> Add support for storing configuration for Verdin iMX8M Mini SoM
> in Toradex config block.
>
> Signed-off-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>
> Signed-off-by: Igor Opaniuk <igor.opaniuk at toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov at toradex.com>

>
> ---
>
> Changes in v2:
> - Split Apalis iMX8X off from this one as suggested by Oleksandr.
>
>  board/toradex/common/tdx-cfg-block.c | 19 +++++++++++++++++--
>  board/toradex/common/tdx-cfg-block.h |  3 +++
>  2 files changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
> index cdd8befbf8..6b47155976 100644
> --- a/board/toradex/common/tdx-cfg-block.c
> +++ b/board/toradex/common/tdx-cfg-block.c
> @@ -10,7 +10,8 @@
>         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)
>  #include <asm/arch/sys_proto.h>
>  #else
>  #define is_cpu_type(cpu) (0)
> @@ -115,6 +116,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] = "UNKNOWN MODULE",
> +       [57] = "Verdin iMX8M Mini DualLite 1GB",
>  };
>
>  #ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC
> @@ -297,17 +301,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_APALIS_IMX8X) || \
> @@ -361,6 +372,10 @@ 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_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 319b2a0087..e12262ea73 100644
> --- a/board/toradex/common/tdx-cfg-block.h
> +++ b/board/toradex/common/tdx-cfg-block.h
> @@ -75,6 +75,9 @@ enum {
>         COLIBRI_IMX8DX,
>         APALIS_IMX8QXP,
>         APALIS_IMX8DXP,
> +       VERDIN_IMX8MMQ_WIFI_BT_IT,
> +       /* 56 */
> +       VERDIN_IMX8MMDL,
>  };
>
>  extern const char * const toradex_modules[];
> --
> 2.24.1
>
diff mbox series

Patch

diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index cdd8befbf8..6b47155976 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -10,7 +10,8 @@ 
 	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)
 #include <asm/arch/sys_proto.h>
 #else
 #define is_cpu_type(cpu) (0)
@@ -115,6 +116,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] = "UNKNOWN MODULE",
+	[57] = "Verdin iMX8M Mini DualLite 1GB",
 };
 
 #ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC
@@ -297,17 +301,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_APALIS_IMX8X) || \
@@ -361,6 +372,10 @@  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_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 319b2a0087..e12262ea73 100644
--- a/board/toradex/common/tdx-cfg-block.h
+++ b/board/toradex/common/tdx-cfg-block.h
@@ -75,6 +75,9 @@  enum {
 	COLIBRI_IMX8DX,
 	APALIS_IMX8QXP,
 	APALIS_IMX8DXP,
+	VERDIN_IMX8MMQ_WIFI_BT_IT,
+	/* 56 */
+	VERDIN_IMX8MMDL,
 };
 
 extern const char * const toradex_modules[];