Commit 7f4ef975 authored by David S. Miller's avatar David S. Miller

Merge branch 'mvneta-jumbo-frames'

Simon Guinot says:

====================
Fix Ethernet jumbo frames support for Armada 370 and 38x

This patch series fixes the Ethernet jumbo frames support for the SoCs
Armada 370, 380 and 385. Unlike Armada XP, the Ethernet controller for
this SoCs don't support TCP/IP checksumming with a frame size larger
than 1600 bytes.

This patches should be applied to the -stable kernels 3.8 and onwards.

Changes since v1:
- Use a new compatible string for the Ethernet IP found in Armada XP
  SoCs (instead of using an optional property).
- Fix the issue for the Armada 380 and 385 SoCs as well.

Changes since v2:
- Add Acked-by from Gregory Clement.
- Add "Fixes:" tag to each commits.

Changes since v3:
- Fix patch 3 name: replace prefix "ARM: mvebu:" with "net: mvneta:".
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 279c6c7f b65657fc
* Marvell Armada 370 / Armada XP Ethernet Controller (NETA) * Marvell Armada 370 / Armada XP Ethernet Controller (NETA)
Required properties: Required properties:
- compatible: should be "marvell,armada-370-neta". - compatible: "marvell,armada-370-neta" or "marvell,armada-xp-neta".
- reg: address and length of the register set for the device. - reg: address and length of the register set for the device.
- interrupts: interrupt for the device - interrupts: interrupt for the device
- phy: See ethernet.txt file in the same directory. - phy: See ethernet.txt file in the same directory.
......
...@@ -270,7 +270,6 @@ usb@51000 { ...@@ -270,7 +270,6 @@ usb@51000 {
}; };
eth0: ethernet@70000 { eth0: ethernet@70000 {
compatible = "marvell,armada-370-neta";
reg = <0x70000 0x4000>; reg = <0x70000 0x4000>;
interrupts = <8>; interrupts = <8>;
clocks = <&gateclk 4>; clocks = <&gateclk 4>;
...@@ -286,7 +285,6 @@ mdio: mdio { ...@@ -286,7 +285,6 @@ mdio: mdio {
}; };
eth1: ethernet@74000 { eth1: ethernet@74000 {
compatible = "marvell,armada-370-neta";
reg = <0x74000 0x4000>; reg = <0x74000 0x4000>;
interrupts = <10>; interrupts = <10>;
clocks = <&gateclk 3>; clocks = <&gateclk 3>;
......
...@@ -307,6 +307,14 @@ xor11 { ...@@ -307,6 +307,14 @@ xor11 {
dmacap,memset; dmacap,memset;
}; };
}; };
ethernet@70000 {
compatible = "marvell,armada-370-neta";
};
ethernet@74000 {
compatible = "marvell,armada-370-neta";
};
}; };
}; };
}; };
......
...@@ -318,7 +318,7 @@ gpio2: gpio@18180 { ...@@ -318,7 +318,7 @@ gpio2: gpio@18180 {
}; };
eth3: ethernet@34000 { eth3: ethernet@34000 {
compatible = "marvell,armada-370-neta"; compatible = "marvell,armada-xp-neta";
reg = <0x34000 0x4000>; reg = <0x34000 0x4000>;
interrupts = <14>; interrupts = <14>;
clocks = <&gateclk 1>; clocks = <&gateclk 1>;
......
...@@ -356,7 +356,7 @@ gpio2: gpio@18180 { ...@@ -356,7 +356,7 @@ gpio2: gpio@18180 {
}; };
eth3: ethernet@34000 { eth3: ethernet@34000 {
compatible = "marvell,armada-370-neta"; compatible = "marvell,armada-xp-neta";
reg = <0x34000 0x4000>; reg = <0x34000 0x4000>;
interrupts = <14>; interrupts = <14>;
clocks = <&gateclk 1>; clocks = <&gateclk 1>;
......
...@@ -177,7 +177,7 @@ cpurst@20800 { ...@@ -177,7 +177,7 @@ cpurst@20800 {
}; };
eth2: ethernet@30000 { eth2: ethernet@30000 {
compatible = "marvell,armada-370-neta"; compatible = "marvell,armada-xp-neta";
reg = <0x30000 0x4000>; reg = <0x30000 0x4000>;
interrupts = <12>; interrupts = <12>;
clocks = <&gateclk 2>; clocks = <&gateclk 2>;
...@@ -220,6 +220,14 @@ xor11 { ...@@ -220,6 +220,14 @@ xor11 {
}; };
}; };
ethernet@70000 {
compatible = "marvell,armada-xp-neta";
};
ethernet@74000 {
compatible = "marvell,armada-xp-neta";
};
xor@f0900 { xor@f0900 {
compatible = "marvell,orion-xor"; compatible = "marvell,orion-xor";
reg = <0xF0900 0x100 reg = <0xF0900 0x100
......
...@@ -310,6 +310,7 @@ struct mvneta_port { ...@@ -310,6 +310,7 @@ struct mvneta_port {
unsigned int link; unsigned int link;
unsigned int duplex; unsigned int duplex;
unsigned int speed; unsigned int speed;
unsigned int tx_csum_limit;
int use_inband_status:1; int use_inband_status:1;
}; };
...@@ -2508,8 +2509,10 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) ...@@ -2508,8 +2509,10 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)
dev->mtu = mtu; dev->mtu = mtu;
if (!netif_running(dev)) if (!netif_running(dev)) {
netdev_update_features(dev);
return 0; return 0;
}
/* The interface is running, so we have to force a /* The interface is running, so we have to force a
* reallocation of the queues * reallocation of the queues
...@@ -2538,9 +2541,26 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) ...@@ -2538,9 +2541,26 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)
mvneta_start_dev(pp); mvneta_start_dev(pp);
mvneta_port_up(pp); mvneta_port_up(pp);
netdev_update_features(dev);
return 0; return 0;
} }
static netdev_features_t mvneta_fix_features(struct net_device *dev,
netdev_features_t features)
{
struct mvneta_port *pp = netdev_priv(dev);
if (pp->tx_csum_limit && dev->mtu > pp->tx_csum_limit) {
features &= ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
netdev_info(dev,
"Disable IP checksum for MTU greater than %dB\n",
pp->tx_csum_limit);
}
return features;
}
/* Get mac address */ /* Get mac address */
static void mvneta_get_mac_addr(struct mvneta_port *pp, unsigned char *addr) static void mvneta_get_mac_addr(struct mvneta_port *pp, unsigned char *addr)
{ {
...@@ -2862,6 +2882,7 @@ static const struct net_device_ops mvneta_netdev_ops = { ...@@ -2862,6 +2882,7 @@ static const struct net_device_ops mvneta_netdev_ops = {
.ndo_set_rx_mode = mvneta_set_rx_mode, .ndo_set_rx_mode = mvneta_set_rx_mode,
.ndo_set_mac_address = mvneta_set_mac_addr, .ndo_set_mac_address = mvneta_set_mac_addr,
.ndo_change_mtu = mvneta_change_mtu, .ndo_change_mtu = mvneta_change_mtu,
.ndo_fix_features = mvneta_fix_features,
.ndo_get_stats64 = mvneta_get_stats64, .ndo_get_stats64 = mvneta_get_stats64,
.ndo_do_ioctl = mvneta_ioctl, .ndo_do_ioctl = mvneta_ioctl,
}; };
...@@ -3107,6 +3128,9 @@ static int mvneta_probe(struct platform_device *pdev) ...@@ -3107,6 +3128,9 @@ static int mvneta_probe(struct platform_device *pdev)
} }
} }
if (of_device_is_compatible(dn, "marvell,armada-370-neta"))
pp->tx_csum_limit = 1600;
pp->tx_ring_size = MVNETA_MAX_TXD; pp->tx_ring_size = MVNETA_MAX_TXD;
pp->rx_ring_size = MVNETA_MAX_RXD; pp->rx_ring_size = MVNETA_MAX_RXD;
...@@ -3185,6 +3209,7 @@ static int mvneta_remove(struct platform_device *pdev) ...@@ -3185,6 +3209,7 @@ static int mvneta_remove(struct platform_device *pdev)
static const struct of_device_id mvneta_match[] = { static const struct of_device_id mvneta_match[] = {
{ .compatible = "marvell,armada-370-neta" }, { .compatible = "marvell,armada-370-neta" },
{ .compatible = "marvell,armada-xp-neta" },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, mvneta_match); MODULE_DEVICE_TABLE(of, mvneta_match);
......
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