1 From 562f1311b529d81662ed41786b8d240db2e2ff51 Mon Sep 17 00:00:00 2001
2 From: Shengzhou Liu <Shengzhou.Liu@nxp.com>
3 Date: Tue, 6 Dec 2016 15:30:39 +0800
4 Subject: [PATCH 237/238] pcie/ls208x: use unified compatible
5 "fsl,ls2080a-pcie" for ls208x
7 To avoid unnecessary reduplication, let's use unified compatible
8 "fsl,ls2080a-pcie" for ls2080a, ls2085a, ls2088a.
10 This patch fixes issue of pcie not working on ls2088a.
12 Signed-off-by: Shengzhou Liu <Shengzhou.Liu@nxp.com>
14 arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi | 12 ++++--------
15 drivers/pci/host/pci-layerscape.c | 13 ++++++++-----
16 2 files changed, 12 insertions(+), 13 deletions(-)
18 diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
19 index bd69942..07c917b 100644
20 --- a/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
21 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
26 - compatible = "fsl,ls2088a-pcie", "fsl,ls2080a-pcie",
27 - "fsl,ls2085a-pcie", "snps,dw-pcie";
28 + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
29 reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */
30 0x20 0x00000000 0x0 0x00002000>; /* configuration space */
31 reg-names = "regs", "config";
36 - compatible = "fsl,ls2080a-pcie", "fsl,ls2080a-pcie",
37 - "fsl,ls2085a-pcie", "snps,dw-pcie";
38 + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
39 reg = <0x00 0x03500000 0x0 0x00100000 /* controller registers */
40 0x28 0x00000000 0x0 0x00002000>; /* configuration space */
41 reg-names = "regs", "config";
46 - compatible = "fsl,ls2088a-pcie", "fsl,ls2080a-pcie",
47 - "fsl,ls2085a-pcie", "snps,dw-pcie";
48 + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
49 reg = <0x00 0x03600000 0x0 0x00100000 /* controller registers */
50 0x30 0x00000000 0x0 0x00002000>; /* configuration space */
51 reg-names = "regs", "config";
56 - compatible = "fsl,ls2080a-pcie", "fsl,ls2080a-pcie",
57 - "fsl,ls2085a-pcie", "snps,dw-pcie";
58 + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
59 reg = <0x00 0x03700000 0x0 0x00100000 /* controller registers */
60 0x38 0x00000000 0x0 0x00002000>; /* configuration space */
61 reg-names = "regs", "config";
62 diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c
63 index 00feabf..3e2100d 100644
64 --- a/drivers/pci/host/pci-layerscape.c
65 +++ b/drivers/pci/host/pci-layerscape.c
66 @@ -158,9 +158,14 @@ static void ls1021_pcie_host_init(struct pcie_port *pp)
67 static int ls_pcie_link_up(struct pcie_port *pp)
69 struct ls_pcie *pcie = to_ls_pcie(pp);
73 + if (of_get_property(pp->dev->of_node, "fsl,lut_diff", NULL))
76 + offset = pcie->drvdata->lut_dbg;
78 - state = (ioread32(pcie->lut + pcie->drvdata->lut_dbg) >>
79 + state = (ioread32(pcie->lut + offset) >>
80 pcie->drvdata->ltssm_shift) &
83 @@ -261,7 +266,6 @@ static const struct of_device_id ls_pcie_of_match[] = {
84 { .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata },
85 { .compatible = "fsl,ls1088a-pcie", .data = &ls1088_drvdata },
86 { .compatible = "fsl,ls2080a-pcie", .data = &ls2080_drvdata },
87 - { .compatible = "fsl,ls2085a-pcie", .data = &ls2080_drvdata },
90 MODULE_DEVICE_TABLE(of, ls_pcie_of_match);
91 @@ -315,8 +319,7 @@ static int __init ls_pcie_probe(struct platform_device *pdev)
92 if (!ls_pcie_is_bridge(pcie))
95 - if (of_device_is_compatible(pdev->dev.of_node, "fsl,ls2085a-pcie") ||
96 - of_device_is_compatible(pdev->dev.of_node, "fsl,ls2080a-pcie") ||
97 + if (of_device_is_compatible(pdev->dev.of_node, "fsl,ls2080a-pcie") ||
98 of_device_is_compatible(pdev->dev.of_node, "fsl,ls1088a-pcie")) {