Lines Matching full:pe

14  * the need to put the MMIO space for each VF into a separate PE. Internally
15 * the PHB maps MMIO addresses to a specific PE using the "Memory BAR Table".
39 * segments. The n'th segment is mapped to the n'th PE.
40 * b) An un-segmented BAR that maps the whole address range to a specific PE.
81 * This is where we actually allocate PE numbers for each VF and setup the
85 * ability because the PE space is shared by all devices on the same PHB.
86 * When using mode a) described above segment 0 in maps to PE#0 which might
89 * As a result we need allocate a contigious range of PE numbers, then shift
92 * PE number. This is handled in pnv_pci_vf_resource_shift().
97 * PE that we allocated for it rather than the PE associated with the bus.
104 * That's how mode a) works. In theory mode b) (single PE mapping) is less work
129 * mapped to any PE. This is matches how the 32bit MMIO window worked on
133 * but with fewer segments and configurable base PE.
135 * i.e. The n'th segment maps to the (n + base)'th PE.
137 * The base PE is also required to be a multiple of the window size.
174 * then each VF BAR should be mapped in single-PE mode to reduce in pnv_pci_ioda_fixup_iov_resources()
189 pci_err(pdev, "VF BAR%d: %pR can't be mapped in single PE mode\n", in pnv_pci_ioda_fixup_iov_resources()
206 pci_info(pdev, "VF BAR%d: %pR (expanded to %d VFs for PE alignment)", in pnv_pci_ioda_fixup_iov_resources()
229 struct pnv_ioda_pe *pe = pnv_ioda_get_pe(pdev); in pnv_pci_ioda_fixup_iov() local
233 * be set. The pdev doesn't exist when the PE is allocated (in in pnv_pci_ioda_fixup_iov()
236 pe->pdev = pdev; in pnv_pci_ioda_fixup_iov()
237 WARN_ON(!(pe->flags & PNV_IODA_PE_VF)); in pnv_pci_ioda_fixup_iov()
258 * BARs would not be placed in the correct PE. in pnv_pci_iov_resource_alignment()
265 * alignment. We validated that it's possible to use a single PE in pnv_pci_iov_resource_alignment()
277 * Shared PE mode or just VF BAR size if not. in pnv_pci_iov_resource_alignment()
278 * If the M64 BAR is in Single PE mode, return the VF BAR size or in pnv_pci_iov_resource_alignment()
350 * assigned to a PE. in pnv_ioda_map_m64_single()
355 * single PE windows added in PHB3 don't map cleanly to this API. in pnv_ioda_map_m64_single()
359 * PE mode, and set the PE for the window before setting the address in pnv_ioda_map_m64_single()
360 * bounds. We need to do it this way because the single PE windows in pnv_ioda_map_m64_single()
372 * NB: In single PE mode the window needs to be aligned to 32MB in pnv_ioda_map_m64_single()
385 * mode so FW will validate that the BAR is in single PE mode. in pnv_ioda_map_m64_single()
393 pr_err("Error mapping single PE BAR\n"); in pnv_ioda_map_m64_single()
450 /* otherwise map each VF with single PE BARs */ in pnv_pci_vf_assign_m64()
478 struct pnv_ioda_pe *pe, *pe_n; in pnv_ioda_release_vf_PE() local
486 list_for_each_entry_safe(pe, pe_n, &phb->ioda.pe_list, list) { in pnv_ioda_release_vf_PE()
487 if (pe->parent_dev != pdev) in pnv_ioda_release_vf_PE()
490 pnv_pci_ioda2_release_pe_dma(pe); in pnv_ioda_release_vf_PE()
494 list_del(&pe->list); in pnv_ioda_release_vf_PE()
497 pnv_ioda_deconfigure_pe(phb, pe); in pnv_ioda_release_vf_PE()
499 pnv_ioda_free_pe(pe); in pnv_ioda_release_vf_PE()
518 * Each segment is in a separate PE, and the high order bits of the in pnv_pci_vf_resource_shift()
519 * address are the PE number. Therefore, each VF's BAR is in a in pnv_pci_vf_resource_shift()
520 * separate PE, and changing the IOV BAR start address changes the in pnv_pci_vf_resource_shift()
552 * the segment which belongs to the PE number assigned to the first VF. in pnv_pci_vf_resource_shift()
617 struct pnv_ioda_pe *pe; in pnv_ioda_setup_vf_PE() local
630 /* Reserve PE for each VF */ in pnv_ioda_setup_vf_PE()
636 pe = &iov->vf_pe_arr[vf_index]; in pnv_ioda_setup_vf_PE()
637 pe->phb = phb; in pnv_ioda_setup_vf_PE()
638 pe->flags = PNV_IODA_PE_VF; in pnv_ioda_setup_vf_PE()
639 pe->pbus = NULL; in pnv_ioda_setup_vf_PE()
640 pe->parent_dev = pdev; in pnv_ioda_setup_vf_PE()
641 pe->mve_number = -1; in pnv_ioda_setup_vf_PE()
642 pe->rid = (vf_bus << 8) | vf_devfn; in pnv_ioda_setup_vf_PE()
644 pe_num = pe->pe_number; in pnv_ioda_setup_vf_PE()
645 pe_info(pe, "VF %04d:%02d:%02d.%d associated with PE#%x\n", in pnv_ioda_setup_vf_PE()
649 if (pnv_ioda_configure_pe(phb, pe)) { in pnv_ioda_setup_vf_PE()
651 pnv_ioda_free_pe(pe); in pnv_ioda_setup_vf_PE()
652 pe->pdev = NULL; in pnv_ioda_setup_vf_PE()
656 /* Put PE to the list */ in pnv_ioda_setup_vf_PE()
658 list_add_tail(&pe->list, &phb->ioda.pe_list); in pnv_ioda_setup_vf_PE()
661 /* associate this pe to it's pdn */ in pnv_ioda_setup_vf_PE()
670 pnv_pci_ioda2_setup_dma_pe(phb, pe); in pnv_ioda_setup_vf_PE()
686 * There's a calls to IODA2 PE setup code littered throughout. We could in pnv_pci_sriov_enable()
721 * the IOV BAR according to the PE# allocated to the VFs. in pnv_pci_sriov_enable()
722 * Otherwise, the PE# for the VF will conflict with others. in pnv_pci_sriov_enable()