Skip to content

Commit b956254

Browse files
haukelinvjw
authored andcommitted
bcma: complete workaround for BCMA43224 and BCM4313
This code is based on the Broadcom SDK and brcmsmac. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 02817be commit b956254

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

‎drivers/bcma/driver_chipcommon_pmu.c‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,32 @@ void bcma_pmu_workarounds(struct bcma_drv_cc *cc)
139139

140140
switch (bus->chipinfo.id) {
141141
case BCMA_CHIP_ID_BCM4313:
142-
bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x7);
142+
/* enable 12 mA drive strenth for 4313 and set chipControl
143+
register bit 1 */
144+
bcma_chipco_chipctl_maskset(cc, 0,
145+
BCMA_CCTRL_4313_12MA_LED_DRIVE,
146+
BCMA_CCTRL_4313_12MA_LED_DRIVE);
143147
break;
144148
case BCMA_CHIP_ID_BCM4331:
145149
case BCMA_CHIP_ID_BCM43431:
146150
/* Ext PA lines must be enabled for tx on BCM4331 */
147151
bcma_chipco_bcm4331_ext_pa_lines_ctl(cc, true);
148152
break;
149153
case BCMA_CHIP_ID_BCM43224:
154+
case BCMA_CHIP_ID_BCM43421:
155+
/* enable 12 mA drive strenth for 43224 and set chipControl
156+
register bit 15 */
150157
if (bus->chipinfo.rev == 0) {
151-
pr_err("Workarounds for 43224 rev 0 not fully "
152-
"implemented\n");
153-
bcma_chipco_chipctl_maskset(cc, 0, ~0, 0x00F000F0);
158+
bcma_cc_maskset32(cc, BCMA_CC_CHIPCTL,
159+
BCMA_CCTRL_43224_GPIO_TOGGLE,
160+
BCMA_CCTRL_43224_GPIO_TOGGLE);
161+
bcma_chipco_chipctl_maskset(cc, 0,
162+
BCMA_CCTRL_43224A0_12MA_LED_DRIVE,
163+
BCMA_CCTRL_43224A0_12MA_LED_DRIVE);
154164
} else {
155-
bcma_chipco_chipctl_maskset(cc, 0, ~0, 0xF0);
165+
bcma_chipco_chipctl_maskset(cc, 0,
166+
BCMA_CCTRL_43224B0_12MA_LED_DRIVE,
167+
BCMA_CCTRL_43224B0_12MA_LED_DRIVE);
156168
}
157169
break;
158170
case BCMA_CHIP_ID_BCM43225:

‎include/linux/bcma/bcma_driver_chipcommon.h‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,14 @@
325325
#define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */
326326
#define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */
327327

328+
/* 43224 chip-specific ChipControl register bits */
329+
#define BCMA_CCTRL_43224_GPIO_TOGGLE 0x8000 /* gpio[3:0] pins as btcoex or s/w gpio */
330+
#define BCMA_CCTRL_43224A0_12MA_LED_DRIVE 0x00F000F0 /* 12 mA drive strength */
331+
#define BCMA_CCTRL_43224B0_12MA_LED_DRIVE 0xF0 /* 12 mA drive strength for later 43224s */
332+
333+
/* 4313 Chip specific ChipControl register bits */
334+
#define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */
335+
328336
/* Data for the PMU, if available.
329337
* Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
330338
*/

0 commit comments

Comments
 (0)