aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-04-28 20:18:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-05-16 12:45:22 -0400
commit29f6b3d823885093890b1604d8450e7b57a31281 (patch)
treeed9f92e732c742a1fc5931372cb58a4adf89f6d4 /drivers/bcma
parent0b2948eeb128e259b7903b12de79d6886d43eb11 (diff)
bcma: add bcma_core_pci_extend_L1timer
This code is based on code from pcie_extendL1timer() 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>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/driver_pci.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index 4d38ae179b48..949206674dc8 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -24,14 +24,12 @@ u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address)
24 return pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_DATA); 24 return pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_DATA);
25} 25}
26 26
27#if 0
28static void bcma_pcie_write(struct bcma_drv_pci *pc, u32 address, u32 data) 27static void bcma_pcie_write(struct bcma_drv_pci *pc, u32 address, u32 data)
29{ 28{
30 pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_ADDR, address); 29 pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_ADDR, address);
31 pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_ADDR); 30 pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_ADDR);
32 pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_DATA, data); 31 pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_DATA, data);
33} 32}
34#endif
35 33
36static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy) 34static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy)
37{ 35{
@@ -224,3 +222,17 @@ out:
224 return err; 222 return err;
225} 223}
226EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl); 224EXPORT_SYMBOL_GPL(bcma_core_pci_irq_ctl);
225
226void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend)
227{
228 u32 w;
229
230 w = bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
231 if (extend)
232 w |= BCMA_CORE_PCI_ASPMTIMER_EXTEND;
233 else
234 w &= ~BCMA_CORE_PCI_ASPMTIMER_EXTEND;
235 bcma_pcie_write(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG, w);
236 bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
237}
238EXPORT_SYMBOL_GPL(bcma_core_pci_extend_L1timer);