summaryrefslogtreecommitdiff
path: root/board/toradex/common/tdx-cfg-block.c
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 /board/toradex/common/tdx-cfg-block.c
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>
Diffstat (limited to 'board/toradex/common/tdx-cfg-block.c')
-rw-r--r--board/toradex/common/tdx-cfg-block.c23
1 files changed, 21 insertions, 2 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);