MIPS: BCM47xx: Extract info about et2 interface
authorRafał Miłecki <zajec5@gmail.com>
Tue, 12 May 2015 09:54:48 +0000 (11:54 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Sun, 21 Jun 2015 19:52:24 +0000 (21:52 +0200)
New devices may have more than 1 Ethernet core (device). We should
extract info about them to make it available to Ethernet drivers.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Hante Meuleman <meuleman@broadcom.com>
Cc: Ian Kent <raven@themaw.net>
Patchwork: https://patchwork.linux-mips.org/patch/10027/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/bcm47xx/sprom.c
include/linux/ssb/ssb.h

index 404808388c038e9d1e3ae73f3b0ea7a7a078f114..92a6c9dc21bda559e4d597e645e2c616acc2b963 100644 (file)
@@ -531,6 +531,8 @@ static int mac_addr_used = 2;
 static void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom,
                                        const char *prefix, bool fallback)
 {
+       bool fb = fallback;
+
        nvram_read_macaddr(prefix, "et0macaddr", sprom->et0mac, fallback);
        nvram_read_u8(prefix, NULL, "et0mdcport", &sprom->et0mdcport, 0,
                      fallback);
@@ -543,6 +545,10 @@ static void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom,
        nvram_read_u8(prefix, NULL, "et1phyaddr", &sprom->et1phyaddr, 0,
                      fallback);
 
+       nvram_read_macaddr(prefix, "et2macaddr", sprom->et2mac, fb);
+       nvram_read_u8(prefix, NULL, "et2mdcport", &sprom->et2mdcport, 0, fb);
+       nvram_read_u8(prefix, NULL, "et2phyaddr", &sprom->et2phyaddr, 0, fb);
+
        nvram_read_macaddr(prefix, "macaddr", sprom->il0mac, fallback);
        nvram_read_macaddr(prefix, "il0macaddr", sprom->il0mac, fallback);
 
index ee90e32a0607bf7a5e92bcd8f2da54496cbdfd24..c3d1a525bacc389c104bfb7d3b990653d531c87f 100644 (file)
@@ -29,10 +29,13 @@ struct ssb_sprom {
        u8 il0mac[6] __aligned(sizeof(u16));    /* MAC address for 802.11b/g */
        u8 et0mac[6] __aligned(sizeof(u16));    /* MAC address for Ethernet */
        u8 et1mac[6] __aligned(sizeof(u16));    /* MAC address for 802.11a */
+       u8 et2mac[6] __aligned(sizeof(u16));    /* MAC address for extra Ethernet */
        u8 et0phyaddr;          /* MII address for enet0 */
        u8 et1phyaddr;          /* MII address for enet1 */
+       u8 et2phyaddr;          /* MII address for enet2 */
        u8 et0mdcport;          /* MDIO for enet0 */
        u8 et1mdcport;          /* MDIO for enet1 */
+       u8 et2mdcport;          /* MDIO for enet2 */
        u16 dev_id;             /* Device ID overriding e.g. PCI ID */
        u16 board_rev;          /* Board revision number from SPROM. */
        u16 board_num;          /* Board number from SPROM. */