Skip to contentSkip to conversation

toradex: tdx-cfg-block: add new 8gb apalis-imx8

PATCH In review Philippe Schenker 3 participants 9 messages May 9, 2022 – Jun 15, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 toradex: tdx-cfg-block: add new 8gb apalis-imx8

From: Philippe Schenker <[email protected]>

0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT

This module is identical to its 4GB counterpart
0037: Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT
except for the RAM size.

---

 board/toradex/common/tdx-cfg-block.c | 18 ++++++++++++++++--
 board/toradex/common/tdx-cfg-block.h |  1 +
 2 files changed, 17 insertions(+), 2 deletions(-)
board/toradex/common/tdx-cfg-block.c +16 -2
index 9c87289ae9..6c8cf4592d 100644
@@ -144,6 +144,7 @@ const char * const toradex_modules[] = {
 	[64] = "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT",
 	[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",
 };
 
 const char * const toradex_carrier_boards[] = {
@@ -359,6 +360,7 @@ static int get_cfgblock_interactive(void)
 	char *soc;
 	char it = 'n';
 	char wb = 'n';
+	char mem8g = 'n';
 	int len = 0;
 
 	/* Unknown module by default */
@@ -377,6 +379,14 @@ static int get_cfgblock_interactive(void)
 	sprintf(message, "Does the module have Wi-Fi / Bluetooth? [y/N] ");
 	len = cli_readline(message);
 	wb = console_buffer[0];
+
+#if defined(CONFIG_TARGET_APALIS_IMX8)
+	if ((wb == 'y' || wb == 'Y') && (it == 'y' || it == 'Y')) {
+		sprintf(message, "Does your module have 8GB of RAM? [y/N] ");
+		len = cli_readline(message);
+		mem8g = console_buffer[0];
+	}
+#endif
 #endif
 
 	soc = env_get("soc");
@@ -430,8 +440,12 @@ static int get_cfgblock_interactive(void)
 		tdx_hw_tag.prodid = COLIBRI_IMX7S;
 	else if (is_cpu_type(MXC_CPU_IMX8QM)) {
 		if (it == 'y' || it == 'Y') {
-			if (wb == 'y' || wb == 'Y')
-				tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+			if (wb == 'y' || wb == 'Y') {
+				if (mem8g == 'y' || mem8g == 'Y')
+					tdx_hw_tag.prodid = APALIS_IMX8QM_8GB_WIFI_BT_IT;
+				else
+					tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+			}
 			else
 				tdx_hw_tag.prodid = APALIS_IMX8QM_IT;
 		} else {
board/toradex/common/tdx-cfg-block.h +1 -0
index ddcf699748..43e662e41d 100644
@@ -87,6 +87,7 @@ enum {
 	VERDIN_IMX8MPQ_2GB_WIFI_BT_IT,
 	VERDIN_IMX8MPQL_IT, /* 65 */
 	VERDIN_IMX8MPQ_8GB_WIFI_BT,
+	APALIS_IMX8QM_8GB_WIFI_BT_IT,
 };
 
 enum {
Signature · 1 line
2.35.1
#1 lore raw

PATCH 2/2 board: apalis-imx8: add new 8gb product variant

From: Philippe Schenker <[email protected]>

Add the new Apalis iMX8 product variant

0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT

the only difference to the product

0037 Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT

is the 8gb of RAM. Toradex strategy to choose the correct RAM timing in SCFW is by fuses in the user area telling which RAM timing to load.

This commit makes use of this information to set the correct size of the RAM and therefore distinguish between the new 0067 and 0037 product

---

 board/toradex/apalis-imx8/apalis-imx8.c | 81 +++++++++++++++++++++++--
 1 file changed, 77 insertions(+), 4 deletions(-)
board/toradex/apalis-imx8/apalis-imx8.c +77 -4
index 04877fcd94..408198843f 100644
@@ -18,6 +18,7 @@
 #include <env.h>
 #include <errno.h>
 #include <linux/libfdt.h>
+#include <linux/bitops.h>
 
 #include "../common/tdx-cfg-block.h"
 
@@ -28,22 +29,75 @@ DECLARE_GLOBAL_DATA_PTR;
 			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
 			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
 
+#define TDX_USER_FUSE_BLOCK1_A	276
+#define TDX_USER_FUSE_BLOCK1_B	277
+#define TDX_USER_FUSE_BLOCK2_A	278
+#define TDX_USER_FUSE_BLOCK2_B	279
+
 static iomux_cfg_t uart1_pads[] = {
 	SC_P_UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
 	SC_P_UART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
 };
 
+struct tdx_user_fuses {
+	u16 pid4;
+	u16 vers;
+	u8 ramid;
+};
+
 static void setup_iomux_uart(void)
 {
 	imx8_iomux_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
 }
 
+static uint32_t do_get_tdx_user_fuse(int a, int b)
+{
+	sc_err_t sciErr;
+	u32 val_a = 0;
+	u32 val_b = 0;
+
+	sciErr = sc_misc_otp_fuse_read(-1, a, &val_a);
+	if (sciErr != SC_ERR_NONE) {
+		printf("Error reading out user fuse %d\n", a);
+		return 0;
+	}
+
+	sciErr = sc_misc_otp_fuse_read(-1, b, &val_b);
+	if (sciErr != SC_ERR_NONE) {
+		printf("Error reading out user fuse %d\n", b);
+		return 0;
+	}
+
+	return ((val_a & 0xffff) << 16) | (val_b & 0xffff);
+}
+
+static void get_tdx_user_fuse(struct tdx_user_fuses *tdxuserfuse)
+{
+	u32 fuse_block;
+
+	fuse_block = do_get_tdx_user_fuse(TDX_USER_FUSE_BLOCK2_A,
+					  TDX_USER_FUSE_BLOCK2_B);
+
+	/*
+	 * Fuse block 2 acts as a backup area, if this reads 0 we want to
+	 * use fuse block 1
+	 */
+	if (fuse_block == 0)
+		fuse_block = do_get_tdx_user_fuse(TDX_USER_FUSE_BLOCK1_A,
+						  TDX_USER_FUSE_BLOCK1_B);
+
+	tdxuserfuse->pid4 = (fuse_block >> 18) & GENMASK(13, 0);
+	tdxuserfuse->vers = (fuse_block >> 4) & GENMASK(13, 0);
+	tdxuserfuse->ramid = fuse_block & GENMASK(3, 0);
+}
+
 void board_mem_get_layout(u64 *phys_sdram_1_start,
 			  u64 *phys_sdram_1_size,
 			  u64 *phys_sdram_2_start,
 			  u64 *phys_sdram_2_size)
 {
 	u32 is_quadplus = 0, val = 0;
+	struct tdx_user_fuses tdxramfuses;
 	sc_err_t scierr = sc_misc_otp_fuse_read(-1, 6, &val);
 
 	if (scierr == SC_ERR_NONE) {
@@ -51,14 +105,33 @@ void board_mem_get_layout(u64 *phys_sdram_1_start,
 		is_quadplus = ((val >> 4) & 0x3) != 0x0;
 	}
 
+	get_tdx_user_fuse(&tdxramfuses);
+
 	*phys_sdram_1_start = PHYS_SDRAM_1;
 	*phys_sdram_1_size = PHYS_SDRAM_1_SIZE;
 	*phys_sdram_2_start = PHYS_SDRAM_2;
-	if (is_quadplus)
-		/* Our QP based SKUs only have 2 GB RAM (PHYS_SDRAM_1_SIZE) */
+
+	switch (tdxramfuses.ramid) {
+	case 1:
+		*phys_sdram_2_size = SZ_2G;
+		break;
+	case 2:
 		*phys_sdram_2_size = 0x0UL;
-	else
-		*phys_sdram_2_size = PHYS_SDRAM_2_SIZE;
+		break;
+	case 3:
+		*phys_sdram_2_size = SZ_2G;
+		break;
+	case 4:
+		*phys_sdram_2_size = SZ_4G + SZ_2G;
+		break;
+	default:
+		if (is_quadplus)
+			/* Our QP based SKUs only have 2 GB RAM (PHYS_SDRAM_1_SIZE) */
+			*phys_sdram_2_size = 0x0UL;
+		else
+			*phys_sdram_2_size = PHYS_SDRAM_2_SIZE;
+		break;
+	}
 }
 
 int board_early_init_f(void)
Signature · 1 line
2.35.1
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] board: apalis-imx8: add new 8gb product variant

Quoted 10 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

Add the new Apalis iMX8 product variant

0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT

the only difference to the product

0037 Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT

Quoted 8 lines

is the 8gb of RAM. Toradex strategy to choose the correct RAM timing in SCFW is by fuses in the user area telling which RAM timing to load.

This commit makes use of this information to set the correct size of the RAM and therefore distinguish between the new 0067 and 0037 product

Quoted 131 lines

---

 board/toradex/apalis-imx8/apalis-imx8.c | 81 +++++++++++++++++++++++--

 1 file changed, 77 insertions(+), 4 deletions(-)
board/toradex/apalis-imx8/apalis-imx8.c +1 -0
index 04877fcd94..408198843f 100644
@@ -18,6 +18,7 @@
  #include <env.h>
  #include <errno.h>
  #include <linux/libfdt.h>
+#include <linux/bitops.h>


 #include "../common/tdx-cfg-block.h"

board/toradex/apalis-imx8/apalis-imx8.c +0 -0
@@ -28,22 +29,75 @@ DECLARE_GLOBAL_DATA_PTR;
                          (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
                          (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))

board/toradex/apalis-imx8/apalis-imx8.c +5 -0
+#define TDX_USER_FUSE_BLOCK1_A 276
+#define TDX_USER_FUSE_BLOCK1_B 277
+#define TDX_USER_FUSE_BLOCK2_A 278
+#define TDX_USER_FUSE_BLOCK2_B 279
+

 static iomux_cfg_t uart1_pads[] = { SC_P_UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL), SC_P_UART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL), };

board/toradex/apalis-imx8/apalis-imx8.c +6 -0
+struct tdx_user_fuses {
+       u16 pid4;
+       u16 vers;
+       u8 ramid;
+};
+

 static void setup_iomux_uart(void)
 {
        imx8_iomux_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads)); }

board/toradex/apalis-imx8/apalis-imx8.c +41 -0
+static uint32_t do_get_tdx_user_fuse(int a, int b)
+{
+       sc_err_t sciErr;
+       u32 val_a = 0;
+       u32 val_b = 0;
+
+       sciErr = sc_misc_otp_fuse_read(-1, a, &val_a);
+       if (sciErr != SC_ERR_NONE) {
+               printf("Error reading out user fuse %d\n", a);
+               return 0;
+       }
+
+       sciErr = sc_misc_otp_fuse_read(-1, b, &val_b);
+       if (sciErr != SC_ERR_NONE) {
+               printf("Error reading out user fuse %d\n", b);
+               return 0;
+       }
+
+       return ((val_a & 0xffff) << 16) | (val_b & 0xffff);
+}
+
+static void get_tdx_user_fuse(struct tdx_user_fuses *tdxuserfuse)
+{
+       u32 fuse_block;
+
+       fuse_block = do_get_tdx_user_fuse(TDX_USER_FUSE_BLOCK2_A,
+                                         TDX_USER_FUSE_BLOCK2_B);
+
+       /*
+        * Fuse block 2 acts as a backup area, if this reads 0 we want to
+        * use fuse block 1
+        */
+       if (fuse_block == 0)
+               fuse_block = do_get_tdx_user_fuse(TDX_USER_FUSE_BLOCK1_A,
+                                                 TDX_USER_FUSE_BLOCK1_B);
+
+       tdxuserfuse->pid4 = (fuse_block >> 18) & GENMASK(13, 0);
+       tdxuserfuse->vers = (fuse_block >> 4) & GENMASK(13, 0);
+       tdxuserfuse->ramid = fuse_block & GENMASK(3, 0);
+}
+

 void board_mem_get_layout(u64 *phys_sdram_1_start, u64 *phys_sdram_1_size, u64 *phys_sdram_2_start, u64 *phys_sdram_2_size)
 {
        u32 is_quadplus = 0, val = 0;
+       struct tdx_user_fuses tdxramfuses;
        sc_err_t scierr = sc_misc_otp_fuse_read(-1, 6, &val);
        if (scierr == SC_ERR_NONE) {

board/toradex/apalis-imx8/apalis-imx8.c +0 -0
@@ -51,14 +105,33 @@ void board_mem_get_layout(u64 *phys_sdram_1_start,
                 is_quadplus = ((val >> 4) & 0x3) != 0x0;
         }


+       get_tdx_user_fuse(&tdxramfuses);
+
        *phys_sdram_1_start = PHYS_SDRAM_1;
        *phys_sdram_1_size = PHYS_SDRAM_1_SIZE;
        *phys_sdram_2_start = PHYS_SDRAM_2;
-       if (is_quadplus)
-               /* Our QP based SKUs only have 2 GB RAM (PHYS_SDRAM_1_SIZE) */ +
+       switch (tdxramfuses.ramid) {
+       case 1:
+               *phys_sdram_2_size = SZ_2G;
+               break;
+       case 2:
                *phys_sdram_2_size = 0x0UL;
-       else
-               *phys_sdram_2_size = PHYS_SDRAM_2_SIZE;
+               break;
+       case 3:
+               *phys_sdram_2_size = SZ_2G;
+               break;
+       case 4:
+               *phys_sdram_2_size = SZ_4G + SZ_2G;
+               break;
+       default:
+               if (is_quadplus)
+                       /* Our QP based SKUs only have 2 GB RAM (PHYS_SDRAM_1_SIZE) */ +                       *phys_sdram_2_size = 0x0UL;
+               else
+                       *phys_sdram_2_size = PHYS_SDRAM_2_SIZE;
+               break;
+       }
 }

 int board_early_init_f(void)

#3 lore raw

Re: [PATCH 2/2] board: apalis-imx8: add new 8gb product variant

In reply to Philippe Schenker

Hi Stefano

Quoted 10 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

Add the new Apalis iMX8 product variant

0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT

the only difference to the product

0037 Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT

Quoted 8 lines

is the 8gb of RAM. Toradex strategy to choose the correct RAM timing in SCFW is by fuses in the user area telling which RAM timing to load.

This commit makes use of this information to set the correct size of the RAM and therefore distinguish between the new 0067 and 0037 product

Those two patches are currently still missing. Could you please apply them as well? Thanks!

Cheers

Marcel

Quoted 131 lines

---

 board/toradex/apalis-imx8/apalis-imx8.c | 81 +++++++++++++++++++++++--

 1 file changed, 77 insertions(+), 4 deletions(-)
board/toradex/apalis-imx8/apalis-imx8.c +1 -0
index 04877fcd94..408198843f 100644
@@ -18,6 +18,7 @@
  #include <env.h>
  #include <errno.h>
  #include <linux/libfdt.h>
+#include <linux/bitops.h>


 #include "../common/tdx-cfg-block.h"

board/toradex/apalis-imx8/apalis-imx8.c +0 -0
@@ -28,22 +29,75 @@ DECLARE_GLOBAL_DATA_PTR;
                          (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
                          (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))

board/toradex/apalis-imx8/apalis-imx8.c +5 -0
+#define TDX_USER_FUSE_BLOCK1_A 276
+#define TDX_USER_FUSE_BLOCK1_B 277
+#define TDX_USER_FUSE_BLOCK2_A 278
+#define TDX_USER_FUSE_BLOCK2_B 279
+

 static iomux_cfg_t uart1_pads[] = { SC_P_UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL), SC_P_UART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL), };

