Skip to content

Commit

Permalink
stmmac: intel: add pcs-xpcs for Intel mGbE controller
Browse files Browse the repository at this point in the history
Intel mGbE controller such as those in EHL & TGL uses pcs-xpcs driver for
SGMII interface. To ensure mdio bus scanning does not assign phy_device
to MDIO-addressable entities like intel serdes and pcs-xpcs, we set up
to phy_mask to skip them.

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
elvinongbl authored and davem330 committed Mar 15, 2021
1 parent c62808e commit 7310fe5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include "dwmac4.h"
#include "stmmac.h"

#define INTEL_MGBE_ADHOC_ADDR 0x15
#define INTEL_MGBE_XPCS_ADDR 0x16

struct intel_priv_data {
int mdio_adhoc_addr; /* mdio address for serdes & etc */
};
Expand Down Expand Up @@ -333,6 +336,16 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
/* Use the last Rx queue */
plat->vlan_fail_q = plat->rx_queues_to_use - 1;

/* Intel mgbe SGMII interface uses pcs-xcps */
if (plat->phy_interface == PHY_INTERFACE_MODE_SGMII) {
plat->mdio_bus_data->has_xpcs = true;
plat->mdio_bus_data->xpcs_an_inband = true;
}

/* Ensure mdio bus scan skips intel serdes and pcs-xpcs */
plat->mdio_bus_data->phy_mask = 1 << INTEL_MGBE_ADHOC_ADDR;
plat->mdio_bus_data->phy_mask |= 1 << INTEL_MGBE_XPCS_ADDR;

return 0;
}

Expand Down Expand Up @@ -664,7 +677,7 @@ static int intel_eth_pci_probe(struct pci_dev *pdev,
pci_set_master(pdev);

plat->bsp_priv = intel_priv;
intel_priv->mdio_adhoc_addr = 0x15;
intel_priv->mdio_adhoc_addr = INTEL_MGBE_ADHOC_ADDR;

ret = info->setup(pdev, plat);
if (ret)
Expand Down

0 comments on commit 7310fe5

Please sign in to comment.