diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-09-29 20:29:50 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-19 21:52:21 +0200 |
commit | 30cfb023019b347cdfd39bd5039d2118a1bd224a (patch) | |
tree | 37c511de8a04b0516909323d207e54cbc6498d34 /drivers/bcma | |
parent | bcma: just do the necessary things in early register on SoCs (diff) | |
download | linux-30cfb023019b347cdfd39bd5039d2118a1bd224a.tar.xz linux-30cfb023019b347cdfd39bd5039d2118a1bd224a.zip |
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: 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/main.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index bea2d7cfa6c2..d6b5c4ca4c43 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -182,6 +182,20 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) 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 */ core = bcma_find_core(bus, bcma_cc_core_id(bus)); if (core) { @@ -210,13 +224,6 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) 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 */ bcma_register_cores(bus); |