Lines Matching refs:hose

59 	struct pci_controller *hose;  in fixup_ppc4xx_pci_bridge()  local
65 hose = pci_bus_to_host(dev->bus); in fixup_ppc4xx_pci_bridge()
66 if (hose == NULL) in fixup_ppc4xx_pci_bridge()
69 if (!of_device_is_compatible(hose->dn, "ibm,plb-pciex") && in fixup_ppc4xx_pci_bridge()
70 !of_device_is_compatible(hose->dn, "ibm,plb-pcix") && in fixup_ppc4xx_pci_bridge()
71 !of_device_is_compatible(hose->dn, "ibm,plb-pci")) in fixup_ppc4xx_pci_bridge()
74 if (of_device_is_compatible(hose->dn, "ibm,plb440epx-pci") || in fixup_ppc4xx_pci_bridge()
75 of_device_is_compatible(hose->dn, "ibm,plb440grx-pci")) { in fixup_ppc4xx_pci_bridge()
76 hose->indirect_type |= PPC_INDIRECT_TYPE_BROKEN_MRM; in fixup_ppc4xx_pci_bridge()
92 static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose, in ppc4xx_parse_dma_ranges() argument
99 int pna = of_n_addr_cells(hose->dn); in ppc4xx_parse_dma_ranges()
109 ranges = of_get_property(hose->dn, "dma-ranges", &rlen); in ppc4xx_parse_dma_ranges()
117 u64 cpu_addr = of_translate_dma_address(hose->dn, ranges + 3); in ppc4xx_parse_dma_ranges()
133 hose->dn, in ppc4xx_parse_dma_ranges()
156 printk(KERN_ERR "%pOF: dma-ranges(s) mismatch\n", hose->dn); in ppc4xx_parse_dma_ranges()
166 hose->dn, size, (u64)total_memory); in ppc4xx_parse_dma_ranges()
173 printk(KERN_ERR "%pOF: dma-ranges unaligned\n", hose->dn); in ppc4xx_parse_dma_ranges()
181 !(of_device_is_compatible(hose->dn, "ibm,plb-pciex-460sx") in ppc4xx_parse_dma_ranges()
182 || of_device_is_compatible(hose->dn, "ibm,plb-pciex-476fpe"))) { in ppc4xx_parse_dma_ranges()
184 hose->dn); in ppc4xx_parse_dma_ranges()
190 hose->dma_window_base_cur = res->start; in ppc4xx_parse_dma_ranges()
191 hose->dma_window_size = resource_size(res); in ppc4xx_parse_dma_ranges()
196 (unsigned long long)hose->dma_window_base_cur); in ppc4xx_parse_dma_ranges()
198 (unsigned long long)hose->dma_window_size); in ppc4xx_parse_dma_ranges()
206 static int __init ppc4xx_setup_one_pci_PMM(struct pci_controller *hose, in ppc4xx_setup_one_pci_PMM() argument
235 printk(KERN_WARNING "%pOF: Resource out of range\n", hose->dn); in ppc4xx_setup_one_pci_PMM()
253 static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose, in ppc4xx_configure_pci_PMMs() argument
260 struct resource *res = &hose->mem_resources[i]; in ppc4xx_configure_pci_PMMs()
261 resource_size_t offset = hose->mem_offset[i]; in ppc4xx_configure_pci_PMMs()
267 printk(KERN_WARNING "%pOF: Too many ranges\n", hose->dn); in ppc4xx_configure_pci_PMMs()
272 if (ppc4xx_setup_one_pci_PMM(hose, reg, in ppc4xx_configure_pci_PMMs()
289 if (j <= 2 && !found_isa_hole && hose->isa_mem_size) in ppc4xx_configure_pci_PMMs()
290 if (ppc4xx_setup_one_pci_PMM(hose, reg, hose->isa_mem_phys, 0, in ppc4xx_configure_pci_PMMs()
291 hose->isa_mem_size, 0, j) == 0) in ppc4xx_configure_pci_PMMs()
293 hose->dn); in ppc4xx_configure_pci_PMMs()
296 static void __init ppc4xx_configure_pci_PTMs(struct pci_controller *hose, in ppc4xx_configure_pci_PTMs() argument
312 early_write_config_dword(hose, hose->first_busno, 0, in ppc4xx_configure_pci_PTMs()
314 early_write_config_dword(hose, hose->first_busno, 0, in ppc4xx_configure_pci_PTMs()
316 early_write_config_word(hose, hose->first_busno, 0, in ppc4xx_configure_pci_PTMs()
326 struct pci_controller *hose = NULL; in ppc4xx_probe_pci_bridge() local
365 hose = pcibios_alloc_controller(np); in ppc4xx_probe_pci_bridge()
366 if (!hose) in ppc4xx_probe_pci_bridge()
369 hose->first_busno = bus_range ? bus_range[0] : 0x0; in ppc4xx_probe_pci_bridge()
370 hose->last_busno = bus_range ? bus_range[1] : 0xff; in ppc4xx_probe_pci_bridge()
373 setup_indirect_pci(hose, rsrc_cfg.start, rsrc_cfg.start + 0x4, 0); in ppc4xx_probe_pci_bridge()
383 pci_process_bridge_OF_ranges(hose, np, primary); in ppc4xx_probe_pci_bridge()
386 if (ppc4xx_parse_dma_ranges(hose, reg, &dma_window) != 0) in ppc4xx_probe_pci_bridge()
390 ppc4xx_configure_pci_PMMs(hose, reg); in ppc4xx_probe_pci_bridge()
393 ppc4xx_configure_pci_PTMs(hose, reg, &dma_window); in ppc4xx_probe_pci_bridge()
400 if (hose) in ppc4xx_probe_pci_bridge()
401 pcibios_free_controller(hose); in ppc4xx_probe_pci_bridge()
410 static int __init ppc4xx_setup_one_pcix_POM(struct pci_controller *hose, in ppc4xx_setup_one_pcix_POM() argument
423 hose->dn); in ppc4xx_setup_one_pcix_POM()
452 static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose, in ppc4xx_configure_pcix_POMs() argument
459 struct resource *res = &hose->mem_resources[i]; in ppc4xx_configure_pcix_POMs()
460 resource_size_t offset = hose->mem_offset[i]; in ppc4xx_configure_pcix_POMs()
466 printk(KERN_WARNING "%pOF: Too many ranges\n", hose->dn); in ppc4xx_configure_pcix_POMs()
471 if (ppc4xx_setup_one_pcix_POM(hose, reg, in ppc4xx_configure_pcix_POMs()
488 if (j <= 1 && !found_isa_hole && hose->isa_mem_size) in ppc4xx_configure_pcix_POMs()
489 if (ppc4xx_setup_one_pcix_POM(hose, reg, hose->isa_mem_phys, 0, in ppc4xx_configure_pcix_POMs()
490 hose->isa_mem_size, 0, j) == 0) in ppc4xx_configure_pcix_POMs()
492 hose->dn); in ppc4xx_configure_pcix_POMs()
495 static void __init ppc4xx_configure_pcix_PIMs(struct pci_controller *hose, in ppc4xx_configure_pcix_PIMs() argument
530 struct pci_controller *hose = NULL; in ppc4xx_probe_pcix_bridge() local
568 hose = pcibios_alloc_controller(np); in ppc4xx_probe_pcix_bridge()
569 if (!hose) in ppc4xx_probe_pcix_bridge()
572 hose->first_busno = bus_range ? bus_range[0] : 0x0; in ppc4xx_probe_pcix_bridge()
573 hose->last_busno = bus_range ? bus_range[1] : 0xff; in ppc4xx_probe_pcix_bridge()
576 setup_indirect_pci(hose, rsrc_cfg.start, rsrc_cfg.start + 0x4, in ppc4xx_probe_pcix_bridge()
592 pci_process_bridge_OF_ranges(hose, np, primary); in ppc4xx_probe_pcix_bridge()
595 if (ppc4xx_parse_dma_ranges(hose, reg, &dma_window) != 0) in ppc4xx_probe_pcix_bridge()
599 ppc4xx_configure_pcix_POMs(hose, reg); in ppc4xx_probe_pcix_bridge()
602 ppc4xx_configure_pcix_PIMs(hose, reg, &dma_window, big_pim, msi); in ppc4xx_probe_pcix_bridge()
609 if (hose) in ppc4xx_probe_pcix_bridge()
610 pcibios_free_controller(hose); in ppc4xx_probe_pcix_bridge()
635 struct pci_controller *hose; member
1453 if (port->endpoint && bus->number != port->hose->first_busno) in ppc4xx_pciex_validate_bdf()
1457 if (bus->number > port->hose->last_busno) { in ppc4xx_pciex_validate_bdf()
1467 if (bus->number == port->hose->first_busno && devfn != 0) in ppc4xx_pciex_validate_bdf()
1471 if (bus->number == (port->hose->first_busno + 1) && in ppc4xx_pciex_validate_bdf()
1476 if ((bus->number != port->hose->first_busno) && !port->link) in ppc4xx_pciex_validate_bdf()
1491 if (bus->number == port->hose->first_busno) in ppc4xx_pciex_get_config_base()
1492 return (void __iomem *)port->hose->cfg_addr; in ppc4xx_pciex_get_config_base()
1494 relbus = bus->number - (port->hose->first_busno + 1); in ppc4xx_pciex_get_config_base()
1495 return (void __iomem *)port->hose->cfg_data + in ppc4xx_pciex_get_config_base()
1502 struct pci_controller *hose = pci_bus_to_host(bus); in ppc4xx_pciex_read_config() local
1504 &ppc4xx_pciex_ports[hose->indirect_type]; in ppc4xx_pciex_read_config()
1508 BUG_ON(hose != port->hose); in ppc4xx_pciex_read_config()
1540 bus->number, hose->first_busno, hose->last_busno, in ppc4xx_pciex_read_config()
1559 struct pci_controller *hose = pci_bus_to_host(bus); in ppc4xx_pciex_write_config() local
1561 &ppc4xx_pciex_ports[hose->indirect_type]; in ppc4xx_pciex_write_config()
1580 bus->number, hose->first_busno, hose->last_busno, in ppc4xx_pciex_write_config()
1607 struct pci_controller *hose, in ppc4xx_setup_one_pciex_POM() argument
1621 printk(KERN_WARNING "%pOF: Resource out of range\n", hose->dn); in ppc4xx_setup_one_pciex_POM()
1683 struct pci_controller *hose, in ppc4xx_configure_pciex_POMs() argument
1690 struct resource *res = &hose->mem_resources[i]; in ppc4xx_configure_pciex_POMs()
1691 resource_size_t offset = hose->mem_offset[i]; in ppc4xx_configure_pciex_POMs()
1703 if (ppc4xx_setup_one_pciex_POM(port, hose, mbase, in ppc4xx_configure_pciex_POMs()
1720 if (j <= 1 && !found_isa_hole && hose->isa_mem_size) in ppc4xx_configure_pciex_POMs()
1721 if (ppc4xx_setup_one_pciex_POM(port, hose, mbase, in ppc4xx_configure_pciex_POMs()
1722 hose->isa_mem_phys, 0, in ppc4xx_configure_pciex_POMs()
1723 hose->isa_mem_size, 0, j) == 0) in ppc4xx_configure_pciex_POMs()
1725 hose->dn); in ppc4xx_configure_pciex_POMs()
1730 if (hose->io_resource.flags & IORESOURCE_IO) in ppc4xx_configure_pciex_POMs()
1731 ppc4xx_setup_one_pciex_POM(port, hose, mbase, in ppc4xx_configure_pciex_POMs()
1732 hose->io_base_phys, 0, in ppc4xx_configure_pciex_POMs()
1737 struct pci_controller *hose, in ppc4xx_configure_pciex_PIMs() argument
1813 struct pci_controller *hose = NULL; in ppc4xx_pciex_port_setup_hose() local
1827 hose = pcibios_alloc_controller(port->node); in ppc4xx_pciex_port_setup_hose()
1828 if (!hose) in ppc4xx_pciex_port_setup_hose()
1834 hose->indirect_type = port->index; in ppc4xx_pciex_port_setup_hose()
1837 hose->first_busno = bus_range ? bus_range[0] : 0x0; in ppc4xx_pciex_port_setup_hose()
1838 hose->last_busno = bus_range ? bus_range[1] : 0xff; in ppc4xx_pciex_port_setup_hose()
1845 busses = hose->last_busno - hose->first_busno; /* This is off by 1 */ in ppc4xx_pciex_port_setup_hose()
1848 hose->last_busno = hose->first_busno + busses; in ppc4xx_pciex_port_setup_hose()
1856 (hose->first_busno + 1) * 0x100000, in ppc4xx_pciex_port_setup_hose()
1863 hose->cfg_data = cfg_data; in ppc4xx_pciex_port_setup_hose()
1875 hose->cfg_addr = mbase; in ppc4xx_pciex_port_setup_hose()
1878 hose->first_busno, hose->last_busno); in ppc4xx_pciex_port_setup_hose()
1880 hose->cfg_addr, hose->cfg_data); in ppc4xx_pciex_port_setup_hose()
1883 hose->ops = &ppc4xx_pciex_pci_ops; in ppc4xx_pciex_port_setup_hose()
1884 port->hose = hose; in ppc4xx_pciex_port_setup_hose()
1885 mbase = (void __iomem *)hose->cfg_addr; in ppc4xx_pciex_port_setup_hose()
1891 out_8(mbase + PCI_PRIMARY_BUS, hose->first_busno); in ppc4xx_pciex_port_setup_hose()
1892 out_8(mbase + PCI_SECONDARY_BUS, hose->first_busno + 1); in ppc4xx_pciex_port_setup_hose()
1893 out_8(mbase + PCI_SUBORDINATE_BUS, hose->last_busno); in ppc4xx_pciex_port_setup_hose()
1902 pci_process_bridge_OF_ranges(hose, port->node, primary); in ppc4xx_pciex_port_setup_hose()
1905 if (ppc4xx_parse_dma_ranges(hose, mbase, &dma_window) != 0) in ppc4xx_pciex_port_setup_hose()
1909 ppc4xx_configure_pciex_POMs(port, hose, mbase); in ppc4xx_pciex_port_setup_hose()
1912 ppc4xx_configure_pciex_PIMs(port, hose, mbase, &dma_window); in ppc4xx_pciex_port_setup_hose()
1964 if (hose) in ppc4xx_pciex_port_setup_hose()
1965 pcibios_free_controller(hose); in ppc4xx_pciex_port_setup_hose()