bafa4e4b1d680663de930245fec958c1b488ae38
[openwrt/staging/chunkeey.git] / target / linux / bcm53xx / patches-4.9 / 700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch
1 From 4abdde3ad6bc0b3b157c4bf6ec0bf139d11d07e8 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Wed, 13 May 2015 14:13:28 +0200
4 Subject: [PATCH] b53: add hacky CPU port fixes for devices not using port 5
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
10 ---
11 drivers/net/phy/b53/b53_common.c | 6 ++++++
12 1 file changed, 6 insertions(+)
13
14 --- a/drivers/net/phy/b53/b53_common.c
15 +++ b/drivers/net/phy/b53/b53_common.c
16 @@ -27,6 +27,7 @@
17 #include <linux/of.h>
18 #include <linux/of_net.h>
19 #include <linux/platform_data/b53.h>
20 +#include <linux/of.h>
21
22 #include "b53_regs.h"
23 #include "b53_priv.h"
24 @@ -1522,6 +1523,28 @@ static int b53_switch_init(struct b53_de
25 return ret;
26 }
27
28 + /* Set correct CPU port */
29 + if (of_machine_is_compatible("asus,rt-ac87u"))
30 + sw_dev->cpu_port = 7;
31 + else if (of_machine_is_compatible("netgear,r7900"))
32 + sw_dev->cpu_port = 8;
33 + else if (of_machine_is_compatible("netgear,r8000"))
34 + sw_dev->cpu_port = 8;
35 + else if (of_machine_is_compatible("netgear,r8500"))
36 + sw_dev->cpu_port = 8;
37 +
38 + /* Enable extra ports */
39 + if (of_machine_is_compatible("tenda,ac9"))
40 + dev->enabled_ports |= BIT(5);
41 +
42 + /*
43 + * Workaround for devices using port 8 (connected to the 3rd iface).
44 + * For some reason it doesn't work (no packets on eth2).
45 + */
46 + if (of_machine_is_compatible("netgear,r7900") ||
47 + of_machine_is_compatible("netgear,r8000"))
48 + sw_dev->cpu_port = 5;
49 +
50 dev->enabled_ports |= BIT(sw_dev->cpu_port);
51 sw_dev->ports = fls(dev->enabled_ports);
52