From: Franz Schnyder <[email protected]> In the progress of decoupling from the Toradex product ID table, the implemented product ID limitation is now obsolete, as no new entries will be made to the table. Therefore, the implemented limitation logic needs to be removed, as otherwise new PID's written to the config block will be assigned as unknown.
This also means that `get_toradex_modules_idx()` is now obsolete and can be dropped. Signed-off-by: Franz Schnyder <[email protected]> --- board/toradex/common/tdx-cfg-block.c | 21 +-------------------- board/toradex/common/tdx-cfg-block.h | 1 - 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 9ddb944fc42..f01f3ea68f8 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -229,20 +229,6 @@ const u32 toradex_ouis[] = { [1] = 0x8c06cbUL, }; -int get_toradex_modules_idx(int pid4) -{ - int i, index = 0; - - for (i = 1; i < ARRAY_SIZE(toradex_modules); i++) { - if (pid4 == toradex_modules[i].pid4) { - index = i; - break; - } - } - - return index; -} - const char * const get_toradex_carrier_boards(int pid4) { int i, index = 0; @@ -416,7 +402,7 @@ static int write_tdx_cfg_block_to_eeprom(unsigned char *config_block) int read_tdx_cfg_block(void) { - int idx, ret = 0; + int ret = 0; u8 *config_block = NULL; struct toradex_tag *tag; size_t size = TDX_CFG_BLOCK_MAX_SIZE; @@ -484,11 +470,6 @@ int read_tdx_cfg_block(void) offset += tag->len * 4; } - /* Cap product id to avoid issues with a yet unknown one */ - idx = get_toradex_modules_idx(tdx_hw_tag.prodid); - if (!toradex_modules[idx].pid4) - tdx_hw_tag.prodid = 0; - out: free(config_block); return ret; diff --git a/board/toradex/common/tdx-cfg-block.h b/board/toradex/common/tdx-cfg-block.h index 32305c61c83..c712fad30ac 100644 --- a/board/toradex/common/tdx-cfg-block.h +++ b/board/toradex/common/tdx-cfg-block.h @@ -188,7 +188,6 @@ extern u32 tdx_car_serial; int read_tdx_cfg_block(void); int read_tdx_cfg_block_carrier(void); -int get_toradex_modules_idx(int pid4); const char * const get_toradex_carrier_boards(int pid4); const char * const get_toradex_display_adapters(int pid4); int try_migrate_tdx_cfg_block_carrier(void); -- 2.43.0