board/toradex/apalis-imx8/apalis-imx8.c +6 -0
+struct tdx_user_fuses {
+       u16 pid4;
+       u16 vers;
+       u8 ramid;
+};
+

 static void setup_iomux_uart(void)
 {
        imx8_iomux_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads)); }

board/toradex/apalis-imx8/apalis-imx8.c +41 -0
+static uint32_t do_get_tdx_user_fuse(int a, int b)
+{
+       sc_err_t sciErr;
+       u32 val_a = 0;
+       u32 val_b = 0;
+
+       sciErr = sc_misc_otp_fuse_read(-1, a, &val_a);
+       if (sciErr != SC_ERR_NONE) {
+               printf("Error reading out user fuse %d\n", a);
+               return 0;
+       }
+
+       sciErr = sc_misc_otp_fuse_read(-1, b, &val_b);
+       if (sciErr != SC_ERR_NONE) {
+               printf("Error reading out user fuse %d\n", b);
+               return 0;
+       }
+
+       return ((val_a & 0xffff) << 16) | (val_b & 0xffff);
+}
+
+static void get_tdx_user_fuse(struct tdx_user_fuses *tdxuserfuse)
+{
+       u32 fuse_block;
+
+       fuse_block = do_get_tdx_user_fuse(TDX_USER_FUSE_BLOCK2_A,
+                                         TDX_USER_FUSE_BLOCK2_B);
+
+       /*
+        * Fuse block 2 acts as a backup area, if this reads 0 we want to
+        * use fuse block 1
+        */
+       if (fuse_block == 0)
+               fuse_block = do_get_tdx_user_fuse(TDX_USER_FUSE_BLOCK1_A,
+                                                 TDX_USER_FUSE_BLOCK1_B);
+
+       tdxuserfuse->pid4 = (fuse_block >> 18) & GENMASK(13, 0);
+       tdxuserfuse->vers = (fuse_block >> 4) & GENMASK(13, 0);
+       tdxuserfuse->ramid = fuse_block & GENMASK(3, 0);
+}
+

 void board_mem_get_layout(u64 *phys_sdram_1_start, u64 *phys_sdram_1_size, u64 *phys_sdram_2_start, u64 *phys_sdram_2_size)
 {
        u32 is_quadplus = 0, val = 0;
+       struct tdx_user_fuses tdxramfuses;
        sc_err_t scierr = sc_misc_otp_fuse_read(-1, 6, &val);
        if (scierr == SC_ERR_NONE) {

board/toradex/apalis-imx8/apalis-imx8.c +0 -0
@@ -51,14 +105,33 @@ void board_mem_get_layout(u64 *phys_sdram_1_start,
                 is_quadplus = ((val >> 4) & 0x3) != 0x0;
         }


+       get_tdx_user_fuse(&tdxramfuses);
+
        *phys_sdram_1_start = PHYS_SDRAM_1;
        *phys_sdram_1_size = PHYS_SDRAM_1_SIZE;
        *phys_sdram_2_start = PHYS_SDRAM_2;
-       if (is_quadplus)
-               /* Our QP based SKUs only have 2 GB RAM (PHYS_SDRAM_1_SIZE) */ +
+       switch (tdxramfuses.ramid) {
+       case 1:
+               *phys_sdram_2_size = SZ_2G;
+               break;
+       case 2:
                *phys_sdram_2_size = 0x0UL;
-       else
-               *phys_sdram_2_size = PHYS_SDRAM_2_SIZE;
+               break;
+       case 3:
+               *phys_sdram_2_size = SZ_2G;
+               break;
+       case 4:
+               *phys_sdram_2_size = SZ_4G + SZ_2G;
+               break;
+       default:
+               if (is_quadplus)
+                       /* Our QP based SKUs only have 2 GB RAM (PHYS_SDRAM_1_SIZE) */ +                       *phys_sdram_2_size = 0x0UL;
+               else
+                       *phys_sdram_2_size = PHYS_SDRAM_2_SIZE;
+               break;
+       }
 }

 int board_early_init_f(void)

#4 lore raw

PATCH 2/2 board: apalis-imx8: add new 8gb product variant

In reply to Philippe Schenker
Quoted 9 lines

From: Philippe Schenker <[email protected]>
Add the new Apalis iMX8 product variant
0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT
the only difference to the product
0037 Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT
is the 8gb of RAM. Toradex strategy to choose the correct RAM timing in SCFW is by fuses in the user area telling which RAM timing to load. This commit makes use of this information to set the correct size of the RAM and therefore distinguish between the new 0067 and 0037 product

Quoted 3 lines

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
Acked-by on v1 1/2
#5 lore raw
In reply to Philippe Schenker
Quoted 10 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT

This module is identical to its 4GB counterpart
0037: Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT
except for the RAM size.

Quoted 68 lines

---

 board/toradex/common/tdx-cfg-block.c | 18 ++++++++++++++++-- board/toradex/common/tdx-cfg-block.h |  1 +

 2 files changed, 17 insertions(+), 2 deletions(-)
board/toradex/common/tdx-cfg-block.c +1 -0
index 9c87289ae9..6c8cf4592d 100644
@@ -144,6 +144,7 @@ const char * const toradex_modules[] = {
         [64] = "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT",
         [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",
  };


 const char * const toradex_carrier_boards[] = {

board/toradex/common/tdx-cfg-block.c +1 -0
@@ -359,6 +360,7 @@ static int get_cfgblock_interactive(void)
         char *soc;
         char it = 'n';
         char wb = 'n';
+       char mem8g = 'n';
         int len = 0;


        /* Unknown module by default */

board/toradex/common/tdx-cfg-block.c +8 -0
@@ -377,6 +379,14 @@ static int get_cfgblock_interactive(void)
         sprintf(message, "Does the module have Wi-Fi / Bluetooth? [y/N] ");
         len = cli_readline(message);
         wb = console_buffer[0];
+
+#if defined(CONFIG_TARGET_APALIS_IMX8)
+       if ((wb == 'y' || wb == 'Y') && (it == 'y' || it == 'Y')) {
+               sprintf(message, "Does your module have 8GB of RAM? [y/N] ");
+               len = cli_readline(message);
+               mem8g = console_buffer[0];
+       }
+#endif
  #endif


        soc = env_get("soc");

board/toradex/common/tdx-cfg-block.c +6 -2
@@ -430,8 +440,12 @@ static int get_cfgblock_interactive(void)
                 tdx_hw_tag.prodid = COLIBRI_IMX7S;
         else if (is_cpu_type(MXC_CPU_IMX8QM)) {
                 if (it == 'y' || it == 'Y') {
-                       if (wb == 'y' || wb == 'Y')
-                               tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+                       if (wb == 'y' || wb == 'Y') {
+                               if (mem8g == 'y' || mem8g == 'Y')
+                                       tdx_hw_tag.prodid = APALIS_IMX8QM_8GB_WIFI_BT_IT;
+                               else
+                                       tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+                       }

                        else
                                tdx_hw_tag.prodid = APALIS_IMX8QM_IT; } else {

board/toradex/common/tdx-cfg-block.h +0 -0
index ddcf699748..43e662e41d 100644
@@ -87,6 +87,7 @@ enum {
         VERDIN_IMX8MPQ_2GB_WIFI_BT_IT,

        VERDIN_IMX8MPQL_IT, /* 65 */
        VERDIN_IMX8MPQ_8GB_WIFI_BT,
+       APALIS_IMX8QM_8GB_WIFI_BT_IT,
 };

 enum {

#6 lore raw
In reply to Philippe Schenker

Hi Stefano

Quoted 10 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT

This module is identical to its 4GB counterpart
0037: Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT
except for the RAM size.

Those two patches are currently still missing. Could you please apply them as well? Thanks!

Cheers

Marcel

Quoted 68 lines

---

 board/toradex/common/tdx-cfg-block.c | 18 ++++++++++++++++-- board/toradex/common/tdx-cfg-block.h |  1 +

 2 files changed, 17 insertions(+), 2 deletions(-)
board/toradex/common/tdx-cfg-block.c +1 -0
index 9c87289ae9..6c8cf4592d 100644
@@ -144,6 +144,7 @@ const char * const toradex_modules[] = {
         [64] = "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT",
         [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",
  };


 const char * const toradex_carrier_boards[] = {

board/toradex/common/tdx-cfg-block.c +1 -0
@@ -359,6 +360,7 @@ static int get_cfgblock_interactive(void)
         char *soc;
         char it = 'n';
         char wb = 'n';
+       char mem8g = 'n';
         int len = 0;


        /* Unknown module by default */

board/toradex/common/tdx-cfg-block.c +8 -0
@@ -377,6 +379,14 @@ static int get_cfgblock_interactive(void)
         sprintf(message, "Does the module have Wi-Fi / Bluetooth? [y/N] ");
         len = cli_readline(message);
         wb = console_buffer[0];
+
+#if defined(CONFIG_TARGET_APALIS_IMX8)
+       if ((wb == 'y' || wb == 'Y') && (it == 'y' || it == 'Y')) {
+               sprintf(message, "Does your module have 8GB of RAM? [y/N] ");
+               len = cli_readline(message);
+               mem8g = console_buffer[0];
+       }
+#endif
  #endif


        soc = env_get("soc");

board/toradex/common/tdx-cfg-block.c +6 -2
@@ -430,8 +440,12 @@ static int get_cfgblock_interactive(void)
                 tdx_hw_tag.prodid = COLIBRI_IMX7S;
         else if (is_cpu_type(MXC_CPU_IMX8QM)) {
                 if (it == 'y' || it == 'Y') {
-                       if (wb == 'y' || wb == 'Y')
-                               tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+                       if (wb == 'y' || wb == 'Y') {
+                               if (mem8g == 'y' || mem8g == 'Y')
+                                       tdx_hw_tag.prodid = APALIS_IMX8QM_8GB_WIFI_BT_IT;
+                               else
+                                       tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+                       }

                        else
                                tdx_hw_tag.prodid = APALIS_IMX8QM_IT; } else {

board/toradex/common/tdx-cfg-block.h +0 -0
index ddcf699748..43e662e41d 100644
@@ -87,6 +87,7 @@ enum {
         VERDIN_IMX8MPQ_2GB_WIFI_BT_IT,

        VERDIN_IMX8MPQL_IT, /* 65 */
        VERDIN_IMX8MPQ_8GB_WIFI_BT,
+       APALIS_IMX8QM_8GB_WIFI_BT_IT,
 };

 enum {

#7 lore raw

Hi Marcel, Philippe,

Quoted 7 lines · Marcel Ziswiler

Hi Stefano

Quoted 4 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT

Quoted 8 lines
Quoted 6 lines

This module is identical to its 4GB counterpart
0037: Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT
except for the RAM size.

Those two patches are currently still missing. Could you please apply them as well? Thanks!

Yes, I solved the long backlog, quite "recent" patches were out of my sight.

Marked them for the release, I plan another PR before release.

Regards,
Stefano

Quoted 73 lines

Cheers

Marcel

Quoted 68 lines

---

  board/toradex/common/tdx-cfg-block.c | 18 ++++++++++++++++--
  board/toradex/common/tdx-cfg-block.h |  1 +
  2 files changed, 17 insertions(+), 2 deletions(-)
board/toradex/common/tdx-cfg-block.c +16 -2
index 9c87289ae9..6c8cf4592d 100644
@@ -144,6 +144,7 @@ const char * const toradex_modules[] = {
         [64] = "Verdin iMX8M Plus Quad 2GB Wi-Fi / BT IT",
         [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",
  };
 
  const char * const toradex_carrier_boards[] = {
@@ -359,6 +360,7 @@ static int get_cfgblock_interactive(void)
         char *soc;
         char it = 'n';
         char wb = 'n';
+       char mem8g = 'n';
         int len = 0;
 
         /* Unknown module by default */
@@ -377,6 +379,14 @@ static int get_cfgblock_interactive(void)
         sprintf(message, "Does the module have Wi-Fi / Bluetooth? [y/N] ");
         len = cli_readline(message);
         wb = console_buffer[0];
+
+#if defined(CONFIG_TARGET_APALIS_IMX8)
+       if ((wb == 'y' || wb == 'Y') && (it == 'y' || it == 'Y')) {
+               sprintf(message, "Does your module have 8GB of RAM? [y/N] ");
+               len = cli_readline(message);
+               mem8g = console_buffer[0];
+       }
+#endif
  #endif
 
         soc = env_get("soc");
@@ -430,8 +440,12 @@ static int get_cfgblock_interactive(void)
                 tdx_hw_tag.prodid = COLIBRI_IMX7S;
         else if (is_cpu_type(MXC_CPU_IMX8QM)) {
                 if (it == 'y' || it == 'Y') {
-                       if (wb == 'y' || wb == 'Y')
-                               tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+                       if (wb == 'y' || wb == 'Y') {
+                               if (mem8g == 'y' || mem8g == 'Y')
+                                       tdx_hw_tag.prodid = APALIS_IMX8QM_8GB_WIFI_BT_IT;
+                               else
+                                       tdx_hw_tag.prodid = APALIS_IMX8QM_WIFI_BT_IT;
+                       }
                         else
                                 tdx_hw_tag.prodid = APALIS_IMX8QM_IT;
                 } else {
board/toradex/common/tdx-cfg-block.h +1 -0
index ddcf699748..43e662e41d 100644
@@ -87,6 +87,7 @@ enum {
         VERDIN_IMX8MPQ_2GB_WIFI_BT_IT,
         VERDIN_IMX8MPQL_IT, /* 65 */
         VERDIN_IMX8MPQ_8GB_WIFI_BT,
+       APALIS_IMX8QM_8GB_WIFI_BT_IT,
  };
 
  enum {
Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#8 lore raw

PATCH 1/2 toradex: tdx-cfg-block: add new 8gb apalis-imx8

In reply to Philippe Schenker
Quoted 8 lines

From: Philippe Schenker <[email protected]> 0067: Apalis iMX8 QuadMax 8GB Wi-Fi / BT IT This module is identical to its 4GB counterpart 0037: Apalis iMX8 QuadMax 4GB Wi-Fi / BT IT except for the RAM size.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================