kernel: update kernel 4.1 to version 4.1.20
[openwrt/svn-archive/archive.git] / target / linux / bcm53xx / patches-4.1 / 710-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 @@ -25,6 +25,7 @@
17 #include <linux/module.h>
18 #include <linux/switch.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 @@ -1370,6 +1371,18 @@ static int b53_switch_init(struct b53_de
25 sw_dev->cpu_port = 5;
26 }
27
28 + if (of_machine_is_compatible("asus,rt-ac87u"))
29 + sw_dev->cpu_port = 7;
30 + else if (of_machine_is_compatible("netgear,r8000"))
31 + sw_dev->cpu_port = 8;
32 +
33 + /*
34 + * Workaround for devices using port 8 (connected to the 3rd iface).
35 + * For some reason it doesn't work (no packets on eth2).
36 + */
37 + if (of_machine_is_compatible("netgear,r8000"))
38 + sw_dev->cpu_port = 5;
39 +
40 /* cpu port is always last */
41 sw_dev->ports = sw_dev->cpu_port + 1;
42 dev->enabled_ports |= BIT(sw_dev->cpu_port);