aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-09-01 17:11:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-09-09 15:27:18 -0400
commitdc8ecdd3a3fccf73fcb07711cde064ce5727f9d1 (patch)
treeb9ded86a4b913f23d44a953e885f7f59f92d5ad0 /drivers/bcma
parent39e90c77637b3892a39f2908aea57539e961c50e (diff)
bcma: move bus struct setup into early part of host specific code
This change is important for SoC host. In future we will want to know chip ID (needed for early MIPS boot) before doing cores scanning. 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>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/host_pci.c3
-rw-r--r--drivers/bcma/host_soc.c3
-rw-r--r--drivers/bcma/main.c2
-rw-r--r--drivers/bcma/scan.c7
4 files changed, 6 insertions, 9 deletions
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index f032ed6dd459..1e5ac0a79696 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -208,6 +208,9 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
208 bus->boardinfo.vendor = bus->host_pci->subsystem_vendor; 208 bus->boardinfo.vendor = bus->host_pci->subsystem_vendor;
209 bus->boardinfo.type = bus->host_pci->subsystem_device; 209 bus->boardinfo.type = bus->host_pci->subsystem_device;
210 210
211 /* Initialize struct, detect chip */
212 bcma_init_bus(bus);
213
211 /* Register */ 214 /* Register */
212 err = bcma_bus_register(bus); 215 err = bcma_bus_register(bus);
213 if (err) 216 if (err)
diff --git a/drivers/bcma/host_soc.c b/drivers/bcma/host_soc.c
index 1edd7e064621..379e0d4ebe72 100644
--- a/drivers/bcma/host_soc.c
+++ b/drivers/bcma/host_soc.c
@@ -178,6 +178,9 @@ int __init bcma_host_soc_register(struct bcma_soc *soc)
178 bus->hosttype = BCMA_HOSTTYPE_SOC; 178 bus->hosttype = BCMA_HOSTTYPE_SOC;
179 bus->ops = &bcma_host_soc_ops; 179 bus->ops = &bcma_host_soc_ops;
180 180
181 /* Initialize struct, detect chip */
182 bcma_init_bus(bus);
183
181 /* Register */ 184 /* Register */
182 err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips); 185 err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips);
183 if (err) 186 if (err)
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 0ff8d58831ef..9f6b0cb9a12c 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -334,8 +334,6 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
334 struct bcma_device *core; 334 struct bcma_device *core;
335 struct bcma_device_id match; 335 struct bcma_device_id match;
336 336
337 bcma_init_bus(bus);
338
339 match.manuf = BCMA_MANUF_BCM; 337 match.manuf = BCMA_MANUF_BCM;
340 match.id = bcma_cc_core_id(bus); 338 match.id = bcma_cc_core_id(bus);
341 match.class = BCMA_CL_SIM; 339 match.class = BCMA_CL_SIM;
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index e9bd77249a4c..e2b990303042 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -438,9 +438,6 @@ void bcma_init_bus(struct bcma_bus *bus)
438 s32 tmp; 438 s32 tmp;
439 struct bcma_chipinfo *chipinfo = &(bus->chipinfo); 439 struct bcma_chipinfo *chipinfo = &(bus->chipinfo);
440 440
441 if (bus->init_done)
442 return;
443
444 INIT_LIST_HEAD(&bus->cores); 441 INIT_LIST_HEAD(&bus->cores);
445 bus->nr_cores = 0; 442 bus->nr_cores = 0;
446 443
@@ -452,8 +449,6 @@ void bcma_init_bus(struct bcma_bus *bus)
452 chipinfo->pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT; 449 chipinfo->pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
453 bcma_info(bus, "Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n", 450 bcma_info(bus, "Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n",
454 chipinfo->id, chipinfo->rev, chipinfo->pkg); 451 chipinfo->id, chipinfo->rev, chipinfo->pkg);
455
456 bus->init_done = true;
457} 452}
458 453
459int bcma_bus_scan(struct bcma_bus *bus) 454int bcma_bus_scan(struct bcma_bus *bus)
@@ -463,8 +458,6 @@ int bcma_bus_scan(struct bcma_bus *bus)
463 458
464 int err, core_num = 0; 459 int err, core_num = 0;
465 460
466 bcma_init_bus(bus);
467
468 erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM); 461 erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM);
469 if (bus->hosttype == BCMA_HOSTTYPE_SOC) { 462 if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
470 eromptr = ioremap_nocache(erombase, BCMA_CORE_SIZE); 463 eromptr = ioremap_nocache(erombase, BCMA_CORE_SIZE);