diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2023-07-17 12:53:11 +0200 |
---|---|---|
committer | Andrejs Cainikovs <andrejs.cainikovs@toradex.com> | 2023-07-18 11:13:05 +0200 |
commit | d4584502e99695c4e1be9cc073d492b350fd4533 (patch) | |
tree | cef7e3b0243380a862a623b87f7495a946fe5772 /board/toradex/common/tdx-common.c | |
parent | c02259eae19431af0a56841388ec40649a26a8e7 (diff) |
toradex: tdx-cfg-block: rework carrier board name handling
Rework the rather big array of zero length strings with 4 entries of
actual carrier board names to a array of structs which ties a pid4
to its correspondent human readable string.
Provide an accessor to get the string for a given PID4.
Rework the user of the information to use the accessor.
Note that check_pid8_sanity() is used for early samples of Dahlia and
the development board. Yavia isn't affected.
Upstream-Status: Submitted [https://lore.kernel.org/all/20230718090734.20357-3-andrejs.cainikovs@toradex.com/]
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
Diffstat (limited to 'board/toradex/common/tdx-common.c')
-rw-r--r-- | board/toradex/common/tdx-common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c index fadbe45541..de94036c47 100644 --- a/board/toradex/common/tdx-common.c +++ b/board/toradex/common/tdx-common.c @@ -31,7 +31,7 @@ static char tdx_board_rev_str[MODULE_VER_STR_LEN + MODULE_REV_STR_LEN + 1]; #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA static char tdx_car_serial_str[SERIAL_STR_LEN + 1]; static char tdx_car_rev_str[MODULE_VER_STR_LEN + MODULE_REV_STR_LEN + 1]; -static char *tdx_carrier_board_name; +static const char *tdx_carrier_board_name; #endif #if defined(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) @@ -125,8 +125,8 @@ int show_board_info(void) printf("MISSING TORADEX CARRIER CONFIG BLOCKS\n"); try_migrate_tdx_cfg_block_carrier(); } else { - tdx_carrier_board_name = (char *) - toradex_carrier_boards[tdx_car_hw_tag.prodid]; + tdx_carrier_board_name = + get_toradex_carrier_boards(tdx_car_hw_tag.prodid); snprintf(tdx_car_serial_str, sizeof(tdx_car_serial_str), "%08u", tdx_car_serial); |