@@ -57,6 +57,10 @@ bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
return false;
break;
+ case DOMAIN_BUS_DEVICE_PCI_EP_MSI:
+ if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_PCI_ENDPOINT)))
+ return false;
+ fallthrough;
case DOMAIN_BUS_DEVICE_MSI:
/*
* Per device MSI should never have any MSI feature bits
@@ -17,6 +17,12 @@
#define MATCH_PLATFORM_MSI BIT(DOMAIN_BUS_PLATFORM_MSI)
+#ifdef CONFIG_PCI_ENDPOINT
+#define MATCH_PLATFORM_PCI_EP_MSI BIT(DOMAIN_BUS_PLATFORM_PCI_EP_MSI)
+#else
+#define MATCH_PLATFORM_PCI_EP_MSI (0)
+#endif
+
int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec,
enum irq_domain_bus_token bus_token);
@@ -15,6 +15,7 @@ enum irq_domain_bus_token {
DOMAIN_BUS_GENERIC_MSI,
DOMAIN_BUS_PCI_MSI,
DOMAIN_BUS_PLATFORM_MSI,
+ DOMAIN_BUS_PLATFORM_PCI_EP_MSI,
DOMAIN_BUS_NEXUS,
DOMAIN_BUS_IPI,
DOMAIN_BUS_FSL_MC_MSI,
@@ -27,6 +28,7 @@ enum irq_domain_bus_token {
DOMAIN_BUS_AMDVI,
DOMAIN_BUS_DEVICE_MSI,
DOMAIN_BUS_WIRED_TO_MSI,
+ DOMAIN_BUS_DEVICE_PCI_EP_MSI,
};
#endif /* _LINUX_IRQDOMAIN_DEFS_H */
┌────────────────────────────────┐ │ │ │ PCI Endpoint Controller │ │ │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ PCI Bus │ │ │ │ │ │ │ │ ─────────► │ │Func1│ │Func2│ ... │Func │ │ Doorbell │ │ │ │ │ │<n> │ │ │ │ │ │ │ │ │ │ │ └──┬──┘ └──┬──┘ └──┬──┘ │ │ │ │ │ │ └──────┼────────┼───────────┼────┘ │ │ │ ▼ ▼ ▼ ┌────────────────────────┐ │ MSI Controller │ └────────────────────────┘ Add domain BUS_PLATFORM_PCI_EP_MSI to allocate MSI domain for Endpoint function in PCI Endpoint (EP) controller, So PCI Root Complex (RC) can write MSI message to MSI controller to trigger doorbell IRQ for difference EP functions. Signed-off-by: Frank Li <Frank.Li@nxp.com> --- change from v12 to v13 - new patch --- drivers/irqchip/irq-msi-lib.c | 4 ++++ drivers/irqchip/irq-msi-lib.h | 6 ++++++ include/linux/irqdomain_defs.h | 2 ++ 3 files changed, 12 insertions(+)