]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: stmmac: dwmac-sunxi: Provide TX and RX fifo sizes
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 14 Apr 2020 22:39:52 +0000 (15:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Apr 2020 20:47:53 +0000 (13:47 -0700)
After commit 8aa479224b68c4fbedc27a502cd67f067ff8206e ("net: dsa:
configure the MTU for switch ports") my Lamobo R1 platform which uses
an allwinner,sun7i-a20-gmac compatible Ethernet MAC started to fail
by rejecting a MTU of 1536. The reason for that is that the DMA
capabilities are not readable on this version of the IP, and there
is also no 'tx-fifo-depth' property being provided in Device Tree. The
property is documented as optional, and is not provided.

Chen-Yu indicated that the FIFO sizes are 4KB for TX and 16KB for RX, so
provide these values through platform data as an immediate fix until
various Device Tree sources get updated accordingly.

Fixes: db3a713a7d70 ("net: stmmac: Do not accept invalid MTU values")
Suggested-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c

index 7d40760e9ba887693e5b6b2a925eee73bd7ad92d..0e1ca2cba3c7c5220d8c24b62e835f64e5bdc2a2 100644 (file)
@@ -150,6 +150,8 @@ static int sun7i_gmac_probe(struct platform_device *pdev)
        plat_dat->init = sun7i_gmac_init;
        plat_dat->exit = sun7i_gmac_exit;
        plat_dat->fix_mac_speed = sun7i_fix_speed;
+       plat_dat->tx_fifo_size = 4096;
+       plat_dat->rx_fifo_size = 16384;
 
        ret = sun7i_gmac_init(pdev, plat_dat->bsp_priv);
        if (ret)