PCI: endpoint: Add custom notifier support
Add support for notifying the EPF device about the custom notifications
received by the EPC device from the Root complex. These notifications
are EPC/vendor specific and are shared with the specific EPF devices.
For instance, the Qcom EPC device generates events such as MHI_A7,
MHI_Q6, DEBUG, MMIO_WRITE, CFG_WRITE etc... These events can be passed
to the EPF device using this notifier.
EPC
---
```
static irqreturn_t pcie_ep_irq(int irq, void *data)
{
...
case PCIE_EP_INT_MHI_A7:
pci_epc_custom_notify(epc, PCIE_EP_INT_MHI_A7);
break;
case PCIE_EP_INT_MHI_Q6:
pci_epc_custom_notify(epc, PCIE_EP_INT_MHI_Q6);
break;
case PCIE_EP_INT_MMIO_WRITE:
pci_epc_custom_notify(epc, PCIE_EP_INT_MMIO_WRITE);
break;
...
}
```
EPF
---
```
static int pci_epf_notifier(struct notifier_block *nb, unsigned long val,
void *data)
{
...
case CUSTOM:
cus_event = data;
if (cus_event == PCIE_EP_INT_MHI_A7)
/* Handle MHI A7 event */
else if (cus_event == PCIE_EP_INT_MHI_Q6)
/* Handle MHI Q6 event */
else if (cus_event == PCIE_EP_INT_MMIO_WRITE)
/* Handle MMIO WRITE event */
break;
...
}
```
Signed-off-by:
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Loading
Please sign in to comment