Lines Matching +full:100 +full:base +full:- +full:fx
1 // SPDX-License-Identifier: GPL-2.0+
13 #include "bcm-phy-lib.h"
21 ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
24 ((phydev)->drv->phy_id & ~((phydev)->drv->phy_id_mask))
42 if (phydev->interface == PHY_INTERFACE_MODE_RGMII || in bcm54xx_config_clock_delay()
43 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { in bcm54xx_config_clock_delay()
44 /* Disable RGMII RXC-RXD skew */ in bcm54xx_config_clock_delay()
47 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || in bcm54xx_config_clock_delay()
48 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) { in bcm54xx_config_clock_delay()
49 /* Enable RGMII RXC-RXD skew */ in bcm54xx_config_clock_delay()
59 if (phydev->interface == PHY_INTERFACE_MODE_RGMII || in bcm54xx_config_clock_delay()
60 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) { in bcm54xx_config_clock_delay()
64 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || in bcm54xx_config_clock_delay()
65 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { in bcm54xx_config_clock_delay()
82 if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) { in bcm54210e_config_init()
98 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) { in bcm54612e_config_init()
116 if (phydev->interface != PHY_INTERFACE_MODE_SGMII && in bcm54616s_config_init()
117 phydev->interface != PHY_INTERFACE_MODE_1000BASEX) in bcm54616s_config_init()
132 /* Select 1000BASE-X register set (primary SerDes) */ in bcm54616s_config_init()
148 val |= phydev->interface == PHY_INTERFACE_MODE_SGMII ? in bcm54616s_config_init()
222 if (phydev->drv->phy_id == PHY_ID_BCM50610) { in bcm54xx_phydsp_config()
280 if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) { in bcm54xx_adjust_rxrefclk()
289 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE)) in bcm54xx_adjust_rxrefclk()
294 if (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) { in bcm54xx_adjust_rxrefclk()
312 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE)) in bcm54xx_adjust_rxrefclk()
323 struct bcm54xx_phy_priv *priv = phydev->priv; in bcm54xx_ptp_stop()
325 if (priv->ptp) in bcm54xx_ptp_stop()
326 bcm_ptp_stop(priv->ptp); in bcm54xx_ptp_stop()
331 struct bcm54xx_phy_priv *priv = phydev->priv; in bcm54xx_ptp_config_init()
333 if (priv->ptp) in bcm54xx_ptp_config_init()
361 (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE)) in bcm54xx_config_init()
381 /* For BCM54810, we need to disable BroadR-Reach function */ in bcm54xx_config_init()
395 /* For non-SFP setups, encode link speed into LED1 and LED3 pair in bcm54xx_config_init()
423 if (!(phydev->dev_flags & PHY_BRCM_IDDQ_SUSPEND)) in bcm54xx_iddq_set()
480 if (phydev->dev_flags & PHY_BRCM_IDDQ_SUSPEND) { in bcm54xx_resume()
493 /* Disable BroadR-Reach function. */ in bcm54811_config_init()
504 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) { in bcm54811_config_init()
517 struct device_node *np = phydev->mdio.dev.of_node; in bcm5481_config_aneg()
526 if (of_property_read_bool(np, "enet-phy-lane-swap")) { in bcm5481_config_aneg()
527 /* Lane Swap - Undocumented register...magic! */ in bcm5481_config_aneg()
546 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL); in bcm54616s_probe()
548 return -ENOMEM; in bcm54616s_probe()
550 phydev->priv = priv; in bcm54616s_probe()
556 /* The PHY is strapped in RGMII-fiber mode when INTERF_SEL[1:0] in bcm54616s_probe()
558 * either 1000Base-X or 100Base-FX. in bcm54616s_probe()
559 * RGMII-1000Base-X is properly supported, but RGMII-100Base-FX in bcm54616s_probe()
567 /* Bit 0 of the SerDes 100-FX Control register, when set in bcm54616s_probe()
568 * to 1, sets the MII/RGMII -> 100BASE-FX configuration. in bcm54616s_probe()
569 * When this bit is set to 0, it sets the GMII/RGMII -> in bcm54616s_probe()
570 * 1000BASE-X configuration. in bcm54616s_probe()
573 priv->mode_1000bx_en = true; in bcm54616s_probe()
575 phydev->port = PORT_FIBRE; in bcm54616s_probe()
583 struct bcm54616s_phy_priv *priv = phydev->priv; in bcm54616s_config_aneg()
587 if (priv->mode_1000bx_en) in bcm54616s_config_aneg()
600 struct bcm54616s_phy_priv *priv = phydev->priv; in bcm54616s_read_status()
603 if (priv->mode_1000bx_en) in bcm54616s_read_status()
639 * We ignore -EIO here as the MDIO controller (e.g.: mdio-bcm-unimac) in brcm_fet_config_init()
640 * may flag the lack of turn-around as a read failure. This is in brcm_fet_config_init()
648 if (err < 0 && err != -EIO) in brcm_fet_config_init()
697 if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) { in brcm_fet_config_init()
732 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in brcm_fet_config_intr()
808 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL); in bcm54xx_phy_probe()
810 return -ENOMEM; in bcm54xx_phy_probe()
812 phydev->priv = priv; in bcm54xx_phy_probe()
814 priv->stats = devm_kcalloc(&phydev->mdio.dev, in bcm54xx_phy_probe()
817 if (!priv->stats) in bcm54xx_phy_probe()
818 return -ENOMEM; in bcm54xx_phy_probe()
820 priv->ptp = bcm_ptp_probe(phydev); in bcm54xx_phy_probe()
821 if (IS_ERR(priv->ptp)) in bcm54xx_phy_probe()
822 return PTR_ERR(priv->ptp); in bcm54xx_phy_probe()
830 struct bcm54xx_phy_priv *priv = phydev->priv; in bcm54xx_get_stats()
832 bcm_phy_get_stats(phydev, priv->stats, stats, data); in bcm54xx_get_stats()
841 if (phydev->state != PHY_RUNNING) in bcm54xx_link_change_notify()
847 if (!(phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE)) in bcm54xx_link_change_notify()
858 if (phydev->speed == SPEED_10) in bcm54xx_link_change_notify()