[net-next,6/6] net: stmmac: Add 1G/2.5G auto-negotiation support for ADL-N
Commit Message
Add modphy register lane to have 1G/2.5G auto-negotiation support for
ADL-N.
Signed-off-by: Choong Yong Liang <yong.liang.choong@linux.intel.com>
---
.../net/ethernet/stmicro/stmmac/dwmac-intel.c | 34 ++++++++++++++++++-
.../net/ethernet/stmicro/stmmac/dwmac-intel.h | 2 ++
2 files changed, 35 insertions(+), 1 deletion(-)
@@ -963,14 +963,46 @@ static struct stmmac_pci_info adls_sgmii1g_phy1_info = {
.setup = adls_sgmii_phy1_data,
};
+static int adln_common_data(struct pci_dev *pdev,
+ struct plat_stmmacenet_data *plat)
+{
+ struct intel_priv_data *intel_priv = plat->bsp_priv;
+
+ plat->rx_queues_to_use = 6;
+ plat->tx_queues_to_use = 4;
+ plat->clk_ptp_rate = 204800000;
+
+ plat->safety_feat_cfg->tsoee = 1;
+ plat->safety_feat_cfg->mrxpee = 0;
+ plat->safety_feat_cfg->mestee = 1;
+ plat->safety_feat_cfg->mrxee = 1;
+ plat->safety_feat_cfg->mtxee = 1;
+ plat->safety_feat_cfg->epsi = 0;
+ plat->safety_feat_cfg->edpp = 0;
+ plat->safety_feat_cfg->prtyen = 0;
+ plat->safety_feat_cfg->tmouten = 0;
+
+ intel_priv->tsn_lane_registers = adln_tsn_lane_registers;
+ intel_priv->max_tsn_lane_registers = ARRAY_SIZE(adln_tsn_lane_registers);
+
+ return intel_mgbe_common_data(pdev, plat);
+}
+
static int adln_sgmii_phy0_data(struct pci_dev *pdev,
struct plat_stmmacenet_data *plat)
{
+ struct intel_priv_data *intel_priv = plat->bsp_priv;
+
plat->bus_id = 1;
plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
+ plat->max_speed = SPEED_2500;
plat->serdes_powerup = intel_serdes_powerup;
plat->serdes_powerdown = intel_serdes_powerdown;
- return tgl_common_data(pdev, plat);
+ plat->config_serdes = intel_config_serdes;
+
+ intel_priv->pid_modphy = PID_MODPHY1;
+
+ return adln_common_data(pdev, plat);
}
static struct stmmac_pci_info adln_sgmii1g_phy0_info = {
@@ -124,8 +124,10 @@ static const struct pmc_serdes_regs pid_modphy1_2p5g_regs[] = {
{}
};
+static const int adln_tsn_lane_registers[] = {6};
static const int ehl_tsn_lane_registers[] = {7, 8, 9, 10, 11};
#else
+static const int adln_tsn_lane_registers[] = {};
static const int ehl_tsn_lane_registers[] = {};
#endif /* CONFIG_INTEL_PMC_CORE */