summaryrefslogtreecommitdiff
path: root/recipes-bsp/u-boot/u-boot/0005-toradex-tdx-cfg-block-add-0068-i.mx-8m-mini-sku.patch
blob: ff6ad15d8cf99921175fee4ee9f57475c9aabd3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
From 1ec0e02d1641050b3143ff72bb3f0ae833113106 Mon Sep 17 00:00:00 2001
From: Philippe Schenker <philippe.schenker@toradex.com>
Date: Mon, 20 Jun 2022 19:49:24 +0200
Subject: [PATCH 5/5] toradex: tdx-cfg-block: add 0068 i.mx 8m mini sku

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.

Upstream-Status: Submitted [https://lore.kernel.org/u-boot/20220706121505.448579-1-dev@pschenker.ch/]
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 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 9305709a3c0..53302925dc2 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[] = {
@@ -408,6 +409,7 @@ static int get_cfgblock_interactive(void)
 	char it = 'n';
 	char wb = 'n';
 	char mem8g = 'n';
+	char can = 'y';
 	int len = 0;
 	int ret = 0;
 
@@ -435,6 +437,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");
@@ -522,7 +531,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 17906984863..79cd09c78d0 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 c51c99b5156..7597cd81f94 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.20.1