diff options
| author | Frank Li <Frank.Li@nxp.com> | 2025-10-15 11:27:30 -0400 |
|---|---|---|
| committer | Manivannan Sadhasivam <mani@kernel.org> | 2025-10-27 20:38:20 +0530 |
| commit | 0bfc6758f213a701bd662982de86f0032b51f18c (patch) | |
| tree | 9c569f535637c397044baddcc2a67a92d784e8fc /include/linux/pci-epf.h | |
| parent | f71e2b67b51dcb2fd8c6d566230f17a735770bee (diff) | |
PCI: endpoint: Add pci_epf_assign_bar_space() API
Add pci_epf_assign_bar_space() API to allow setting any MMIO address as
the BAR memory space, such as an MSI message base address.
This API also conforms to the BAR base address and size alignment
restrictions enforced by the PCI spec r6.0, sec 7.5.1.2.1.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
[mani: removed unused epc var, reworded kdoc, comments and description]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20251015-vntb_msi_doorbell-v6-3-9230298b1910@nxp.com
Diffstat (limited to 'include/linux/pci-epf.h')
| -rw-r--r-- | include/linux/pci-epf.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/pci-epf.h b/include/linux/pci-epf.h index 4022dd080e20..48f68c4dcfa5 100644 --- a/include/linux/pci-epf.h +++ b/include/linux/pci-epf.h @@ -242,6 +242,12 @@ void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar, void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar, enum pci_epc_interface_type type); +int pci_epf_assign_bar_space(struct pci_epf *epf, size_t size, + enum pci_barno bar, + const struct pci_epc_features *epc_features, + enum pci_epc_interface_type type, + dma_addr_t bar_addr); + int pci_epf_align_inbound_addr(struct pci_epf *epf, enum pci_barno bar, u64 addr, dma_addr_t *base, size_t *off); int pci_epf_bind(struct pci_epf *epf); |
