aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-09-01 17:11:07 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-09-09 15:27:18 -0400
commita395135ddebb0a06052b84c309eb6cb68b79c797 (patch)
treed2d0582c1a5e1d260b91d40515b914c4a0b968f8
parentdc8ecdd3a3fccf73fcb07711cde064ce5727f9d1 (diff)
bcma: use separated function to initialize bus on SoC
This is required to split SoC bus init into two phases. The later one (which includes scanning) should be called when kalloc is available. Cc: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--arch/mips/bcm47xx/setup.c4
-rw-r--r--drivers/bcma/host_soc.c11
-rw-r--r--include/linux/bcma/bcma_soc.h1
3 files changed, 14 insertions, 2 deletions
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
index 2b63e7e7d3d3..fff6ed4978c7 100644
--- a/arch/mips/bcm47xx/setup.c
+++ b/arch/mips/bcm47xx/setup.c
@@ -202,6 +202,10 @@ static void __init bcm47xx_register_bcma(void)
202 202
203 err = bcma_host_soc_register(&bcm47xx_bus.bcma); 203 err = bcma_host_soc_register(&bcm47xx_bus.bcma);
204 if (err) 204 if (err)
205 panic("Failed to register BCMA bus (err %d)", err);
206
207 err = bcma_host_soc_init(&bcm47xx_bus.bcma);
208 if (err)
205 panic("Failed to initialize BCMA bus (err %d)", err); 209 panic("Failed to initialize BCMA bus (err %d)", err);
206 210
207 bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL); 211 bcm47xx_fill_bcma_boardinfo(&bcm47xx_bus.bcma.bus.boardinfo, NULL);
diff --git a/drivers/bcma/host_soc.c b/drivers/bcma/host_soc.c
index 379e0d4ebe72..718e054dd727 100644
--- a/drivers/bcma/host_soc.c
+++ b/drivers/bcma/host_soc.c
@@ -165,7 +165,6 @@ static const struct bcma_host_ops bcma_host_soc_ops = {
165int __init bcma_host_soc_register(struct bcma_soc *soc) 165int __init bcma_host_soc_register(struct bcma_soc *soc)
166{ 166{
167 struct bcma_bus *bus = &soc->bus; 167 struct bcma_bus *bus = &soc->bus;
168 int err;
169 168
170 /* iomap only first core. We have to read some register on this core 169 /* iomap only first core. We have to read some register on this core
171 * to scan the bus. 170 * to scan the bus.
@@ -181,7 +180,15 @@ int __init bcma_host_soc_register(struct bcma_soc *soc)
181 /* Initialize struct, detect chip */ 180 /* Initialize struct, detect chip */
182 bcma_init_bus(bus); 181 bcma_init_bus(bus);
183 182
184 /* Register */ 183 return 0;
184}
185
186int __init bcma_host_soc_init(struct bcma_soc *soc)
187{
188 struct bcma_bus *bus = &soc->bus;
189 int err;
190
191 /* Scan bus and initialize it */
185 err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips); 192 err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips);
186 if (err) 193 if (err)
187 iounmap(bus->mmio); 194 iounmap(bus->mmio);
diff --git a/include/linux/bcma/bcma_soc.h b/include/linux/bcma/bcma_soc.h
index 4203c5593b9f..f24d245f8394 100644
--- a/include/linux/bcma/bcma_soc.h
+++ b/include/linux/bcma/bcma_soc.h
@@ -10,6 +10,7 @@ struct bcma_soc {
10}; 10};
11 11
12int __init bcma_host_soc_register(struct bcma_soc *soc); 12int __init bcma_host_soc_register(struct bcma_soc *soc);
13int __init bcma_host_soc_init(struct bcma_soc *soc);
13 14
14int bcma_bus_register(struct bcma_bus *bus); 15int bcma_bus_register(struct bcma_bus *bus);
15 16