Merge branch 'add-support-for-synopsis-dwmac-ip-on-nxp-automotive-socs-s32g2xx-s32g3xx-s32r45'

Jan Petrous via says:

====================
Add support for Synopsis DWMAC IP on NXP Automotive SoCs S32G2xx/S32G3xx/S32R45

The SoC series S32G2xx and S32G3xx feature one DWMAC instance,
the SoC S32R45 has two instances. The devices can use RGMII/RMII/MII
interface over Pinctrl device or the output can be routed
to the embedded SerDes for SGMII connectivity.

The provided stmmac glue code implements only basic functionality,
interface support is restricted to RGMII only. More, including
SGMII/SerDes support will come later.

This patchset adds stmmac glue driver based on downstream NXP git [0].

[0] https://github.com/nxp-auto-linux/linux

v7: https://lore.kernel.org/20241202-upstream_s32cc_gmac-v7-0-bc3e1f9f656e@oss.nxp.com
v6: https://lore.kernel.org/20241124-upstream_s32cc_gmac-v6-0-dc5718ccf001@oss.nxp.com
v5: https://lore.kernel.org/20241119-upstream_s32cc_gmac-v5-0-7dcc90fcffef@oss.nxp.com
v4: https://lore.kernel.org/20241028-upstream_s32cc_gmac-v4-0-03618f10e3e2@oss.nxp.com
v3: https://lore.kernel.org/20241013-upstream_s32cc_gmac-v3-0-d84b5a67b930@oss.nxp.com
====================

Link: https://patch.msgid.link/20241205-upstream_s32cc_gmac-v8-0-ec1d180df815@oss.nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski
2024-12-09 18:36:05 -08:00
21 changed files with 399 additions and 121 deletions

View File

@@ -0,0 +1,105 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright 2021-2024 NXP
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/nxp,s32-dwmac.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: NXP S32G2xx/S32G3xx/S32R45 GMAC ethernet controller
maintainers:
- Jan Petrous (OSS) <jan.petrous@oss.nxp.com>
description:
This device is a Synopsys DWC IP, integrated on NXP S32G/R SoCs.
The SoC series S32G2xx and S32G3xx feature one DWMAC instance,
the SoC S32R45 has two instances. The devices can use RGMII/RMII/MII
interface over Pinctrl device or the output can be routed
to the embedded SerDes for SGMII connectivity.
properties:
compatible:
oneOf:
- const: nxp,s32g2-dwmac
- items:
- enum:
- nxp,s32g3-dwmac
- nxp,s32r45-dwmac
- const: nxp,s32g2-dwmac
reg:
items:
- description: Main GMAC registers
- description: GMAC PHY mode control register
interrupts:
maxItems: 1
interrupt-names:
const: macirq
clocks:
items:
- description: Main GMAC clock
- description: Transmit clock
- description: Receive clock
- description: PTP reference clock
clock-names:
items:
- const: stmmaceth
- const: tx
- const: rx
- const: ptp_ref
required:
- clocks
- clock-names
allOf:
- $ref: snps,dwmac.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/phy/phy.h>
bus {
#address-cells = <2>;
#size-cells = <2>;
ethernet@4033c000 {
compatible = "nxp,s32g2-dwmac";
reg = <0x0 0x4033c000 0x0 0x2000>, /* gmac IP */
<0x0 0x4007c004 0x0 0x4>; /* GMAC_0_CTRL_STS */
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "macirq";
snps,mtl-rx-config = <&mtl_rx_setup>;
snps,mtl-tx-config = <&mtl_tx_setup>;
clocks = <&clks 24>, <&clks 17>, <&clks 16>, <&clks 15>;
clock-names = "stmmaceth", "tx", "rx", "ptp_ref";
phy-mode = "rgmii-id";
phy-handle = <&phy0>;
mtl_rx_setup: rx-queues-config {
snps,rx-queues-to-use = <5>;
};
mtl_tx_setup: tx-queues-config {
snps,tx-queues-to-use = <5>;
};
mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "snps,dwmac-mdio";
phy0: ethernet-phy@0 {
reg = <0>;
};
};
};
};

View File

