aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm47xx/patches-3.3/202-bcma-init-sprom-struct-earlier.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-09-30 11:44:44 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2012-09-30 11:44:44 +0000
commit42952fd94fdd974714ceb9206b9ba7f30bc04415 (patch)
treef79a419a1b8391f180b8173fdc13197b80f2e6de /target/linux/brcm47xx/patches-3.3/202-bcma-init-sprom-struct-earlier.patch
parent2d40590a23ba44ce79c0c8c224888630aa907ab6 (diff)
downloadupstream-42952fd94fdd974714ceb9206b9ba7f30bc04415.tar.gz
upstream-42952fd94fdd974714ceb9206b9ba7f30bc04415.tar.bz2
upstream-42952fd94fdd974714ceb9206b9ba7f30bc04415.zip
bcma: initialize sprom earlier
The chip common and the PCIe code are accessing the sprom struct which is not filled when these cores are initialized. Fix this by adding an early initialize and fill the sprom struct before accessing it in other code. SVN-Revision: 33600
Diffstat (limited to 'target/linux/brcm47xx/patches-3.3/202-bcma-init-sprom-struct-earlier.patch')
-rw-r--r--target/linux/brcm47xx/patches-3.3/202-bcma-init-sprom-struct-earlier.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.3/202-bcma-init-sprom-struct-earlier.patch b/target/linux/brcm47xx/patches-3.3/202-bcma-init-sprom-struct-earlier.patch
new file mode 100644
index 0000000000..03540f04cc
--- /dev/null
+++ b/target/linux/brcm47xx/patches-3.3/202-bcma-init-sprom-struct-earlier.patch
@@ -0,0 +1,37 @@
+--- a/drivers/bcma/main.c
++++ b/drivers/bcma/main.c
+@@ -165,6 +165,20 @@ int __devinit bcma_bus_register(struct b
+ 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) {
+@@ -193,13 +207,6 @@ int __devinit bcma_bus_register(struct b
+ 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);
+