Skip to content

Commit c435669

Browse files
Richard ZhuLorenzo Pieralisi
authored andcommitted
PCI: imx6: Add i.MX8MP PCIe EP support
Add the i.MX8MP PCIe EP support. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Richard Zhu <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]>
1 parent fb3217e commit c435669

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ enum imx6_pcie_variants {
5454
IMX8MP,
5555
IMX8MQ_EP,
5656
IMX8MM_EP,
57+
IMX8MP_EP,
5758
};
5859

5960
#define IMX6_PCIE_FLAG_IMX6_PHY BIT(0)
@@ -158,7 +159,8 @@ static unsigned int imx6_pcie_grp_offset(const struct imx6_pcie *imx6_pcie)
158159
imx6_pcie->drvdata->variant != IMX8MQ_EP &&
159160
imx6_pcie->drvdata->variant != IMX8MM &&
160161
imx6_pcie->drvdata->variant != IMX8MM_EP &&
161-
imx6_pcie->drvdata->variant != IMX8MP);
162+
imx6_pcie->drvdata->variant != IMX8MP &&
163+
imx6_pcie->drvdata->variant != IMX8MP_EP);
162164
return imx6_pcie->controller_id == 1 ? IOMUXC_GPR16 : IOMUXC_GPR14;
163165
}
164166

@@ -323,6 +325,7 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie)
323325
case IMX8MM:
324326
case IMX8MM_EP:
325327
case IMX8MP:
328+
case IMX8MP_EP:
326329
/*
327330
* The PHY initialization had been done in the PHY
328331
* driver, break here directly.
@@ -584,6 +587,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
584587
case IMX8MQ:
585588
case IMX8MQ_EP:
586589
case IMX8MP:
590+
case IMX8MP_EP:
587591
ret = clk_prepare_enable(imx6_pcie->pcie_aux);
588592
if (ret) {
589593
dev_err(dev, "unable to enable pcie_aux clock\n");
@@ -631,6 +635,7 @@ static void imx6_pcie_disable_ref_clk(struct imx6_pcie *imx6_pcie)
631635
case IMX8MQ:
632636
case IMX8MQ_EP:
633637
case IMX8MP:
638+
case IMX8MP_EP:
634639
clk_disable_unprepare(imx6_pcie->pcie_aux);
635640
break;
636641
default:
@@ -701,6 +706,7 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie)
701706
case IMX8MM:
702707
case IMX8MM_EP:
703708
case IMX8MP:
709+
case IMX8MP_EP:
704710
reset_control_assert(imx6_pcie->apps_reset);
705711
break;
706712
case IMX6SX:
@@ -779,6 +785,7 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
779785
case IMX8MM:
780786
case IMX8MM_EP:
781787
case IMX8MP:
788+
case IMX8MP_EP:
782789
break;
783790
}
784791

@@ -831,6 +838,7 @@ static void imx6_pcie_ltssm_enable(struct device *dev)
831838
case IMX8MM:
832839
case IMX8MM_EP:
833840
case IMX8MP:
841+
case IMX8MP_EP:
834842
reset_control_deassert(imx6_pcie->apps_reset);
835843
break;
836844
}
@@ -853,6 +861,7 @@ static void imx6_pcie_ltssm_disable(struct device *dev)
853861
case IMX8MM:
854862
case IMX8MM_EP:
855863
case IMX8MP:
864+
case IMX8MP_EP:
856865
reset_control_assert(imx6_pcie->apps_reset);
857866
break;
858867
}
@@ -1105,6 +1114,7 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie,
11051114
switch (imx6_pcie->drvdata->variant) {
11061115
case IMX8MQ_EP:
11071116
case IMX8MM_EP:
1117+
case IMX8MP_EP:
11081118
pcie_dbi2_offset = SZ_1M;
11091119
break;
11101120
default:
@@ -1319,6 +1329,7 @@ static int imx6_pcie_probe(struct platform_device *pdev)
13191329
case IMX8MM:
13201330
case IMX8MM_EP:
13211331
case IMX8MP:
1332+
case IMX8MP_EP:
13221333
imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux");
13231334
if (IS_ERR(imx6_pcie->pcie_aux))
13241335
return dev_err_probe(dev, PTR_ERR(imx6_pcie->pcie_aux),
@@ -1488,6 +1499,11 @@ static const struct imx6_pcie_drvdata drvdata[] = {
14881499
.mode = DW_PCIE_EP_TYPE,
14891500
.gpr = "fsl,imx8mm-iomuxc-gpr",
14901501
},
1502+
[IMX8MP_EP] = {
1503+
.variant = IMX8MP_EP,
1504+
.mode = DW_PCIE_EP_TYPE,
1505+
.gpr = "fsl,imx8mp-iomuxc-gpr",
1506+
},
14911507
};
14921508

14931509
static const struct of_device_id imx6_pcie_of_match[] = {
@@ -1500,6 +1516,7 @@ static const struct of_device_id imx6_pcie_of_match[] = {
15001516
{ .compatible = "fsl,imx8mp-pcie", .data = &drvdata[IMX8MP], },
15011517
{ .compatible = "fsl,imx8mq-pcie-ep", .data = &drvdata[IMX8MQ_EP], },
15021518
{ .compatible = "fsl,imx8mm-pcie-ep", .data = &drvdata[IMX8MM_EP], },
1519+
{ .compatible = "fsl,imx8mp-pcie-ep", .data = &drvdata[IMX8MP_EP], },
15031520
{},
15041521
};
15051522

0 commit comments

Comments
 (0)