public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Philippe Schenker <dev@pschenker.ch>
To: u-boot@lists.denx.de
Cc: Philippe Schenker <philippe.schenker@toradex.com>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Denys Drozdov <denys.drozdov@toradex.com>,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>,
	Simon Glass <sjg@chromium.org>
Subject: [PATCH v2] toradex: tdx-cfg-block: add 0068 i.mx 8m mini sku
Date: Wed,  6 Jul 2022 14:15:05 +0200	[thread overview]
Message-ID: <20220706121505.448579-1-dev@pschenker.ch> (raw)

From: Philippe Schenker <philippe.schenker@toradex.com>

Add new i.MX 8M Mini SKU to ConfigBlock handling.

0068: Verdin iMX8M Mini Quad 2GB WB IT No CAN

This SKU is identical to 0055 but without CAN. Mention this in the name
so those modules can be distinguished.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>

---

Changes in v2:
- Added the define to is_wifi detection so the correct devicetree is
  selected on boot.
- Shortened the name so the resulting string printed is no longer than
  80 characters.

 board/toradex/common/tdx-cfg-block.c        | 13 ++++++++++++-
 board/toradex/common/tdx-cfg-block.h        |  1 +
 board/toradex/verdin-imx8mm/verdin-imx8mm.c |  3 ++-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index 6c8cf4592d..112e687ca6 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -145,6 +145,7 @@ const char * const toradex_modules[] = {
 	[65] = "Verdin iMX8M Plus QuadLite 1GB IT",
 	[66] = "Verdin iMX8M Plus Quad 8GB Wi-Fi / BT",
 	[67] = "Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT",
+	[68] = "Verdin iMX8M Mini Quad 2GB WB IT No CAN",
 };
 
 const char * const toradex_carrier_boards[] = {
@@ -361,6 +362,7 @@ static int get_cfgblock_interactive(void)
 	char it = 'n';
 	char wb = 'n';
 	char mem8g = 'n';
+	char can = 'y';
 	int len = 0;
 
 	/* Unknown module by default */
@@ -387,6 +389,13 @@ static int get_cfgblock_interactive(void)
 		mem8g = console_buffer[0];
 	}
 #endif
+#if defined(CONFIG_TARGET_VERDIN_IMX8MM)
+	if (is_cpu_type(MXC_CPU_IMX8MM) && (wb == 'y' || wb == 'Y')) {
+		sprintf(message, "Does your module have CAN? [y/N] ");
+		len = cli_readline(message);
+		can = console_buffer[0];
+	}
+#endif
 #endif
 
 	soc = env_get("soc");
@@ -474,7 +483,9 @@ static int get_cfgblock_interactive(void)
 		else
 			tdx_hw_tag.prodid = VERDIN_IMX8MMDL;
 	} else if (is_cpu_type(MXC_CPU_IMX8MM)) {
-		if (wb == 'y' || wb == 'Y')
+		if (can == 'n' || can == 'N')
+			tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN;
+		else if (wb == 'y' || wb == 'Y')
 			tdx_hw_tag.prodid = VERDIN_IMX8MMQ_WIFI_BT_IT;
 		else
 			tdx_hw_tag.prodid = VERDIN_IMX8MMQ_IT;
diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h
index 43e662e41d..9697447158 100644
--- a/board/toradex/common/tdx-cfg-block.h
+++ b/board/toradex/common/tdx-cfg-block.h
@@ -88,6 +88,7 @@ enum {
 	VERDIN_IMX8MPQL_IT, /* 65 */
 	VERDIN_IMX8MPQ_8GB_WIFI_BT,
 	APALIS_IMX8QM_8GB_WIFI_BT_IT,
+	VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN,
 };
 
 enum {
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index c51c99b515..7597cd81f9 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -83,7 +83,8 @@ static void select_dt_from_module_version(void)
 		 * device tree.
 		 */
 		is_wifi = (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_WIFI_BT_IT) ||
-			  (tdx_hw_tag.prodid == VERDIN_IMX8MMDL_WIFI_BT_IT);
+			  (tdx_hw_tag.prodid == VERDIN_IMX8MMDL_WIFI_BT_IT) ||
+			  (tdx_hw_tag.prodid == VERDIN_IMX8MMQ_WIFI_BT_IT_NO_CAN);
 	}
 
 	switch (get_pcb_revision()) {
-- 
2.36.1


                 reply	other threads:[~2022-07-06 12:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220706121505.448579-1-dev@pschenker.ch \
    --to=dev@pschenker.ch \
    --cc=denys.drozdov@toradex.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=marcel.ziswiler@toradex.com \
    --cc=philippe.schenker@toradex.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox