struct napi_struct napi_tx;
dma_addr_t rx_ring_dma;
-@@ -1285,9 +1304,15 @@ struct macb {
+@@ -1287,9 +1306,15 @@ struct macb {
u32 caps;
unsigned int dma_burst_length;
wmb(); // ensure softirq can see update
}
-@@ -2402,6 +2425,11 @@ static netdev_tx_t macb_start_xmit(struc
+@@ -2404,6 +2427,11 @@ static netdev_tx_t macb_start_xmit(struc
skb_tx_timestamp(skb);
spin_lock_irq(&bp->lock);
macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART));
spin_unlock_irq(&bp->lock);
-@@ -2776,6 +2804,37 @@ static void macb_configure_dma(struct ma
+@@ -2778,6 +2806,37 @@ static void macb_configure_dma(struct ma
}
}
static void macb_init_hw(struct macb *bp)
{
u32 config;
-@@ -2804,6 +2863,11 @@ static void macb_init_hw(struct macb *bp
+@@ -2806,6 +2865,11 @@ static void macb_init_hw(struct macb *bp
if (bp->caps & MACB_CAPS_JUMBO)
bp->rx_frm_len_mask = MACB_RX_JFRMLEN_MASK;
macb_configure_dma(bp);
/* Enable RX partial store and forward and set watermark */
-@@ -3165,6 +3229,52 @@ static void gem_get_ethtool_strings(stru
+@@ -3170,6 +3234,52 @@ static void gem_get_ethtool_strings(stru
}
}
static struct net_device_stats *macb_get_stats(struct net_device *dev)
{
struct macb *bp = netdev_priv(dev);
-@@ -3757,6 +3867,8 @@ static const struct ethtool_ops macb_eth
+@@ -3764,6 +3874,8 @@ static const struct ethtool_ops macb_eth
};
static const struct ethtool_ops gem_ethtool_ops = {
.get_regs_len = macb_get_regs_len,
.get_regs = macb_get_regs,
.get_wol = macb_get_wol,
-@@ -3766,6 +3878,8 @@ static const struct ethtool_ops gem_etht
+@@ -3773,6 +3885,8 @@ static const struct ethtool_ops gem_etht
.get_ethtool_stats = gem_get_ethtool_stats,
.get_strings = gem_get_ethtool_strings,
.get_sset_count = gem_get_sset_count,
.get_link_ksettings = macb_get_link_ksettings,
.set_link_ksettings = macb_set_link_ksettings,
.get_ringparam = macb_get_ringparam,
-@@ -5062,6 +5176,11 @@ static int macb_probe(struct platform_de
+@@ -5069,6 +5183,11 @@ static int macb_probe(struct platform_de
}
}
}
+ bp->use_aw2b_fill = device_property_read_bool(&pdev->dev, "cdns,use-aw2b-fill");
+
spin_lock_init(&bp->lock);
+ spin_lock_init(&bp->stats_lock);
- /* setup capabilities */
-@@ -5117,6 +5236,21 @@ static int macb_probe(struct platform_de
+@@ -5125,6 +5244,21 @@ static int macb_probe(struct platform_de
else
bp->phy_interface = interface;
/* IP specific init */
err = init(pdev);
if (err)
-@@ -5193,6 +5327,19 @@ static int macb_remove(struct platform_d
+@@ -5201,6 +5335,19 @@ static int macb_remove(struct platform_d
return 0;
}
static int __maybe_unused macb_suspend(struct device *dev)
{
struct net_device *netdev = dev_get_drvdata(dev);
-@@ -5407,6 +5554,7 @@ static const struct dev_pm_ops macb_pm_o
+@@ -5415,6 +5562,7 @@ static const struct dev_pm_ops macb_pm_o
static struct platform_driver macb_driver = {
.probe = macb_probe,
.remove = macb_remove,
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -5023,6 +5023,17 @@ static const struct macb_config versal_c
+@@ -5030,6 +5030,17 @@ static const struct macb_config versal_c
.usrio = &macb_default_usrio,
};
static const struct of_device_id macb_dt_ids[] = {
{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
{ .compatible = "cdns,macb" },
-@@ -5043,6 +5054,7 @@ static const struct of_device_id macb_dt
+@@ -5050,6 +5061,7 @@ static const struct of_device_id macb_dt
{ .compatible = "microchip,mpfs-macb", .data = &mpfs_config },
{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
{ .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config },