1 From 4294e32111781b3de4d73b944cbd1bc1662a9a7a Mon Sep 17 00:00:00 2001
2 From: Sam Edwards <cfsworks@gmail.com>
3 Date: Wed, 11 Sep 2024 19:50:30 -0700
4 Subject: arm64: dts: rockchip: Split up RK3588's PCIe pinctrls
6 These pinctrls manage the low-speed PCIe signals:
7 - CLKREQ#: An output on the RK3588 (both RC or EP modes), used to
8 request that external clock-generation circuitry provide a clock.
9 - PERST#: An input on the RK3588 in EP mode, used to detect a reset
10 signal from the RC. In RC mode, the hardware does not use this signal:
11 Linux itself generates it by putting the pin in GPIO mode.
12 - WAKE#: In EP mode, this is an output; in RC mode, this is an input.
14 Each of these signals serves a distinct purpose, and more importantly,
15 PERST# should not be muxed when the RK3588 is in the RC role. Bundling
16 them together in pinctrl groups prevents proper use: indeed, almost none
17 of the current board-specific .dts files make any use of them.
18 (Exception: Rock 5A recently had a patch land that misuses _pins; this
21 However, on some RK3588 boards, the PCIe 3 controller will indefinitely
22 stall the boot if CLKREQ# is not muxed (details in the next patch).
23 This patch unbundles the signals to allow them to be used.
25 Signed-off-by: Sam Edwards <CFSworks@gmail.com>
26 Link: https://lore.kernel.org/r/20240912025034.180233-2-CFSworks@gmail.com
27 Signed-off-by: Heiko Stuebner <heiko@sntech.de>
29 --- a/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi
30 +++ b/arch/arm64/boot/dts/rockchip/rk3588-base-pinctrl.dtsi
31 @@ -1612,23 +1612,43 @@
35 - pcie20x1m0_pins: pcie20x1m0-pins {
36 + pcie20x1m0_clkreqn: pcie20x1m0-clkreqn {
38 /* pcie20x1_2_clkreqn_m0 */
39 - <3 RK_PC7 4 &pcfg_pull_none>,
40 + <3 RK_PC7 4 &pcfg_pull_none>;
44 + pcie20x1m0_perstn: pcie20x1m0-perstn {
46 /* pcie20x1_2_perstn_m0 */
47 - <3 RK_PD1 4 &pcfg_pull_none>,
48 + <3 RK_PD1 4 &pcfg_pull_none>;
52 + pcie20x1m0_waken: pcie20x1m0-waken {
54 /* pcie20x1_2_waken_m0 */
55 <3 RK_PD0 4 &pcfg_pull_none>;
59 - pcie20x1m1_pins: pcie20x1m1-pins {
60 + pcie20x1m1_clkreqn: pcie20x1m1-clkreqn {
62 /* pcie20x1_2_clkreqn_m1 */
63 - <4 RK_PB7 4 &pcfg_pull_none>,
64 + <4 RK_PB7 4 &pcfg_pull_none>;
68 + pcie20x1m1_perstn: pcie20x1m1-perstn {
70 /* pcie20x1_2_perstn_m1 */
71 - <4 RK_PC1 4 &pcfg_pull_none>,
72 + <4 RK_PC1 4 &pcfg_pull_none>;
76 + pcie20x1m1_waken: pcie20x1m1-waken {
78 /* pcie20x1_2_waken_m1 */
79 <4 RK_PC0 4 &pcfg_pull_none>;
81 @@ -1654,52 +1674,127 @@
85 - pcie30x1m0_pins: pcie30x1m0-pins {
86 + pcie30x1m0_0_clkreqn: pcie30x1m0-0-clkreqn {
88 /* pcie30x1_0_clkreqn_m0 */
89 - <0 RK_PC0 12 &pcfg_pull_none>,
90 + <0 RK_PC0 12 &pcfg_pull_none>;
94 + pcie30x1m0_0_perstn: pcie30x1m0-0-perstn {
96 /* pcie30x1_0_perstn_m0 */
97 - <0 RK_PC5 12 &pcfg_pull_none>,
98 + <0 RK_PC5 12 &pcfg_pull_none>;
102 + pcie30x1m0_0_waken: pcie30x1m0-0-waken {
104 /* pcie30x1_0_waken_m0 */
105 - <0 RK_PC4 12 &pcfg_pull_none>,
106 + <0 RK_PC4 12 &pcfg_pull_none>;
110 + pcie30x1m0_1_clkreqn: pcie30x1m0-1-clkreqn {
112 /* pcie30x1_1_clkreqn_m0 */
113 - <0 RK_PB5 12 &pcfg_pull_none>,
114 + <0 RK_PB5 12 &pcfg_pull_none>;
118 + pcie30x1m0_1_perstn: pcie30x1m0-1-perstn {
120 /* pcie30x1_1_perstn_m0 */
121 - <0 RK_PB7 12 &pcfg_pull_none>,
122 + <0 RK_PB7 12 &pcfg_pull_none>;
126 + pcie30x1m0_1_waken: pcie30x1m0-1-waken {
128 /* pcie30x1_1_waken_m0 */
129 <0 RK_PB6 12 &pcfg_pull_none>;
133 - pcie30x1m1_pins: pcie30x1m1-pins {
134 + pcie30x1m1_0_clkreqn: pcie30x1m1-0-clkreqn {
136 /* pcie30x1_0_clkreqn_m1 */
137 - <4 RK_PA3 4 &pcfg_pull_none>,
138 + <4 RK_PA3 4 &pcfg_pull_none>;
142 + pcie30x1m1_0_perstn: pcie30x1m1-0-perstn {
144 /* pcie30x1_0_perstn_m1 */
145 - <4 RK_PA5 4 &pcfg_pull_none>,
146 + <4 RK_PA5 4 &pcfg_pull_none>;
150 + pcie30x1m1_0_waken: pcie30x1m1-0-waken {
152 /* pcie30x1_0_waken_m1 */
153 - <4 RK_PA4 4 &pcfg_pull_none>,
154 + <4 RK_PA4 4 &pcfg_pull_none>;
158 + pcie30x1m1_1_clkreqn: pcie30x1m1-1-clkreqn {
160 /* pcie30x1_1_clkreqn_m1 */
161 - <4 RK_PA0 4 &pcfg_pull_none>,
162 + <4 RK_PA0 4 &pcfg_pull_none>;
166 + pcie30x1m1_1_perstn: pcie30x1m1-1-perstn {
168 /* pcie30x1_1_perstn_m1 */
169 - <4 RK_PA2 4 &pcfg_pull_none>,
170 + <4 RK_PA2 4 &pcfg_pull_none>;
174 + pcie30x1m1_1_waken: pcie30x1m1-1-waken {
176 /* pcie30x1_1_waken_m1 */
177 <4 RK_PA1 4 &pcfg_pull_none>;
181 - pcie30x1m2_pins: pcie30x1m2-pins {
182 + pcie30x1m2_0_clkreqn: pcie30x1m2-0-clkreqn {
184 /* pcie30x1_0_clkreqn_m2 */
185 - <1 RK_PB5 4 &pcfg_pull_none>,
186 + <1 RK_PB5 4 &pcfg_pull_none>;
190 + pcie30x1m2_0_perstn: pcie30x1m2-0-perstn {
192 /* pcie30x1_0_perstn_m2 */
193 - <1 RK_PB4 4 &pcfg_pull_none>,
194 + <1 RK_PB4 4 &pcfg_pull_none>;
198 + pcie30x1m2_0_waken: pcie30x1m2-0-waken {
200 /* pcie30x1_0_waken_m2 */
201 - <1 RK_PB3 4 &pcfg_pull_none>,
202 + <1 RK_PB3 4 &pcfg_pull_none>;
206 + pcie30x1m2_1_clkreqn: pcie30x1m2-1-clkreqn {
208 /* pcie30x1_1_clkreqn_m2 */
209 - <1 RK_PA0 4 &pcfg_pull_none>,
210 + <1 RK_PA0 4 &pcfg_pull_none>;
214 + pcie30x1m2_1_perstn: pcie30x1m2-1-perstn {
216 /* pcie30x1_1_perstn_m2 */
217 - <1 RK_PA7 4 &pcfg_pull_none>,
218 + <1 RK_PA7 4 &pcfg_pull_none>;
222 + pcie30x1m2_1_waken: pcie30x1m2-1-waken {
224 /* pcie30x1_1_waken_m2 */
225 <1 RK_PA1 4 &pcfg_pull_none>;
227 @@ -1721,45 +1816,85 @@
231 - pcie30x2m0_pins: pcie30x2m0-pins {
232 + pcie30x2m0_clkreqn: pcie30x2m0-clkreqn {
234 /* pcie30x2_clkreqn_m0 */
235 - <0 RK_PD1 12 &pcfg_pull_none>,
236 + <0 RK_PD1 12 &pcfg_pull_none>;
240 + pcie30x2m0_perstn: pcie30x2m0-perstn {
242 /* pcie30x2_perstn_m0 */
243 - <0 RK_PD4 12 &pcfg_pull_none>,
244 + <0 RK_PD4 12 &pcfg_pull_none>;
248 + pcie30x2m0_waken: pcie30x2m0-waken {
250 /* pcie30x2_waken_m0 */
251 <0 RK_PD2 12 &pcfg_pull_none>;
255 - pcie30x2m1_pins: pcie30x2m1-pins {
256 + pcie30x2m1_clkreqn: pcie30x2m1-clkreqn {
258 /* pcie30x2_clkreqn_m1 */
259 - <4 RK_PA6 4 &pcfg_pull_none>,
260 + <4 RK_PA6 4 &pcfg_pull_none>;
264 + pcie30x2m1_perstn: pcie30x2m1-perstn {
266 /* pcie30x2_perstn_m1 */
267 - <4 RK_PB0 4 &pcfg_pull_none>,
268 + <4 RK_PB0 4 &pcfg_pull_none>;
272 + pcie30x2m1_waken: pcie30x2m1-waken {
274 /* pcie30x2_waken_m1 */
275 <4 RK_PA7 4 &pcfg_pull_none>;
279 - pcie30x2m2_pins: pcie30x2m2-pins {
280 + pcie30x2m2_clkreqn: pcie30x2m2-clkreqn {
282 /* pcie30x2_clkreqn_m2 */
283 - <3 RK_PD2 4 &pcfg_pull_none>,
284 + <3 RK_PD2 4 &pcfg_pull_none>;
288 + pcie30x2m2_perstn: pcie30x2m2-perstn {
290 /* pcie30x2_perstn_m2 */
291 - <3 RK_PD4 4 &pcfg_pull_none>,
292 + <3 RK_PD4 4 &pcfg_pull_none>;
296 + pcie30x2m2_waken: pcie30x2m2-waken {
298 /* pcie30x2_waken_m2 */
299 <3 RK_PD3 4 &pcfg_pull_none>;
303 - pcie30x2m3_pins: pcie30x2m3-pins {
304 + pcie30x2m3_clkreqn: pcie30x2m3-clkreqn {
306 /* pcie30x2_clkreqn_m3 */
307 - <1 RK_PD7 4 &pcfg_pull_none>,
308 + <1 RK_PD7 4 &pcfg_pull_none>;
312 + pcie30x2m3_perstn: pcie30x2m3-perstn {
314 /* pcie30x2_perstn_m3 */
315 - <1 RK_PB7 4 &pcfg_pull_none>,
316 + <1 RK_PB7 4 &pcfg_pull_none>;
320 + pcie30x2m3_waken: pcie30x2m3-waken {
322 /* pcie30x2_waken_m3 */
323 <1 RK_PB6 4 &pcfg_pull_none>;
325 @@ -1774,45 +1909,85 @@
329 - pcie30x4m0_pins: pcie30x4m0-pins {
330 + pcie30x4m0_clkreqn: pcie30x4m0-clkreqn {
332 /* pcie30x4_clkreqn_m0 */
333 - <0 RK_PC6 12 &pcfg_pull_none>,
334 + <0 RK_PC6 12 &pcfg_pull_none>;
338 + pcie30x4m0_perstn: pcie30x4m0-perstn {
340 /* pcie30x4_perstn_m0 */
341 - <0 RK_PD0 12 &pcfg_pull_none>,
342 + <0 RK_PD0 12 &pcfg_pull_none>;
346 + pcie30x4m0_waken: pcie30x4m0-waken {
348 /* pcie30x4_waken_m0 */
349 <0 RK_PC7 12 &pcfg_pull_none>;
353 - pcie30x4m1_pins: pcie30x4m1-pins {
354 + pcie30x4m1_clkreqn: pcie30x4m1-clkreqn {
356 /* pcie30x4_clkreqn_m1 */
357 - <4 RK_PB4 4 &pcfg_pull_none>,
358 + <4 RK_PB4 4 &pcfg_pull_none>;
362 + pcie30x4m1_perstn: pcie30x4m1-perstn {
364 /* pcie30x4_perstn_m1 */
365 - <4 RK_PB6 4 &pcfg_pull_none>,
366 + <4 RK_PB6 4 &pcfg_pull_none>;
370 + pcie30x4m1_waken: pcie30x4m1-waken {
372 /* pcie30x4_waken_m1 */
373 <4 RK_PB5 4 &pcfg_pull_none>;
377 - pcie30x4m2_pins: pcie30x4m2-pins {
378 + pcie30x4m2_clkreqn: pcie30x4m2-clkreqn {
380 /* pcie30x4_clkreqn_m2 */
381 - <3 RK_PC4 4 &pcfg_pull_none>,
382 + <3 RK_PC4 4 &pcfg_pull_none>;
386 + pcie30x4m2_perstn: pcie30x4m2-perstn {
388 /* pcie30x4_perstn_m2 */
389 - <3 RK_PC6 4 &pcfg_pull_none>,
390 + <3 RK_PC6 4 &pcfg_pull_none>;
394 + pcie30x4m2_waken: pcie30x4m2-waken {
396 /* pcie30x4_waken_m2 */
397 <3 RK_PC5 4 &pcfg_pull_none>;
401 - pcie30x4m3_pins: pcie30x4m3-pins {
402 + pcie30x4m3_clkreqn: pcie30x4m3-clkreqn {
404 /* pcie30x4_clkreqn_m3 */
405 - <1 RK_PB0 4 &pcfg_pull_none>,
406 + <1 RK_PB0 4 &pcfg_pull_none>;
410 + pcie30x4m3_perstn: pcie30x4m3-perstn {
412 /* pcie30x4_perstn_m3 */
413 - <1 RK_PB2 4 &pcfg_pull_none>,
414 + <1 RK_PB2 4 &pcfg_pull_none>;
418 + pcie30x4m3_waken: pcie30x4m3-waken {
420 /* pcie30x4_waken_m3 */
421 <1 RK_PB1 4 &pcfg_pull_none>;
423 --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
424 +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts
429 - pinctrl-0 = <&pcie20x1m0_pins>;
430 + pinctrl-0 = <&pcie2_reset>, <&pcie20x1m0_clkreqn>, <&pcie20x1m0_waken>;
431 pinctrl-names = "default";
432 reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>;
433 vpcie3v3-supply = <&vcc3v3_wf>;
436 rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
439 + pcie2_reset: pcie2-reset {
440 + rockchip,pins = <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;