Lines Matching refs:hose

230 	struct pci_controller *hose = pci_bus_to_host(bus);  in pcibios_setup_bridge()  local
232 if (hose->controller_ops.setup_bridge) in pcibios_setup_bridge()
233 hose->controller_ops.setup_bridge(bus, type); in pcibios_setup_bridge()
283 static resource_size_t pcibios_io_size(const struct pci_controller *hose) in pcibios_io_size() argument
286 return hose->pci_io_size; in pcibios_io_size()
288 return resource_size(&hose->io_resource); in pcibios_io_size()
295 struct pci_controller *hose; in pcibios_vaddr_is_ioport() local
299 list_for_each_entry(hose, &hose_list, list_node) { in pcibios_vaddr_is_ioport()
300 size = pcibios_io_size(hose); in pcibios_vaddr_is_ioport()
301 if (address >= hose->io_base_virt && in pcibios_vaddr_is_ioport()
302 address < (hose->io_base_virt + size)) { in pcibios_vaddr_is_ioport()
313 struct pci_controller *hose; in pci_address_to_pio() local
318 list_for_each_entry(hose, &hose_list, list_node) { in pci_address_to_pio()
319 size = pcibios_io_size(hose); in pci_address_to_pio()
320 if (address >= hose->io_base_phys && in pci_address_to_pio()
321 address < (hose->io_base_phys + size)) { in pci_address_to_pio()
323 (unsigned long)hose->io_base_virt - _IO_BASE; in pci_address_to_pio()
324 ret = base + (address - hose->io_base_phys); in pci_address_to_pio()
339 struct pci_controller *hose = pci_bus_to_host(bus); in pci_domain_nr() local
341 return hose->global_number; in pci_domain_nr()
355 struct pci_controller *hose, *tmp; in pci_find_hose_for_OF_device() local
356 list_for_each_entry_safe(hose, tmp, &hose_list, list_node) in pci_find_hose_for_OF_device()
357 if (hose->dn == node) in pci_find_hose_for_OF_device()
358 return hose; in pci_find_hose_for_OF_device()
366 struct pci_controller *hose; in pci_find_controller_for_domain() local
368 list_for_each_entry(hose, &hose_list, list_node) in pci_find_controller_for_domain()
369 if (hose->global_number == domain_nr) in pci_find_controller_for_domain()
370 return hose; in pci_find_controller_for_domain()
506 struct pci_controller *hose = pci_bus_to_host(pdev->bus); in pci_iobar_pfn() local
509 if (!hose) in pci_iobar_pfn()
513 ioaddr -= (unsigned long)hose->io_base_virt - _IO_BASE; in pci_iobar_pfn()
515 vma->vm_pgoff += (ioaddr + hose->io_base_phys) >> PAGE_SHIFT; in pci_iobar_pfn()
571 struct pci_controller *hose = pci_bus_to_host(bus); in pci_legacy_read() local
572 struct resource *rp = &hose->io_resource; in pci_legacy_read()
580 offset = (unsigned long)hose->io_base_virt - _IO_BASE; in pci_legacy_read()
587 addr = hose->io_base_virt + port; in pci_legacy_read()
611 struct pci_controller *hose = pci_bus_to_host(bus); in pci_legacy_write() local
612 struct resource *rp = &hose->io_resource; in pci_legacy_write()
620 offset = (unsigned long)hose->io_base_virt - _IO_BASE; in pci_legacy_write()
627 addr = hose->io_base_virt + port; in pci_legacy_write()
657 struct pci_controller *hose = pci_bus_to_host(bus); in pci_mmap_legacy_page_range() local
677 if ((offset + size) > hose->isa_mem_size) { in pci_mmap_legacy_page_range()
685 offset += hose->isa_mem_phys; in pci_mmap_legacy_page_range()
687 unsigned long io_offset = (unsigned long)hose->io_base_virt - _IO_BASE; in pci_mmap_legacy_page_range()
689 rp = &hose->io_resource; in pci_mmap_legacy_page_range()
694 offset += hose->io_base_phys; in pci_mmap_legacy_page_range()
754 void pci_process_bridge_OF_ranges(struct pci_controller *hose, in pci_process_bridge_OF_ranges() argument
789 if (hose->pci_io_size) { in pci_process_bridge_OF_ranges()
800 hose->io_base_virt = ioremap(range.cpu_addr, in pci_process_bridge_OF_ranges()
806 (unsigned long)hose->io_base_virt; in pci_process_bridge_OF_ranges()
811 hose->pci_io_size = range.pci_addr + range.size; in pci_process_bridge_OF_ranges()
812 hose->io_base_phys = range.cpu_addr - range.pci_addr; in pci_process_bridge_OF_ranges()
815 res = &hose->io_resource; in pci_process_bridge_OF_ranges()
836 hose->isa_mem_phys = range.cpu_addr; in pci_process_bridge_OF_ranges()
837 hose->isa_mem_size = range.size; in pci_process_bridge_OF_ranges()
841 hose->mem_offset[memno] = range.cpu_addr - in pci_process_bridge_OF_ranges()
843 res = &hose->mem_resources[memno++]; in pci_process_bridge_OF_ranges()
859 struct pci_controller *hose = pci_bus_to_host(bus); in pci_proc_domain() local
864 return hose->global_number != 0; in pci_proc_domain()
881 struct pci_controller *hose = pci_bus_to_host(dev->bus); in pcibios_fixup_resources() local
885 if (!hose) { in pcibios_fixup_resources()
935 struct pci_controller *hose = pci_bus_to_host(bus); in pcibios_uninitialized_bridge_resource() local
966 if ((hose->mem_resources[i].flags & IORESOURCE_MEM) && in pcibios_uninitialized_bridge_resource()
967 hose->mem_resources[i].start == hose->mem_offset[i]) in pcibios_uninitialized_bridge_resource()
977 offset = (unsigned long)hose->io_base_virt - _IO_BASE; in pcibios_uninitialized_bridge_resource()
1360 struct pci_controller *hose = pci_bus_to_host(bus); in pcibios_reserve_legacy_regions() local
1368 if (!(hose->io_resource.flags & IORESOURCE_IO)) in pcibios_reserve_legacy_regions()
1370 offset = (unsigned long)hose->io_base_virt - _IO_BASE; in pcibios_reserve_legacy_regions()
1378 if (request_resource(&hose->io_resource, res)) { in pcibios_reserve_legacy_regions()
1388 pres = &hose->mem_resources[i]; in pcibios_reserve_legacy_regions()
1389 offset = hose->mem_offset[i]; in pcibios_reserve_legacy_regions()
1523 resource_size_t pcibios_io_space_offset(struct pci_controller *hose) in pcibios_io_space_offset() argument
1525 return (unsigned long) hose->io_base_virt - _IO_BASE; in pcibios_io_space_offset()
1528 static void pcibios_setup_phb_resources(struct pci_controller *hose, in pcibios_setup_phb_resources() argument
1536 res = &hose->io_resource; in pcibios_setup_phb_resources()
1541 hose->dn, hose->global_number); in pcibios_setup_phb_resources()
1543 offset = pcibios_io_space_offset(hose); in pcibios_setup_phb_resources()
1552 res = &hose->mem_resources[i]; in pcibios_setup_phb_resources()
1556 offset = hose->mem_offset[i]; in pcibios_setup_phb_resources()
1600 fake_pci_bus(struct pci_controller *hose, int busnr) in fake_pci_bus() argument
1604 if (hose == NULL) { in fake_pci_bus()
1608 bus.sysdata = hose; in fake_pci_bus()
1609 bus.ops = hose? hose->ops: &null_pci_ops; in fake_pci_bus()
1614 int early_##rw##_config_##size(struct pci_controller *hose, int bus, \
1617 return pci_bus_##rw##_config_##size(fake_pci_bus(hose, bus), \
1628 int early_find_capability(struct pci_controller *hose, int bus, int devfn, in EARLY_PCI_OP()
1631 return pci_bus_find_capability(fake_pci_bus(hose, bus), devfn, cap); in EARLY_PCI_OP()
1636 struct pci_controller *hose = bus->sysdata; in pcibios_get_phb_of_node() local
1638 return of_node_get(hose->dn); in pcibios_get_phb_of_node()
1645 void pcibios_scan_phb(struct pci_controller *hose) in pcibios_scan_phb() argument
1649 struct device_node *node = hose->dn; in pcibios_scan_phb()
1655 pcibios_setup_phb_io_space(hose); in pcibios_scan_phb()
1658 pcibios_setup_phb_resources(hose, &resources); in pcibios_scan_phb()
1660 hose->busn.start = hose->first_busno; in pcibios_scan_phb()
1661 hose->busn.end = hose->last_busno; in pcibios_scan_phb()
1662 hose->busn.flags = IORESOURCE_BUS; in pcibios_scan_phb()
1663 pci_add_resource(&resources, &hose->busn); in pcibios_scan_phb()
1666 bus = pci_create_root_bus(hose->parent, hose->first_busno, in pcibios_scan_phb()
1667 hose->ops, hose, &resources); in pcibios_scan_phb()
1670 hose->global_number); in pcibios_scan_phb()
1674 hose->bus = bus; in pcibios_scan_phb()
1678 if (node && hose->controller_ops.probe_mode) in pcibios_scan_phb()
1679 mode = hose->controller_ops.probe_mode(bus); in pcibios_scan_phb()
1686 hose->last_busno = pci_scan_child_bus(bus); in pcibios_scan_phb()
1687 pci_bus_update_busn_res_end(bus, hose->last_busno); in pcibios_scan_phb()
1694 ppc_md.pcibios_fixup_phb(hose); in pcibios_scan_phb()