* [PATCH 2/4] bcma: cc: set GPIOTIMER register
2011-07-14 19:49 [PATCH 1/4] ssb: SPROM: add LED duty cycle fields Rafał Miłecki
@ 2011-07-14 19:49 ` Rafał Miłecki
2011-07-14 19:49 ` [PATCH 3/4] bcma: implement BCM4331 workaround for external PA lines Rafał Miłecki
2011-07-14 19:49 ` [PATCH 4/4] bcma: extract SPROM rev 9 the same way as rev 8 Rafał Miłecki
2 siblings, 0 replies; 5+ messages in thread
From: Rafał Miłecki @ 2011-07-14 19:49 UTC (permalink / raw)
To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki
We use value supplied via SPROM, or default 10:90 as fallback.
Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
drivers/bcma/driver_chipcommon.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/bcma/driver_chipcommon.c b/drivers/bcma/driver_chipcommon.c
index 6061022..fb54302 100644
--- a/drivers/bcma/driver_chipcommon.c
+++ b/drivers/bcma/driver_chipcommon.c
@@ -23,6 +23,9 @@ static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
void bcma_core_chipcommon_init(struct bcma_drv_cc *cc)
{
+ u32 leddc_on = 10;
+ u32 leddc_off = 90;
+
if (cc->core->id.rev >= 11)
cc->status = bcma_cc_read32(cc, BCMA_CC_CHIPSTAT);
cc->capabilities = bcma_cc_read32(cc, BCMA_CC_CAP);
@@ -38,6 +41,17 @@ void bcma_core_chipcommon_init(struct bcma_drv_cc *cc)
bcma_pmu_init(cc);
if (cc->capabilities & BCMA_CC_CAP_PCTL)
pr_err("Power control not implemented!\n");
+
+ if (cc->core->id.rev >= 16) {
+ if (cc->core->bus->sprom.leddc_on_time &&
+ cc->core->bus->sprom.leddc_off_time) {
+ leddc_on = cc->core->bus->sprom.leddc_on_time;
+ leddc_off = cc->core->bus->sprom.leddc_off_time;
+ }
+ bcma_cc_write32(cc, BCMA_CC_GPIOTIMER,
+ ((leddc_on << BCMA_CC_GPIOTIMER_ONTIME_SHIFT) |
+ (leddc_off << BCMA_CC_GPIOTIMER_OFFTIME_SHIFT)));
+ }
}
/* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/4] bcma: implement BCM4331 workaround for external PA lines
2011-07-14 19:49 [PATCH 1/4] ssb: SPROM: add LED duty cycle fields Rafał Miłecki
2011-07-14 19:49 ` [PATCH 2/4] bcma: cc: set GPIOTIMER register Rafał Miłecki
@ 2011-07-14 19:49 ` Rafał Miłecki
2011-07-14 20:46 ` Rafał Miłecki
2011-07-14 19:49 ` [PATCH 4/4] bcma: extract SPROM rev 9 the same way as rev 8 Rafał Miłecki
2 siblings, 1 reply; 5+ messages in thread
From: Rafał Miłecki @ 2011-07-14 19:49 UTC (permalink / raw)
To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki
Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
drivers/bcma/driver_chipcommon_pmu.c | 19 ++++++++++++++++++-
include/linux/bcma/bcma_driver_chipcommon.h | 16 ++++++++++++++++
2 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c
index dd5846b..9fab4cd 100644
--- a/drivers/bcma/driver_chipcommon_pmu.c
+++ b/drivers/bcma/driver_chipcommon_pmu.c
@@ -83,6 +83,23 @@ void bcma_pmu_swreg_init(struct bcma_drv_cc *cc)
}
}
+static void bcma_bcm4331_exp_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable)
+{
+ struct bcma_bus *bus = cc->core->bus;
+ u32 val;
+
+ val = bcma_cc_read32(cc, BCMA_CC_CHIPCTL);
+ if (enable) {
+ val |= BCMA_CHIPCTL_4331_EXTPA_EN;
+ if (bus->chipinfo.pkg == 9 || bus->chipinfo.pkg == 11)
+ val |= BCMA_CHIPCTL_4331_EXTPA_ON_GPIO2_5;
+ } else {
+ val &= ~BCMA_CHIPCTL_4331_EXTPA_EN;
+ val &= ~BCMA_CHIPCTL_4331_EXTPA_ON_GPIO2_5;
+ }
+ bcma_cc_write32(cc, BCMA_CC_CHIPCTL, val);
+}
+
void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
{
struct bcma_bus *bus = cc->core->bus;
@@ -92,7 +109,7 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x7);
break;
case 0x4331:
- pr_err("Enabling Ext PA lines not implemented\n");
+ bcma_bcm4331_exp_pa_lines_ctl(cc, true);
break;
case 43224:
if (bus->chipinfo.rev == 0) {
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 9c5b69f..ac659f0 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -246,6 +246,22 @@
#define BCMA_CC_PLLCTL_DATA 0x0664
#define BCMA_CC_SPROM 0x0830 /* SPROM beginning */
+/* BCM4331 ChipControl numbers. */
+#define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */
+#define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */
+#define BCMA_CHIPCTL_4331_EXT_LNA BIT(2) /* 0 disable */
+#define BCMA_CHIPCTL_4331_SPROM_GPIO13_15 BIT(3) /* sprom/gpio13-15 mux */
+#define BCMA_CHIPCTL_4331_EXTPA_EN BIT(4) /* 0 ext pa disable, 1 ext pa enabled */
+#define BCMA_CHIPCTL_4331_GPIOCLK_ON_SPROMCS BIT(5) /* set drive out GPIO_CLK on sprom_cs pin */
+#define BCMA_CHIPCTL_4331_PCIE_MDIO_ON_SPROMCS BIT(6) /* use sprom_cs pin as PCIE mdio interface */
+#define BCMA_CHIPCTL_4331_EXTPA_ON_GPIO2_5 BIT(7) /* aband extpa will be at gpio2/5 and sprom_dout */
+#define BCMA_CHIPCTL_4331_OVR_PIPEAUXCLKEN BIT(8) /* override core control on pipe_AuxClkEnable */
+#define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */
+#define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */
+#define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */
+#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */
+#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */
+
/* Data for the PMU, if available.
* Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
*/
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 4/4] bcma: extract SPROM rev 9 the same way as rev 8
2011-07-14 19:49 [PATCH 1/4] ssb: SPROM: add LED duty cycle fields Rafał Miłecki
2011-07-14 19:49 ` [PATCH 2/4] bcma: cc: set GPIOTIMER register Rafał Miłecki
2011-07-14 19:49 ` [PATCH 3/4] bcma: implement BCM4331 workaround for external PA lines Rafał Miłecki
@ 2011-07-14 19:49 ` Rafał Miłecki
2 siblings, 0 replies; 5+ messages in thread
From: Rafał Miłecki @ 2011-07-14 19:49 UTC (permalink / raw)
To: linux-wireless, John W. Linville; +Cc: b43-dev, Rafał Miłecki
SPROM rev 9 was discovered on 14e4:4331, it seems to have very similar
layout to rev 8 one. Use the same extracting function until we find some
differences.
Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
drivers/bcma/sprom.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c
index 8e8d5cf..52917e5 100644
--- a/drivers/bcma/sprom.c
+++ b/drivers/bcma/sprom.c
@@ -112,7 +112,7 @@ static int bcma_sprom_valid(const u16 *sprom)
return err;
revision = sprom[SSB_SPROMSIZE_WORDS_R4 - 1] & SSB_SPROM_REVISION_REV;
- if (revision != 8) {
+ if (revision != 8 && revision != 9) {
pr_err("Unsupported SPROM revision: %d\n", revision);
return -ENOENT;
}
--
1.7.3.4
^ permalink raw reply related [flat|nested] 5+ messages in thread