• Home
  • Raw
  • Download

Lines Matching refs:pc

20 u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address)  in bcma_pcie_read()  argument
22 pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_ADDR, address); in bcma_pcie_read()
23 pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_ADDR); in bcma_pcie_read()
24 return pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_DATA); in bcma_pcie_read()
27 static void bcma_pcie_write(struct bcma_drv_pci *pc, u32 address, u32 data) in bcma_pcie_write() argument
29 pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_ADDR, address); in bcma_pcie_write()
30 pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_ADDR); in bcma_pcie_write()
31 pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_DATA, data); in bcma_pcie_write()
34 static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u16 phy) in bcma_pcie_mdio_set_phy() argument
47 pcicore_write32(pc, BCMA_CORE_PCI_MDIO_DATA, v); in bcma_pcie_mdio_set_phy()
51 v = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_CONTROL); in bcma_pcie_mdio_set_phy()
58 static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u16 device, u8 address) in bcma_pcie_mdio_read() argument
68 pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, v); in bcma_pcie_mdio_read()
70 if (pc->core->id.rev >= 10) { in bcma_pcie_mdio_read()
72 bcma_pcie_mdio_set_phy(pc, device); in bcma_pcie_mdio_read()
85 pcicore_write32(pc, BCMA_CORE_PCI_MDIO_DATA, v); in bcma_pcie_mdio_read()
89 v = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_CONTROL); in bcma_pcie_mdio_read()
92 ret = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_DATA); in bcma_pcie_mdio_read()
97 pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, 0); in bcma_pcie_mdio_read()
101 static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u16 device, in bcma_pcie_mdio_write() argument
111 pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, v); in bcma_pcie_mdio_write()
113 if (pc->core->id.rev >= 10) { in bcma_pcie_mdio_write()
115 bcma_pcie_mdio_set_phy(pc, device); in bcma_pcie_mdio_write()
128 pcicore_write32(pc, BCMA_CORE_PCI_MDIO_DATA, v); in bcma_pcie_mdio_write()
132 v = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_CONTROL); in bcma_pcie_mdio_write()
137 pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, 0); in bcma_pcie_mdio_write()
140 static u16 bcma_pcie_mdio_writeread(struct bcma_drv_pci *pc, u16 device, in bcma_pcie_mdio_writeread() argument
143 bcma_pcie_mdio_write(pc, device, address, data); in bcma_pcie_mdio_writeread()
144 return bcma_pcie_mdio_read(pc, device, address); in bcma_pcie_mdio_writeread()
151 static void bcma_core_pci_fixcfg(struct bcma_drv_pci *pc) in bcma_core_pci_fixcfg() argument
153 struct bcma_device *core = pc->core; in bcma_core_pci_fixcfg()
160 val16 = pcicore_read16(pc, regoff); in bcma_core_pci_fixcfg()
165 pcicore_write16(pc, regoff, val16); in bcma_core_pci_fixcfg()
173 void bcma_core_pci_early_init(struct bcma_drv_pci *pc) in bcma_core_pci_early_init() argument
175 if (pc->early_setup_done) in bcma_core_pci_early_init()
178 pc->hostmode = bcma_core_pci_is_in_hostmode(pc); in bcma_core_pci_early_init()
179 if (pc->hostmode) in bcma_core_pci_early_init()
182 bcma_core_pci_fixcfg(pc); in bcma_core_pci_early_init()
185 pc->early_setup_done = true; in bcma_core_pci_early_init()
192 static u8 bcma_pcicore_polarity_workaround(struct bcma_drv_pci *pc) in bcma_pcicore_polarity_workaround() argument
196 tmp = bcma_pcie_read(pc, BCMA_CORE_PCI_PLP_STATUSREG); in bcma_pcicore_polarity_workaround()
204 static void bcma_pcicore_serdes_workaround(struct bcma_drv_pci *pc) in bcma_pcicore_serdes_workaround() argument
208 bcma_pcie_mdio_write(pc, BCMA_CORE_PCI_MDIODATA_DEV_RX, in bcma_pcicore_serdes_workaround()
210 bcma_pcicore_polarity_workaround(pc)); in bcma_pcicore_serdes_workaround()
211 tmp = bcma_pcie_mdio_read(pc, BCMA_CORE_PCI_MDIODATA_DEV_PLL, in bcma_pcicore_serdes_workaround()
214 bcma_pcie_mdio_write(pc, BCMA_CORE_PCI_MDIODATA_DEV_PLL, in bcma_pcicore_serdes_workaround()
221 static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc) in bcma_core_pci_config_fixup() argument
228 val16 = pcicore_read16(pc, regoff); in bcma_core_pci_config_fixup()
232 pcicore_write16(pc, regoff, val16); in bcma_core_pci_config_fixup()
240 static void bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc) in bcma_core_pci_clientmode_init() argument
242 bcma_pcicore_serdes_workaround(pc); in bcma_core_pci_clientmode_init()
243 bcma_core_pci_config_fixup(pc); in bcma_core_pci_clientmode_init()
246 void bcma_core_pci_init(struct bcma_drv_pci *pc) in bcma_core_pci_init() argument
248 if (pc->setup_done) in bcma_core_pci_init()
251 bcma_core_pci_early_init(pc); in bcma_core_pci_init()
253 if (pc->hostmode) in bcma_core_pci_init()
254 bcma_core_pci_hostmode_init(pc); in bcma_core_pci_init()
256 bcma_core_pci_clientmode_init(pc); in bcma_core_pci_init()
261 struct bcma_drv_pci *pc; in bcma_core_pci_power_save() local
267 pc = &bus->drv_pci[0]; in bcma_core_pci_power_save()
269 if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) { in bcma_core_pci_power_save()
271 bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, in bcma_core_pci_power_save()
273 bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, in bcma_core_pci_power_save()
275 } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) { in bcma_core_pci_power_save()
277 bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, in bcma_core_pci_power_save()
279 bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, in bcma_core_pci_power_save()
285 static void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend) in bcma_core_pci_extend_L1timer() argument
289 w = bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG); in bcma_core_pci_extend_L1timer()
294 bcma_pcie_write(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG, w); in bcma_core_pci_extend_L1timer()
295 bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG); in bcma_core_pci_extend_L1timer()
298 void bcma_core_pci_up(struct bcma_drv_pci *pc) in bcma_core_pci_up() argument
300 bcma_core_pci_extend_L1timer(pc, true); in bcma_core_pci_up()
303 void bcma_core_pci_down(struct bcma_drv_pci *pc) in bcma_core_pci_down() argument
305 bcma_core_pci_extend_L1timer(pc, false); in bcma_core_pci_down()