7785e0c036092aad20d54c15c2eb0ddc8b9657f8
[openwrt/staging/pepe2k.git] /
1 From 8373a0fe9c7160a55482effa8a3f725efd3f8434 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Wed, 10 Mar 2021 13:51:59 +0100
4 Subject: [PATCH] net: dsa: bcm_sf2: use 2 Gbps IMP port link on BCM4908
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 BCM4908 uses 2 Gbps link between switch and the Ethernet interface.
10 Without this BCM4908 devices were able to achieve only 2 x ~895 Mb/s.
11 This allows handling e.g. NAT traffic with 940 Mb/s.
12
13 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
14 Acked-by: Florian Fainelli <f.fainelli@gmail.com>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 ---
17 drivers/net/dsa/bcm_sf2.c | 5 ++++-
18 1 file changed, 4 insertions(+), 1 deletion(-)
19
20 --- a/drivers/net/dsa/bcm_sf2.c
21 +++ b/drivers/net/dsa/bcm_sf2.c
22 @@ -114,7 +114,10 @@ static void bcm_sf2_imp_setup(struct dsa
23 /* Force link status for IMP port */
24 reg = core_readl(priv, offset);
25 reg |= (MII_SW_OR | LINK_STS);
26 - reg &= ~GMII_SPEED_UP_2G;
27 + if (priv->type == BCM4908_DEVICE_ID)
28 + reg |= GMII_SPEED_UP_2G;
29 + else
30 + reg &= ~GMII_SPEED_UP_2G;
31 core_writel(priv, reg, offset);
32
33 /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */