Commit 428e2d6f authored by David S. Miller's avatar David S. Miller

Merge branch 'stmmac-next'

Jose Abreu says:

====================
net: stmmac: Improvements and fixes for -next

Improvements and fixes for recently introduced features. All for -next tree.
More info in commit logs.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0079ad8e d9da2c87
...@@ -352,7 +352,8 @@ enum power_event { ...@@ -352,7 +352,8 @@ enum power_event {
/* Default operating mode of the MAC */ /* Default operating mode of the MAC */
#define GMAC_CORE_INIT (GMAC_CONFIG_JD | GMAC_CONFIG_PS | \ #define GMAC_CORE_INIT (GMAC_CONFIG_JD | GMAC_CONFIG_PS | \
GMAC_CONFIG_BE | GMAC_CONFIG_DCRS) GMAC_CONFIG_BE | GMAC_CONFIG_DCRS | \
GMAC_CONFIG_JE)
/* To dump the core regs excluding the Address Registers */ /* To dump the core regs excluding the Address Registers */
#define GMAC_REG_NUM 132 #define GMAC_REG_NUM 132
......
...@@ -25,15 +25,9 @@ static void dwmac4_core_init(struct mac_device_info *hw, ...@@ -25,15 +25,9 @@ static void dwmac4_core_init(struct mac_device_info *hw,
{ {
void __iomem *ioaddr = hw->pcsr; void __iomem *ioaddr = hw->pcsr;
u32 value = readl(ioaddr + GMAC_CONFIG); u32 value = readl(ioaddr + GMAC_CONFIG);
int mtu = dev->mtu;
value |= GMAC_CORE_INIT; value |= GMAC_CORE_INIT;
if (mtu > 1500)
value |= GMAC_CONFIG_2K;
if (mtu > 2000)
value |= GMAC_CONFIG_JE;
if (hw->ps) { if (hw->ps) {
value |= GMAC_CONFIG_TE; value |= GMAC_CONFIG_TE;
......
...@@ -831,8 +831,14 @@ static void stmmac_validate(struct phylink_config *config, ...@@ -831,8 +831,14 @@ static void stmmac_validate(struct phylink_config *config,
phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseT_Full);
phylink_set(mask, 1000baseX_Full); phylink_set(mask, 1000baseX_Full);
} else if (priv->plat->has_xgmac) { } else if (priv->plat->has_xgmac) {
if (!max_speed || (max_speed >= 2500)) {
phylink_set(mac_supported, 2500baseT_Full); phylink_set(mac_supported, 2500baseT_Full);
phylink_set(mac_supported, 2500baseX_Full);
}
if (!max_speed || (max_speed >= 5000)) {
phylink_set(mac_supported, 5000baseT_Full); phylink_set(mac_supported, 5000baseT_Full);
}
if (!max_speed || (max_speed >= 10000)) {
phylink_set(mac_supported, 10000baseSR_Full); phylink_set(mac_supported, 10000baseSR_Full);
phylink_set(mac_supported, 10000baseLR_Full); phylink_set(mac_supported, 10000baseLR_Full);
phylink_set(mac_supported, 10000baseER_Full); phylink_set(mac_supported, 10000baseER_Full);
...@@ -841,6 +847,7 @@ static void stmmac_validate(struct phylink_config *config, ...@@ -841,6 +847,7 @@ static void stmmac_validate(struct phylink_config *config,
phylink_set(mac_supported, 10000baseKX4_Full); phylink_set(mac_supported, 10000baseKX4_Full);
phylink_set(mac_supported, 10000baseKR_Full); phylink_set(mac_supported, 10000baseKR_Full);
} }
}
/* Half-Duplex can only work with single queue */ /* Half-Duplex can only work with single queue */
if (tx_cnt > 1) { if (tx_cnt > 1) {
......
...@@ -722,8 +722,14 @@ static int stmmac_test_flowctrl(struct stmmac_priv *priv) ...@@ -722,8 +722,14 @@ static int stmmac_test_flowctrl(struct stmmac_priv *priv)
for (i = 0; i < rx_cnt; i++) { for (i = 0; i < rx_cnt; i++) {
struct stmmac_channel *ch = &priv->channel[i]; struct stmmac_channel *ch = &priv->channel[i];
u32 tail;
tail = priv->rx_queue[i].dma_rx_phy +
(DMA_RX_SIZE * sizeof(struct dma_desc));
stmmac_set_rx_tail_ptr(priv, priv->ioaddr, tail, i);
stmmac_start_rx(priv, priv->ioaddr, i); stmmac_start_rx(priv, priv->ioaddr, i);
local_bh_disable(); local_bh_disable();
napi_reschedule(&ch->rx_napi); napi_reschedule(&ch->rx_napi);
local_bh_enable(); local_bh_enable();
...@@ -1057,6 +1063,9 @@ static int stmmac_test_desc_sai(struct stmmac_priv *priv) ...@@ -1057,6 +1063,9 @@ static int stmmac_test_desc_sai(struct stmmac_priv *priv)
struct stmmac_packet_attrs attr = { }; struct stmmac_packet_attrs attr = { };
int ret; int ret;
if (!priv->dma_cap.vlins)
return -EOPNOTSUPP;
attr.remove_sa = true; attr.remove_sa = true;
attr.sarc = true; attr.sarc = true;
attr.src = src; attr.src = src;
...@@ -1076,6 +1085,9 @@ static int stmmac_test_desc_sar(struct stmmac_priv *priv) ...@@ -1076,6 +1085,9 @@ static int stmmac_test_desc_sar(struct stmmac_priv *priv)
struct stmmac_packet_attrs attr = { }; struct stmmac_packet_attrs attr = { };
int ret; int ret;
if (!priv->dma_cap.vlins)
return -EOPNOTSUPP;
attr.sarc = true; attr.sarc = true;
attr.src = src; attr.src = src;
attr.dst = priv->dev->dev_addr; attr.dst = priv->dev->dev_addr;
...@@ -1094,6 +1106,9 @@ static int stmmac_test_reg_sai(struct stmmac_priv *priv) ...@@ -1094,6 +1106,9 @@ static int stmmac_test_reg_sai(struct stmmac_priv *priv)
struct stmmac_packet_attrs attr = { }; struct stmmac_packet_attrs attr = { };
int ret; int ret;
if (!priv->dma_cap.vlins)
return -EOPNOTSUPP;
attr.remove_sa = true; attr.remove_sa = true;
attr.sarc = true; attr.sarc = true;
attr.src = src; attr.src = src;
...@@ -1114,6 +1129,9 @@ static int stmmac_test_reg_sar(struct stmmac_priv *priv) ...@@ -1114,6 +1129,9 @@ static int stmmac_test_reg_sar(struct stmmac_priv *priv)
struct stmmac_packet_attrs attr = { }; struct stmmac_packet_attrs attr = { };
int ret; int ret;
if (!priv->dma_cap.vlins)
return -EOPNOTSUPP;
attr.sarc = true; attr.sarc = true;
attr.src = src; attr.src = src;
attr.dst = priv->dev->dev_addr; attr.dst = priv->dev->dev_addr;
...@@ -1585,6 +1603,44 @@ static int stmmac_test_mjumbo(struct stmmac_priv *priv) ...@@ -1585,6 +1603,44 @@ static int stmmac_test_mjumbo(struct stmmac_priv *priv)
return 0; return 0;
} }
static int stmmac_test_sph(struct stmmac_priv *priv)
{
unsigned long cnt_end, cnt_start = priv->xstats.rx_split_hdr_pkt_n;
struct stmmac_packet_attrs attr = { };
int ret;
if (!priv->sph)
return -EOPNOTSUPP;
/* Check for UDP first */
attr.dst = priv->dev->dev_addr;
attr.tcp = false;
ret = __stmmac_test_loopback(priv, &attr);
if (ret)
return ret;
cnt_end = priv->xstats.rx_split_hdr_pkt_n;
if (cnt_end <= cnt_start)
return -EINVAL;
/* Check for TCP now */
cnt_start = cnt_end;
attr.dst = priv->dev->dev_addr;
attr.tcp = true;
ret = __stmmac_test_loopback(priv, &attr);
if (ret)
return ret;
cnt_end = priv->xstats.rx_split_hdr_pkt_n;
if (cnt_end <= cnt_start)
return -EINVAL;
return 0;
}
#define STMMAC_LOOPBACK_NONE 0 #define STMMAC_LOOPBACK_NONE 0
#define STMMAC_LOOPBACK_MAC 1 #define STMMAC_LOOPBACK_MAC 1
#define STMMAC_LOOPBACK_PHY 2 #define STMMAC_LOOPBACK_PHY 2
...@@ -1706,6 +1762,10 @@ static const struct stmmac_test { ...@@ -1706,6 +1762,10 @@ static const struct stmmac_test {
.name = "Multichannel Jumbo ", .name = "Multichannel Jumbo ",
.lb = STMMAC_LOOPBACK_PHY, .lb = STMMAC_LOOPBACK_PHY,
.fn = stmmac_test_mjumbo, .fn = stmmac_test_mjumbo,
}, {
.name = "Split Header ",
.lb = STMMAC_LOOPBACK_PHY,
.fn = stmmac_test_sph,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment