aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/driver_chipcommon_pmu.c20
-rw-r--r--drivers/bcma/sprom.c6
2 files changed, 25 insertions, 1 deletions
diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c
index 5940c81e7e12..4bc10aa57bd4 100644
--- a/drivers/bcma/driver_chipcommon_pmu.c
+++ b/drivers/bcma/driver_chipcommon_pmu.c
@@ -90,6 +90,24 @@ void bcma_pmu_swreg_init(struct bcma_drv_cc *cc)
90 } 90 }
91} 91}
92 92
93/* Disable to allow reading SPROM. Don't know the adventages of enabling it. */
94void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable)
95{
96 struct bcma_bus *bus = cc->core->bus;
97 u32 val;
98
99 val = bcma_cc_read32(cc, BCMA_CC_CHIPCTL);
100 if (enable) {
101 val |= BCMA_CHIPCTL_4331_EXTPA_EN;
102 if (bus->chipinfo.pkg == 9 || bus->chipinfo.pkg == 11)
103 val |= BCMA_CHIPCTL_4331_EXTPA_ON_GPIO2_5;
104 } else {
105 val &= ~BCMA_CHIPCTL_4331_EXTPA_EN;
106 val &= ~BCMA_CHIPCTL_4331_EXTPA_ON_GPIO2_5;
107 }
108 bcma_cc_write32(cc, BCMA_CC_CHIPCTL, val);
109}
110
93void bcma_pmu_workarounds(struct bcma_drv_cc *cc) 111void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
94{ 112{
95 struct bcma_bus *bus = cc->core->bus; 113 struct bcma_bus *bus = cc->core->bus;
@@ -99,7 +117,7 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
99 bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x7); 117 bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x7);
100 break; 118 break;
101 case 0x4331: 119 case 0x4331:
102 pr_err("Enabling Ext PA lines not implemented\n"); 120 /* BCM4331 workaround is SPROM-related, we put it in sprom.c */
103 break; 121 break;
104 case 43224: 122 case 43224:
105 if (bus->chipinfo.rev == 0) { 123 if (bus->chipinfo.rev == 0) {
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c
index 8b5b7856abe3..166ed13ec066 100644
--- a/drivers/bcma/sprom.c
+++ b/drivers/bcma/sprom.c
@@ -152,6 +152,9 @@ int bcma_sprom_get(struct bcma_bus *bus)
152 if (!sprom) 152 if (!sprom)
153 return -ENOMEM; 153 return -ENOMEM;
154 154
155 if (bus->chipinfo.id == 0x4331)
156 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, false);
157
155 /* Most cards have SPROM moved by additional offset 0x30 (48 dwords). 158 /* Most cards have SPROM moved by additional offset 0x30 (48 dwords).
156 * According to brcm80211 this applies to cards with PCIe rev >= 6 159 * According to brcm80211 this applies to cards with PCIe rev >= 6
157 * TODO: understand this condition and use it */ 160 * TODO: understand this condition and use it */
@@ -159,6 +162,9 @@ int bcma_sprom_get(struct bcma_bus *bus)
159 BCMA_CC_SPROM_PCIE6; 162 BCMA_CC_SPROM_PCIE6;
160 bcma_sprom_read(bus, offset, sprom); 163 bcma_sprom_read(bus, offset, sprom);
161 164
165 if (bus->chipinfo.id == 0x4331)
166 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true);
167
162 err = bcma_sprom_valid(sprom); 168 err = bcma_sprom_valid(sprom);
163 if (err) 169 if (err)
164 goto out; 170 goto out;