diff mbox series

[v1,2/5] toradex: tdx-cfg-block: add Verdin i.MX8MM support

Message ID 20200123113140.9353-3-igor.opaniuk@gmail.com
State New
Headers show
Series board: toradex: add Verdin iMX8MM 2GB WB IT v1.0a | expand

Commit Message

Igor Opaniuk Jan. 23, 2020, 11:31 a.m. UTC
From: Marcel Ziswiler <marcel.ziswiler at toradex.com>

Add support for storing configuration for Verdin i.MX8MM 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>
---

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

Comments

Oleksandr Suvorov Jan. 23, 2020, 11:41 a.m. UTC | #1
On Thu, Jan 23, 2020 at 1:32 PM Igor Opaniuk <igor.opaniuk at gmail.com> wrote:
>
> From: Marcel Ziswiler <marcel.ziswiler at toradex.com>
>
> Add support for storing configuration for Verdin i.MX8MM 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>
> ---
>
>  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",
>  };

I think it is better to add missing Apalis iMX8 items in a separate commit.
If you'll push the next version, please keep it in mind.

Anyway,

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

>
>  #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
>
Marcel Ziswiler Jan. 26, 2020, 12:30 a.m. UTC | #2
Hi Igor and Oleksandr

On Thu, 2020-01-23 at 11:41 +0000, Oleksandr Suvorov wrote:
> On Thu, Jan 23, 2020 at 1:32 PM Igor Opaniuk <igor.opaniuk at gmail.com>
> wrote:
> > From: Marcel Ziswiler <marcel.ziswiler at toradex.com>
> > 
> > Add support for storing configuration for Verdin i.MX8MM 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>
> > ---
> > 
> >  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",
> >  };
> 
> I think it is better to add missing Apalis iMX8 items in a separate
> commit.
> If you'll push the next version, please keep it in mind.

Yes, plus we meanwhile got the final Verdin SKU naming. I will update
it accordingly in a v2.

> Anyway,
> 
> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov at toradex.com>
> 
> >  #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
> > 
> 
> -- 
> Best regards
> Oleksandr Suvorov
> 
> Toradex AG
> Altsagenstrasse 5 | 6048 Horw/Luzern | Switzerland | T: +41 41 500
> 4800 (main line)

Cheers

Marcel
diff mbox series

Patch

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[];