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))
37 if (phydev->interface == PHY_INTERFACE_MODE_RGMII || in bcm54xx_config_clock_delay()
38 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { in bcm54xx_config_clock_delay()
39 /* Disable RGMII RXC-RXD skew */ in bcm54xx_config_clock_delay()
42 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || in bcm54xx_config_clock_delay()
43 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) { in bcm54xx_config_clock_delay()
44 /* Enable RGMII RXC-RXD skew */ in bcm54xx_config_clock_delay()
54 if (phydev->interface == PHY_INTERFACE_MODE_RGMII || in bcm54xx_config_clock_delay()
55 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) { in bcm54xx_config_clock_delay()
59 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || in bcm54xx_config_clock_delay()
60 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { in bcm54xx_config_clock_delay()
77 if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) { in bcm54210e_config_init()
93 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) { in bcm54612e_config_init()
111 if (phydev->interface != PHY_INTERFACE_MODE_SGMII && in bcm54616s_config_init()
112 phydev->interface != PHY_INTERFACE_MODE_1000BASEX) in bcm54616s_config_init()
127 /* Select 1000BASE-X register set (primary SerDes) */ in bcm54616s_config_init()
143 val |= phydev->interface == PHY_INTERFACE_MODE_SGMII ? in bcm54616s_config_init()
217 if (phydev->drv->phy_id == PHY_ID_BCM50610) { in bcm54xx_phydsp_config()
274 if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) { in bcm54xx_adjust_rxrefclk()
283 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE)) in bcm54xx_adjust_rxrefclk()
288 if (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) { in bcm54xx_adjust_rxrefclk()
305 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE)) in bcm54xx_adjust_rxrefclk()
338 (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE)) in bcm54xx_config_init()
358 /* For BCM54810, we need to disable BroadR-Reach function */ in bcm54xx_config_init()
411 /* Disable BroadR-Reach function. */ in bcm54811_config_init()
422 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) { in bcm54811_config_init()
439 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) { in bcm5482_config_init()
450 * Enable SGMII slave mode and auto-detection in bcm5482_config_init()
475 * Select 1000BASE-X register set (primary SerDes) in bcm5482_config_init()
490 * Auto-negotiation doesn't seem to work quite right in bcm5482_config_init()
495 phydev->autoneg = AUTONEG_DISABLE; in bcm5482_config_init()
496 phydev->speed = SPEED_1000; in bcm5482_config_init()
497 phydev->duplex = DUPLEX_FULL; in bcm5482_config_init()
509 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) { in bcm5482_read_status()
511 * Only link status matters for 1000Base-X mode, so force in bcm5482_read_status()
512 * 1000 Mbit/s full-duplex status in bcm5482_read_status()
514 if (phydev->link) { in bcm5482_read_status()
515 phydev->speed = SPEED_1000; in bcm5482_read_status()
516 phydev->duplex = DUPLEX_FULL; in bcm5482_read_status()
525 struct device_node *np = phydev->mdio.dev.of_node; in bcm5481_config_aneg()
534 if (of_property_read_bool(np, "enet-phy-lane-swap")) { in bcm5481_config_aneg()
535 /* Lane Swap - Undocumented register...magic! */ in bcm5481_config_aneg()
553 /* The PHY is strapped in RGMII-fiber mode when INTERF_SEL[1:0] in bcm54616s_probe()
555 * either 1000Base-X or 100Base-FX. in bcm54616s_probe()
556 * RGMII-1000Base-X is properly supported, but RGMII-100Base-FX in bcm54616s_probe()
564 /* Bit 0 of the SerDes 100-FX Control register, when set in bcm54616s_probe()
565 * to 1, sets the MII/RGMII -> 100BASE-FX configuration. in bcm54616s_probe()
566 * When this bit is set to 0, it sets the GMII/RGMII -> in bcm54616s_probe()
567 * 1000BASE-X configuration. in bcm54616s_probe()
570 phydev->dev_flags |= PHY_BCM_FLAGS_MODE_1000BX; in bcm54616s_probe()
572 phydev->port = PORT_FIBRE; in bcm54616s_probe()
583 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) in bcm54616s_config_aneg()
598 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) in bcm54616s_read_status()
634 * We ignore -EIO here as the MDIO controller (e.g.: mdio-bcm-unimac) in brcm_fet_config_init()
635 * may flag the lack of turn-around as a read failure. This is in brcm_fet_config_init()
643 if (err < 0 && err != -EIO) in brcm_fet_config_init()
692 if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) { in brcm_fet_config_init()
727 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in brcm_fet_config_intr()
744 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL); in bcm53xx_phy_probe()
746 return -ENOMEM; in bcm53xx_phy_probe()
748 phydev->priv = priv; in bcm53xx_phy_probe()
750 priv->stats = devm_kcalloc(&phydev->mdio.dev, in bcm53xx_phy_probe()
753 if (!priv->stats) in bcm53xx_phy_probe()
754 return -ENOMEM; in bcm53xx_phy_probe()
762 struct bcm53xx_phy_priv *priv = phydev->priv; in bcm53xx_phy_get_stats()
764 bcm_phy_get_stats(phydev, priv->stats, stats, data); in bcm53xx_phy_get_stats()