Lines Matching +full:bus +full:- +full:err
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()
20 core->addr); 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()
30 switch (core->id.id) { in bcma_host_pci_provide_access_to_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
164 int err = -ENOMEM; in bcma_host_pci_probe() local
168 bus = kzalloc(sizeof(*bus), GFP_KERNEL); in bcma_host_pci_probe()
169 if (!bus) in bcma_host_pci_probe()
173 err = pci_enable_device(dev); in bcma_host_pci_probe()
174 if (err) in bcma_host_pci_probe()
177 err = pci_request_regions(dev, "bcma-pci-bridge"); in bcma_host_pci_probe()
178 if (err) in bcma_host_pci_probe()
190 bcma_err(bus, "PCI card detected, they are not supported.\n"); in bcma_host_pci_probe()
191 err = -ENXIO; in bcma_host_pci_probe()
195 bus->dev = &dev->dev; in bcma_host_pci_probe()
198 err = -ENOMEM; in bcma_host_pci_probe()
199 bus->mmio = pci_iomap(dev, 0, ~0UL); in bcma_host_pci_probe()
200 if (!bus->mmio) in bcma_host_pci_probe()
204 bus->host_pci = dev; in bcma_host_pci_probe()
205 bus->hosttype = BCMA_HOSTTYPE_PCI; in bcma_host_pci_probe()
206 bus->ops = &bcma_host_pci_ops; in bcma_host_pci_probe()
208 bus->boardinfo.vendor = bus->host_pci->subsystem_vendor; in bcma_host_pci_probe()
209 bus->boardinfo.type = bus->host_pci->subsystem_device; in bcma_host_pci_probe()
212 bcma_init_bus(bus); in bcma_host_pci_probe()
214 /* Scan bus to find out generation of PCIe core */ in bcma_host_pci_probe()
215 err = bcma_bus_scan(bus); in bcma_host_pci_probe()
216 if (err) in bcma_host_pci_probe()
219 if (bcma_find_core(bus, BCMA_CORE_PCIE2)) in bcma_host_pci_probe()
220 bus->host_is_pcie2 = true; in bcma_host_pci_probe()
223 err = bcma_bus_register(bus); in bcma_host_pci_probe()
224 if (err) in bcma_host_pci_probe()
227 pci_set_drvdata(dev, bus); in bcma_host_pci_probe()
230 return err; in bcma_host_pci_probe()
233 bcma_unregister_cores(bus); in bcma_host_pci_probe()
235 pci_iounmap(dev, bus->mmio); in bcma_host_pci_probe()
241 kfree(bus); in bcma_host_pci_probe()
242 return err; in bcma_host_pci_probe()
247 struct bcma_bus *bus = pci_get_drvdata(dev); in bcma_host_pci_remove() local
249 bcma_bus_unregister(bus); in bcma_host_pci_remove()
250 pci_iounmap(dev, bus->mmio); in bcma_host_pci_remove()
253 kfree(bus); in bcma_host_pci_remove()
259 struct bcma_bus *bus = dev_get_drvdata(dev); in bcma_host_pci_suspend() local
261 bus->mapped_core = NULL; in bcma_host_pci_suspend()
263 return bcma_bus_suspend(bus); in bcma_host_pci_suspend()
268 struct bcma_bus *bus = dev_get_drvdata(dev); in bcma_host_pci_resume() local
270 return bcma_bus_resume(bus); in bcma_host_pci_resume()
309 .name = "bcma-pci-bridge",
331 void bcma_host_pci_up(struct bcma_bus *bus) in bcma_host_pci_up() argument
333 if (bus->hosttype != BCMA_HOSTTYPE_PCI) in bcma_host_pci_up()
336 if (bus->host_is_pcie2) in bcma_host_pci_up()
337 bcma_core_pcie2_up(&bus->drv_pcie2); in bcma_host_pci_up()
339 bcma_core_pci_up(&bus->drv_pci[0]); in bcma_host_pci_up()
344 void bcma_host_pci_down(struct bcma_bus *bus) in bcma_host_pci_down() argument
346 if (bus->hosttype != BCMA_HOSTTYPE_PCI) in bcma_host_pci_down()
349 if (!bus->host_is_pcie2) in bcma_host_pci_down()
350 bcma_core_pci_down(&bus->drv_pci[0]); in bcma_host_pci_down()
355 int bcma_host_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core, in bcma_host_pci_irq_ctl() argument
360 int err = 0; in bcma_host_pci_irq_ctl() local
362 if (bus->hosttype != BCMA_HOSTTYPE_PCI) { in bcma_host_pci_irq_ctl()
363 /* This bcma device is not on a PCI host-bus. So the IRQs are in bcma_host_pci_irq_ctl()
369 pdev = bus->host_pci; in bcma_host_pci_irq_ctl()
371 err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp); in bcma_host_pci_irq_ctl()
372 if (err) in bcma_host_pci_irq_ctl()
375 coremask = BIT(core->core_index) << 8; in bcma_host_pci_irq_ctl()
381 err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp); in bcma_host_pci_irq_ctl()
384 return err; in bcma_host_pci_irq_ctl()