Commit 30cfb023 authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by John W. Linville

bcma: init sprom struct earlier

The PCIe host driver and the chip common initialisation accesses the
sprom struct, but it is not initialized when these functions are run.
Move the sprom parsing up in to do it earlier.
As we need the chip common core rev and some other attributes from the
chip common core, the early initialization is done before accessing the
sprom.
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 49655bb8
...@@ -182,6 +182,20 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) ...@@ -182,6 +182,20 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
return -1; return -1;
} }
/* Early init CC core */
core = bcma_find_core(bus, bcma_cc_core_id(bus));
if (core) {
bus->drv_cc.core = core;
bcma_core_chipcommon_early_init(&bus->drv_cc);
}
/* Try to get SPROM */
err = bcma_sprom_get(bus);
if (err == -ENOENT) {
bcma_err(bus, "No SPROM available\n");
} else if (err)
bcma_err(bus, "Failed to get SPROM: %d\n", err);
/* Init CC core */ /* Init CC core */
core = bcma_find_core(bus, bcma_cc_core_id(bus)); core = bcma_find_core(bus, bcma_cc_core_id(bus));
if (core) { if (core) {
...@@ -210,13 +224,6 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) ...@@ -210,13 +224,6 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
bcma_core_gmac_cmn_init(&bus->drv_gmac_cmn); bcma_core_gmac_cmn_init(&bus->drv_gmac_cmn);
} }
/* Try to get SPROM */
err = bcma_sprom_get(bus);
if (err == -ENOENT) {
bcma_err(bus, "No SPROM available\n");
} else if (err)
bcma_err(bus, "Failed to get SPROM: %d\n", err);
/* Register found cores */ /* Register found cores */
bcma_register_cores(bus); bcma_register_cores(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