diff --git a/board/nm/hw14/board.c b/board/nm/hw14/board.c index c0f1c02deb..c58d8ae83c 100644 --- a/board/nm/hw14/board.c +++ b/board/nm/hw14/board.c @@ -208,13 +208,31 @@ static int init_console(void) int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count) { - int i; + int i, j; + int bd_config_is_broken = 0; if (read_eeprom() < 0){ /* If we do not have a board descriptor use the default serdes configuration defined in board_serdes_map */ puts("Could not read board descriptor using default serdes config.\n"); } else { + /* Check for broken serdes config in BD -> If multiple serdes lines are + configured for the same function something is obviously broken. */ + for (i = 0; i Ignoring BD serdes config\n"); + } + for (i = 0; i < ARRAY_SIZE(board_serdes_map); i++) { enum serdes_type type; uint8_t user_config = get_eeprom_serdes_config(i); @@ -223,10 +241,15 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count) /* if we have a user config we use that one */ type = (enum serdes_type)user_config; } else { - /* otherwise we use the config from the bd */ - type = bd_get_serdes_type(i); + /* otherwise we use the config from the bd if it is not broken */ + if (bd_config_is_broken) { + type = LAST_SERDES_TYPE; + } else { + type = bd_get_serdes_type(i); + } } + /* LAST_SERDES_TYPE means use compiled in default */ if (type < LAST_SERDES_TYPE) { if ((type >= SGMII0) && (type <= SGMII2)) { board_serdes_map[i].serdes_speed = SERDES_SPEED_1_25_GBPS; diff --git a/board/nm/hw17/board.c b/board/nm/hw17/board.c index 78bf915518..9db7cd4781 100644 --- a/board/nm/hw17/board.c +++ b/board/nm/hw17/board.c @@ -225,13 +225,31 @@ static int init_console(void) int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count) { - int i; + int i, j; + int bd_config_is_broken = 0; if (read_eeprom() < 0){ - /* If we do not have a board descriptor use the default + /* If we do not have a board descriptor use the default serdes configuration defined in board_serdes_map */ puts("Could not read board descriptor using default serdes config.\n"); } else { + /* Check for broken serdes config in BD -> If multiple serdes lines are + configured for the same function something is obviously broken. */ + for (i = 0; i Ignoring BD serdes config\n"); + } + for (i = 0; i < ARRAY_SIZE(board_serdes_map); i++) { enum serdes_type type; uint8_t user_config = get_eeprom_serdes_config(i); @@ -240,10 +258,15 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count) /* if we have a user config we use that one */ type = (enum serdes_type)user_config; } else { - /* otherwise we use the config from the bd */ - type = bd_get_serdes_type(i); + /* otherwise we use the config from the bd if it is not broken */ + if (bd_config_is_broken) { + type = LAST_SERDES_TYPE; + } else { + type = bd_get_serdes_type(i); + } } + /* LAST_SERDES_TYPE means use compiled in default */ if (type < LAST_SERDES_TYPE) { if ((type >= SGMII0) && (type <= SGMII2)) { board_serdes_map[i].serdes_speed = SERDES_SPEED_1_25_GBPS; diff --git a/board/nm/hw18/board.c b/board/nm/hw18/board.c index 136086630e..1592763b7e 100644 --- a/board/nm/hw18/board.c +++ b/board/nm/hw18/board.c @@ -203,13 +203,31 @@ static int init_console(void) int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count) { - int i; + int i, j; + int bd_config_is_broken = 0; if (read_eeprom() < 0){ /* If we do not have a board descriptor use the default serdes configuration defined in board_serdes_map */ puts("Could not read board descriptor using default serdes config.\n"); } else { + /* Check for broken serdes config in BD -> If multiple serdes lines are + configured for the same function something is obviously broken. */ + for (i = 0; i Ignoring BD serdes config\n"); + } + for (i = 0; i < ARRAY_SIZE(board_serdes_map); i++) { enum serdes_type type; uint8_t user_config = get_eeprom_serdes_config(i); @@ -218,10 +236,15 @@ int hws_board_topology_load(struct serdes_map **serdes_map_array, u8 *count) /* if we have a user config we use that one */ type = (enum serdes_type)user_config; } else { - /* otherwise we use the config from the bd */ - type = bd_get_serdes_type(i); + /* otherwise we use the config from the bd if it is not broken */ + if (bd_config_is_broken) { + type = LAST_SERDES_TYPE; + } else { + type = bd_get_serdes_type(i); + } } + /* LAST_SERDES_TYPE means use compiled in default */ if (type < LAST_SERDES_TYPE) { if ((type >= SGMII0) && (type <= SGMII2)) { board_serdes_map[i].serdes_speed = SERDES_SPEED_1_25_GBPS;