Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcma: add bcma_core_pci_config_fixup()

This code is based on code from pcie_misc_config_fixup() in brcmsmac.
This patch is part of the move of pci specific code from brcmsmac to
bcma.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Hauke Mehrtens and committed by
John W. Linville
2b2715b8 ec00f373

+22
+18
drivers/bcma/driver_pci.c
··· 186 186 } 187 187 } 188 188 189 + /* Fix MISC config to allow coming out of L2/L3-Ready state w/o PRST */ 190 + /* Needs to happen when coming out of 'standby'/'hibernate' */ 191 + static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc) 192 + { 193 + u16 val16; 194 + uint regoff; 195 + 196 + regoff = BCMA_CORE_PCI_SPROM(BCMA_CORE_PCI_SPROM_MISC_CONFIG); 197 + 198 + val16 = pcicore_read16(pc, regoff); 199 + 200 + if (!(val16 & BCMA_CORE_PCI_SPROM_L23READY_EXIT_NOPERST)) { 201 + val16 |= BCMA_CORE_PCI_SPROM_L23READY_EXIT_NOPERST; 202 + pcicore_write16(pc, regoff, val16); 203 + } 204 + } 205 + 189 206 /************************************************** 190 207 * Init. 191 208 **************************************************/ ··· 211 194 { 212 195 bcma_core_pci_fixcfg(pc); 213 196 bcma_pcicore_serdes_workaround(pc); 197 + bcma_core_pci_config_fixup(pc); 214 198 } 215 199 216 200 void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc)
+4
include/linux/bcma/bcma_driver_pci.h
··· 90 90 #define BCMA_CORE_PCI_SPROM_PI_OFFSET 0 /* first word */ 91 91 #define BCMA_CORE_PCI_SPROM_PI_MASK 0xf000 /* bit 15:12 */ 92 92 #define BCMA_CORE_PCI_SPROM_PI_SHIFT 12 /* bit 15:12 */ 93 + #define BCMA_CORE_PCI_SPROM_MISC_CONFIG 5 /* word 5 */ 94 + #define BCMA_CORE_PCI_SPROM_L23READY_EXIT_NOPERST 0x8000 /* bit 15 */ 95 + #define BCMA_CORE_PCI_SPROM_CLKREQ_OFFSET_REV5 20 /* word 20 for srom rev <= 5 */ 96 + #define BCMA_CORE_PCI_SPROM_CLKREQ_ENB 0x0800 /* bit 11 */ 93 97 94 98 /* SBtoPCIx */ 95 99 #define BCMA_CORE_PCI_SBTOPCI_MEM 0x00000000