• Home
  • Raw
  • Download

Lines Matching +full:force +full:- +full:internal +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0+
3 * drivers/net/phy/broadcom.c
13 #include "bcm-phy-lib.h"
15 #include <linux/phy.h>
20 ((phydev)->drv->phy_id & (phydev)->drv->phy_id_mask)
23 ((phydev)->drv->phy_id & ~((phydev)->drv->phy_id_mask))
25 MODULE_DESCRIPTION("Broadcom PHY driver");
33 /* handling PHY's internal RX clock delay */ in bcm54xx_config_clock_delay()
36 if (phydev->interface == PHY_INTERFACE_MODE_RGMII || in bcm54xx_config_clock_delay()
37 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { in bcm54xx_config_clock_delay()
38 /* Disable RGMII RXC-RXD skew */ in bcm54xx_config_clock_delay()
41 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || in bcm54xx_config_clock_delay()
42 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) { in bcm54xx_config_clock_delay()
43 /* Enable RGMII RXC-RXD skew */ in bcm54xx_config_clock_delay()
51 /* handling PHY's internal TX clock delay */ in bcm54xx_config_clock_delay()
53 if (phydev->interface == PHY_INTERFACE_MODE_RGMII || in bcm54xx_config_clock_delay()
54 phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) { in bcm54xx_config_clock_delay()
55 /* Disable internal TX clock delay */ in bcm54xx_config_clock_delay()
58 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || in bcm54xx_config_clock_delay()
59 phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) { in bcm54xx_config_clock_delay()
60 /* Enable internal TX clock delay */ in bcm54xx_config_clock_delay()
76 if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) { in bcm54210e_config_init()
92 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) { in bcm54612e_config_init()
110 if (phydev->interface != PHY_INTERFACE_MODE_SGMII && in bcm54616s_config_init()
111 phydev->interface != PHY_INTERFACE_MODE_1000BASEX) in bcm54616s_config_init()
126 /* Select 1000BASE-X register set (primary SerDes) */ in bcm54616s_config_init()
142 val |= phydev->interface == PHY_INTERFACE_MODE_SGMII ? in bcm54616s_config_init()
210 /* Clear bit 9 to fix a phy interop issue. */ in bcm54xx_phydsp_config()
216 if (phydev->drv->phy_id == PHY_ID_BCM50610) { in bcm54xx_phydsp_config()
250 /* Abort if we are using an untested phy. */ in bcm54xx_adjust_rxrefclk()
273 if (phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED) { in bcm54xx_adjust_rxrefclk()
282 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE)) in bcm54xx_adjust_rxrefclk()
287 if (phydev->dev_flags & PHY_BRCM_DIS_TXCRXC_NOENRGY) { in bcm54xx_adjust_rxrefclk()
304 if (!clk125en || (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE)) in bcm54xx_adjust_rxrefclk()
337 (phydev->dev_flags & PHY_BRCM_CLEAR_RGMII_MODE)) in bcm54xx_config_init()
357 /* For BCM54810, we need to disable BroadR-Reach function */ in bcm54xx_config_init()
398 /* Upon exiting power down, the PHY remains in an internal reset state in bcm54xx_resume()
410 /* Disable BroadR-Reach function. */ in bcm54811_config_init()
421 if (!(phydev->dev_flags & PHY_BRCM_RX_REFCLK_UNUSED)) { in bcm54811_config_init()
438 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) { in bcm5482_config_init()
449 * Enable SGMII slave mode and auto-detection in bcm5482_config_init()
474 * Select 1000BASE-X register set (primary SerDes) in bcm5482_config_init()
489 * Auto-negotiation doesn't seem to work quite right in bcm5482_config_init()
490 * in this mode, so we disable it and force it to the in bcm5482_config_init()
494 phydev->autoneg = AUTONEG_DISABLE; in bcm5482_config_init()
495 phydev->speed = SPEED_1000; in bcm5482_config_init()
496 phydev->duplex = DUPLEX_FULL; in bcm5482_config_init()
508 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) { in bcm5482_read_status()
510 * Only link status matters for 1000Base-X mode, so force in bcm5482_read_status()
511 * 1000 Mbit/s full-duplex status in bcm5482_read_status()
513 if (phydev->link) { in bcm5482_read_status()
514 phydev->speed = SPEED_1000; in bcm5482_read_status()
515 phydev->duplex = DUPLEX_FULL; in bcm5482_read_status()
524 struct device_node *np = phydev->mdio.dev.of_node; in bcm5481_config_aneg()
533 if (of_property_read_bool(np, "enet-phy-lane-swap")) { in bcm5481_config_aneg()
534 /* Lane Swap - Undocumented register...magic! */ in bcm5481_config_aneg()
552 /* The PHY is strapped in RGMII-fiber mode when INTERF_SEL[1:0] in bcm54616s_probe()
553 * is 01b, and the link between PHY and its link partner can be in bcm54616s_probe()
554 * either 1000Base-X or 100Base-FX. in bcm54616s_probe()
555 * RGMII-1000Base-X is properly supported, but RGMII-100Base-FX in bcm54616s_probe()
563 /* Bit 0 of the SerDes 100-FX Control register, when set in bcm54616s_probe()
564 * to 1, sets the MII/RGMII -> 100BASE-FX configuration. in bcm54616s_probe()
565 * When this bit is set to 0, it sets the GMII/RGMII -> in bcm54616s_probe()
566 * 1000BASE-X configuration. in bcm54616s_probe()
569 phydev->dev_flags |= PHY_BCM_FLAGS_MODE_1000BX; in bcm54616s_probe()
571 phydev->port = PORT_FIBRE; in bcm54616s_probe()
582 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) in bcm54616s_config_aneg()
597 if (phydev->dev_flags & PHY_BCM_FLAGS_MODE_1000BX) in bcm54616s_read_status()
620 /* Reset the PHY to bring it to a known state. */ in brcm_fet_config_init()
671 if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) { in brcm_fet_config_init()
706 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in brcm_fet_config_intr()
723 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL); in bcm53xx_phy_probe()
725 return -ENOMEM; in bcm53xx_phy_probe()
727 phydev->priv = priv; in bcm53xx_phy_probe()
729 priv->stats = devm_kcalloc(&phydev->mdio.dev, in bcm53xx_phy_probe()
732 if (!priv->stats) in bcm53xx_phy_probe()
733 return -ENOMEM; in bcm53xx_phy_probe()
741 struct bcm53xx_phy_priv *priv = phydev->priv; in bcm53xx_phy_get_stats()
743 bcm_phy_get_stats(phydev, priv->stats, stats, data); in bcm53xx_phy_get_stats()