Lines Matching refs:bus

49 static struct cns3xxx_pcie *pbus_to_cnspci(struct pci_bus *bus)  in pbus_to_cnspci()  argument
51 return sysdata_to_cnspci(bus->sysdata); in pbus_to_cnspci()
54 static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus, in cns3xxx_pci_map_bus() argument
57 struct cns3xxx_pcie *cnspci = pbus_to_cnspci(bus); in cns3xxx_pci_map_bus()
58 int busno = bus->number; in cns3xxx_pci_map_bus()
88 static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, in cns3xxx_pci_read_config() argument
95 ret = pci_generic_config_read32(bus, devfn, where, size, val); in cns3xxx_pci_read_config()
97 if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn && in cns3xxx_pci_read_config()
133 int irq = cnspci->irqs[!!dev->bus->number]; in cns3xxx_pcie_map_irq()
136 pci_domain_nr(dev->bus), dev->bus->number, PCI_SLOT(dev->devfn), in cns3xxx_pcie_map_irq()
220 struct pci_bus bus = { in cns3xxx_pcie_hw_init() local
234 pci_bus_write_config_byte(&bus, devfn, PCI_PRIMARY_BUS, 0); in cns3xxx_pcie_hw_init()
235 pci_bus_write_config_byte(&bus, devfn, PCI_SECONDARY_BUS, 1); in cns3xxx_pcie_hw_init()
236 pci_bus_write_config_byte(&bus, devfn, PCI_SUBORDINATE_BUS, 1); in cns3xxx_pcie_hw_init()
238 pci_bus_read_config_byte(&bus, devfn, PCI_PRIMARY_BUS, &tmp8); in cns3xxx_pcie_hw_init()
239 pci_bus_read_config_byte(&bus, devfn, PCI_SECONDARY_BUS, &tmp8); in cns3xxx_pcie_hw_init()
240 pci_bus_read_config_byte(&bus, devfn, PCI_SUBORDINATE_BUS, &tmp8); in cns3xxx_pcie_hw_init()
242 pci_bus_write_config_word(&bus, devfn, PCI_MEMORY_BASE, mem_base); in cns3xxx_pcie_hw_init()
243 pci_bus_write_config_word(&bus, devfn, PCI_MEMORY_LIMIT, mem_limit); in cns3xxx_pcie_hw_init()
244 pci_bus_write_config_word(&bus, devfn, PCI_IO_BASE_UPPER16, io_base); in cns3xxx_pcie_hw_init()
245 pci_bus_write_config_word(&bus, devfn, PCI_IO_LIMIT_UPPER16, io_limit); in cns3xxx_pcie_hw_init()
251 bus.number = 1; /* directly connected PCIe device */ in cns3xxx_pcie_hw_init()
253 pos = pci_bus_find_capability(&bus, devfn, PCI_CAP_ID_EXP); in cns3xxx_pcie_hw_init()
254 pci_bus_read_config_word(&bus, devfn, pos + PCI_EXP_DEVCTL, &dc); in cns3xxx_pcie_hw_init()
257 pci_bus_write_config_word(&bus, devfn, pos + PCI_EXP_DEVCTL, dc); in cns3xxx_pcie_hw_init()
258 pci_bus_read_config_word(&bus, devfn, pos + PCI_EXP_DEVCTL, &dc); in cns3xxx_pcie_hw_init()