bcm53xx: 3.18: add early support for Buffalo WZR-900DHP
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-3.10 / 206-b44-activate-PHY-when-MAC-is-off.patch
1 From bea69c47f5b93b3142f8833f8a34b666d5d7d6a7 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Fri, 20 Dec 2013 02:16:11 +0100
4 Subject: [PATCH 206/208] b44: activate PHY when MAC is off
5
6 Without this patch we can not access the PHY when the MAC is switched
7 off. This PHY access is needed to configure the switch, which is done
8 through PHY registers.
9
10 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
12 ---
13 drivers/net/ethernet/broadcom/b44.c | 5 ++++-
14 1 file changed, 4 insertions(+), 1 deletion(-)
15
16 --- a/drivers/net/ethernet/broadcom/b44.c
17 +++ b/drivers/net/ethernet/broadcom/b44.c
18 @@ -1360,7 +1360,10 @@ static void b44_halt(struct b44 *bp)
19 bw32(bp, B44_MAC_CTRL, MAC_CTRL_PHY_PDOWN);
20 /* now reset the chip, but without enabling the MAC&PHY
21 * part of it. This has to be done _after_ we shut down the PHY */
22 - b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
23 + if (bp->flags & B44_FLAG_EXTERNAL_PHY)
24 + b44_chip_reset(bp, B44_CHIP_RESET_FULL);
25 + else
26 + b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
27 }
28
29 /* bp->lock is held. */