Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[pandora-kernel.git] / arch / mips / bcm47xx / nvram.c
index 54db815..a84e3bb 100644 (file)
@@ -26,14 +26,35 @@ static char nvram_buf[NVRAM_SPACE];
 /* Probe for NVRAM header */
 static void early_nvram_init(void)
 {
-       struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
+#ifdef CONFIG_BCM47XX_SSB
+       struct ssb_mipscore *mcore_ssb;
+#endif
+#ifdef CONFIG_BCM47XX_BCMA
+       struct bcma_drv_cc *bcma_cc;
+#endif
        struct nvram_header *header;
        int i;
-       u32 base, lim, off;
+       u32 base = 0;
+       u32 lim = 0;
+       u32 off;
        u32 *src, *dst;
 
-       base = mcore->flash_window;
-       lim = mcore->flash_window_size;
+       switch (bcm47xx_bus_type) {
+#ifdef CONFIG_BCM47XX_SSB
+       case BCM47XX_BUS_TYPE_SSB:
+               mcore_ssb = &bcm47xx_bus.ssb.mipscore;
+               base = mcore_ssb->flash_window;
+               lim = mcore_ssb->flash_window_size;
+               break;
+#endif
+#ifdef CONFIG_BCM47XX_BCMA
+       case BCM47XX_BUS_TYPE_BCMA:
+               bcma_cc = &bcm47xx_bus.bcma.bus.drv_cc;
+               base = bcma_cc->pflash.window;
+               lim = bcma_cc->pflash.window_size;
+               break;
+#endif
+       }
 
        off = FLASH_MIN;
        while (off <= lim) {