Lines Matching refs:bus
16 int win2 = core->bus->host_is_pcie2 ? in bcma_host_pci_switch_core()
19 pci_write_config_dword(core->bus->host_pci, BCMA_PCI_BAR0_WIN, in bcma_host_pci_switch_core()
21 pci_write_config_dword(core->bus->host_pci, win2, core->wrap); in bcma_host_pci_switch_core()
22 core->bus->mapped_core = core; in bcma_host_pci_switch_core()
23 bcma_debug(core->bus, "Switched to core: 0x%X\n", core->id.id); in bcma_host_pci_switch_core()
37 if (core->bus->mapped_core != core) in bcma_host_pci_provide_access_to_core()
45 return ioread8(core->bus->mmio + offset); in bcma_host_pci_read8()
51 return ioread16(core->bus->mmio + offset); in bcma_host_pci_read16()
57 return ioread32(core->bus->mmio + offset); in bcma_host_pci_read32()
64 iowrite8(value, core->bus->mmio + offset); in bcma_host_pci_write8()
71 iowrite16(value, core->bus->mmio + offset); in bcma_host_pci_write16()
78 iowrite32(value, core->bus->mmio + offset); in bcma_host_pci_write32()
85 void __iomem *addr = core->bus->mmio + offset; in bcma_host_pci_block_read()
86 if (core->bus->mapped_core != core) in bcma_host_pci_block_read()
109 void __iomem *addr = core->bus->mmio + offset; in bcma_host_pci_block_write()
110 if (core->bus->mapped_core != core) in bcma_host_pci_block_write()
132 if (core->bus->mapped_core != core) in bcma_host_pci_aread32()
134 return ioread32(core->bus->mmio + (1 * BCMA_CORE_SIZE) + offset); in bcma_host_pci_aread32()
140 if (core->bus->mapped_core != core) in bcma_host_pci_awrite32()
142 iowrite32(value, core->bus->mmio + (1 * BCMA_CORE_SIZE) + offset); in bcma_host_pci_awrite32()
163 struct bcma_bus *bus; in bcma_host_pci_probe() local
169 bus = kzalloc(sizeof(*bus), GFP_KERNEL); in bcma_host_pci_probe()
170 if (!bus) in bcma_host_pci_probe()
194 bcma_err(bus, "PCI card detected, they are not supported.\n"); in bcma_host_pci_probe()
201 bus->mmio = pci_iomap(dev, 0, ~0UL); in bcma_host_pci_probe()
202 if (!bus->mmio) in bcma_host_pci_probe()
206 bus->host_pci = dev; in bcma_host_pci_probe()
207 bus->hosttype = BCMA_HOSTTYPE_PCI; in bcma_host_pci_probe()
208 bus->ops = &bcma_host_pci_ops; in bcma_host_pci_probe()
210 bus->boardinfo.vendor = bus->host_pci->subsystem_vendor; in bcma_host_pci_probe()
211 bus->boardinfo.type = bus->host_pci->subsystem_device; in bcma_host_pci_probe()
214 bcma_init_bus(bus); in bcma_host_pci_probe()
217 err = bcma_bus_scan(bus); in bcma_host_pci_probe()
221 if (bcma_find_core(bus, BCMA_CORE_PCIE2)) in bcma_host_pci_probe()
222 bus->host_is_pcie2 = true; in bcma_host_pci_probe()
225 err = bcma_bus_register(bus); in bcma_host_pci_probe()
229 pci_set_drvdata(dev, bus); in bcma_host_pci_probe()
235 bcma_unregister_cores(bus); in bcma_host_pci_probe()
237 pci_iounmap(dev, bus->mmio); in bcma_host_pci_probe()
243 kfree(bus); in bcma_host_pci_probe()
249 struct bcma_bus *bus = pci_get_drvdata(dev); in bcma_host_pci_remove() local
251 bcma_bus_unregister(bus); in bcma_host_pci_remove()
252 pci_iounmap(dev, bus->mmio); in bcma_host_pci_remove()
255 kfree(bus); in bcma_host_pci_remove()
262 struct bcma_bus *bus = pci_get_drvdata(pdev); in bcma_host_pci_suspend() local
264 bus->mapped_core = NULL; in bcma_host_pci_suspend()
266 return bcma_bus_suspend(bus); in bcma_host_pci_suspend()
272 struct bcma_bus *bus = pci_get_drvdata(pdev); in bcma_host_pci_resume() local
274 return bcma_bus_resume(bus); in bcma_host_pci_resume()
332 void bcma_host_pci_up(struct bcma_bus *bus) in bcma_host_pci_up() argument
334 if (bus->hosttype != BCMA_HOSTTYPE_PCI) in bcma_host_pci_up()
337 if (bus->host_is_pcie2) in bcma_host_pci_up()
338 bcma_core_pcie2_up(&bus->drv_pcie2); in bcma_host_pci_up()
340 bcma_core_pci_up(&bus->drv_pci[0]); in bcma_host_pci_up()
345 void bcma_host_pci_down(struct bcma_bus *bus) in bcma_host_pci_down() argument
347 if (bus->hosttype != BCMA_HOSTTYPE_PCI) in bcma_host_pci_down()
350 if (!bus->host_is_pcie2) in bcma_host_pci_down()
351 bcma_core_pci_down(&bus->drv_pci[0]); in bcma_host_pci_down()
356 int bcma_host_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, in bcma_host_pci_irq_ctl() argument
363 if (bus->hosttype != BCMA_HOSTTYPE_PCI) { in bcma_host_pci_irq_ctl()
370 pdev = bus->host_pci; in bcma_host_pci_irq_ctl()