Commit a395135d authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

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: default avatarRafał Miłecki <zajec5@gmail.com>
Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent dc8ecdd3
...@@ -201,6 +201,10 @@ static void __init bcm47xx_register_bcma(void) ...@@ -201,6 +201,10 @@ static void __init bcm47xx_register_bcma(void)
pr_warn("bcm47xx: someone else already registered a bcma SPROM callback handler (err %d)\n", err); pr_warn("bcm47xx: someone else already registered a bcma SPROM callback handler (err %d)\n", err);
err = bcma_host_soc_register(&bcm47xx_bus.bcma); err = bcma_host_soc_register(&bcm47xx_bus.bcma);
if (err)
panic("Failed to register BCMA bus (err %d)", err);
err = bcma_host_soc_init(&bcm47xx_bus.bcma);
if (err) if (err)
panic("Failed to initialize BCMA bus (err %d)", err); panic("Failed to initialize BCMA bus (err %d)", err);
......
...@@ -165,7 +165,6 @@ static const struct bcma_host_ops bcma_host_soc_ops = { ...@@ -165,7 +165,6 @@ static const struct bcma_host_ops bcma_host_soc_ops = {
int __init bcma_host_soc_register(struct bcma_soc *soc) int __init bcma_host_soc_register(struct bcma_soc *soc)
{ {
struct bcma_bus *bus = &soc->bus; struct bcma_bus *bus = &soc->bus;
int err;
/* iomap only first core. We have to read some register on this core /* iomap only first core. We have to read some register on this core
* to scan the bus. * to scan the bus.
...@@ -181,7 +180,15 @@ int __init bcma_host_soc_register(struct bcma_soc *soc) ...@@ -181,7 +180,15 @@ int __init bcma_host_soc_register(struct bcma_soc *soc)
/* Initialize struct, detect chip */ /* Initialize struct, detect chip */
bcma_init_bus(bus); bcma_init_bus(bus);
/* Register */ return 0;
}
int __init bcma_host_soc_init(struct bcma_soc *soc)
{
struct bcma_bus *bus = &soc->bus;
int err;
/* Scan bus and initialize it */
err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips); err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips);
if (err) if (err)
iounmap(bus->mmio); iounmap(bus->mmio);
......
...@@ -10,6 +10,7 @@ struct bcma_soc { ...@@ -10,6 +10,7 @@ struct bcma_soc {
}; };
int __init bcma_host_soc_register(struct bcma_soc *soc); int __init bcma_host_soc_register(struct bcma_soc *soc);
int __init bcma_host_soc_init(struct bcma_soc *soc);
int bcma_bus_register(struct bcma_bus *bus); int bcma_bus_register(struct bcma_bus *bus);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment