summaryrefslogtreecommitdiff
path: root/board/toradex/common/tdx-cfg-block.c
diff options
context:
space:
mode:
authorDenys Drozdov <denys.drozdov@toradex.com>2021-04-01 19:56:40 +0300
committerDenys Drozdov <denys.drozdov@toradex.com>2021-04-01 19:56:40 +0300
commit2a68bb1926d61ee0f15877ce76d615fd1bc88fe3 (patch)
tree309202d112a984388f7f367830f42906157518a4 /board/toradex/common/tdx-cfg-block.c
parent72c5548771bed674e0fb48a9a683fc8106943b6e (diff)
apalis_imx6: fix module revision in config block
U-boot might display wrong module revision information for modules with an assembly version 'K'. "cfgblock create" does not takes into account all revision digits from PID8. This fix takes into account 6th,7th digits of PID8 to store module revision. Related-to: ELB-3893 Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com>
Diffstat (limited to 'board/toradex/common/tdx-cfg-block.c')
-rw-r--r--board/toradex/common/tdx-cfg-block.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index bf27b2fa66..107b25bc60 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -545,6 +545,8 @@ static int get_cfgblock_interactive(void)
static int get_cfgblock_barcode(char *barcode, struct toradex_hw *tag,
u32 *serial)
{
+ char revision[3] = {barcode[6], barcode[7], '\0'};
+
if (strlen(barcode) < 16) {
printf("Argument too short, barcode is 16 chars long\n");
return -1;
@@ -553,7 +555,7 @@ static int get_cfgblock_barcode(char *barcode, struct toradex_hw *tag,
/* Get hardware information from the first 8 digits */
tag->ver_major = barcode[4] - '0';
tag->ver_minor = barcode[5] - '0';
- tag->ver_assembly = barcode[7] - '0';
+ tag->ver_assembly = simple_strtoul(revision, NULL, 10);
barcode[4] = '\0';
tag->prodid = simple_strtoul(barcode, NULL, 10);