+ cf_read_tlv_data();
+
+ /* Apply build configuration options before runtime configuration */
+ if (IS_ENABLED(CONFIG_CLEARFOG_SFP_25GB))
+ board_serdes_map[5].serdes_speed = SERDES_SPEED_3_125_GBPS;
+
+ if (IS_ENABLED(CONFIG_CLEARFOG_CON2_SATA)) {
+ board_serdes_map[4].serdes_type = SATA2;
+ board_serdes_map[4].serdes_speed = SERDES_SPEED_3_GBPS;
+ board_serdes_map[4].serdes_mode = SERDES_DEFAULT_MODE;
+ board_serdes_map[4].swap_rx = 1;
+ }
+
+ if (IS_ENABLED(CONFIG_CLEARFOG_CON3_SATA)) {
+ board_serdes_map[2].serdes_type = SATA1;
+ board_serdes_map[2].serdes_speed = SERDES_SPEED_3_GBPS;
+ board_serdes_map[2].serdes_mode = SERDES_DEFAULT_MODE;
+ board_serdes_map[2].swap_rx = 1;
+ }
+
+ /* Apply runtime detection changes */
+ if (sr_product_is(&cf_tlv_data, "Clearfog GTR")) {
+ board_serdes_map[0].serdes_type = PEX0;
+ board_serdes_map[0].serdes_speed = SERDES_SPEED_5_GBPS;
+ board_serdes_map[0].serdes_mode = PEX_ROOT_COMPLEX_X1;
+ } else if (sr_product_is(&cf_tlv_data, "Clearfog Pro")) {
+ /* handle recognized product as noop, no adjustment required */
+ } else if (sr_product_is(&cf_tlv_data, "Clearfog Base")) {
+ config_cfbase_serdes_map();
+ } else {
+ /*
+ * Fallback to static default. EEPROM TLV support is not
+ * enabled, runtime detection failed, hardware support is not
+ * present, EEPROM is corrupt, or an unrecognized product name
+ * is present.
+ */
+ if (IS_ENABLED(CONFIG_SPL_CMD_TLV_EEPROM))
+ puts("EEPROM TLV detection failed: ");
+ puts("Using static config for ");
+ if (IS_ENABLED(CONFIG_TARGET_CLEARFOG_BASE)) {
+ puts("Clearfog Base.\n");
+ config_cfbase_serdes_map();
+ } else {
+ puts("Clearfog Pro.\n");
+ }
+ }
+