brcm47xx: b44: fix some problems with the phy
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-3.10 / 206-b44-activate-PHY-when-MAC-is-off.patch
1 From 444044a410d4cf3b6dd462f2c9352d56039d9e07 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 6 Oct 2013 17:58:24 +0200
4 Subject: [PATCH 6/6] 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 ---
12 drivers/net/ethernet/broadcom/b44.c | 5 ++++-
13 1 file changed, 4 insertions(+), 1 deletion(-)
14
15 --- a/drivers/net/ethernet/broadcom/b44.c
16 +++ b/drivers/net/ethernet/broadcom/b44.c
17 @@ -1358,7 +1358,10 @@ static void b44_halt(struct b44 *bp)
18 bw32(bp, B44_MAC_CTRL, MAC_CTRL_PHY_PDOWN);
19 /* now reset the chip, but without enabling the MAC&PHY
20 * part of it. This has to be done _after_ we shut down the PHY */
21 - b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
22 + if (bp->has_phy)
23 + b44_chip_reset(bp, B44_CHIP_RESET_FULL);
24 + else
25 + b44_chip_reset(bp, B44_CHIP_RESET_PARTIAL);
26 }
27
28 /* bp->lock is held. */