Lines Matching full:bus

32  * insert specific PCI bus resources instead of using the platform-level bus
33 * resources directly for the PCI root bus.
36 * root bus by pcibios_fixup_bus().
56 #define CONFIG_CMD(bus, devfn, where) \ argument
57 (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3))
69 static inline int __query(const struct pci_bus *bus, unsigned int devfn) in __query() argument
72 return bus->number == 0 && (devfn == PCI_DEVFN(0, 0)); in __query()
73 return bus->number == 1; in __query()
74 return bus->number == 0 && in __query()
81 * translate Linuxcentric addresses to PCI bus addresses
97 printk(KERN_DEBUG "RES->BUS: %lx-%lx => %lx-%lx\n", in pcibios_resource_to_bus()
104 * translate PCI bus addresses to Linuxcentric addresses
120 printk(KERN_INFO "BUS->RES: %lx-%lx => %lx-%lx\n", in pcibios_bus_to_resource()
129 static int pci_ampci_read_config_byte(struct pci_bus *bus, unsigned int devfn, in pci_ampci_read_config_byte() argument
134 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_read_config_byte()
138 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_read_config_byte()
141 if (__query(bus, devfn)) in pci_ampci_read_config_byte()
142 __pcidebug("=> %02hx", bus, devfn, where, value); in pci_ampci_read_config_byte()
149 static int pci_ampci_read_config_word(struct pci_bus *bus, unsigned int devfn, in pci_ampci_read_config_word() argument
154 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_read_config_word()
158 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_read_config_word()
161 if (__query(bus, devfn)) in pci_ampci_read_config_word()
162 __pcidebug("=> %04hx", bus, devfn, where, value); in pci_ampci_read_config_word()
169 static int pci_ampci_read_config_dword(struct pci_bus *bus, unsigned int devfn, in pci_ampci_read_config_dword() argument
174 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_read_config_dword()
178 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_read_config_dword()
181 if (__query(bus, devfn)) in pci_ampci_read_config_dword()
182 __pcidebug("=> %08x", bus, devfn, where, value); in pci_ampci_read_config_dword()
189 static int pci_ampci_write_config_byte(struct pci_bus *bus, unsigned int devfn, in pci_ampci_write_config_byte() argument
194 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_write_config_byte()
198 if (bus->number == 0 && in pci_ampci_write_config_byte()
201 __pcidebug("<= %02x", bus, devfn, where, value); in pci_ampci_write_config_byte()
202 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_write_config_byte()
209 static int pci_ampci_write_config_word(struct pci_bus *bus, unsigned int devfn, in pci_ampci_write_config_word() argument
214 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_write_config_word()
218 if (__query(bus, devfn)) in pci_ampci_write_config_word()
219 __pcidebug("<= %04hx", bus, devfn, where, value); in pci_ampci_write_config_word()
220 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_write_config_word()
227 static int pci_ampci_write_config_dword(struct pci_bus *bus, unsigned int devfn, in pci_ampci_write_config_dword() argument
232 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_write_config_dword()
236 if (__query(bus, devfn)) in pci_ampci_write_config_dword()
237 __pcidebug("<= %08x", bus, devfn, where, value); in pci_ampci_write_config_dword()
238 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_write_config_dword()
245 static int pci_ampci_read_config(struct pci_bus *bus, unsigned int devfn, in pci_ampci_read_config() argument
250 return pci_ampci_read_config_byte(bus, devfn, where, val); in pci_ampci_read_config()
252 return pci_ampci_read_config_word(bus, devfn, where, val); in pci_ampci_read_config()
254 return pci_ampci_read_config_dword(bus, devfn, where, val); in pci_ampci_read_config()
261 static int pci_ampci_write_config(struct pci_bus *bus, unsigned int devfn, in pci_ampci_write_config() argument
266 return pci_ampci_write_config_byte(bus, devfn, where, val); in pci_ampci_write_config()
268 return pci_ampci_write_config_word(bus, devfn, where, val); in pci_ampci_write_config()
270 return pci_ampci_write_config_dword(bus, devfn, where, val); in pci_ampci_write_config()
285 * whether bus 00 contains a host bridge (this is similar to checking
294 struct pci_bus bus; /* Fake bus and device */ in pci_sanity_check() local
297 bus.number = 0; in pci_sanity_check()
299 if ((!o->read(&bus, 0, PCI_CLASS_DEVICE, 2, &x) && in pci_sanity_check()
301 (!o->read(&bus, 0, PCI_VENDOR_ID, 2, &x) && in pci_sanity_check()
336 if (dev->bus) { in is_valid_resource()
337 pci_bus_for_each_resource(dev->bus, busr, i) { in is_valid_resource()
357 if (dev->bus->number != 0) in pcibios_fixup_device_resources()
376 * Called after each bus is probed, but before its children
379 void __devinit pcibios_fixup_bus(struct pci_bus *bus) in pcibios_fixup_bus() argument
383 if (bus->self) { in pcibios_fixup_bus()
384 pci_read_bridge_bases(bus); in pcibios_fixup_bus()
385 pcibios_fixup_device_resources(bus->self); in pcibios_fixup_bus()
388 list_for_each_entry(dev, &bus->devices, bus_list) in pcibios_fixup_bus()
416 printk(KERN_WARNING "PCI: No PCI bus detected\n"); in pcibios_init()
463 static void __init unit_disable_pcnet(struct pci_bus *bus, struct pci_ops *o) in unit_disable_pcnet() argument
467 bus->number = 0; in unit_disable_pcnet()
469 o->read (bus, PCI_DEVFN(2, 0), PCI_VENDOR_ID, 4, &x); in unit_disable_pcnet()
470 o->read (bus, PCI_DEVFN(2, 0), PCI_COMMAND, 2, &x); in unit_disable_pcnet()
474 o->write(bus, PCI_DEVFN(2, 0), PCI_COMMAND, 2, x); in unit_disable_pcnet()
475 o->read (bus, PCI_DEVFN(2, 0), PCI_COMMAND, 2, &x); in unit_disable_pcnet()
476 o->write(bus, PCI_DEVFN(2, 0), PCI_BASE_ADDRESS_0, 4, 0x00030001); in unit_disable_pcnet()
477 o->read (bus, PCI_DEVFN(2, 0), PCI_BASE_ADDRESS_0, 4, &x); in unit_disable_pcnet()
502 struct pci_bus bus; /* Fake bus and device */ in unit_pci_init() local
508 memset(&bus, 0, sizeof(bus)); in unit_pci_init()
523 BRIDGEREGB(0x41) = 0x00; /* secondary bus in unit_pci_init()
525 BRIDGEREGB(0x42) = 0x01; /* subordinate bus in unit_pci_init()
533 bus.number = 0; in unit_pci_init()
536 o->read (&bus, PCI_DEVFN(3, 0), PCI_COMMAND, 2, &x); in unit_pci_init()
540 o->write(&bus, PCI_DEVFN(3, 0), PCI_COMMAND, 2, x); in unit_pci_init()
542 o->read (&bus, PCI_DEVFN(3, 0), PCI_IO_BASE, 1, &x); in unit_pci_init()
543 o->read (&bus, PCI_DEVFN(3, 0), PCI_IO_BASE_UPPER16, 4, &x); in unit_pci_init()
544 o->read (&bus, PCI_DEVFN(3, 0), PCI_MEMORY_BASE, 4, &x); in unit_pci_init()
545 o->read (&bus, PCI_DEVFN(3, 0), PCI_PREF_MEMORY_BASE, 4, &x); in unit_pci_init()
547 o->write(&bus, PCI_DEVFN(3, 0), PCI_IO_BASE, 1, 0x01); in unit_pci_init()
548 o->read (&bus, PCI_DEVFN(3, 0), PCI_IO_BASE, 1, &x); in unit_pci_init()
549 o->write(&bus, PCI_DEVFN(3, 0), PCI_IO_BASE_UPPER16, 4, 0x00020000); in unit_pci_init()
550 o->read (&bus, PCI_DEVFN(3, 0), PCI_IO_BASE_UPPER16, 4, &x); in unit_pci_init()
551 o->write(&bus, PCI_DEVFN(3, 0), PCI_MEMORY_BASE, 4, 0xEBB0EA00); in unit_pci_init()
552 o->read (&bus, PCI_DEVFN(3, 0), PCI_MEMORY_BASE, 4, &x); in unit_pci_init()
553 o->write(&bus, PCI_DEVFN(3, 0), PCI_PREF_MEMORY_BASE, 4, 0xE9F0E800); in unit_pci_init()
554 o->read (&bus, PCI_DEVFN(3, 0), PCI_PREF_MEMORY_BASE, 4, &x); in unit_pci_init()
556 unit_disable_pcnet(&bus, o); in unit_pci_init()