summaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/patches-2.6.38/033-bcm47xx-register-fallback-callback.patch
diff options
context:
space:
mode:
authorhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-05-01 20:28:35 +0000
committerhauke <hauke@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-05-01 20:28:35 +0000
commit374bb82f67f49829cb443fe95a11d88c83675be4 (patch)
treea4af4b9a59d3ffae404928bc156a91909a87be21 /target/linux/brcm47xx/patches-2.6.38/033-bcm47xx-register-fallback-callback.patch
parent505d82b643b326b3a63484cdce6fc07e7aa28277 (diff)
brcm47xx: add fallback sprom for pci devices without an own sprom.
If there is no sprom on an ssb based pci device on the brcm47xx architecture ssb now asks the architecture code to look into the nvram to get some sprom data for this device. Now we are able to read out pci/1/1/ foo or pci/1/3/ foo config options. This will fix some problems where the wireless devices does not got an mac address and the following message was show: ssb: WARNING: Invalid SPROM CRC (corrupt SPROM) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26801 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-2.6.38/033-bcm47xx-register-fallback-callback.patch')
-rw-r--r--target/linux/brcm47xx/patches-2.6.38/033-bcm47xx-register-fallback-callback.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-2.6.38/033-bcm47xx-register-fallback-callback.patch b/target/linux/brcm47xx/patches-2.6.38/033-bcm47xx-register-fallback-callback.patch
new file mode 100644
index 000000000..f63deacdd
--- /dev/null
+++ b/target/linux/brcm47xx/patches-2.6.38/033-bcm47xx-register-fallback-callback.patch
@@ -0,0 +1,48 @@
+--- a/arch/mips/bcm47xx/nvram.c
++++ b/arch/mips/bcm47xx/nvram.c
+@@ -23,7 +23,7 @@
+ static char nvram_buf[NVRAM_SPACE];
+
+ /* Probe for NVRAM header */
+-static void __init early_nvram_init(void)
++static void early_nvram_init(void)
+ {
+ struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
+ struct nvram_header *header;
+--- a/arch/mips/bcm47xx/setup.c
++++ b/arch/mips/bcm47xx/setup.c
+@@ -156,6 +156,22 @@ static void bcm47xx_fill_sprom(struct ss
+ }
+ }
+
++int bcm47xx_get_sprom(struct ssb_bus *bus)
++{
++ char prefix[10];
++
++ if (bus->bustype == SSB_BUSTYPE_PCI) {
++ snprintf(prefix, sizeof(prefix), "pci/%x/%x/",
++ bus->host_pci->bus->number + 1,
++ PCI_SLOT(bus->host_pci->devfn));
++ bcm47xx_fill_sprom(&bus->sprom, prefix);
++ return 0;
++ } else {
++ printk(KERN_WARNING "bcm47xx: unable to fill SPROM for given bustype.\n");
++ return -EINVAL;
++ }
++}
++
+ static int bcm47xx_get_invariants(struct ssb_bus *bus,
+ struct ssb_init_invariants *iv)
+ {
+@@ -212,6 +228,11 @@ void __init plat_mem_setup(void)
+ char buf[100];
+ struct ssb_mipscore *mcore;
+
++ err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom);
++ if (err)
++ printk(KERN_WARNING "bcm47xx: someone else already registered"
++ " a ssb SPROM callback handler (err %d)\n", err);
++
+ err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
+ bcm47xx_get_invariants);
+ if (err)