diff options
author | Jose Abreu <Jose.Abreu@synopsys.com> | 2019-08-17 21:54:47 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-17 22:43:59 +0300 |
commit | 8000ddc0eceb8e504cb9f95a1d72af0a8d2fc76e (patch) | |
tree | 718cc58f7659f0231c0739fac8761efa598ab0c5 /drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | |
parent | bfc56530697d939d07608d221451cd875aefa295 (diff) | |
download | linux-8000ddc0eceb8e504cb9f95a1d72af0a8d2fc76e.tar.xz |
net: stmmac: Add support for SA Insertion/Replacement in XGMAC cores
Add the support for Source Address Insertion and Replacement in XGMAC
cores. Two methods are supported: Descriptor based and register based.
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index a161285340c6..d0e7b62cc2ae 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -1075,6 +1075,16 @@ static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index, return 0; } +static void dwxgmac2_sarc_configure(void __iomem *ioaddr, int val) +{ + u32 value = readl(ioaddr + XGMAC_TX_CONFIG); + + value &= ~XGMAC_CONFIG_SARC; + value |= val << XGMAC_CONFIG_SARC_SHIFT; + + writel(value, ioaddr + XGMAC_TX_CONFIG); +} + const struct stmmac_ops dwxgmac210_ops = { .core_init = dwxgmac2_core_init, .set_mac = dwxgmac2_set_mac, @@ -1113,6 +1123,7 @@ const struct stmmac_ops dwxgmac210_ops = { .rxp_config = dwxgmac3_rxp_config, .get_mac_tx_timestamp = dwxgmac2_get_mac_tx_timestamp, .flex_pps_config = dwxgmac2_flex_pps_config, + .sarc_configure = dwxgmac2_sarc_configure, }; int dwxgmac2_setup(struct stmmac_priv *priv) |