Skip to content

Commit 9d0ca8d

Browse files
nxpfrankliMani-Sadhasivam
authored andcommitted
PCI: imx6: Add helper function imx_pcie_add_lut_by_rid()
Add helper function imx_pcie_add_lut_by_rid(), which will be used by the upcoming LUT configuration for MSI/IOMMU in the Endpoint mode. No functional change. Signed-off-by: Frank Li <[email protected]> [mani: reworded commit message and dropped tested-by tag] Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 399444a commit 9d0ca8d

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,18 +1096,14 @@ static void imx_pcie_remove_lut(struct imx_pcie *imx_pcie, u16 rid)
10961096
}
10971097
}
10981098

1099-
static int imx_pcie_enable_device(struct pci_host_bridge *bridge,
1100-
struct pci_dev *pdev)
1099+
static int imx_pcie_add_lut_by_rid(struct imx_pcie *imx_pcie, u32 rid)
11011100
{
1102-
struct imx_pcie *imx_pcie = to_imx_pcie(to_dw_pcie_from_pp(bridge->sysdata));
1103-
u32 sid_i, sid_m, rid = pci_dev_id(pdev);
1101+
struct device *dev = imx_pcie->pci->dev;
11041102
struct device_node *target;
1105-
struct device *dev;
1103+
u32 sid_i, sid_m;
11061104
int err_i, err_m;
11071105
u32 sid = 0;
11081106

1109-
dev = imx_pcie->pci->dev;
1110-
11111107
target = NULL;
11121108
err_i = of_map_id(dev->of_node, rid, "iommu-map", "iommu-map-mask",
11131109
&target, &sid_i);
@@ -1182,6 +1178,13 @@ static int imx_pcie_enable_device(struct pci_host_bridge *bridge,
11821178
return imx_pcie_add_lut(imx_pcie, rid, sid);
11831179
}
11841180

1181+
static int imx_pcie_enable_device(struct pci_host_bridge *bridge, struct pci_dev *pdev)
1182+
{
1183+
struct imx_pcie *imx_pcie = to_imx_pcie(to_dw_pcie_from_pp(bridge->sysdata));
1184+
1185+
return imx_pcie_add_lut_by_rid(imx_pcie, pci_dev_id(pdev));
1186+
}
1187+
11851188
static void imx_pcie_disable_device(struct pci_host_bridge *bridge,
11861189
struct pci_dev *pdev)
11871190
{

0 commit comments

Comments
 (0)