bcm53xx: make the l2x0 L2 cache controller work
[openwrt/openwrt.git] / target / linux / bcm53xx / patches-3.10 / 202-bgmac-make-bgmac-work-on-systems-without-nvram.patch
1 These are some hackish patches to make the Ethernet driver work somehow
2 on this arm core.
3 The flash driver is not working, so we removed the nvram reading, this
4 should be changed after we have a flash driver.
5 The mdelay(1) is a ugly workaround for this arm chip, this seams to be a dma problem.
6
7 The PHY says it is not connected by default, just ignore it.
8
9 --- a/drivers/net/ethernet/broadcom/Kconfig
10 +++ b/drivers/net/ethernet/broadcom/Kconfig
11 @@ -132,7 +132,7 @@ config BNX2X_SRIOV
12
13 config BGMAC
14 tristate "BCMA bus GBit core support"
15 - depends on BCMA_HOST_SOC && HAS_DMA && BCM47XX
16 + depends on BCMA_HOST_SOC && HAS_DMA
17 select PHYLIB
18 ---help---
19 This driver supports GBit MAC and BCM4706 GBit MAC cores on BCMA bus.
20 --- a/drivers/net/ethernet/broadcom/bgmac.c
21 +++ b/drivers/net/ethernet/broadcom/bgmac.c
22 @@ -17,7 +17,11 @@
23 #include <linux/interrupt.h>
24 #include <linux/dma-mapping.h>
25 #include <linux/platform_data/b53.h>
26 +#ifdef CONFIG_BCM47XX
27 #include <bcm47xx_nvram.h>
28 +#else
29 +#define bcm47xx_nvram_getenv(a, b, c) -1
30 +#endif
31
32 static const struct bcma_device_id bgmac_bcma_tbl[] = {
33 BCMA_CORE(BCMA_MANUF_BCM, BCMA_CORE_4706_MAC_GBIT, BCMA_ANY_REV, BCMA_ANY_CLASS),
34 @@ -1438,7 +1442,7 @@ static int bgmac_probe(struct bcma_devic
35 int err;
36
37 /* We don't support 2nd, 3rd, ... units, SPROM has to be adjusted */
38 - if (core->core_unit > 1) {
39 + if (core->core_unit > 0) {
40 pr_err("Unsupported core_unit %d\n", core->core_unit);
41 return -ENOTSUPP;
42 }
43 @@ -1534,8 +1538,7 @@ static int bgmac_probe(struct bcma_devic
44 /* TODO: reset the external phy. Specs are needed */
45 bgmac_phy_reset(bgmac);
46
47 - bgmac->has_robosw = !!(core->bus->sprom.boardflags_lo &
48 - BGMAC_BFL_ENETROBO);
49 + bgmac->has_robosw = 1;
50 if (bgmac->has_robosw)
51 bgmac_warn(bgmac, "Support for Roboswitch not implemented\n");
52
53 --- a/drivers/net/phy/phy_device.c
54 +++ b/drivers/net/phy/phy_device.c
55 @@ -814,7 +814,7 @@ int genphy_update_link(struct phy_device
56 return status;
57
58 if ((status & BMSR_LSTATUS) == 0)
59 - phydev->link = 0;
60 + phydev->link = 1;
61 else
62 phydev->link = 1;
63