]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: imx6: Add IOMMU and ITS MSI support for i.MX95
authorFrank Li <Frank.Li@nxp.com>
Tue, 14 Jan 2025 20:37:09 +0000 (15:37 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 15 Jan 2025 20:47:24 +0000 (14:47 -0600)
commitce4c4301728541db7e5f571a5688a3a236d9e488
treef6981b2a5d183ea8f1a3ffbe85dc15aff33e0b49
parenta3751212a8eeece59d2018c455000f30ed7e5bb7
PCI: imx6: Add IOMMU and ITS MSI support for i.MX95

For the i.MX95, the configuration of a LUT is necessary to convert PCIe
Requester IDs (RIDs) to StreamIDs, which are used by both IOMMU and ITS.
This involves checking msi-map and iommu-map device tree properties to
ensure consistent mapping of Requester IDs to the same StreamIDs.

Subsequently, LUT-related registers are configured. If a msi-map isn't
detected, the platform relies on DWC built-in controller for MSIs that
do not need StreamIDs.

Implement PCI bus callback function to handle enable_device() and
disable_device() operations, setting up the LUT whenever a new PCI
device is enabled.

Known limitations:

  - If iommu-map exists in the device tree but the IOMMU controller is
    disabled, StreamIDs are programmed into the LUT. However, if a RID
    is out of range of the iommu-map, enabling the PCI device would
    result in a failure, although the PCI device can work without the
    IOMMU.

  - If msi-map exists in the device tree but the MSI controller is
    disabled, MSIs will not work. The DWC driver skips initializing the
    built-in MSI controller, falling back to legacy PCI INTx only.

Link: https://lore.kernel.org/r/20250114-imx95_lut-v9-2-39f58dbed03a@nxp.com
Signed-off-by: Frank Li <Frank.Li@nxp.com>
[kwilczynski: commit log]
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
[bhelgaas: fix uninitialized "sid" in imx_pcie_enable_device()]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Richard Zhu <hongxing.zhu@nxp.com>
drivers/pci/controller/dwc/pci-imx6.c