Lines Matching refs:pbm

19 static int config_out_of_range(struct pci_pbm_info *pbm,  in config_out_of_range()  argument
24 if (bus < pbm->pci_first_busno || in config_out_of_range()
25 bus > pbm->pci_last_busno) in config_out_of_range()
30 static void *sun4u_config_mkaddr(struct pci_pbm_info *pbm, in sun4u_config_mkaddr() argument
35 unsigned long rbits = pbm->config_space_reg_bits; in sun4u_config_mkaddr()
37 if (config_out_of_range(pbm, bus, devfn, reg)) in sun4u_config_mkaddr()
44 return (void *) (pbm->config_space | bus | devfn | reg); in sun4u_config_mkaddr()
52 static int sun4u_read_pci_cfg_host(struct pci_pbm_info *pbm, in sun4u_read_pci_cfg_host() argument
60 addr = sun4u_config_mkaddr(pbm, bus, devfn, where); in sun4u_read_pci_cfg_host()
95 sun4u_read_pci_cfg_host(pbm, bus, devfn, in sun4u_read_pci_cfg_host()
100 sun4u_read_pci_cfg_host(pbm, bus, devfn, in sun4u_read_pci_cfg_host()
111 struct pci_pbm_info *pbm = bus_dev->sysdata; in sun4u_read_pci_cfg() local
130 return sun4u_read_pci_cfg_host(pbm, bus, devfn, where, in sun4u_read_pci_cfg()
133 addr = sun4u_config_mkaddr(pbm, bus, devfn, where); in sun4u_read_pci_cfg()
165 static int sun4u_write_pci_cfg_host(struct pci_pbm_info *pbm, in sun4u_write_pci_cfg_host() argument
171 addr = sun4u_config_mkaddr(pbm, bus, devfn, where); in sun4u_write_pci_cfg_host()
203 sun4u_write_pci_cfg_host(pbm, bus, devfn, in sun4u_write_pci_cfg_host()
205 sun4u_write_pci_cfg_host(pbm, bus, devfn, in sun4u_write_pci_cfg_host()
215 struct pci_pbm_info *pbm = bus_dev->sysdata; in sun4u_write_pci_cfg() local
220 return sun4u_write_pci_cfg_host(pbm, bus, devfn, where, in sun4u_write_pci_cfg()
223 addr = sun4u_config_mkaddr(pbm, bus, devfn, where); in sun4u_write_pci_cfg()
260 struct pci_pbm_info *pbm = bus_dev->sysdata; in sun4v_read_pci_cfg() local
261 u32 devhandle = pbm->devhandle; in sun4v_read_pci_cfg()
267 if (config_out_of_range(pbm, bus, devfn, where)) { in sun4v_read_pci_cfg()
293 struct pci_pbm_info *pbm = bus_dev->sysdata; in sun4v_write_pci_cfg() local
294 u32 devhandle = pbm->devhandle; in sun4v_write_pci_cfg()
299 if (config_out_of_range(pbm, bus, devfn, where)) { in sun4v_write_pci_cfg()
318 void pci_get_pbm_props(struct pci_pbm_info *pbm) in pci_get_pbm_props() argument
320 const u32 *val = of_get_property(pbm->op->dev.of_node, "bus-range", NULL); in pci_get_pbm_props()
322 pbm->pci_first_busno = val[0]; in pci_get_pbm_props()
323 pbm->pci_last_busno = val[1]; in pci_get_pbm_props()
325 val = of_get_property(pbm->op->dev.of_node, "ino-bitmap", NULL); in pci_get_pbm_props()
327 pbm->ino_bitmap = (((u64)val[1] << 32UL) | in pci_get_pbm_props()
332 static void pci_register_iommu_region(struct pci_pbm_info *pbm) in pci_register_iommu_region() argument
334 const u32 *vdma = of_get_property(pbm->op->dev.of_node, "virtual-dma", in pci_register_iommu_region()
342 pbm->name); in pci_register_iommu_region()
346 rp->start = pbm->mem_space.start + (unsigned long) vdma[0]; in pci_register_iommu_region()
349 if (request_resource(&pbm->mem_space, rp)) { in pci_register_iommu_region()
351 pbm->name); in pci_register_iommu_region()
357 void pci_determine_mem_io_space(struct pci_pbm_info *pbm) in pci_determine_mem_io_space() argument
366 pbm_ranges = of_get_property(pbm->op->dev.of_node, "ranges", &i); in pci_determine_mem_io_space()
370 pbm->name); in pci_determine_mem_io_space()
375 memset(&pbm->mem64_space, 0, sizeof(struct resource)); in pci_determine_mem_io_space()
406 pbm->config_space = a; in pci_determine_mem_io_space()
411 pbm->io_space.start = a; in pci_determine_mem_io_space()
412 pbm->io_space.end = a + size - 1UL; in pci_determine_mem_io_space()
413 pbm->io_space.flags = IORESOURCE_IO; in pci_determine_mem_io_space()
414 pbm->io_offset = a - region_a; in pci_determine_mem_io_space()
420 pbm->mem_space.start = a; in pci_determine_mem_io_space()
421 pbm->mem_space.end = a + size - 1UL; in pci_determine_mem_io_space()
422 pbm->mem_space.flags = IORESOURCE_MEM; in pci_determine_mem_io_space()
423 pbm->mem_offset = a - region_a; in pci_determine_mem_io_space()
429 pbm->mem64_space.start = a; in pci_determine_mem_io_space()
430 pbm->mem64_space.end = a + size - 1UL; in pci_determine_mem_io_space()
431 pbm->mem64_space.flags = IORESOURCE_MEM; in pci_determine_mem_io_space()
432 pbm->mem64_offset = a - region_a; in pci_determine_mem_io_space()
443 pbm->name, in pci_determine_mem_io_space()
448 if (pbm->io_space.flags) in pci_determine_mem_io_space()
450 pbm->name, &pbm->io_space, pbm->io_offset); in pci_determine_mem_io_space()
451 if (pbm->mem_space.flags) in pci_determine_mem_io_space()
453 pbm->name, &pbm->mem_space, pbm->mem_offset); in pci_determine_mem_io_space()
454 if (pbm->mem64_space.flags && pbm->mem_space.flags) { in pci_determine_mem_io_space()
455 if (pbm->mem64_space.start <= pbm->mem_space.end) in pci_determine_mem_io_space()
456 pbm->mem64_space.start = pbm->mem_space.end + 1; in pci_determine_mem_io_space()
457 if (pbm->mem64_space.start > pbm->mem64_space.end) in pci_determine_mem_io_space()
458 pbm->mem64_space.flags = 0; in pci_determine_mem_io_space()
461 if (pbm->mem64_space.flags) in pci_determine_mem_io_space()
463 pbm->name, &pbm->mem64_space, pbm->mem64_offset); in pci_determine_mem_io_space()
465 pbm->io_space.name = pbm->mem_space.name = pbm->name; in pci_determine_mem_io_space()
466 pbm->mem64_space.name = pbm->name; in pci_determine_mem_io_space()
468 request_resource(&ioport_resource, &pbm->io_space); in pci_determine_mem_io_space()
469 request_resource(&iomem_resource, &pbm->mem_space); in pci_determine_mem_io_space()
470 if (pbm->mem64_space.flags) in pci_determine_mem_io_space()
471 request_resource(&iomem_resource, &pbm->mem64_space); in pci_determine_mem_io_space()
473 pci_register_iommu_region(pbm); in pci_determine_mem_io_space()
477 void pci_scan_for_target_abort(struct pci_pbm_info *pbm, in pci_scan_for_target_abort() argument
493 pbm->name, status); in pci_scan_for_target_abort()
498 pci_scan_for_target_abort(pbm, bus); in pci_scan_for_target_abort()
501 void pci_scan_for_master_abort(struct pci_pbm_info *pbm, in pci_scan_for_master_abort() argument
516 "[%016x]\n", pbm->name, status); in pci_scan_for_master_abort()
521 pci_scan_for_master_abort(pbm, bus); in pci_scan_for_master_abort()
524 void pci_scan_for_parity_error(struct pci_pbm_info *pbm, in pci_scan_for_parity_error() argument
540 pbm->name, status); in pci_scan_for_parity_error()
545 pci_scan_for_parity_error(pbm, bus); in pci_scan_for_parity_error()