2011-05-01 20:28:35 +00:00
|
|
|
--- 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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-05 14:05:21 +00:00
|
|
|
+int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
|
2011-05-01 20:28:35 +00:00
|
|
|
+{
|
|
|
|
+ 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));
|
2011-05-05 14:05:21 +00:00
|
|
|
+ bcm47xx_fill_sprom(out, prefix);
|
2011-05-01 20:28:35 +00:00
|
|
|
+ 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)
|