1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

brcm47xx: sprom for nvram parsing

This adds support for parsing sprom form nvram for sprom version form 1 to 9.
It also adds sprom from nvram support for devices on the bcma bus.


git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30638 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
hauke
2012-02-18 23:08:26 +00:00
parent 7005c79799
commit 035f06d698
16 changed files with 1378 additions and 44 deletions

View File

@@ -14,7 +14,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
--- a/drivers/bcma/sprom.c
+++ b/drivers/bcma/sprom.c
@@ -210,6 +210,7 @@ int bcma_sprom_get(struct bcma_bus *bus)
@@ -209,6 +209,7 @@ int bcma_sprom_get(struct bcma_bus *bus)
{
u16 offset;
u16 *sprom;
@@ -22,14 +22,13 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
int err = 0;
if (!bus->drv_cc.core)
@@ -220,6 +221,13 @@ int bcma_sprom_get(struct bcma_bus *bus)
@@ -217,6 +218,12 @@ int bcma_sprom_get(struct bcma_bus *bus)
if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM))
return -ENOENT;
}
+ if (bus->drv_cc.core->id.rev >= 32) {
+ sromctrl = bcma_read32(bus->drv_cc.core, BCMA_CC_SROM_CONTROL);
+ if (!(sromctrl & BCMA_CC_SROM_CONTROL_PRESENT))
+ random_ether_addr(bus->sprom.il0mac);
+ return -ENOENT;
+ }
+