diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-02-27 08:06:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-02 06:15:03 -0500 |
commit | 190dbcfd6806c7c88fc028acda95731ffd43979d (patch) | |
tree | 3ad2f2bd43ab71c45dd051d5c52c476871dd5b87 /drivers/net/sfc/sfe4001.c | |
parent | 7b065f91faf56f5445ba45878ce6c55ea6388bb3 (diff) |
sfc: SFT9001/SFN4111T: Check PHY boot status during board initialisation
During SFN4111T initialisation, check whether the PHY boot status
indicates a bad firmware checksum. If so, prepare to reflash rather
than continuing with normal initialisation.
Remove redundant PHY boot status check from tenxpress_phy_init().
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/sfe4001.c')
-rw-r--r-- | drivers/net/sfc/sfe4001.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/sfc/sfe4001.c b/drivers/net/sfc/sfe4001.c index c0e906831623..4eac5da81e5a 100644 --- a/drivers/net/sfc/sfe4001.c +++ b/drivers/net/sfc/sfe4001.c | |||
@@ -399,6 +399,7 @@ static struct i2c_board_info sfn4111t_r5_hwmon_info = { | |||
399 | 399 | ||
400 | int sfn4111t_init(struct efx_nic *efx) | 400 | int sfn4111t_init(struct efx_nic *efx) |
401 | { | 401 | { |
402 | int i = 0; | ||
402 | int rc; | 403 | int rc; |
403 | 404 | ||
404 | efx->board_info.hwmon_client = | 405 | efx->board_info.hwmon_client = |
@@ -417,13 +418,20 @@ int sfn4111t_init(struct efx_nic *efx) | |||
417 | if (rc) | 418 | if (rc) |
418 | goto fail_hwmon; | 419 | goto fail_hwmon; |
419 | 420 | ||
420 | if (efx->phy_mode & PHY_MODE_SPECIAL) { | 421 | do { |
421 | efx_stats_disable(efx); | 422 | if (efx->phy_mode & PHY_MODE_SPECIAL) { |
422 | sfn4111t_reset(efx); | 423 | /* PHY may not generate a 156.25 MHz clock and MAC |
423 | } | 424 | * stats fetch will fail. */ |
424 | 425 | efx_stats_disable(efx); | |
425 | return 0; | 426 | sfn4111t_reset(efx); |
427 | } | ||
428 | rc = sft9001_wait_boot(efx); | ||
429 | if (rc == 0) | ||
430 | return 0; | ||
431 | efx->phy_mode = PHY_MODE_SPECIAL; | ||
432 | } while (rc == -EINVAL && ++i < 2); | ||
426 | 433 | ||
434 | device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); | ||
427 | fail_hwmon: | 435 | fail_hwmon: |
428 | i2c_unregister_device(efx->board_info.hwmon_client); | 436 | i2c_unregister_device(efx->board_info.hwmon_client); |
429 | return rc; | 437 | return rc; |