31a384f499be66e87cd4164da73a716159f84445
[openwrt/openwrt.git] / target / linux / ipq806x / patches-4.4 / 112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
1 From 5b40516b2f5fb9b2a7d6d3e2e924f12ec9d183a8 Mon Sep 17 00:00:00 2001
2 From: Mathieu Olivari <mathieu@codeaurora.org>
3 Date: Tue, 21 Apr 2015 19:01:42 -0700
4 Subject: [PATCH 8/9] ARM: dts: qcom: add pcie nodes to ipq806x platforms
5
6 qcom-pcie driver now supports version 0 of the controller. This change
7 adds the corresponding entries to the IPQ806x dtsi file and
8 corresponding platform (AP148).
9
10 Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
11 ---
12 arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 30 ++++++++
13 arch/arm/boot/dts/qcom-ipq8064.dtsi | 124 +++++++++++++++++++++++++++++++
14 2 files changed, 154 insertions(+)
15
16 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
17 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
18 @@ -116,5 +116,15 @@
19 usb30@1 {
20 status = "ok";
21 };
22 +
23 + pcie0: pci@1b500000 {
24 + status = "ok";
25 + phy-tx0-term-offset = <7>;
26 + };
27 +
28 + pcie1: pci@1b700000 {
29 + status = "ok";
30 + phy-tx0-term-offset = <7>;
31 + };
32 };
33 };
34 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
35 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
36 @@ -128,5 +128,17 @@
37 usb30@1 {
38 status = "ok";
39 };
40 +
41 + pcie0: pci@1b500000 {
42 + status = "ok";
43 + };
44 +
45 + pcie1: pci@1b700000 {
46 + status = "ok";
47 + };
48 +
49 + pcie2: pci@1b900000 {
50 + status = "ok";
51 + };
52 };
53 };
54 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
55 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
56 @@ -4,6 +4,9 @@
57 #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
58 #include <dt-bindings/clock/qcom,lcc-ipq806x.h>
59 #include <dt-bindings/soc/qcom,gsbi.h>
60 +#include <dt-bindings/reset/qcom,gcc-ipq806x.h>
61 +#include <dt-bindings/interrupt-controller/arm-gic.h>
62 +#include <dt-bindings/gpio/gpio.h>
63
64 / {
65 model = "Qualcomm IPQ8064";
66 @@ -99,6 +102,34 @@
67 interrupt-controller;
68 #interrupt-cells = <2>;
69 interrupts = <0 16 0x4>;
70 +
71 + pcie0_pins: pcie0_pinmux {
72 + mux {
73 + pins = "gpio3";
74 + function = "pcie1_rst";
75 + drive-strength = <2>;
76 + bias-disable;
77 + };
78 + };
79 +
80 + pcie1_pins: pcie1_pinmux {
81 + mux {
82 + pins = "gpio48";
83 + function = "pcie2_rst";
84 + drive-strength = <2>;
85 + bias-disable;
86 + };
87 + };
88 +
89 + pcie2_pins: pcie2_pinmux {
90 + mux {
91 + pins = "gpio63";
92 + function = "pcie3_rst";
93 + drive-strength = <2>;
94 + bias-disable;
95 + output-low;
96 + };
97 + };
98 };
99
100 intc: interrupt-controller@2000000 {
101 @@ -417,6 +447,144 @@
102 dr_mode = "host";
103 };
104 };
105 +
106 + pcie0: pci@1b500000 {
107 + compatible = "qcom,pcie-v0";
108 + reg = <0x1b500000 0x1000
109 + 0x1b502000 0x80
110 + 0x1b600000 0x100
111 + 0x0ff00000 0x100000>;
112 + reg-names = "dbi", "elbi", "parf", "config";
113 + device_type = "pci";
114 + linux,pci-domain = <0>;
115 + bus-range = <0x00 0xff>;
116 + num-lanes = <1>;
117 + #address-cells = <3>;
118 + #size-cells = <2>;
119 +
120 + ranges = <0x81000000 0 0x0fe00000 0x0fe00000 0 0x00100000 /* downstream I/O */
121 + 0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */
122 +
123 + interrupts = <GIC_SPI 35 IRQ_TYPE_NONE>;
124 + interrupt-names = "msi";
125 + #interrupt-cells = <1>;
126 + interrupt-map-mask = <0 0 0 0x7>;
127 + interrupt-map = <0 0 0 1 &intc 0 36 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
128 + <0 0 0 2 &intc 0 37 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
129 + <0 0 0 3 &intc 0 38 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
130 + <0 0 0 4 &intc 0 39 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
131 +
132 + clocks = <&gcc PCIE_A_CLK>,
133 + <&gcc PCIE_H_CLK>,
134 + <&gcc PCIE_PHY_CLK>;
135 + clock-names = "core", "iface", "phy";
136 +
137 + resets = <&gcc PCIE_ACLK_RESET>,
138 + <&gcc PCIE_HCLK_RESET>,
139 + <&gcc PCIE_POR_RESET>,
140 + <&gcc PCIE_PCI_RESET>,
141 + <&gcc PCIE_PHY_RESET>;
142 + reset-names = "axi", "ahb", "por", "pci", "phy";
143 +
144 + pinctrl-0 = <&pcie0_pins>;
145 + pinctrl-names = "default";
146 +
147 + perst-gpios = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>;
148 +
149 + status = "disabled";
150 + };
151 +
152 + pcie1: pci@1b700000 {
153 + compatible = "qcom,pcie-v0";
154 + reg = <0x1b700000 0x1000
155 + 0x1b702000 0x80
156 + 0x1b800000 0x100
157 + 0x31f00000 0x100000>;
158 + reg-names = "dbi", "elbi", "parf", "config";
159 + device_type = "pci";
160 + linux,pci-domain = <1>;
161 + bus-range = <0x00 0xff>;
162 + num-lanes = <1>;
163 + #address-cells = <3>;
164 + #size-cells = <2>;
165 +
166 + ranges = <0x81000000 0 0x31e00000 0x31e00000 0 0x00100000 /* downstream I/O */
167 + 0x82000000 0 0x2e000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */
168 +
169 + interrupts = <GIC_SPI 57 IRQ_TYPE_NONE>;
170 + interrupt-names = "msi";
171 + #interrupt-cells = <1>;
172 + interrupt-map-mask = <0 0 0 0x7>;
173 + interrupt-map = <0 0 0 1 &intc 0 58 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
174 + <0 0 0 2 &intc 0 59 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
175 + <0 0 0 3 &intc 0 60 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
176 + <0 0 0 4 &intc 0 61 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
177 +
178 + clocks = <&gcc PCIE_1_A_CLK>,
179 + <&gcc PCIE_1_H_CLK>,
180 + <&gcc PCIE_1_PHY_CLK>;
181 + clock-names = "core", "iface", "phy";
182 +
183 + resets = <&gcc PCIE_1_ACLK_RESET>,
184 + <&gcc PCIE_1_HCLK_RESET>,
185 + <&gcc PCIE_1_POR_RESET>,
186 + <&gcc PCIE_1_PCI_RESET>,
187 + <&gcc PCIE_1_PHY_RESET>;
188 + reset-names = "axi", "ahb", "por", "pci", "phy";
189 +
190 + pinctrl-0 = <&pcie1_pins>;
191 + pinctrl-names = "default";
192 +
193 + perst-gpios = <&qcom_pinmux 48 GPIO_ACTIVE_LOW>;
194 +
195 + status = "disabled";
196 + };
197 +
198 + pcie2: pci@1b900000 {
199 + compatible = "qcom,pcie-v0";
200 + reg = <0x1b900000 0x1000
201 + 0x1b902000 0x80
202 + 0x1ba00000 0x100
203 + 0x35f00000 0x100000>;
204 + reg-names = "dbi", "elbi", "parf", "config";
205 + device_type = "pci";
206 + linux,pci-domain = <2>;
207 + bus-range = <0x00 0xff>;
208 + num-lanes = <1>;
209 + #address-cells = <3>;
210 + #size-cells = <2>;
211 +
212 + ranges = <0x81000000 0 0x35e00000 0x35e00000 0 0x00100000 /* downstream I/O */
213 + 0x82000000 0 0x32000000 0x32000000 0 0x03e00000>; /* non-prefetchable memory */
214 +
215 + interrupts = <GIC_SPI 71 IRQ_TYPE_NONE>;
216 + interrupt-names = "msi";
217 + #interrupt-cells = <1>;
218 + interrupt-map-mask = <0 0 0 0x7>;
219 + interrupt-map = <0 0 0 1 &intc 0 72 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
220 + <0 0 0 2 &intc 0 73 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
221 + <0 0 0 3 &intc 0 74 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
222 + <0 0 0 4 &intc 0 75 IRQ_TYPE_LEVEL_HIGH>; /* int_d */
223 +
224 + clocks = <&gcc PCIE_2_A_CLK>,
225 + <&gcc PCIE_2_H_CLK>,
226 + <&gcc PCIE_2_PHY_CLK>;
227 + clock-names = "core", "iface", "phy";
228 +
229 + resets = <&gcc PCIE_2_ACLK_RESET>,
230 + <&gcc PCIE_2_HCLK_RESET>,
231 + <&gcc PCIE_2_POR_RESET>,
232 + <&gcc PCIE_2_PCI_RESET>,
233 + <&gcc PCIE_2_PHY_RESET>;
234 + reset-names = "axi", "ahb", "por", "pci", "phy";
235 +
236 + pinctrl-0 = <&pcie2_pins>;
237 + pinctrl-names = "default";
238 +
239 + perst-gpios = <&qcom_pinmux 63 GPIO_ACTIVE_LOW>;
240 +
241 + status = "disabled";
242 + };
243 };
244
245 sfpb_mutex: sfpb-mutex {