Lines Matching +full:fiber +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0
109 /* SOR1 mode */
149 struct net_device *ndev = phydev->attached_dev; in dp83822_config_wol()
153 if (wol->wolopts & (WAKE_MAGIC | WAKE_MAGICSECURE)) { in dp83822_config_wol()
154 mac = (const u8 *)ndev->dev_addr; in dp83822_config_wol()
157 return -EINVAL; in dp83822_config_wol()
171 if (wol->wolopts & WAKE_MAGIC) in dp83822_config_wol()
176 if (wol->wolopts & WAKE_MAGICSECURE) { in dp83822_config_wol()
179 (wol->sopass[1] << 8) | wol->sopass[0]); in dp83822_config_wol()
182 (wol->sopass[3] << 8) | wol->sopass[2]); in dp83822_config_wol()
185 (wol->sopass[5] << 8) | wol->sopass[4]); in dp83822_config_wol()
211 struct dp83822_private *dp83822 = phydev->priv; in dp83822_set_wol()
216 memcpy(&dp83822->wol, wol, sizeof(*wol)); in dp83822_set_wol()
226 wol->supported = (WAKE_MAGIC | WAKE_MAGICSECURE); in dp83822_get_wol()
227 wol->wolopts = 0; in dp83822_get_wol()
232 wol->wolopts |= WAKE_MAGIC; in dp83822_get_wol()
237 wol->sopass[0] = (sopass_val & 0xff); in dp83822_get_wol()
238 wol->sopass[1] = (sopass_val >> 8); in dp83822_get_wol()
242 wol->sopass[2] = (sopass_val & 0xff); in dp83822_get_wol()
243 wol->sopass[3] = (sopass_val >> 8); in dp83822_get_wol()
247 wol->sopass[4] = (sopass_val & 0xff); in dp83822_get_wol()
248 wol->sopass[5] = (sopass_val >> 8); in dp83822_get_wol()
250 wol->wolopts |= WAKE_MAGICSECURE; in dp83822_get_wol()
255 wol->wolopts = 0; in dp83822_get_wol()
260 struct dp83822_private *dp83822 = phydev->priv; in dp83822_config_intr()
265 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in dp83822_config_intr()
274 if (!dp83822->fx_enabled) in dp83822_config_intr()
294 if (!dp83822->fx_enabled) in dp83822_config_intr()
365 struct dp83822_private *dp83822 = phydev->priv; in dp83822_read_status()
370 if (dp83822->fx_enabled) { in dp83822_read_status()
372 phydev->speed = SPEED_UNKNOWN; in dp83822_read_status()
373 phydev->duplex = DUPLEX_UNKNOWN; in dp83822_read_status()
396 phydev->duplex = DUPLEX_FULL; in dp83822_read_status()
398 phydev->duplex = DUPLEX_HALF; in dp83822_read_status()
401 phydev->speed = SPEED_10; in dp83822_read_status()
403 phydev->speed = SPEED_100; in dp83822_read_status()
410 struct dp83822_private *dp83822 = phydev->priv; in dp83822_config_init()
411 struct device *dev = &phydev->mdio.dev; in dp83822_config_init()
451 if (dp83822->fx_enabled) { in dp83822_config_init()
458 linkmode_and(phydev->advertising, phydev->advertising, in dp83822_config_init()
459 phydev->supported); in dp83822_config_init()
462 phydev->supported); in dp83822_config_init()
464 phydev->advertising); in dp83822_config_init()
466 phydev->supported); in dp83822_config_init()
468 phydev->supported); in dp83822_config_init()
470 phydev->advertising); in dp83822_config_init()
472 phydev->advertising); in dp83822_config_init()
474 /* Auto neg is not supported in fiber mode */ in dp83822_config_init()
484 phydev->autoneg = AUTONEG_DISABLE; in dp83822_config_init()
486 phydev->supported); in dp83822_config_init()
488 phydev->advertising); in dp83822_config_init()
490 /* Setup fiber advertisement */ in dp83822_config_init()
498 if (dp83822->fx_signal_det_low) { in dp83822_config_init()
506 return dp83822_config_wol(phydev, &dp83822->wol); in dp83822_config_init()
511 struct device *dev = &phydev->mdio.dev; in dp83826_config_rmii_mode()
515 if (!device_property_read_string(dev, "ti,rmii-mode", &of_val)) { in dp83826_config_rmii_mode()
523 phydev_err(phydev, "Invalid value for ti,rmii-mode property (%s)\n", in dp83826_config_rmii_mode()
525 ret = -EINVAL; in dp83826_config_rmii_mode()
537 struct dp83822_private *dp83822 = phydev->priv; in dp83826_config_init()
541 if (phydev->interface == PHY_INTERFACE_MODE_RMII) { in dp83826_config_init()
557 if (dp83822->cfg_dac_minus != DP83826_CFG_DAC_MINUS_DEFAULT) { in dp83826_config_init()
558 val = FIELD_PREP(DP83826_VOD_CFG1_MINUS_MDI_MASK, dp83822->cfg_dac_minus) | in dp83826_config_init()
561 dp83822->cfg_dac_minus)); in dp83826_config_init()
569 dp83822->cfg_dac_minus)); in dp83826_config_init()
576 if (dp83822->cfg_dac_plus != DP83826_CFG_DAC_PLUS_DEFAULT) { in dp83826_config_init()
577 val = FIELD_PREP(DP83826_VOD_CFG2_PLUS_MDIX_MASK, dp83822->cfg_dac_plus) | in dp83826_config_init()
578 FIELD_PREP(DP83826_VOD_CFG2_PLUS_MDI_MASK, dp83822->cfg_dac_plus); in dp83826_config_init()
585 return dp83822_config_wol(phydev, &dp83822->wol); in dp83826_config_init()
590 struct dp83822_private *dp83822 = phydev->priv; in dp8382x_config_init()
592 return dp83822_config_wol(phydev, &dp83822->wol); in dp8382x_config_init()
603 return phydev->drv->config_init(phydev); in dp83822_phy_reset()
609 struct dp83822_private *dp83822 = phydev->priv; in dp83822_of_init()
610 struct device *dev = &phydev->mdio.dev; in dp83822_of_init()
616 if (dp83822->fx_enabled && dp83822->fx_sd_enable) in dp83822_of_init()
617 dp83822->fx_signal_det_low = device_property_present(dev, in dp83822_of_init()
618 "ti,link-loss-low"); in dp83822_of_init()
619 if (!dp83822->fx_enabled) in dp83822_of_init()
620 dp83822->fx_enabled = device_property_present(dev, in dp83822_of_init()
621 "ti,fiber-mode"); in dp83822_of_init()
628 int tmp = DP83826_CFG_DAC_PERCENT_DEFAULT - percent; in dp83826_to_dac_minus_one_regval()
635 int tmp = percent - DP83826_CFG_DAC_PERCENT_DEFAULT; in dp83826_to_dac_plus_one_regval()
642 struct dp83822_private *dp83822 = phydev->priv; in dp83826_of_init()
643 struct device *dev = &phydev->mdio.dev; in dp83826_of_init()
646 dp83822->cfg_dac_minus = DP83826_CFG_DAC_MINUS_DEFAULT; in dp83826_of_init()
647 if (!device_property_read_u32(dev, "ti,cfg-dac-minus-one-bp", &val)) in dp83826_of_init()
648 dp83822->cfg_dac_minus += dp83826_to_dac_minus_one_regval(val); in dp83826_of_init()
650 dp83822->cfg_dac_plus = DP83826_CFG_DAC_PLUS_DEFAULT; in dp83826_of_init()
651 if (!device_property_read_u32(dev, "ti,cfg-dac-plus-one-bp", &val)) in dp83826_of_init()
652 dp83822->cfg_dac_plus += dp83826_to_dac_plus_one_regval(val); in dp83826_of_init()
667 struct dp83822_private *dp83822 = phydev->priv; in dp83822_read_straps()
680 dp83822->fx_enabled = 1; in dp83822_read_straps()
682 if (dp83822->fx_enabled) { in dp83822_read_straps()
686 dp83822->fx_sd_enable = 1; in dp83822_read_straps()
696 dp83822 = devm_kzalloc(&phydev->mdio.dev, sizeof(*dp83822), in dp8382x_probe()
699 return -ENOMEM; in dp8382x_probe()
701 phydev->priv = dp83822; in dp8382x_probe()
715 dp83822 = phydev->priv; in dp83822_probe()
723 if (dp83822->fx_enabled) in dp83822_probe()
724 phydev->port = PORT_FIBRE; in dp83822_probe()