@@ -67,6 +67,7 @@ properties:
- ingenic,x2000-mac
- loongson,ls2k-dwmac
- loongson,ls7a-dwmac
- nxp,s32g2-dwmac
- qcom,qcs404-ethqos
- qcom,sa8775p-ethqos
- qcom,sc8280xp-ethqos

View File

@@ -2836,6 +2836,13 @@ S: Maintained
F: arch/arm64/boot/dts/freescale/s32g*.dts*
F: drivers/pinctrl/nxp/
ARM/NXP S32G/S32R DWMAC ETHERNET DRIVER
M: Jan Petrous <jan.petrous@oss.nxp.com>
L: NXP S32 Linux Team <s32@nxp.com>
S: Maintained
F: Documentation/devicetree/bindings/net/nxp,s32-dwmac.yaml
F: drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c
ARM/Orion SoC/Technologic Systems TS-78xx platform support
M: Alexander Clouter <alex@digriz.org.uk>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)

View File

@@ -421,18 +421,12 @@ static void xgene_enet_configure_clock(struct xgene_enet_pdata *pdata)
if (dev->of_node) {
struct clk *parent = clk_get_parent(pdata->clk);
long rate = rgmii_clock(pdata->phy_speed);
switch (pdata->phy_speed) {
case SPEED_10:
clk_set_rate(parent, 2500000);
break;
case SPEED_100:
clk_set_rate(parent, 25000000);
break;
default:
clk_set_rate(parent, 125000000);
break;
}
if (rate < 0)
rate = 125000000;
clk_set_rate(parent, rate);
}
#ifdef CONFIG_ACPI
else {

View File

@@ -530,19 +530,9 @@ static void macb_set_tx_clk(struct macb *bp, int speed)
if (bp->phy_interface == PHY_INTERFACE_MODE_MII)
return;
switch (speed) {
case SPEED_10:
rate = 2500000;
break;
case SPEED_100:
rate = 25000000;
break;
case SPEED_1000:
rate = 125000000;
break;
default:
rate = rgmii_clock(speed);
if (rate < 0)
return;
}
rate_rounded = clk_round_rate(bp->tx_clk, rate);
if (rate_rounded < 0)

View File

@@ -154,6 +154,18 @@ config DWMAC_RZN1
the stmmac device driver. This support can make use of a custom MII
converter PCS device.
config DWMAC_S32
tristate "NXP S32G/S32R GMAC support"
default ARCH_S32
depends on OF && (ARCH_S32 || COMPILE_TEST)
help
Support for ethernet controller on NXP S32CC SOCs.
This selects NXP SoC glue layer support for the stmmac
device driver. This driver is used for the S32CC series
SOCs GMAC ethernet controller, ie. S32G2xx, S32G3xx and
S32R45.
config DWMAC_SOCFPGA
tristate "SOCFPGA dwmac support"
default ARCH_INTEL_SOCFPGA

View File

@@ -22,6 +22,7 @@ obj-$(CONFIG_DWMAC_MESON) += dwmac-meson.o dwmac-meson8b.o
obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-ethqos.o
obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rk.o
obj-$(CONFIG_DWMAC_RZN1) += dwmac-rzn1.o
obj-$(CONFIG_DWMAC_S32) += dwmac-s32.o
obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-altr-socfpga.o
obj-$(CONFIG_DWMAC_STARFIVE) += dwmac-starfive.o
obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o

View File

@@ -257,6 +257,8 @@ struct stmmac_safety_stats {
#define CSR_F_150M 150000000
#define CSR_F_250M 250000000
#define CSR_F_300M 300000000
#define CSR_F_500M 500000000
#define CSR_F_800M 800000000
#define MAC_CSR_H_FRQ_MASK 0x20

View File

@@ -181,24 +181,19 @@ static void dwc_qos_remove(struct platform_device *pdev)
static void tegra_eqos_fix_speed(void *priv, unsigned int speed, unsigned int mode)
{
struct tegra_eqos *eqos = priv;
unsigned long rate = 125000000;
bool needs_calibration = false;
long rate = 125000000;
u32 value;
int err;
switch (speed) {
case SPEED_1000:
needs_calibration = true;
rate = 125000000;
break;
case SPEED_100:
needs_calibration = true;
rate = 25000000;
break;
fallthrough;
case SPEED_10:
rate = 2500000;
rate = rgmii_clock(speed);
break;
default:

View File

@@ -186,7 +186,7 @@ static void imx_dwmac_fix_speed(void *priv, unsigned int speed, unsigned int mod
{
struct plat_stmmacenet_data *plat_dat;
struct imx_priv_data *dwmac = priv;
unsigned long rate;
long rate;
int err;
plat_dat = dwmac->plat_dat;
@@ -196,17 +196,8 @@ static void imx_dwmac_fix_speed(void *priv, unsigned int speed, unsigned int mod
(plat_dat->mac_interface == PHY_INTERFACE_MODE_MII))
return;
switch (speed) {
case SPEED_1000:
rate = 125000000;
break;
case SPEED_100:
rate = 25000000;
break;
case SPEED_10:
rate = 2500000;
break;
default:
rate = rgmii_clock(speed);
if (rate < 0) {
dev_err(dwmac->dev, "invalid speed %u\n", speed);
return;
}

View File

@@ -31,27 +31,13 @@ struct intel_dwmac_data {
static void kmb_eth_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
{
struct intel_dwmac *dwmac = priv;
unsigned long rate;
long rate;
int ret;
rate = clk_get_rate(dwmac->tx_clk);
switch (speed) {
case SPEED_1000:
rate = 125000000;
break;
case SPEED_100:
rate = 25000000;
break;
case SPEED_10:
rate = 2500000;
break;
default:
rate = rgmii_clock(speed);
if (rate < 0) {
dev_err(dwmac->dev, "Invalid speed\n");
break;
return;
}
ret = clk_set_rate(dwmac->tx_clk, rate);

View File

@@ -777,7 +777,7 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
netdev_err(priv->dev, "Failed to max out clk_ptp_ref: %d\n", err);
plat_dat->clk_ptp_rate = clk_get_rate(plat_dat->clk_ptp_ref);
netdev_dbg(priv->dev, "PTP rate %d\n", plat_dat->clk_ptp_rate);
netdev_dbg(priv->dev, "PTP rate %lu\n", plat_dat->clk_ptp_rate);
}
static int qcom_ethqos_probe(struct platform_device *pdev)

View File

@@ -1079,20 +1079,11 @@ static void rk3568_set_gmac_speed(struct rk_priv_data *bsp_priv, int speed)
{
struct clk *clk_mac_speed = bsp_priv->clks[RK_CLK_MAC_SPEED].clk;
struct device *dev = &bsp_priv->pdev->dev;
unsigned long rate;
long rate;
int ret;
switch (speed) {
case 10:
rate = 2500000;
break;
case 100:
rate = 25000000;
break;
case 1000:
rate = 125000000;
break;
default:
rate = rgmii_clock(speed);
if (rate < 0) {
dev_err(dev, "unknown speed value for GMAC speed=%d", speed);
return;
}
@@ -1540,20 +1531,11 @@ static void rv1126_set_rgmii_speed(struct rk_priv_data *bsp_priv, int speed)
{
struct clk *clk_mac_speed = bsp_priv->clks[RK_CLK_MAC_SPEED].clk;
struct device *dev = &bsp_priv->pdev->dev;
unsigned long rate;
long rate;
int ret;
switch (speed) {
case 10:
rate = 2500000;
break;
case 100:
rate = 25000000;
break;
case 1000:
rate = 125000000;
break;
default:
rate = rgmii_clock(speed);
if (rate < 0) {
dev_err(dev, "unknown speed value for RGMII speed=%d", speed);
return;
}

View File

@@ -0,0 +1,202 @@
// SPDX-License-Identifier: GPL-2.0
/*
* NXP S32G/R GMAC glue layer
*
* Copyright 2019-2024 NXP
*
*/
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/device.h>
#include <linux/ethtool.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of_mdio.h>
#include <linux/of_address.h>
#include <linux/phy.h>
#include <linux/phylink.h>
#include <linux/platform_device.h>
#include <linux/stmmac.h>
#include "stmmac_platform.h"
#define GMAC_INTF_RATE_125M 125000000 /* 125MHz */
/* SoC PHY interface control register */
#define PHY_INTF_SEL_MII 0x00
#define PHY_INTF_SEL_SGMII 0x01
#define PHY_INTF_SEL_RGMII 0x02
#define PHY_INTF_SEL_RMII 0x08
struct s32_priv_data {
void __iomem *ioaddr;
void __iomem *ctrl_sts;
struct device *dev;
phy_interface_t *intf_mode;
struct clk *tx_clk;
struct clk *rx_clk;
};
static int s32_gmac_write_phy_intf_select(struct s32_priv_data *gmac)
{
writel(PHY_INTF_SEL_RGMII, gmac->ctrl_sts);
dev_dbg(gmac->dev, "PHY mode set to %s\n", phy_modes(*gmac->intf_mode));
return 0;
}
static int s32_gmac_init(struct platform_device *pdev, void *priv)
{
struct s32_priv_data *gmac = priv;
int ret;
/* Set initial TX interface clock */
ret = clk_prepare_enable(gmac->tx_clk);
if (ret) {
dev_err(&pdev->dev, "Can't enable tx clock\n");
return ret;
}
ret = clk_set_rate(gmac->tx_clk, GMAC_INTF_RATE_125M);
if (ret) {
dev_err(&pdev->dev, "Can't set tx clock\n");
goto err_tx_disable;
}
/* Set initial RX interface clock */
ret = clk_prepare_enable(gmac->rx_clk);
if (ret) {
dev_err(&pdev->dev, "Can't enable rx clock\n");
goto err_tx_disable;
}
ret = clk_set_rate(gmac->rx_clk, GMAC_INTF_RATE_125M);
if (ret) {
dev_err(&pdev->dev, "Can't set rx clock\n");
goto err_txrx_disable;
}
/* Set interface mode */
ret = s32_gmac_write_phy_intf_select(gmac);
if (ret) {
dev_err(&pdev->dev, "Can't set PHY interface mode\n");
goto err_txrx_disable;
}
return 0;
err_txrx_disable:
clk_disable_unprepare(gmac->rx_clk);
err_tx_disable:
clk_disable_unprepare(gmac->tx_clk);
return ret;
}
static void s32_gmac_exit(struct platform_device *pdev, void *priv)
{
struct s32_priv_data *gmac = priv;
clk_disable_unprepare(gmac->tx_clk);
clk_disable_unprepare(gmac->rx_clk);
}
static void s32_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
{
struct s32_priv_data *gmac = priv;
long tx_clk_rate;
int ret;
tx_clk_rate = rgmii_clock(speed);
if (tx_clk_rate < 0) {
dev_err(gmac->dev, "Unsupported/Invalid speed: %d\n", speed);
return;
}
dev_dbg(gmac->dev, "Set tx clock to %ld Hz\n", tx_clk_rate);
ret = clk_set_rate(gmac->tx_clk, tx_clk_rate);
if (ret)
dev_err(gmac->dev, "Can't set tx clock\n");
}
static int s32_dwmac_probe(struct platform_device *pdev)
{
struct plat_stmmacenet_data *plat;
struct device *dev = &pdev->dev;
struct stmmac_resources res;
struct s32_priv_data *gmac;
int ret;
gmac = devm_kzalloc(&pdev->dev, sizeof(*gmac), GFP_KERNEL);
if (!gmac)
return -ENOMEM;
gmac->dev = &pdev->dev;
ret = stmmac_get_platform_resources(pdev, &res);
if (ret)
return dev_err_probe(dev, ret,
"Failed to get platform resources\n");
plat = devm_stmmac_probe_config_dt(pdev, res.mac);
if (IS_ERR(plat))
return dev_err_probe(dev, PTR_ERR(plat),
"dt configuration failed\n");
/* PHY interface mode control reg */
gmac->ctrl_sts = devm_platform_get_and_ioremap_resource(pdev, 1, NULL);
if (IS_ERR(gmac->ctrl_sts))
return dev_err_probe(dev, PTR_ERR(gmac->ctrl_sts),
"S32CC config region is missing\n");
/* tx clock */
gmac->tx_clk = devm_clk_get(&pdev->dev, "tx");
if (IS_ERR(gmac->tx_clk))
return dev_err_probe(dev, PTR_ERR(gmac->tx_clk),
"tx clock not found\n");
/* rx clock */
gmac->rx_clk = devm_clk_get(&pdev->dev, "rx");
if (IS_ERR(gmac->rx_clk))
return dev_err_probe(dev, PTR_ERR(gmac->rx_clk),
"rx clock not found\n");
gmac->intf_mode = &plat->phy_interface;
gmac->ioaddr = res.addr;
/* S32CC core feature set */
plat->has_gmac4 = true;
plat->pmt = 1;
plat->flags |= STMMAC_FLAG_SPH_DISABLE;
plat->rx_fifo_size = 20480;
plat->tx_fifo_size = 20480;
plat->init = s32_gmac_init;
plat->exit = s32_gmac_exit;
plat->fix_mac_speed = s32_fix_mac_speed;
plat->bsp_priv = gmac;
return stmmac_pltfr_probe(pdev, plat, &res);
}
static const struct of_device_id s32_dwmac_match[] = {
{ .compatible = "nxp,s32g2-dwmac" },
{ }
};
MODULE_DEVICE_TABLE(of, s32_dwmac_match);
static struct platform_driver s32_dwmac_driver = {
.probe = s32_dwmac_probe,
.remove = stmmac_pltfr_remove,
.driver = {
.name = "s32-dwmac",
.pm = &stmmac_pltfr_pm_ops,
.of_match_table = s32_dwmac_match,
},
};
module_platform_driver(s32_dwmac_driver);
MODULE_AUTHOR("Jan Petrous (OSS) <jan.petrous@oss.nxp.com>");
MODULE_DESCRIPTION("NXP S32G/R common chassis GMAC driver");
MODULE_LICENSE("GPL");

View File

@@ -34,24 +34,13 @@ struct starfive_dwmac {
static void starfive_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigned int mode)
{
struct starfive_dwmac *dwmac = priv;
unsigned long rate;
long rate;
int err;
rate = clk_get_rate(dwmac->clk_tx);
switch (speed) {
case SPEED_1000:
rate = 125000000;
break;
case SPEED_100:
rate = 25000000;
break;
case SPEED_10:
rate = 2500000;
break;
default:
rate = rgmii_clock(speed);
if (rate < 0) {
dev_err(dwmac->dev, "invalid speed %u\n", speed);
break;
return;
}
err = clk_set_rate(dwmac->clk_tx, rate);

View File

@@ -21,10 +21,7 @@
#include "stmmac_platform.h"
#define DWMAC_125MHZ 125000000
#define DWMAC_50MHZ 50000000
#define DWMAC_25MHZ 25000000
#define DWMAC_2_5MHZ 2500000
#define IS_PHY_IF_MODE_RGMII(iface) (iface == PHY_INTERFACE_MODE_RGMII || \
iface == PHY_INTERFACE_MODE_RGMII_ID || \
@@ -140,7 +137,7 @@ static void stih4xx_fix_retime_src(void *priv, u32 spd, unsigned int mode)
struct sti_dwmac *dwmac = priv;
u32 src = dwmac->tx_retime_src;
u32 reg = dwmac->ctrl_reg;
u32 freq = 0;
long freq = 0;
if (dwmac->interface == PHY_INTERFACE_MODE_MII) {
src = TX_RETIME_SRC_TXCLK;
@@ -153,19 +150,14 @@ static void stih4xx_fix_retime_src(void *priv, u32 spd, unsigned int mode)
}
} else if (IS_PHY_IF_MODE_RGMII(dwmac->interface)) {
/* On GiGa clk source can be either ext or from clkgen */
if (spd == SPEED_1000) {
freq = DWMAC_125MHZ;
} else {
freq = rgmii_clock(spd);
if (spd != SPEED_1000 && freq > 0)
/* Switch to clkgen for these speeds */
src = TX_RETIME_SRC_CLKGEN;
if (spd == SPEED_100)
freq = DWMAC_25MHZ;
else if (spd == SPEED_10)
freq = DWMAC_2_5MHZ;
}
}
if (src == TX_RETIME_SRC_CLKGEN && freq)
if (src == TX_RETIME_SRC_CLKGEN && freq > 0)
clk_set_rate(dwmac->clk, freq);
regmap_update_bits(dwmac->regmap, reg, STIH4XX_RETIME_SRC_MASK,

View File

@@ -27,7 +27,7 @@ static void dwmac4_core_init(struct mac_device_info *hw,
struct stmmac_priv *priv = netdev_priv(dev);
void __iomem *ioaddr = hw->pcsr;
u32 value = readl(ioaddr + GMAC_CONFIG);
u32 clk_rate;
unsigned long clk_rate;
value |= GMAC_CORE_INIT;

View File

@@ -301,7 +301,7 @@ static void stmmac_global_err(struct stmmac_priv *priv)
*/
static void stmmac_clk_csr_set(struct stmmac_priv *priv)
{
u32 clk_rate;
unsigned long clk_rate;
clk_rate = clk_get_rate(priv->plat->stmmac_clk);
@@ -325,6 +325,10 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv)
priv->clk_csr = STMMAC_CSR_150_250M;
else if ((clk_rate >= CSR_F_250M) && (clk_rate <= CSR_F_300M))
priv->clk_csr = STMMAC_CSR_250_300M;
else if ((clk_rate >= CSR_F_300M) && (clk_rate < CSR_F_500M))
priv->clk_csr = STMMAC_CSR_300_500M;
else if ((clk_rate >= CSR_F_500M) && (clk_rate < CSR_F_800M))
priv->clk_csr = STMMAC_CSR_500_800M;
}
if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) {

View File

@@ -640,7 +640,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
dev_info(&pdev->dev, "PTP uses main clock\n");
} else {
plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref);
dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate);
dev_dbg(&pdev->dev, "PTP rate %lu\n", plat->clk_ptp_rate);
}
plat->stmmac_rst = devm_reset_control_get_optional(&pdev->dev,

View File

@@ -298,6 +298,29 @@ static inline const char *phy_modes(phy_interface_t interface)
}
}
/**
* rgmii_clock - map link speed to the clock rate
* @speed: link speed value
*
* Description: maps RGMII supported link speeds
* into the clock rates.
*
* Returns: clock rate or negative errno
*/
static inline long rgmii_clock(int speed)
{
switch (speed) {
case SPEED_10:
return 2500000;
case SPEED_100:
return 25000000;
case SPEED_1000:
return 125000000;
default:
return -EINVAL;
}
}
#define PHY_INIT_TIMEOUT 100000
#define PHY_FORCE_TIMEOUT 10

View File

@@ -33,7 +33,9 @@
#define STMMAC_CSR_20_35M 0x2 /* MDC = clk_scr_i/16 */
#define STMMAC_CSR_35_60M 0x3 /* MDC = clk_scr_i/26 */
#define STMMAC_CSR_150_250M 0x4 /* MDC = clk_scr_i/102 */
#define STMMAC_CSR_250_300M 0x5 /* MDC = clk_scr_i/122 */
#define STMMAC_CSR_250_300M 0x5 /* MDC = clk_scr_i/124 */
#define STMMAC_CSR_300_500M 0x6 /* MDC = clk_scr_i/204 */
#define STMMAC_CSR_500_800M 0x7 /* MDC = clk_scr_i/324 */
/* MTL algorithms identifiers */
#define MTL_TX_ALGORITHM_WRR 0x0
@@ -250,8 +252,8 @@ struct plat_stmmacenet_data {
struct clk *stmmac_clk;
struct clk *pclk;
struct clk *clk_ptp_ref;
unsigned int clk_ptp_rate;
unsigned int clk_ref_rate;
unsigned long clk_ptp_rate;
unsigned long clk_ref_rate;
unsigned int mult_fact_100ns;
s32 ptp_max_adj;
u32 cdc_error_adj;
@@ -263,7 +265,7 @@ struct plat_stmmacenet_data {
int mac_port_sel_speed;
int has_xgmac;
u8 vlan_fail_q;
unsigned int eee_usecs_rate;
unsigned long eee_usecs_rate;
struct pci_dev *pdev;
int int_snapshot_num;
int msi_mac_vec;