summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Drozdov <denys.drozdov@toradex.com>2021-04-05 17:33:21 +0300
committerDenys Drozdov <denys.drozdov@toradex.com>2021-04-07 10:41:49 +0300
commit96412c35eb05d5a10e955a07ce95a098ba29b2b7 (patch)
tree0bfab60d6db859dc52f584d452b1e72f0466de80
parent347b4ac4e4205379f6570f5e73e2c706870bc37f (diff)
toradex: configblock: fix module revision in config blocktoradex_2019.07-nexttoradex_2019.07
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>
-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 c19d7611c2..80be726281 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -459,6 +459,8 @@ static int get_cfgblock_interactive(void)
static int get_cfgblock_barcode(char *barcode)
{
+ char revision[3] = {barcode[6], barcode[7], '\0'};
+
if (strlen(barcode) < 16) {
printf("Argument too short, barcode is 16 chars long\n");
return -1;
@@ -467,7 +469,7 @@ static int get_cfgblock_barcode(char *barcode)
/* Get hardware information from the first 8 digits */
tdx_hw_tag.ver_major = barcode[4] - '0';
tdx_hw_tag.ver_minor = barcode[5] - '0';
- tdx_hw_tag.ver_assembly = barcode[7] - '0';
+ tdx_hw_tag.ver_assembly = simple_strtoul(revision, NULL, 10);
barcode[4] = '\0';
tdx_hw_tag.prodid = simple_strtoul(barcode, NULL, 10);