Lines Matching full: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()
199 bus->dev = &dev->dev; in bcma_host_pci_probe()
203 bus->mmio = pci_iomap(dev, 0, ~0UL); in bcma_host_pci_probe()
204 if (!bus->mmio) in bcma_host_pci_probe()
208 bus->host_pci = dev; in bcma_host_pci_probe()
209 bus->hosttype = BCMA_HOSTTYPE_PCI; in bcma_host_pci_probe()
210 bus->ops = &bcma_host_pci_ops; in bcma_host_pci_probe()
212 bus->boardinfo.vendor = bus->host_pci->subsystem_vendor; in bcma_host_pci_probe()
213 bus->boardinfo.type = bus->host_pci->subsystem_device; in bcma_host_pci_probe()
216 bcma_init_bus(bus); in bcma_host_pci_probe()
218 /* Scan bus to find out generation of PCIe core */ in bcma_host_pci_probe()
219 err = bcma_bus_scan(bus); in bcma_host_pci_probe()
223 if (bcma_find_core(bus, BCMA_CORE_PCIE2)) in bcma_host_pci_probe()
224 bus->host_is_pcie2 = true; in bcma_host_pci_probe()
227 err = bcma_bus_register(bus); in bcma_host_pci_probe()
231 pci_set_drvdata(dev, bus); in bcma_host_pci_probe()
237 bcma_unregister_cores(bus); in bcma_host_pci_probe()
239 pci_iounmap(dev, bus->mmio); in bcma_host_pci_probe()
245 kfree(bus); in bcma_host_pci_probe()
251 struct bcma_bus *bus = pci_get_drvdata(dev); in bcma_host_pci_remove() local
253 bcma_bus_unregister(bus); in bcma_host_pci_remove()
254 pci_iounmap(dev, bus->mmio); in bcma_host_pci_remove()
257 kfree(bus); in bcma_host_pci_remove()
263 struct bcma_bus *bus = dev_get_drvdata(dev); in bcma_host_pci_suspend() local
265 bus->mapped_core = NULL; in bcma_host_pci_suspend()
267 return bcma_bus_suspend(bus); in bcma_host_pci_suspend()
272 struct bcma_bus *bus = dev_get_drvdata(dev); in bcma_host_pci_resume() local
274 return bcma_bus_resume(bus); in bcma_host_pci_resume()
335 void bcma_host_pci_up(struct bcma_bus *bus) in bcma_host_pci_up() argument
337 if (bus->hosttype != BCMA_HOSTTYPE_PCI) in bcma_host_pci_up()
340 if (bus->host_is_pcie2) in bcma_host_pci_up()
341 bcma_core_pcie2_up(&bus->drv_pcie2); in bcma_host_pci_up()
343 bcma_core_pci_up(&bus->drv_pci[0]); in bcma_host_pci_up()
348 void bcma_host_pci_down(struct bcma_bus *bus) in bcma_host_pci_down() argument
350 if (bus->hosttype != BCMA_HOSTTYPE_PCI) in bcma_host_pci_down()
353 if (!bus->host_is_pcie2) in bcma_host_pci_down()
354 bcma_core_pci_down(&bus->drv_pci[0]); in bcma_host_pci_down()
359 int bcma_host_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, in bcma_host_pci_irq_ctl() argument
366 if (bus->hosttype != BCMA_HOSTTYPE_PCI) { in bcma_host_pci_irq_ctl()
367 /* This bcma device is not on a PCI host-bus. So the IRQs are in bcma_host_pci_irq_ctl()
373 pdev = bus->host_pci; in bcma_host_pci_irq_ctl()