Lines Matching refs:efx
90 static int efx_init_lm87(struct efx_nic *efx, const struct i2c_board_info *info, in efx_init_lm87() argument
93 struct falcon_board *board = falcon_board(efx); in efx_init_lm87()
119 static void efx_fini_lm87(struct efx_nic *efx) in efx_fini_lm87() argument
121 i2c_unregister_device(falcon_board(efx)->hwmon_client); in efx_fini_lm87()
124 static int efx_check_lm87(struct efx_nic *efx, unsigned mask) in efx_check_lm87() argument
126 struct i2c_client *client = falcon_board(efx)->hwmon_client; in efx_check_lm87()
132 if (EFX_WORKAROUND_7884(efx) && efx->link_state.up) in efx_check_lm87()
164 netif_err(efx, hw, efx->net_dev, in efx_check_lm87()
182 efx_init_lm87(struct efx_nic *efx, const struct i2c_board_info *info, in efx_init_lm87() argument
187 static inline void efx_fini_lm87(struct efx_nic *efx) in efx_fini_lm87() argument
190 static inline int efx_check_lm87(struct efx_nic *efx, unsigned mask) in efx_check_lm87() argument
258 static void sfe4001_poweroff(struct efx_nic *efx) in sfe4001_poweroff() argument
260 struct i2c_client *ioexp_client = falcon_board(efx)->ioexp_client; in sfe4001_poweroff()
261 struct i2c_client *hwmon_client = falcon_board(efx)->hwmon_client; in sfe4001_poweroff()
272 static int sfe4001_poweron(struct efx_nic *efx) in sfe4001_poweron() argument
274 struct i2c_client *ioexp_client = falcon_board(efx)->ioexp_client; in sfe4001_poweron()
275 struct i2c_client *hwmon_client = falcon_board(efx)->hwmon_client; in sfe4001_poweron()
304 netif_info(efx, hw, efx->net_dev, "power-cycling PHY\n"); in sfe4001_poweron()
316 if (efx->phy_mode & PHY_MODE_SPECIAL) in sfe4001_poweron()
330 netif_info(efx, hw, efx->net_dev, in sfe4001_poweron()
336 if (efx->phy_mode & PHY_MODE_SPECIAL) { in sfe4001_poweron()
353 netif_info(efx, hw, efx->net_dev, "timed out waiting for DSP boot\n"); in sfe4001_poweron()
356 sfe4001_poweroff(efx); in sfe4001_poweron()
363 struct efx_nic *efx = pci_get_drvdata(to_pci_dev(dev)); in show_phy_flash_cfg() local
364 return sprintf(buf, "%d\n", !!(efx->phy_mode & PHY_MODE_SPECIAL)); in show_phy_flash_cfg()
371 struct efx_nic *efx = pci_get_drvdata(to_pci_dev(dev)); in set_phy_flash_cfg() local
376 old_mode = efx->phy_mode; in set_phy_flash_cfg()
383 } else if (efx->state != STATE_READY || netif_running(efx->net_dev)) { in set_phy_flash_cfg()
388 efx->phy_mode = new_mode; in set_phy_flash_cfg()
390 falcon_stop_nic_stats(efx); in set_phy_flash_cfg()
391 err = sfe4001_poweron(efx); in set_phy_flash_cfg()
393 err = efx_reconfigure_port(efx); in set_phy_flash_cfg()
395 falcon_start_nic_stats(efx); in set_phy_flash_cfg()
404 static void sfe4001_fini(struct efx_nic *efx) in sfe4001_fini() argument
406 struct falcon_board *board = falcon_board(efx); in sfe4001_fini()
408 netif_info(efx, drv, efx->net_dev, "%s\n", __func__); in sfe4001_fini()
410 device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); in sfe4001_fini()
411 sfe4001_poweroff(efx); in sfe4001_fini()
416 static int sfe4001_check_hw(struct efx_nic *efx) in sfe4001_check_hw() argument
418 struct falcon_nic_data *nic_data = efx->nic_data; in sfe4001_check_hw()
422 if (EFX_WORKAROUND_7884(efx) && !nic_data->xmac_poll_required) in sfe4001_check_hw()
433 status = i2c_smbus_read_byte_data(falcon_board(efx)->ioexp_client, P1_IN); in sfe4001_check_hw()
439 sfe4001_poweroff(efx); in sfe4001_check_hw()
440 efx->phy_mode = PHY_MODE_OFF; in sfe4001_check_hw()
453 static int sfe4001_init(struct efx_nic *efx) in sfe4001_init() argument
455 struct falcon_board *board = falcon_board(efx); in sfe4001_init()
480 if (efx->phy_mode & PHY_MODE_SPECIAL) { in sfe4001_init()
483 falcon_stop_nic_stats(efx); in sfe4001_init()
485 rc = sfe4001_poweron(efx); in sfe4001_init()
489 rc = device_create_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); in sfe4001_init()
493 netif_info(efx, hw, efx->net_dev, "PHY is powered on\n"); in sfe4001_init()
497 sfe4001_poweroff(efx); in sfe4001_init()
540 static void sfe4002_init_phy(struct efx_nic *efx) in sfe4002_init_phy() argument
544 falcon_qt202x_set_led(efx, SFE4002_TX_LED, in sfe4002_init_phy()
546 falcon_qt202x_set_led(efx, SFE4002_RX_LED, in sfe4002_init_phy()
548 falcon_qt202x_set_led(efx, SFE4002_FAULT_LED, QUAKE_LED_OFF); in sfe4002_init_phy()
551 static void sfe4002_set_id_led(struct efx_nic *efx, enum efx_led_mode mode) in sfe4002_set_id_led() argument
554 efx, SFE4002_FAULT_LED, in sfe4002_set_id_led()
558 static int sfe4002_check_hw(struct efx_nic *efx) in sfe4002_check_hw() argument
560 struct falcon_board *board = falcon_board(efx); in sfe4002_check_hw()
568 return efx_check_lm87(efx, alarm_mask); in sfe4002_check_hw()
571 static int sfe4002_init(struct efx_nic *efx) in sfe4002_init() argument
573 return efx_init_lm87(efx, &sfe4002_hwmon_info, sfe4002_lm87_regs); in sfe4002_init()
602 static void sfn4112f_init_phy(struct efx_nic *efx) in sfn4112f_init_phy() argument
604 falcon_qt202x_set_led(efx, SFN4112F_ACT_LED, in sfn4112f_init_phy()
606 falcon_qt202x_set_led(efx, SFN4112F_LINK_LED, in sfn4112f_init_phy()
610 static void sfn4112f_set_id_led(struct efx_nic *efx, enum efx_led_mode mode) in sfn4112f_set_id_led() argument
626 falcon_qt202x_set_led(efx, SFN4112F_LINK_LED, reg); in sfn4112f_set_id_led()
629 static int sfn4112f_check_hw(struct efx_nic *efx) in sfn4112f_check_hw() argument
632 return efx_check_lm87(efx, ~0x48); in sfn4112f_check_hw()
635 static int sfn4112f_init(struct efx_nic *efx) in sfn4112f_init() argument
637 return efx_init_lm87(efx, &sfn4112f_hwmon_info, sfn4112f_lm87_regs); in sfn4112f_init()
666 static void sfe4003_set_id_led(struct efx_nic *efx, enum efx_led_mode mode) in sfe4003_set_id_led() argument
668 struct falcon_board *board = falcon_board(efx); in sfe4003_set_id_led()
675 efx, SFE4003_RED_LED_GPIO, in sfe4003_set_id_led()
679 static void sfe4003_init_phy(struct efx_nic *efx) in sfe4003_init_phy() argument
681 struct falcon_board *board = falcon_board(efx); in sfe4003_init_phy()
687 falcon_txc_set_gpio_dir(efx, SFE4003_RED_LED_GPIO, TXC_GPIO_DIR_OUTPUT); in sfe4003_init_phy()
688 falcon_txc_set_gpio_val(efx, SFE4003_RED_LED_GPIO, SFE4003_LED_OFF); in sfe4003_init_phy()
691 static int sfe4003_check_hw(struct efx_nic *efx) in sfe4003_check_hw() argument
693 struct falcon_board *board = falcon_board(efx); in sfe4003_check_hw()
701 return efx_check_lm87(efx, alarm_mask); in sfe4003_check_hw()
704 static int sfe4003_init(struct efx_nic *efx) in sfe4003_init() argument
706 return efx_init_lm87(efx, &sfe4003_hwmon_info, sfe4003_lm87_regs); in sfe4003_init()
744 int falcon_probe_board(struct efx_nic *efx, u16 revision_info) in falcon_probe_board() argument
746 struct falcon_board *board = falcon_board(efx); in falcon_probe_board()
760 netif_err(efx, probe, efx->net_dev, "unknown board type %d\n", in falcon_probe_board()