layerscape: make uImage with zImage for 32-bit kernel
[openwrt/staging/dedeckeh.git] / target / linux / layerscape / patches-4.4 / 8237-pcie-ls208x-use-unified-compatible-fsl-ls2080a-pcie-.patch
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
6
7 To avoid unnecessary reduplication, let's use unified compatible
8 "fsl,ls2080a-pcie" for ls2080a, ls2085a, ls2088a.
9
10 This patch fixes issue of pcie not working on ls2088a.
11
12 Signed-off-by: Shengzhou Liu <Shengzhou.Liu@nxp.com>
13 ---
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(-)
17
18 --- a/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
19 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
20 @@ -513,8 +513,7 @@
21 };
22
23 pcie1: pcie@3400000 {
24 - compatible = "fsl,ls2088a-pcie", "fsl,ls2080a-pcie",
25 - "fsl,ls2085a-pcie", "snps,dw-pcie";
26 + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
27 reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */
28 0x20 0x00000000 0x0 0x00002000>; /* configuration space */
29 reg-names = "regs", "config";
30 @@ -539,8 +538,7 @@
31 };
32
33 pcie2: pcie@3500000 {
34 - compatible = "fsl,ls2080a-pcie", "fsl,ls2080a-pcie",
35 - "fsl,ls2085a-pcie", "snps,dw-pcie";
36 + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
37 reg = <0x00 0x03500000 0x0 0x00100000 /* controller registers */
38 0x28 0x00000000 0x0 0x00002000>; /* configuration space */
39 reg-names = "regs", "config";
40 @@ -565,8 +563,7 @@
41 };
42
43 pcie3: pcie@3600000 {
44 - compatible = "fsl,ls2088a-pcie", "fsl,ls2080a-pcie",
45 - "fsl,ls2085a-pcie", "snps,dw-pcie";
46 + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
47 reg = <0x00 0x03600000 0x0 0x00100000 /* controller registers */
48 0x30 0x00000000 0x0 0x00002000>; /* configuration space */
49 reg-names = "regs", "config";
50 @@ -591,8 +588,7 @@
51 };
52
53 pcie4: pcie@3700000 {
54 - compatible = "fsl,ls2080a-pcie", "fsl,ls2080a-pcie",
55 - "fsl,ls2085a-pcie", "snps,dw-pcie";
56 + compatible = "fsl,ls2080a-pcie", "snps,dw-pcie";
57 reg = <0x00 0x03700000 0x0 0x00100000 /* controller registers */
58 0x38 0x00000000 0x0 0x00002000>; /* configuration space */
59 reg-names = "regs", "config";
60 --- a/drivers/pci/host/pci-layerscape.c
61 +++ b/drivers/pci/host/pci-layerscape.c
62 @@ -158,9 +158,14 @@ static void ls1021_pcie_host_init(struct
63 static int ls_pcie_link_up(struct pcie_port *pp)
64 {
65 struct ls_pcie *pcie = to_ls_pcie(pp);
66 - u32 state;
67 + u32 state, offset;
68
69 - state = (ioread32(pcie->lut + pcie->drvdata->lut_dbg) >>
70 + if (of_get_property(pp->dev->of_node, "fsl,lut_diff", NULL))
71 + offset = 0x407fc;
72 + else
73 + offset = pcie->drvdata->lut_dbg;
74 +
75 + state = (ioread32(pcie->lut + offset) >>
76 pcie->drvdata->ltssm_shift) &
77 LTSSM_STATE_MASK;
78
79 @@ -261,7 +266,6 @@ static const struct of_device_id ls_pcie
80 { .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata },
81 { .compatible = "fsl,ls1088a-pcie", .data = &ls1088_drvdata },
82 { .compatible = "fsl,ls2080a-pcie", .data = &ls2080_drvdata },
83 - { .compatible = "fsl,ls2085a-pcie", .data = &ls2080_drvdata },
84 { },
85 };
86 MODULE_DEVICE_TABLE(of, ls_pcie_of_match);
87 @@ -315,8 +319,7 @@ static int __init ls_pcie_probe(struct p
88 if (!ls_pcie_is_bridge(pcie))
89 return -ENODEV;
90
91 - if (of_device_is_compatible(pdev->dev.of_node, "fsl,ls2085a-pcie") ||
92 - of_device_is_compatible(pdev->dev.of_node, "fsl,ls2080a-pcie") ||
93 + if (of_device_is_compatible(pdev->dev.of_node, "fsl,ls2080a-pcie") ||
94 of_device_is_compatible(pdev->dev.of_node, "fsl,ls1088a-pcie")) {
95 int len;
96 const u32 *prop;