aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-04-14 08:38:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-16 13:32:01 -0400
commit32998cc96a76cc3f42f66b55fec301377e439c66 (patch)
treed45d2f0a3194956081111fb87730a94cc50b6abd /drivers/bcma
parent428ca8a7065354877db63ceabfc493107686eebe (diff)
bcma: use fallback sprom if no on chip sprom is available
bcma should check for a fallback sprom every time it can not find a sprom on the card itself or a normal external sprom mapped into the memory of the chip. When otp sprom support was introduced it tried to read out the sprom from the wireless chip also if no otp sprom was available. This caused a Data bus error in bcma_sprom_get() when reading out the sprom for the SoC. This fixes a regression introduced in commit: commit 10d8493cd9efd38b1947b7a74276dbdc8311aa1a Author: Arend van Spriel <arend@broadcom.com> Date: Tue Mar 6 15:50:48 2012 +0100 bcma: add support for on-chip OTP memory used for SPROM storage This patch was tested on a Netgear WNDR3400 (Broadcom BCM4718 SoC). Reported-by: Nick Bowler <nbowler@elliptictech.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/sprom.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c
index cdcf75c0954f..3e2a6002aae6 100644
--- a/drivers/bcma/sprom.c
+++ b/drivers/bcma/sprom.c
@@ -404,16 +404,19 @@ int bcma_sprom_get(struct bcma_bus *bus)
404 return -EOPNOTSUPP; 404 return -EOPNOTSUPP;
405 405
406 if (!bcma_sprom_ext_available(bus)) { 406 if (!bcma_sprom_ext_available(bus)) {
407 bool sprom_onchip;
408
407 /* 409 /*
408 * External SPROM takes precedence so check 410 * External SPROM takes precedence so check
409 * on-chip OTP only when no external SPROM 411 * on-chip OTP only when no external SPROM
410 * is present. 412 * is present.
411 */ 413 */
412 if (bcma_sprom_onchip_available(bus)) { 414 sprom_onchip = bcma_sprom_onchip_available(bus);
415 if (sprom_onchip) {
413 /* determine offset */ 416 /* determine offset */
414 offset = bcma_sprom_onchip_offset(bus); 417 offset = bcma_sprom_onchip_offset(bus);
415 } 418 }
416 if (!offset) { 419 if (!offset || !sprom_onchip) {
417 /* 420 /*
418 * Maybe there is no SPROM on the device? 421 * Maybe there is no SPROM on the device?
419 * Now we ask the arch code if there is some sprom 422 * Now we ask the arch code if there is some sprom