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