From 1fd6c9b67f371abe90efc22b3b9a1efacac4b215 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 27 Jul 2024 18:21:21 +0800 Subject: [PATCH] rockchip: backport upstream fastrhino r66s/r68s fixes Signed-off-by: Tianling Shen --- ...x-regulator-name-for-Lunzn-Fastrhino.patch | 48 +++++++++++++++ ...ix-usb-regulator-for-Lunzn-Fastrhino.patch | 57 +++++++++++++++++ ...ix-pmu_io-supply-for-Lunzn-Fastrhino.patch | 61 +++++++++++++++++++ ...p-remove-unused-usb2-nodes-for-Lunzn.patch | 53 ++++++++++++++++ ...-disable-display-subsystem-for-Lunzn.patch | 30 +++++++++ ...-fixes-PHY-reset-for-Lunzn-Fastrhino.patch | 60 ++++++++++++++++++ ...0-arm64-rockchip-add-OF-node-for-eth.patch | 12 ++-- 7 files changed, 315 insertions(+), 6 deletions(-) create mode 100644 target/linux/rockchip/patches-5.15/030-v6.11-arm64-dts-rockchip-fix-regulator-name-for-Lunzn-Fastrhino.patch create mode 100644 target/linux/rockchip/patches-5.15/031-v6.11-arm64-dts-rockchip-fix-usb-regulator-for-Lunzn-Fastrhino.patch create mode 100644 target/linux/rockchip/patches-5.15/032-v6.11-arm64-dts-rockchip-fix-pmu_io-supply-for-Lunzn-Fastrhino.patch create mode 100644 target/linux/rockchip/patches-5.15/033-v6.11-arm64-dts-rockchip-remove-unused-usb2-nodes-for-Lunzn.patch create mode 100644 target/linux/rockchip/patches-5.15/034-v6.11-arm64-dts-rockchip-disable-display-subsystem-for-Lunzn.patch create mode 100644 target/linux/rockchip/patches-5.15/035-v6.11-arm64-dts-rockchip-fixes-PHY-reset-for-Lunzn-Fastrhino.patch diff --git a/target/linux/rockchip/patches-5.15/030-v6.11-arm64-dts-rockchip-fix-regulator-name-for-Lunzn-Fastrhino.patch b/target/linux/rockchip/patches-5.15/030-v6.11-arm64-dts-rockchip-fix-regulator-name-for-Lunzn-Fastrhino.patch new file mode 100644 index 0000000000..5e70275af1 --- /dev/null +++ b/target/linux/rockchip/patches-5.15/030-v6.11-arm64-dts-rockchip-fix-regulator-name-for-Lunzn-Fastrhino.patch @@ -0,0 +1,48 @@ +From 2dad31528de9ea8b05245ce6ac4f76ebf8dae947 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 30 Jun 2024 23:00:02 +0800 +Subject: [PATCH] arm64: dts: rockchip: fix regulator name for Lunzn Fastrhino + R6xS + +Make the regulator name the same as those marked by schematics. + +Fixes: c79dab407afd ("arm64: dts: rockchip: Add Lunzn Fastrhino R66S") +Signed-off-by: Chukun Pan +Link: https://lore.kernel.org/r/20240630150010.55729-2-amadeus@jmu.edu.cn +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi +@@ -39,9 +39,9 @@ + }; + }; + +- dc_12v: dc-12v-regulator { ++ vcc12v_dcin: vcc12v-dcin-regulator { + compatible = "regulator-fixed"; +- regulator-name = "dc_12v"; ++ regulator-name = "vcc12v_dcin"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; +@@ -65,7 +65,7 @@ + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; +- vin-supply = <&dc_12v>; ++ vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_sys: vcc5v0-sys-regulator { +@@ -75,7 +75,7 @@ + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; +- vin-supply = <&dc_12v>; ++ vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_usb_host: vcc5v0-usb-host-regulator { diff --git a/target/linux/rockchip/patches-5.15/031-v6.11-arm64-dts-rockchip-fix-usb-regulator-for-Lunzn-Fastrhino.patch b/target/linux/rockchip/patches-5.15/031-v6.11-arm64-dts-rockchip-fix-usb-regulator-for-Lunzn-Fastrhino.patch new file mode 100644 index 0000000000..bfa0232c52 --- /dev/null +++ b/target/linux/rockchip/patches-5.15/031-v6.11-arm64-dts-rockchip-fix-usb-regulator-for-Lunzn-Fastrhino.patch @@ -0,0 +1,57 @@ +From 9e823ba92118510c0d1c050b67bb000f9b9a73d7 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Mon, 1 Jul 2024 22:30:26 +0800 +Subject: [PATCH] arm64: dts: rockchip: fix usb regulator for Lunzn Fastrhino + R6xS + +Remove the non-existent usb_host regulator and fix the supply according +to the schematic. Also remove the unnecessary always-on and boot-on for +the usb_otg regulator. + +Fixes: c79dab407afd ("arm64: dts: rockchip: Add Lunzn Fastrhino R66S") +Signed-off-by: Chukun Pan +Link: https://lore.kernel.org/r/20240701143028.1203997-2-amadeus@jmu.edu.cn +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi | 16 ++++------------ + 1 file changed, 4 insertions(+), 12 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi +@@ -78,15 +78,6 @@ + vin-supply = <&vcc12v_dcin>; + }; + +- vcc5v0_usb_host: vcc5v0-usb-host-regulator { +- compatible = "regulator-fixed"; +- regulator-name = "vcc5v0_usb_host"; +- regulator-always-on; +- regulator-boot-on; +- regulator-min-microvolt = <5000000>; +- regulator-max-microvolt = <5000000>; +- }; +- + vcc5v0_usb_otg: vcc5v0-usb-otg-regulator { + compatible = "regulator-fixed"; + enable-active-high; +@@ -94,8 +85,9 @@ + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_usb_otg_en>; + regulator-name = "vcc5v0_usb_otg"; +- regulator-always-on; +- regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_sys>; + }; + }; + +@@ -464,7 +456,7 @@ + }; + + &usb2phy0_host { +- phy-supply = <&vcc5v0_usb_host>; ++ phy-supply = <&vcc5v0_sys>; + status = "okay"; + }; + diff --git a/target/linux/rockchip/patches-5.15/032-v6.11-arm64-dts-rockchip-fix-pmu_io-supply-for-Lunzn-Fastrhino.patch b/target/linux/rockchip/patches-5.15/032-v6.11-arm64-dts-rockchip-fix-pmu_io-supply-for-Lunzn-Fastrhino.patch new file mode 100644 index 0000000000..49076fccaa --- /dev/null +++ b/target/linux/rockchip/patches-5.15/032-v6.11-arm64-dts-rockchip-fix-pmu_io-supply-for-Lunzn-Fastrhino.patch @@ -0,0 +1,61 @@ +From cfeac8e5d05815521f5c5568680735a92ee91fe4 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 30 Jun 2024 23:00:04 +0800 +Subject: [PATCH] arm64: dts: rockchip: fix pmu_io supply for Lunzn Fastrhino + R6xS + +Fixes pmu_io_domains supply according to the schematic. Among them, +the vccio3 is responsible for the io voltage of sdcard. There is no +sdcard slot on the R68S, and it's connected to vcc_3v3, so describe +the supply of vccio3 separately. + +Fixes: c79dab407afd ("arm64: dts: rockchip: Add Lunzn Fastrhino R66S") +Fixes: b9f8ca655d80 ("arm64: dts: rockchip: Add Lunzn Fastrhino R68S") +Signed-off-by: Chukun Pan +Link: https://lore.kernel.org/r/20240630150010.55729-4-amadeus@jmu.edu.cn +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dts | 4 ++++ + arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi | 4 ++-- + arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r68s.dts | 4 ++++ + 3 files changed, 10 insertions(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dts +@@ -11,6 +11,10 @@ + }; + }; + ++&pmu_io_domains { ++ vccio3-supply = <&vccio_sd>; ++}; ++ + &sdmmc0 { + bus-width = <4>; + cap-mmc-highspeed; +--- a/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi +@@ -401,8 +401,8 @@ + &pmu_io_domains { + pmuio1-supply = <&vcc3v3_pmu>; + pmuio2-supply = <&vcc3v3_pmu>; +- vccio1-supply = <&vccio_acodec>; +- vccio3-supply = <&vccio_sd>; ++ vccio1-supply = <&vcc_3v3>; ++ vccio2-supply = <&vcc_1v8>; + vccio4-supply = <&vcc_1v8>; + vccio5-supply = <&vcc_3v3>; + vccio6-supply = <&vcc_1v8>; +--- a/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r68s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r68s.dts +@@ -102,6 +102,10 @@ + }; + }; + ++&pmu_io_domains { ++ vccio3-supply = <&vcc_3v3>; ++}; ++ + &sdhci { + bus-width = <8>; + max-frequency = <200000000>; diff --git a/target/linux/rockchip/patches-5.15/033-v6.11-arm64-dts-rockchip-remove-unused-usb2-nodes-for-Lunzn.patch b/target/linux/rockchip/patches-5.15/033-v6.11-arm64-dts-rockchip-remove-unused-usb2-nodes-for-Lunzn.patch new file mode 100644 index 0000000000..061f25613b --- /dev/null +++ b/target/linux/rockchip/patches-5.15/033-v6.11-arm64-dts-rockchip-remove-unused-usb2-nodes-for-Lunzn.patch @@ -0,0 +1,53 @@ +From cd77139a307fbabe75e6b5cb8a3753e3c700f394 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 30 Jun 2024 23:00:05 +0800 +Subject: [PATCH] arm64: dts: rockchip: remove unused usb2 nodes for Lunzn + Fastrhino R6xS + +Fix the following error when booting: +[ 15.851853] platform fd800000.usb: deferred probe pending +[ 15.852384] platform fd840000.usb: deferred probe pending +[ 15.852881] platform fd880000.usb: deferred probe pending + +This is due to usb2phy1 is not enabled. There is no USB 2.0 +port on the board, just remove it. + +Fixes: c79dab407afd ("arm64: dts: rockchip: Add Lunzn Fastrhino R66S") +Signed-off-by: Chukun Pan +Link: https://lore.kernel.org/r/20240630150010.55729-5-amadeus@jmu.edu.cn +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi | 16 ---------------- + 1 file changed, 16 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi +@@ -425,28 +425,12 @@ + status = "okay"; + }; + +-&usb_host0_ehci { +- status = "okay"; +-}; +- +-&usb_host0_ohci { +- status = "okay"; +-}; +- + &usb_host0_xhci { + dr_mode = "host"; + extcon = <&usb2phy0>; + status = "okay"; + }; + +-&usb_host1_ehci { +- status = "okay"; +-}; +- +-&usb_host1_ohci { +- status = "okay"; +-}; +- + &usb_host1_xhci { + status = "okay"; + }; diff --git a/target/linux/rockchip/patches-5.15/034-v6.11-arm64-dts-rockchip-disable-display-subsystem-for-Lunzn.patch b/target/linux/rockchip/patches-5.15/034-v6.11-arm64-dts-rockchip-disable-display-subsystem-for-Lunzn.patch new file mode 100644 index 0000000000..d6997655aa --- /dev/null +++ b/target/linux/rockchip/patches-5.15/034-v6.11-arm64-dts-rockchip-disable-display-subsystem-for-Lunzn.patch @@ -0,0 +1,30 @@ +From 2bf5d445df2ec89689d15ea259a916260c936959 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Mon, 1 Jul 2024 22:30:27 +0800 +Subject: [PATCH] arm64: dts: rockchip: disable display subsystem for Lunzn + Fastrhino R6xS + +The R66S and R68S boards do not have HDMI output, so disable +the display subsystem. + +Fixes: c79dab407afd ("arm64: dts: rockchip: Add Lunzn Fastrhino R66S") +Signed-off-by: Chukun Pan +Link: https://lore.kernel.org/r/20240701143028.1203997-3-amadeus@jmu.edu.cn +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi +@@ -115,6 +115,10 @@ + cpu-supply = <&vdd_cpu>; + }; + ++&display_subsystem { ++ status = "disabled"; ++}; ++ + &gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; diff --git a/target/linux/rockchip/patches-5.15/035-v6.11-arm64-dts-rockchip-fixes-PHY-reset-for-Lunzn-Fastrhino.patch b/target/linux/rockchip/patches-5.15/035-v6.11-arm64-dts-rockchip-fixes-PHY-reset-for-Lunzn-Fastrhino.patch new file mode 100644 index 0000000000..204fb89053 --- /dev/null +++ b/target/linux/rockchip/patches-5.15/035-v6.11-arm64-dts-rockchip-fixes-PHY-reset-for-Lunzn-Fastrhino.patch @@ -0,0 +1,60 @@ +From e261bd74000ca80e5483ba8a8bda509de8cbe7fd Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Sun, 30 Jun 2024 23:00:07 +0800 +Subject: [PATCH] arm64: dts: rockchip: fixes PHY reset for Lunzn Fastrhino + R68S + +Fixed the PHY address and reset GPIOs (does not match the corresponding +pinctrl) for gmac0 and gmac1. + +Fixes: b9f8ca655d80 ("arm64: dts: rockchip: Add Lunzn Fastrhino R68S") +Signed-off-by: Chukun Pan +Link: https://lore.kernel.org/r/20240630150010.55729-7-amadeus@jmu.edu.cn +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3568-fastrhino-r68s.dts | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r68s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r68s.dts +@@ -39,7 +39,7 @@ + &gmac0_rx_bus2 + &gmac0_rgmii_clk + &gmac0_rgmii_bus>; +- snps,reset-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_LOW>; ++ snps,reset-gpio = <&gpio1 RK_PB0 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + /* Reset time is 15ms, 50ms for rtl8211f */ + snps,reset-delays-us = <0 15000 50000>; +@@ -61,7 +61,7 @@ + &gmac1m1_rx_bus2 + &gmac1m1_rgmii_clk + &gmac1m1_rgmii_bus>; +- snps,reset-gpio = <&gpio0 RK_PB1 GPIO_ACTIVE_LOW>; ++ snps,reset-gpio = <&gpio1 RK_PB1 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + /* Reset time is 15ms, 50ms for rtl8211f */ + snps,reset-delays-us = <0 15000 50000>; +@@ -71,18 +71,18 @@ + }; + + &mdio0 { +- rgmii_phy0: ethernet-phy@0 { ++ rgmii_phy0: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; +- reg = <0>; ++ reg = <0x1>; + pinctrl-0 = <ð_phy0_reset_pin>; + pinctrl-names = "default"; + }; + }; + + &mdio1 { +- rgmii_phy1: ethernet-phy@0 { ++ rgmii_phy1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; +- reg = <0>; ++ reg = <0x1>; + pinctrl-0 = <ð_phy1_reset_pin>; + pinctrl-names = "default"; + }; diff --git a/target/linux/rockchip/patches-5.15/610-arm64-rockchip-add-OF-node-for-eth.patch b/target/linux/rockchip/patches-5.15/610-arm64-rockchip-add-OF-node-for-eth.patch index 7785f0a67c..867671c84c 100644 --- a/target/linux/rockchip/patches-5.15/610-arm64-rockchip-add-OF-node-for-eth.patch +++ b/target/linux/rockchip/patches-5.15/610-arm64-rockchip-add-OF-node-for-eth.patch @@ -104,7 +104,7 @@ Signed-off-by: David Bauer &pinctrl { --- a/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568-fastrhino-r66s.dtsi -@@ -376,6 +376,19 @@ +@@ -372,6 +372,19 @@ reset-gpios = <&gpio0 RK_PC3 GPIO_ACTIVE_HIGH>; vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay"; @@ -124,7 +124,7 @@ Signed-off-by: David Bauer }; &pcie3x2 { -@@ -383,6 +396,19 @@ +@@ -379,6 +392,19 @@ reset-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>; vpcie3v3-supply = <&vcc3v3_pcie>; status = "okay"; @@ -163,7 +163,7 @@ Signed-off-by: David Bauer phy-mode = "rgmii-id"; pinctrl-names = "default"; @@ -76,6 +78,7 @@ - reg = <0>; + reg = <0x1>; pinctrl-0 = <ð_phy0_reset_pin>; pinctrl-names = "default"; + realtek,led-data = <0x6d60>; @@ -171,15 +171,15 @@ Signed-off-by: David Bauer }; @@ -85,6 +88,7 @@ - reg = <0>; + reg = <0x1>; pinctrl-0 = <ð_phy1_reset_pin>; pinctrl-names = "default"; + realtek,led-data = <0x6d60>; }; }; -@@ -102,6 +106,14 @@ - }; +@@ -106,6 +110,14 @@ + vccio3-supply = <&vcc_3v3>; }; +&rtl8125_1 {