Skip to content

Commit 234b925

Browse files
nxpfrankliMani-Sadhasivam
authored andcommitted
PCI: imx6: Add LUT configuration for MSI/IOMMU in Endpoint mode
Add LUT entry for MSI/IOMMU in Endpoint mode by calling imx_pcie_add_lut_by_rid() helper function. Since only one physical function is supported in the Endpoint mode for now, '0' is passed as the Device ID. This sets up a single LUT entry required for MSI/IOMMU. The Endpoint function can operate without LUT configuration if neither IOMMU nor MSI is used by the platform. This LUT configuration is used for the EP doorbell feature by allowing the Root Complex to trigger the doorbell on the Endpoint with the help of the Endpoint MSI controller. Signed-off-by: Frank Li <[email protected]> [mani: reworded the comments & commit message and dropped tested-by tag] Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 9d0ca8d commit 234b925

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/pci/controller/dwc/pci-imx6.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,10 @@ static int imx_pcie_add_lut(struct imx_pcie *imx_pcie, u16 rid, u8 sid)
10631063
data1 |= IMX95_PE0_LUT_VLD;
10641064
regmap_write(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_DATA1, data1);
10651065

1066-
data2 = IMX95_PE0_LUT_MASK; /* Match all bits of RID */
1066+
if (imx_pcie->drvdata->mode == DW_PCIE_EP_TYPE)
1067+
data2 = 0x7; /* In the EP mode, only 'Device ID' is required */
1068+
else
1069+
data2 = IMX95_PE0_LUT_MASK; /* Match all bits of RID */
10671070
data2 |= FIELD_PREP(IMX95_PE0_LUT_REQID, rid);
10681071
regmap_write(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_DATA2, data2);
10691072

@@ -1769,6 +1772,12 @@ static int imx_pcie_probe(struct platform_device *pdev)
17691772
ret = imx_add_pcie_ep(imx_pcie, pdev);
17701773
if (ret < 0)
17711774
return ret;
1775+
1776+
/*
1777+
* FIXME: Only single Device (EPF) is supported due to the
1778+
* Endpoint framework limitation.
1779+
*/
1780+
imx_pcie_add_lut_by_rid(imx_pcie, 0);
17721781
} else {
17731782
pci->pp.use_atu_msg = true;
17741783
ret = dw_pcie_host_init(&pci->pp);

0 commit comments

Comments
 (0)