diff options
Diffstat (limited to 'board/toradex/common/tdx-cfg-block.c')
-rw-r--r-- | board/toradex/common/tdx-cfg-block.c | 65 |
1 files changed, 54 insertions, 11 deletions
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c index 11f4d5e14a..7187e1ba37 100644 --- a/board/toradex/common/tdx-cfg-block.c +++ b/board/toradex/common/tdx-cfg-block.c @@ -139,18 +139,34 @@ const struct toradex_som toradex_modules[] = { [66] = { "Verdin iMX8M Plus Quad 8GB WB", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, [67] = { "Apalis iMX8QM 8GB WB IT", TARGET_IS_ENABLED(APALIS_IMX8) }, [68] = { "Verdin iMX8M Mini Quad 2GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MM) }, + [69] = { "Verdin AM62 Quad 1GB WB IT", TARGET_IS_ENABLED(VERDIN_AM62_A53) }, + [70] = { "Verdin iMX8M Plus Quad 8GB WB IT", TARGET_IS_ENABLED(VERDIN_IMX8MP) }, + [71] = { "Verdin AM62 Solo 512MB", TARGET_IS_ENABLED(VERDIN_AM62_A53) }, + [72] = { "Verdin AM62 Solo 512MB WB IT", TARGET_IS_ENABLED(VERDIN_AM62_A53) }, + [73] = { "Verdin AM62 Dual 1GB ET", TARGET_IS_ENABLED(VERDIN_AM62_A53) }, + [74] = { "Verdin AM62 Dual 1GB IT", TARGET_IS_ENABLED(VERDIN_AM62_A53) }, + [75] = { "Verdin AM62 Dual 1GB WB IT", TARGET_IS_ENABLED(VERDIN_AM62_A53) }, + [76] = { "Verdin AM62 Quad 2GB WB IT", TARGET_IS_ENABLED(VERDIN_AM62_A53) }, }; -const char * const toradex_carrier_boards[] = { - [0] = "UNKNOWN CARRIER BOARD", - [155] = "Dahlia", - [156] = "Verdin Development Board", +struct pid4list { + int pid4; + char * const name; }; -const char * const toradex_display_adapters[] = { - [0] = "UNKNOWN DISPLAY ADAPTER", - [157] = "Verdin DSI to HDMI Adapter", - [159] = "Verdin DSI to LVDS Adapter", +const struct pid4list toradex_carrier_boards[] = { + /* the code assumes unknown at index 0 */ + {0, "UNKNOWN CARRIER BOARD"}, + {DAHLIA, "Dahlia"}, + {VERDIN_DEVELOPMENT_BOARD, "Verdin Development Board"}, + {YAVIA, "Yavia"}, +}; + +const struct pid4list toradex_display_adapters[] = { + /* the code assumes unknown at index 0 */ + {0, "UNKNOWN DISPLAY ADAPTER"}, + {VERDIN_DSI_TO_HDMI_ADAPTER, "Verdin DSI to HDMI Adapter"}, + {VERDIN_DSI_TO_LVDS_ADAPTER, "Verdin DSI to LVDS Adapter"}, }; const u32 toradex_ouis[] = { @@ -158,6 +174,32 @@ const u32 toradex_ouis[] = { [1] = 0x8c06cbUL, }; +const char * const get_toradex_carrier_boards(int pid4) +{ + int i, index = 0; + + for (i = 1; i < ARRAY_SIZE(toradex_carrier_boards); i++) { + if (pid4 == toradex_carrier_boards[i].pid4) { + index = i; + break; + } + } + return toradex_carrier_boards[index].name; +} + +const char * const get_toradex_display_adapters(int pid4) +{ + int i, index = 0; + + for (i = 1; i < ARRAY_SIZE(toradex_display_adapters); i++) { + if (pid4 == toradex_display_adapters[i].pid4) { + index = i; + break; + } + } + return toradex_display_adapters[index].name; +} + static u32 get_serial_from_mac(struct toradex_eth_addr *eth_addr) { int i; @@ -637,10 +679,11 @@ static int get_cfgblock_carrier_interactive(void) int ret = 0; printf("Supported carrier boards:\n"); - printf("CARRIER BOARD NAME\t\t [ID]\n"); + printf("%30s\t[ID]\n", "CARRIER BOARD NAME"); for (int i = 0; i < ARRAY_SIZE(toradex_carrier_boards); i++) - if (toradex_carrier_boards[i]) - printf("%s \t\t [%d]\n", toradex_carrier_boards[i], i); + printf("%30s\t[%d]\n", + toradex_carrier_boards[i].name, + toradex_carrier_boards[i].pid4); sprintf(message, "Choose your carrier board (provide ID): "); len = cli_readline(message); |