Skip to content

Commit 7310fe5

Browse files
elvinongbldavem330
authored andcommitted
stmmac: intel: add pcs-xpcs for Intel mGbE controller
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c62808e commit 7310fe5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#include "dwmac4.h"
1010
#include "stmmac.h"
1111

12+
#define INTEL_MGBE_ADHOC_ADDR 0x15
13+
#define INTEL_MGBE_XPCS_ADDR 0x16
14+
1215
struct intel_priv_data {
1316
int mdio_adhoc_addr; /* mdio address for serdes & etc */
1417
};
@@ -333,6 +336,16 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
333336
/* Use the last Rx queue */
334337
plat->vlan_fail_q = plat->rx_queues_to_use - 1;
335338

339+
/* Intel mgbe SGMII interface uses pcs-xcps */
340+
if (plat->phy_interface == PHY_INTERFACE_MODE_SGMII) {
341+
plat->mdio_bus_data->has_xpcs = true;
342+
plat->mdio_bus_data->xpcs_an_inband = true;
343+
}
344+
345+
/* Ensure mdio bus scan skips intel serdes and pcs-xpcs */
346+
plat->mdio_bus_data->phy_mask = 1 << INTEL_MGBE_ADHOC_ADDR;
347+
plat->mdio_bus_data->phy_mask |= 1 << INTEL_MGBE_XPCS_ADDR;
348+
336349
return 0;
337350
}
338351

@@ -664,7 +677,7 @@ static int intel_eth_pci_probe(struct pci_dev *pdev,
664677
pci_set_master(pdev);
665678

666679
plat->bsp_priv = intel_priv;
667-
intel_priv->mdio_adhoc_addr = 0x15;
680+
intel_priv->mdio_adhoc_addr = INTEL_MGBE_ADHOC_ADDR;
668681

669682
ret = info->setup(pdev, plat);
670683
if (ret)

0 commit comments

Comments
 (0)