summaryrefslogtreecommitdiff
path: root/board/toradex/common
diff options
context:
space:
mode:
authorDenys Drozdov <denys.drozdov@toradex.com>2021-04-07 15:28:24 +0300
committerTom Rini <trini@konsulko.com>2021-04-20 07:31:12 -0400
commitfd90aca329a37eade4187ca886a8dea5c60aaba0 (patch)
treebb201255ec78a847414959615aeac674e275fffd /board/toradex/common
parent1aa2a745c5e652689626b5cccd758fa9cdb56f9d (diff)
downloadu-boot-fd90aca329a37eade4187ca886a8dea5c60aaba0.tar.gz
u-boot-fd90aca329a37eade4187ca886a8dea5c60aaba0.tar.bz2
u-boot-fd90aca329a37eade4187ca886a8dea5c60aaba0.zip
toradex: configblock: 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 all digits of PID8 to store module revision. Signed-off-by: Denys Drozdov <denys.drozdov@toradex.com> Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Diffstat (limited to 'board/toradex/common')
-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 b00467f976..93eb20cf63 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -556,6 +556,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;
@@ -564,7 +566,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);