summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Schenker <philippe.schenker@toradex.com>2019-09-11 12:42:40 +0200
committerPhilippe Schenker <philippe.schenker@toradex.com>2019-09-18 17:15:55 +0200
commit1a62ebf22608b6ecb4f99b84dcf22096c4d35b2d (patch)
tree68504670d98a55d1f51782af14f759499cfcecea
parent92d0497781fdddf43e33791b7e676b0ebf8d6878 (diff)
tdx-cfg-block: Add prototype numbering and Apalis iMX8X
Toradex will use product-id 2600 upwards as id's for prototypes. This commit adds this functionality to the config block. The Apalis iMX8X is as well added in the same commit as it is the first prototype and the first prodid in that range. Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
-rw-r--r--board/toradex/common/tdx-cfg-block.c23
-rw-r--r--board/toradex/common/tdx-cfg-block.h7
-rw-r--r--board/toradex/common/tdx-common.c10
3 files changed, 37 insertions, 3 deletions
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index e454de9abe..1fec008b82 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -8,6 +8,7 @@
#if defined(CONFIG_TARGET_APALIS_IMX6) || \
defined(CONFIG_TARGET_APALIS_IMX8) || \
+ defined(CONFIG_TARGET_APALIS_IMX8QXP) || \
defined(CONFIG_TARGET_COLIBRI_IMX6) || \
defined(CONFIG_TARGET_COLIBRI_IMX8QXP)
#include <asm/arch/sys_proto.h>
@@ -111,6 +112,12 @@ 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",
+};
+
+const char * const toradex_prototype_modules[] = {
+ [0] = "Apalis iMX8QXP 2GB ECC Wi / BT IT PROTO"
};
#ifdef CONFIG_TDX_CFG_BLOCK_IS_IN_MMC
@@ -213,6 +220,16 @@ static int write_tdx_cfg_block_to_nor(unsigned char *config_block)
}
#endif
+int is_tdx_prototype_prodid(u16 prodid)
+{
+ int prototype_range_min = 2600;
+ int prototype_range_max = 2600 + (sizeof(toradex_prototype_modules) /
+ sizeof(toradex_prototype_modules[0]));
+
+ return ((prodid >= prototype_range_min) &&
+ (prodid < prototype_range_max));
+}
+
int read_tdx_cfg_block(void)
{
int ret = 0;
@@ -279,8 +296,10 @@ int read_tdx_cfg_block(void)
/* Cap product id to avoid issues with a yet unknown one */
if (tdx_hw_tag.prodid >= (sizeof(toradex_modules) /
- sizeof(toradex_modules[0])))
- tdx_hw_tag.prodid = 0;
+ sizeof(toradex_modules[0]))) {
+ if (!is_tdx_prototype_prodid(tdx_hw_tag.prodid))
+ tdx_hw_tag.prodid = 0;
+ }
out:
free(config_block);
diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h
index bfdc8b7f70..e03553c698 100644
--- a/board/toradex/common/tdx-cfg-block.h
+++ b/board/toradex/common/tdx-cfg-block.h
@@ -73,9 +73,14 @@ enum {
COLIBRI_IMX8QXP_IT, /* 50 */
COLIBRI_IMX8DX_WIFI_BT,
COLIBRI_IMX8DX,
+ APALIS_IMX8QXP_ECC_IT,
+ APALIS_IMX8DXP,
+ /* Prototypes */
+ APALIS_IMX8QXP_ECC_WIFI_BT_IT_PROTOTYPE = 2600,
};
extern const char * const toradex_modules[];
+extern const char * const toradex_prototype_modules[];
extern bool valid_cfgblock;
extern struct toradex_hw tdx_hw_tag;
extern struct toradex_eth_addr tdx_eth_addr;
@@ -83,4 +88,6 @@ extern u32 tdx_serial;
int read_tdx_cfg_block(void);
+int is_tdx_prototype_prodid(u16 prodid);
+
#endif /* _TDX_CFG_BLOCK_H */
diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c
index 2d560cceaf..b983424fc4 100644
--- a/board/toradex/common/tdx-common.c
+++ b/board/toradex/common/tdx-common.c
@@ -68,6 +68,7 @@ void get_board_serial(struct tag_serialnr *serialnr)
int show_board_info(void)
{
unsigned char ethaddr[6];
+ char* tdx_module_name;
if (read_tdx_cfg_block()) {
printf("MISSING TORADEX CONFIG BLOCK\n");
@@ -75,6 +76,13 @@ int show_board_info(void)
tdx_eth_addr.nic = htonl(tdx_serial << 8);
checkboard();
} else {
+ if (is_tdx_prototype_prodid(tdx_hw_tag.prodid)) {
+ tdx_module_name = (char *)
+ toradex_prototype_modules[tdx_hw_tag.prodid - 2600];
+ } else {
+ tdx_module_name = (char *)
+ toradex_modules[tdx_hw_tag.prodid];
+ }
sprintf(tdx_serial_str, "%08u", tdx_serial);
sprintf(tdx_board_rev_str, "V%1d.%1d%c",
tdx_hw_tag.ver_major,
@@ -84,7 +92,7 @@ int show_board_info(void)
env_set("serial#", tdx_serial_str);
printf("Model: Toradex %s %s, Serial# %s\n",
- toradex_modules[tdx_hw_tag.prodid],
+ tdx_module_name,
tdx_board_rev_str,
tdx_serial_str);
}