Skip to content

Commit e2ee8a4

Browse files
openedevmmind
authored andcommitted
arm64: dts: rockchip: Fix PCIe3 handling for Edgeble-6TOPS Modules
The Edgeble 6TOPS modules has configured the PCIe3.0 with - 2 lanes on Port1 of pcie3x2 controller for M.2 M-Key - 2 lanes on Port0 of pcie3x4 controller for B and E-Key The, current DT uses opposite controller nodes that indeed uses incorrect reset, regulator nodes. The configuration also uses refclk oscillator that need to enable explicitly in DT to avoid the probe hang on while reading DBI. So, this patch fixes all these essential issues and make this PCIe work properly. Issues fixed are, - Fix the associate controller nodes for M and B, E-Key - Fix the reset gpio handlings - Fix the regulator handlings and naming convensions - Support pcie_refclk oscillator Fixes: 92eaee2 ("arm64: dts: rockchip: Add Edgeble NCM6A-IO M.2 B-Key, E-Key") Fixes: 5d85d4c ("arm64: dts: rockchip: Add Edgeble NCM6A-IO M.2 M-Key") Reported-by: Mitchell Ma <[email protected]> Co-developed-by: Mitchell Ma <[email protected]> Signed-off-by: Jagan Teki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 9be4171 commit e2ee8a4

File tree

1 file changed

+59
-22
lines changed

1 file changed

+59
-22
lines changed

arch/arm64/boot/dts/rockchip/rk3588-edgeble-neu6a-io.dtsi

Lines changed: 59 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
stdout-path = "serial2:1500000n8";
1111
};
1212

13+
/* Unnamed gated oscillator: 100MHz,3.3V,3225 */
14+
pcie30_port0_refclk: pcie30_port1_refclk: pcie-oscillator {
15+
compatible = "gated-fixed-clock";
16+
#clock-cells = <0>;
17+
clock-frequency = <100000000>;
18+
clock-output-names = "pcie30_refclk";
19+
vdd-supply = <&vcc3v3_pi6c_05>;
20+
};
21+
1322
vcc3v3_pcie2x1l0: regulator-vcc3v3-pcie2x1l0 {
1423
compatible = "regulator-fixed";
1524
regulator-name = "vcc3v3_pcie2x1l0";
@@ -19,26 +28,26 @@
1928
vin-supply = <&vcc_3v3_s3>;
2029
};
2130

