aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-10-28 08:30:23 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-11-24 01:44:59 -0500
commit7177efc5b030012c54c2e217c9d6decc0bcc1c53 (patch)
treede7286cacf84e4936905451e6278e9f726b9cca8 /arch/mips
parent21400f252a97755579b43a4dc95dd02cd7f0ca75 (diff)
MIPS: BCM47XX: Make bcma init NVRAM instead of bcm47xx polling it
This drops ssb/bcma dependency and will allow us to make it a standalone driver. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Cc: linux-mips@linux-mips.org Cc: Hauke Mehrtens <hauke@hauke-m.de> Patchwork: https://patchwork.linux-mips.org/patch/8233/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/bcm47xx/nvram.c42
1 files changed, 2 insertions, 40 deletions
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
index fecc5aeddd46..21712fb40d72 100644
--- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c
@@ -121,48 +121,10 @@ int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
121 return err; 121 return err;
122} 122}
123 123
124#ifdef CONFIG_BCM47XX_BCMA
125static int nvram_init_bcma(void)
126{
127 struct bcma_drv_cc *cc = &bcm47xx_bus.bcma.bus.drv_cc;
128 u32 base;
129 u32 lim;
130
131#ifdef CONFIG_BCMA_NFLASH
132 if (cc->nflash.boot) {
133 base = BCMA_SOC_FLASH1;
134 lim = BCMA_SOC_FLASH1_SZ;
135 } else
136#endif
137 if (cc->pflash.present) {
138 base = cc->pflash.window;
139 lim = cc->pflash.window_size;
140#ifdef CONFIG_BCMA_SFLASH
141 } else if (cc->sflash.present) {
142 base = cc->sflash.window;
143 lim = cc->sflash.size;
144#endif
145 } else {
146 pr_err("Couldn't find supported flash memory\n");
147 return -ENXIO;
148 }
149
150 return bcm47xx_nvram_init_from_mem(base, lim);
151}
152#endif
153
154static int nvram_init(void) 124static int nvram_init(void)
155{ 125{
156 switch (bcm47xx_bus_type) { 126 /* TODO: Look for MTD "nvram" partition */
157#ifdef CONFIG_BCM47XX_SSB 127
158 case BCM47XX_BUS_TYPE_SSB:
159 break;
160#endif
161#ifdef CONFIG_BCM47XX_BCMA
162 case BCM47XX_BUS_TYPE_BCMA:
163 return nvram_init_bcma();
164#endif
165 }
166 return -ENXIO; 128 return -ENXIO;
167} 129}
168 130