diff options
Diffstat (limited to 'arch/mips/bcm47xx/nvram.c')
-rw-r--r-- | arch/mips/bcm47xx/nvram.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c index 54db815bc86c..a84e3bb7387f 100644 --- a/arch/mips/bcm47xx/nvram.c +++ b/arch/mips/bcm47xx/nvram.c | |||
@@ -26,14 +26,35 @@ static char nvram_buf[NVRAM_SPACE]; | |||
26 | /* Probe for NVRAM header */ | 26 | /* Probe for NVRAM header */ |
27 | static void early_nvram_init(void) | 27 | static void early_nvram_init(void) |
28 | { | 28 | { |
29 | struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore; | 29 | #ifdef CONFIG_BCM47XX_SSB |
30 | struct ssb_mipscore *mcore_ssb; | ||
31 | #endif | ||
32 | #ifdef CONFIG_BCM47XX_BCMA | ||
33 | struct bcma_drv_cc *bcma_cc; | ||
34 | #endif | ||
30 | struct nvram_header *header; | 35 | struct nvram_header *header; |
31 | int i; | 36 | int i; |
32 | u32 base, lim, off; | 37 | u32 base = 0; |
38 | u32 lim = 0; | ||
39 | u32 off; | ||
33 | u32 *src, *dst; | 40 | u32 *src, *dst; |
34 | 41 | ||
35 | base = mcore->flash_window; | 42 | switch (bcm47xx_bus_type) { |
36 | lim = mcore->flash_window_size; | 43 | #ifdef CONFIG_BCM47XX_SSB |
44 | case BCM47XX_BUS_TYPE_SSB: | ||
45 | mcore_ssb = &bcm47xx_bus.ssb.mipscore; | ||
46 | base = mcore_ssb->flash_window; | ||
47 | lim = mcore_ssb->flash_window_size; | ||
48 | break; | ||
49 | #endif | ||
50 | #ifdef CONFIG_BCM47XX_BCMA | ||
51 | case BCM47XX_BUS_TYPE_BCMA: | ||
52 | bcma_cc = &bcm47xx_bus.bcma.bus.drv_cc; | ||
53 | base = bcma_cc->pflash.window; | ||
54 | lim = bcma_cc->pflash.window_size; | ||
55 | break; | ||
56 | #endif | ||
57 | } | ||
37 | 58 | ||
38 | off = FLASH_MIN; | 59 | off = FLASH_MIN; |
39 | while (off <= lim) { | 60 | while (off <= lim) { |