Skip to content

Commit 0ec7e10

Browse files
Heiko Stuebnermmind
authored andcommitted
arm64: dts: rockchip: add PCIe3 support on rk3588-jaguar
The Jaguar SBC provides an M.2 slot connected to the pcie3 controller. In contrast to a number of other boards the pcie-refclk is gpio-controlled, so the necessary clock and is added to the list of pcie3 clocks. Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de> Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Link: https://lore.kernel.org/r/20240423074956.2622318-1-heiko@sntech.de Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent 5adbad5 commit 0ec7e10

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,27 @@
7272
};
7373
};
7474

75+
/*
76+
* 100MHz reference clock for PCIe peripherals from PI6C557-05BLE
77+
* clock generator.
78+
* The clock output is gated via the OE pin on the clock generator.
79+
* This is modeled as a fixed-clock plus a gpio-gate-clock.
80+
*/
81+
pcie_refclk_gen: pcie-refclk-gen-clock {
82+
compatible = "fixed-clock";
83+
#clock-cells = <0>;
84+
clock-frequency = <100000000>;
85+
};
86+
87+
pcie_refclk: pcie-refclk-clock {
88+
compatible = "gpio-gate-clock";
89+
clocks = <&pcie_refclk_gen>;
90+
#clock-cells = <0>;
91+
enable-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_LOW>; /* PCIE30X4_CLKREQN_M0 */
92+
pinctrl-names = "default";
93+
pinctrl-0 = <&pcie30x4_clkreqn_m0>;
94+
};
95+
7596
pps {
7697
compatible = "pps-gpio";
7798
gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>;
@@ -358,6 +379,30 @@
358379
status = "okay";
359380
};
360381

382+
&pcie30phy {
383+
status = "okay";
384+
};
385+
386+
&pcie3x4 {
387+
/*
388+
* The board has a gpio-controlled "pcie_refclk" generator,
389+
* so add it to the list of clocks.
390+
*/
391+
clocks = <&cru ACLK_PCIE_4L_MSTR>, <&cru ACLK_PCIE_4L_SLV>,
392+
<&cru ACLK_PCIE_4L_DBI>, <&cru PCLK_PCIE_4L>,
393+
<&cru CLK_PCIE_AUX0>, <&cru CLK_PCIE4L_PIPE>,
394+
<&pcie_refclk>;
395+
clock-names = "aclk_mst", "aclk_slv",
396+
"aclk_dbi", "pclk",
397+
"aux", "pipe",
398+
"ref";
399+
pinctrl-names = "default";
400+
pinctrl-0 = <&pcie30x4_waken_m0 &pcie30x4_perstn_m0>;
401+
reset-gpios = <&gpio0 RK_PD0 GPIO_ACTIVE_HIGH>; /* PCIE30X4_PERSTN_M0 */
402+
vpcie3v3-supply = <&vcc3v3_mdot2>;
403+
status = "okay";
404+
};
405+
361406
&pinctrl {
362407
emmc {
363408
emmc_reset: emmc-reset {
@@ -376,6 +421,20 @@
376421
rockchip,pins = <1 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
377422
};
378423
};
424+
425+
pcie30x4 {
426+
pcie30x4_clkreqn_m0: pcie30x4-clkreqn-m0 {
427+
rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
428+
};
429+
430+
pcie30x4_perstn_m0: pcie30x4-perstn-m0 {
431+
rockchip,pins = <0 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
432+
};
433+
434+
pcie30x4_waken_m0: pcie30x4-waken-m0 {
435+
rockchip,pins = <0 RK_PC7 12 &pcfg_pull_none>;
436+
};
437+
};
379438
};
380439

381440
&saradc {

0 commit comments

Comments
 (0)