22-
vcc3v3_pcie3x2: regulator-vcc3v3-pcie3x2 {
31+
vcc3v3_bkey: regulator-vcc3v3-bkey {
2332
compatible = "regulator-fixed";
2433
enable-active-high;
2534
gpios = <&gpio2 RK_PC4 GPIO_ACTIVE_HIGH>; /* PCIE_4G_PWEN */
2635
pinctrl-names = "default";
27-
pinctrl-0 = <&pcie3x2_vcc3v3_en>;
28-
regulator-name = "vcc3v3_pcie3x2";
36+
pinctrl-0 = <&pcie_4g_pwen>;
37+
regulator-name = "vcc3v3_bkey";
2938
regulator-min-microvolt = <3300000>;
3039
regulator-max-microvolt = <3300000>;
3140
startup-delay-us = <5000>;
3241
vin-supply = <&vcc5v0_sys>;
3342
};
3443

35-
vcc3v3_pcie3x4: regulator-vcc3v3-pcie3x4 {
44+
vcc3v3_pcie30: vcc3v3_pi6c_05: regulator-vcc3v3-pi6c-05 {
3645
compatible = "regulator-fixed";
3746
enable-active-high;
3847
gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>; /* PCIE30x4_PWREN_H */
3948
pinctrl-names = "default";
40-
pinctrl-0 = <&pcie3x4_vcc3v3_en>;
41-
regulator-name = "vcc3v3_pcie3x4";
49+
pinctrl-0 = <&pcie30x4_pwren_h>;
50+
regulator-name = "vcc3v3_pcie30";
4251
regulator-min-microvolt = <3300000>;
4352
regulator-max-microvolt = <3300000>;
4453
startup-delay-us = <5000>;
@@ -98,24 +107,52 @@
98107
};
99108

100109
&pcie30phy {
110+
data-lanes = <1 1 2 2>;
111+
/* separate clock lines from the clock generator to phy and devices */
112+
rockchip,rx-common-refclk-mode = <0 0 0 0>;
101113
status = "okay";
102114
};
103115

104-
/* B-Key and E-Key */
116+
/* M-Key */
105117
&pcie3x2 {
118+
/*
119+
* The board has a "pcie_refclk" oscillator that needs enabling,
120+
* so add it to the list of clocks.
121+
*/
122+
clocks = <&cru ACLK_PCIE_2L_MSTR>, <&cru ACLK_PCIE_2L_SLV>,
123+
<&cru ACLK_PCIE_2L_DBI>, <&cru PCLK_PCIE_2L>,
124+
<&cru CLK_PCIE_AUX1>, <&cru CLK_PCIE2L_PIPE>,
125+
<&pcie30_port1_refclk>;
126+
clock-names = "aclk_mst", "aclk_slv",
127+
"aclk_dbi", "pclk",
128+
"aux", "pipe",
129+
"ref";
130+
num-lanes = <2>;
106131
pinctrl-names = "default";
107-
pinctrl-0 = <&pcie3x2_rst>;
108-
reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; /* PCIE30X4_PERSTn_M1_L */
109-
vpcie3v3-supply = <&vcc3v3_pcie3x2>;
132+
pinctrl-0 = <&pcie30x2_perstn_m1_l>;
133+
reset-gpios = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; /* PCIE30X2_PERSTn_M1_L */
134+
vpcie3v3-supply = <&vcc3v3_pcie30>;
110135
status = "okay";
111136
};
112137

113-
/* M-Key */
138+
/* B-Key and E-Key */
114139
&pcie3x4 {
140+
/*
141+
* The board has a "pcie_refclk" oscillator that needs enabling,
142+
* so add it to the list of clocks.
143+
*/
144+
clocks = <&cru ACLK_PCIE_4L_MSTR>, <&cru ACLK_PCIE_4L_SLV>,
145+
<&cru ACLK_PCIE_4L_DBI>, <&cru PCLK_PCIE_4L>,
146+
<&cru CLK_PCIE_AUX0>, <&cru CLK_PCIE4L_PIPE>,
147+
<&pcie30_port0_refclk>;
148+
clock-names = "aclk_mst", "aclk_slv",
149+
"aclk_dbi", "pclk",
150+
"aux", "pipe",
151+
"ref";
115152
pinctrl-names = "default";
116-
pinctrl-0 = <&pcie3x4_rst>;
117-
reset-gpios = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; /* PCIE30X2_PERSTn_M1_L */
118-
vpcie3v3-supply = <&vcc3v3_pcie3x4>;
153+
pinctrl-0 = <&pcie30x4_perstn_m1_l>;
154+
reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; /* PCIE30X4_PERSTn_M1_L */
155+
vpcie3v3-supply = <&vcc3v3_bkey>;
119156
status = "okay";
120157
};
121158

@@ -127,20 +164,20 @@
127164
};
128165

129166
pcie3 {
130-
pcie3x2_rst: pcie3x2-rst {
131-
rockchip,pins = <4 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
167+
pcie30x2_perstn_m1_l: pcie30x2-perstn-m1-l {
168+
rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
132169
};
133170

134-
pcie3x2_vcc3v3_en: pcie3x2-vcc3v3-en {
135-
rockchip,pins = <2 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
171+
pcie_4g_pwen: pcie-4g-pwen {
172+
rockchip,pins = <2 RK_PC4 RK_FUNC_GPIO &pcfg_pull_down>;
136173
};
137174

138-
pcie3x4_rst: pcie3x4-rst {
139-
rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
175+
pcie30x4_perstn_m1_l: pcie30x4-perstn-m1-l {
176+
rockchip,pins = <4 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
140177
};
141178

142-
pcie3x4_vcc3v3_en: pcie3x4-vcc3v3-en {
143-
rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
179+
pcie30x4_pwren_h: pcie30x4-pwren-h {
180+
rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_down>;
144181
};
145182
};
146183

0 commit comments

Comments
 (0)