diff options
Diffstat (limited to 'drivers/net/sfc/falcon_boards.c')
-rw-r--r-- | drivers/net/sfc/falcon_boards.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c index b2505fc5c1f7..429d3cd646b5 100644 --- a/drivers/net/sfc/falcon_boards.c +++ b/drivers/net/sfc/falcon_boards.c | |||
@@ -499,9 +499,22 @@ static struct i2c_board_info sfn4111t_r5_hwmon_info = { | |||
499 | I2C_BOARD_INFO("max6646", 0x4d), | 499 | I2C_BOARD_INFO("max6646", 0x4d), |
500 | }; | 500 | }; |
501 | 501 | ||
502 | static void sfn4111t_init_phy(struct efx_nic *efx) | ||
503 | { | ||
504 | if (!(efx->phy_mode & PHY_MODE_SPECIAL)) { | ||
505 | if (sft9001_wait_boot(efx) != -EINVAL) | ||
506 | return; | ||
507 | |||
508 | efx->phy_mode = PHY_MODE_SPECIAL; | ||
509 | efx_stats_disable(efx); | ||
510 | } | ||
511 | |||
512 | sfn4111t_reset(efx); | ||
513 | sft9001_wait_boot(efx); | ||
514 | } | ||
515 | |||
502 | static int sfn4111t_init(struct efx_nic *efx) | 516 | static int sfn4111t_init(struct efx_nic *efx) |
503 | { | 517 | { |
504 | int i = 0; | ||
505 | int rc; | 518 | int rc; |
506 | 519 | ||
507 | efx->board_info.hwmon_client = | 520 | efx->board_info.hwmon_client = |
@@ -512,6 +525,7 @@ static int sfn4111t_init(struct efx_nic *efx) | |||
512 | if (!efx->board_info.hwmon_client) | 525 | if (!efx->board_info.hwmon_client) |
513 | return -EIO; | 526 | return -EIO; |
514 | 527 | ||
528 | efx->board_info.init_phy = sfn4111t_init_phy; | ||
515 | efx->board_info.set_id_led = tenxpress_set_id_led; | 529 | efx->board_info.set_id_led = tenxpress_set_id_led; |
516 | efx->board_info.monitor = sfn4111t_check_hw; | 530 | efx->board_info.monitor = sfn4111t_check_hw; |
517 | efx->board_info.fini = sfn4111t_fini; | 531 | efx->board_info.fini = sfn4111t_fini; |
@@ -520,20 +534,13 @@ static int sfn4111t_init(struct efx_nic *efx) | |||
520 | if (rc) | 534 | if (rc) |
521 | goto fail_hwmon; | 535 | goto fail_hwmon; |
522 | 536 | ||
523 | do { | 537 | if (efx->phy_mode & PHY_MODE_SPECIAL) |
524 | if (efx->phy_mode & PHY_MODE_SPECIAL) { | 538 | /* PHY may not generate a 156.25 MHz clock and MAC |
525 | /* PHY may not generate a 156.25 MHz clock and MAC | 539 | * stats fetch will fail. */ |
526 | * stats fetch will fail. */ | 540 | efx_stats_disable(efx); |
527 | efx_stats_disable(efx); | 541 | |
528 | sfn4111t_reset(efx); | 542 | return 0; |
529 | } | ||
530 | rc = sft9001_wait_boot(efx); | ||
531 | if (rc == 0) | ||
532 | return 0; | ||
533 | efx->phy_mode = PHY_MODE_SPECIAL; | ||
534 | } while (rc == -EINVAL && ++i < 2); | ||
535 | 543 | ||
536 | device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); | ||
537 | fail_hwmon: | 544 | fail_hwmon: |
538 | i2c_unregister_device(efx->board_info.hwmon_client); | 545 | i2c_unregister_device(efx->board_info.hwmon_client); |
539 | return rc; | 546 | return rc; |
@@ -574,7 +581,7 @@ static struct i2c_board_info sfe4002_hwmon_info = { | |||
574 | #define SFE4002_RX_LED (0) /* Green */ | 581 | #define SFE4002_RX_LED (0) /* Green */ |
575 | #define SFE4002_TX_LED (1) /* Amber */ | 582 | #define SFE4002_TX_LED (1) /* Amber */ |
576 | 583 | ||
577 | static void sfe4002_init_leds(struct efx_nic *efx) | 584 | static void sfe4002_init_phy(struct efx_nic *efx) |
578 | { | 585 | { |
579 | /* Set the TX and RX LEDs to reflect status and activity, and the | 586 | /* Set the TX and RX LEDs to reflect status and activity, and the |
580 | * fault LED off */ | 587 | * fault LED off */ |
@@ -609,7 +616,7 @@ static int sfe4002_init(struct efx_nic *efx) | |||
609 | if (rc) | 616 | if (rc) |
610 | return rc; | 617 | return rc; |
611 | efx->board_info.monitor = sfe4002_check_hw; | 618 | efx->board_info.monitor = sfe4002_check_hw; |
612 | efx->board_info.init_leds = sfe4002_init_leds; | 619 | efx->board_info.init_phy = sfe4002_init_phy; |
613 | efx->board_info.set_id_led = sfe4002_set_id_led; | 620 | efx->board_info.set_id_led = sfe4002_set_id_led; |
614 | efx->board_info.fini = efx_fini_lm87; | 621 | efx->board_info.fini = efx_fini_lm87; |
615 | return 0; | 622 | return 0; |
@@ -641,7 +648,7 @@ static struct i2c_board_info sfn4112f_hwmon_info = { | |||
641 | #define SFN4112F_ACT_LED 0 | 648 | #define SFN4112F_ACT_LED 0 |
642 | #define SFN4112F_LINK_LED 1 | 649 | #define SFN4112F_LINK_LED 1 |
643 | 650 | ||
644 | static void sfn4112f_init_leds(struct efx_nic *efx) | 651 | static void sfn4112f_init_phy(struct efx_nic *efx) |
645 | { | 652 | { |
646 | falcon_qt202x_set_led(efx, SFN4112F_ACT_LED, | 653 | falcon_qt202x_set_led(efx, SFN4112F_ACT_LED, |
647 | QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACT); | 654 | QUAKE_LED_RXLINK | QUAKE_LED_LINK_ACT); |
@@ -680,7 +687,7 @@ static int sfn4112f_init(struct efx_nic *efx) | |||
680 | if (rc) | 687 | if (rc) |
681 | return rc; | 688 | return rc; |
682 | efx->board_info.monitor = sfn4112f_check_hw; | 689 | efx->board_info.monitor = sfn4112f_check_hw; |
683 | efx->board_info.init_leds = sfn4112f_init_leds; | 690 | efx->board_info.init_phy = sfn4112f_init_phy; |
684 | efx->board_info.set_id_led = sfn4112f_set_id_led; | 691 | efx->board_info.set_id_led = sfn4112f_set_id_led; |
685 | efx->board_info.fini = efx_fini_lm87; | 692 | efx->board_info.fini = efx_fini_lm87; |
686 | return 0; | 693 | return 0; |