Lines Matching full:bar
15 * the PHB maps MMIO addresses to a specific PE using the "Memory BAR Table".
24 * For a SR-IOV BAR things are a little more awkward since size and alignment
25 * are not coupled. The alignment is set based on the per-VF BAR size, but
26 * the total BAR area is: number-of-vfs * per-vf-size. The number of VFs
28 * we need to finesse (read: hack) the Linux BAR allocator so that it will
33 * so as a baseline we can assume that we have the following BAR modes
38 * a) A segmented BAR that splits the mapped range into $PE_COUNT equally sized
40 * b) An un-segmented BAR that maps the whole address range to a specific PE.
43 * We prefer to use mode a) since it only requires one MBT entry per SR-IOV BAR
44 * For comparison b) requires one entry per-VF per-BAR, or:
46 * to equal the size of the per-VF BAR area. So:
50 * The alignment for the SR-IOV BAR also needs to be changed from per-vf-size
82 * MBT mapping for each SR-IOV BAR. In steps 1) and 2) we setup an "arena"
83 * where each MBT segment is equal in size to the VF BAR so we can shift
84 * around the actual SR-IOV BAR location within this arena. We need this
90 * the address programmed into the SR-IOV BAR of the PF so that the address
105 * since we can map each individual VF with a separate BAR. However, there's a
124 * the Linux BAR allocation will place any BAR marked as non-prefetchable into
128 * c) A segmented BAR similar to a), but each segment can be individually
132 * d) A segmented BAR with 8, 64, or 128 segments. This works similarly to a),
163 dev_warn(&pdev->dev, "Don't support SR-IOV with non M64 VF BAR%d: %pR. \n", in pnv_pci_ioda_fixup_iov_resources()
171 * Generally, one segmented M64 BAR maps one IOV BAR. However, in pnv_pci_ioda_fixup_iov_resources()
172 * if a VF BAR is too large we end up wasting a lot of space. in pnv_pci_ioda_fixup_iov_resources()
174 * then each VF BAR should be mapped in single-PE mode to reduce in pnv_pci_ioda_fixup_iov_resources()
182 * On PHB3, the minimum size alignment of M64 BAR in in pnv_pci_ioda_fixup_iov_resources()
183 * single mode is 32MB. If this VF BAR is smaller than 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()
199 * This BAR can be mapped with one segmented window, so adjust in pnv_pci_ioda_fixup_iov_resources()
202 pci_dbg(pdev, " Fixing VF BAR%d: %pR to\n", i, res); 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()
241 * the PHB can support using it's M64 BAR table. in pnv_pci_ioda_fixup_iov()
255 * iov can be null if we have an SR-IOV device with IOV BAR that can't in pnv_pci_iov_resource_alignment()
256 * be placed in the m64 space (i.e. The BAR is 32bit or non-prefetch). in pnv_pci_iov_resource_alignment()
264 * If we're using single mode then we can just use the native VF BAR in pnv_pci_iov_resource_alignment()
272 * On PowerNV platform, IOV BAR is mapped by M64 BAR to enable the in pnv_pci_iov_resource_alignment()
274 * BAR should be size aligned. in pnv_pci_iov_resource_alignment()
276 * This function returns the total IOV BAR size if M64 BAR is in 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()
279 * M64 segment size if IOV BAR size is less. in pnv_pci_iov_resource_alignment()
348 * with P7-IOC in mind. For that chip each M64 BAR (window) had a fixed in pnv_ioda_map_m64_single()
353 * communicate the number of segments we want on a BAR. This wasn't in pnv_ioda_map_m64_single()
384 * Now actually enable it. We specified the BAR should be in "non-split" 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()
517 * are segmented, each segment is the same size as the IOV BAR. 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()
532 * The actual IOV BAR range is determined by the start address in pnv_pci_vf_resource_shift()
533 * and the actual size for num_vfs VFs BAR. This check is to in pnv_pci_vf_resource_shift()
543 …dev_err(&dev->dev, "VF BAR%d: %pR would extend past %pR (trying to enable %d VFs shifted by %d)\n", in pnv_pci_vf_resource_shift()
550 * Since M64 BAR shares segments among all possible 256 PEs, in pnv_pci_vf_resource_shift()
551 * we have to shift the beginning of PF IOV BAR to make it start from in pnv_pci_vf_resource_shift()
568 dev_info(&dev->dev, "VF BAR%d: %pR shifted to %pR (%sabling %d VFs shifted by %d)\n", in pnv_pci_vf_resource_shift()
698 dev_info(&pdev->dev, "don't support this SRIOV device with non 64bit-prefetchable IOV BAR\n"); in pnv_pci_sriov_enable()
720 * When using one M64 BAR to map one IOV BAR, we need to shift in pnv_pci_sriov_enable()
721 * the IOV BAR according to the PE# allocated to the VFs. in pnv_pci_sriov_enable()