ar71xx: make 902-unaligned_access_hacks.patch apply again
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-4.0 / 031-04-MIPS-BCM47xx-Extract-info-about-et2-interface.patch
1 From c58ec43eaca5f970911770c17cb3a29ac102656d Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Tue, 12 May 2015 11:54:48 +0200
4 Subject: [PATCH] MIPS: BCM47xx: Extract info about et2 interface
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 New devices may have more than 1 Ethernet core (device). We should
10 extract info about them to make it available to Ethernet drivers.
11
12 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
13 Cc: linux-mips@linux-mips.org
14 Cc: Hauke Mehrtens <hauke@hauke-m.de>
15 Cc: Hante Meuleman <meuleman@broadcom.com>
16 Cc: Ian Kent <raven@themaw.net>
17 Patchwork: https://patchwork.linux-mips.org/patch/10027/
18 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
19 ---
20 arch/mips/bcm47xx/sprom.c | 6 ++++++
21 include/linux/ssb/ssb.h | 3 +++
22 2 files changed, 9 insertions(+)
23
24 --- a/arch/mips/bcm47xx/sprom.c
25 +++ b/arch/mips/bcm47xx/sprom.c
26 @@ -531,6 +531,8 @@ static int mac_addr_used = 2;
27 static void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom,
28 const char *prefix, bool fallback)
29 {
30 + bool fb = fallback;
31 +
32 nvram_read_macaddr(prefix, "et0macaddr", sprom->et0mac, fallback);
33 nvram_read_u8(prefix, NULL, "et0mdcport", &sprom->et0mdcport, 0,
34 fallback);
35 @@ -543,6 +545,10 @@ static void bcm47xx_fill_sprom_ethernet(
36 nvram_read_u8(prefix, NULL, "et1phyaddr", &sprom->et1phyaddr, 0,
37 fallback);
38
39 + nvram_read_macaddr(prefix, "et2macaddr", sprom->et2mac, fb);
40 + nvram_read_u8(prefix, NULL, "et2mdcport", &sprom->et2mdcport, 0, fb);
41 + nvram_read_u8(prefix, NULL, "et2phyaddr", &sprom->et2phyaddr, 0, fb);
42 +
43 nvram_read_macaddr(prefix, "macaddr", sprom->il0mac, fallback);
44 nvram_read_macaddr(prefix, "il0macaddr", sprom->il0mac, fallback);
45