From f1ac8ecf1bbf5b9db76feb59d2a7c7fee3a90ef1 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sat, 4 May 2024 20:36:34 +0800 Subject: [PATCH] rockchip: backport latest rk3588 patches Signed-off-by: Tianling Shen --- ...fine-reset-id-used-for-HDMI-Receiver.patch | 24 +++ ...588-Add-reset-line-for-HDMI-Receiver.patch | 25 +++ ...kchip-add-rk3588-pcie-and-php-IOMMUs.patch | 74 +++++++++ ...s-rockchip-Enable-GPU-on-Orange-Pi-5.patch | 28 ++++ ...d-USB-C-support-to-rk3588s-orangepi-.patch | 146 ++++++++++++++++++ ...-rockchip-use-system-LED-for-OpenWrt.patch | 4 +- ...hip-rk3588-add-cpu-frequency-scaling.patch | 2 +- ...kchip-enable-RK3588-tsadc-by-default.patch | 2 +- ...64-dts-rockchip-rk3588s-add-rng-node.patch | 2 +- ...ts-rockchip-rk3588s-rng-use-scmi_clk.patch | 2 +- 10 files changed, 303 insertions(+), 6 deletions(-) create mode 100644 target/linux/rockchip/patches-6.6/030-07-v6.10-dt-bindings-reset-Define-reset-id-used-for-HDMI-Receiver.patch create mode 100644 target/linux/rockchip/patches-6.6/030-08-v6.10-clk-rockchip-rk3588-Add-reset-line-for-HDMI-Receiver.patch create mode 100644 target/linux/rockchip/patches-6.6/050-21-v6.10-arm64-dts-rockchip-add-rk3588-pcie-and-php-IOMMUs.patch create mode 100644 target/linux/rockchip/patches-6.6/055-04-v6.10-arm64-dts-rockchip-Enable-GPU-on-Orange-Pi-5.patch create mode 100644 target/linux/rockchip/patches-6.6/055-05-v6.10-arm64-dts-rockchip-add-USB-C-support-to-rk3588s-orangepi-.patch diff --git a/target/linux/rockchip/patches-6.6/030-07-v6.10-dt-bindings-reset-Define-reset-id-used-for-HDMI-Receiver.patch b/target/linux/rockchip/patches-6.6/030-07-v6.10-dt-bindings-reset-Define-reset-id-used-for-HDMI-Receiver.patch new file mode 100644 index 0000000000..0b9082f9b6 --- /dev/null +++ b/target/linux/rockchip/patches-6.6/030-07-v6.10-dt-bindings-reset-Define-reset-id-used-for-HDMI-Receiver.patch @@ -0,0 +1,24 @@ +From ca151fd56b5736a7adbdba5675b9d87d70f20b23 Mon Sep 17 00:00:00 2001 +From: Shreeya Patel +Date: Thu, 28 Mar 2024 04:20:52 +0530 +Subject: [PATCH] dt-bindings: reset: Define reset id used for HDMI Receiver + +Add reset id used for HDMI Receiver in RK3588 SoCs + +Acked-by: Rob Herring +Signed-off-by: Shreeya Patel +Link: https://lore.kernel.org/r/20240327225057.672304-2-shreeya.patel@collabora.com +Signed-off-by: Heiko Stuebner +--- + include/dt-bindings/reset/rockchip,rk3588-cru.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/dt-bindings/reset/rockchip,rk3588-cru.h ++++ b/include/dt-bindings/reset/rockchip,rk3588-cru.h +@@ -751,4 +751,6 @@ + #define SRST_P_TRNG_CHK 658 + #define SRST_TRNG_S 659 + ++#define SRST_A_HDMIRX_BIU 660 ++ + #endif diff --git a/target/linux/rockchip/patches-6.6/030-08-v6.10-clk-rockchip-rk3588-Add-reset-line-for-HDMI-Receiver.patch b/target/linux/rockchip/patches-6.6/030-08-v6.10-clk-rockchip-rk3588-Add-reset-line-for-HDMI-Receiver.patch new file mode 100644 index 0000000000..6aa9c058a3 --- /dev/null +++ b/target/linux/rockchip/patches-6.6/030-08-v6.10-clk-rockchip-rk3588-Add-reset-line-for-HDMI-Receiver.patch @@ -0,0 +1,25 @@ +From 7af67019cd78d028ef377df689ac103d51905518 Mon Sep 17 00:00:00 2001 +From: Shreeya Patel +Date: Thu, 28 Mar 2024 04:20:53 +0530 +Subject: [PATCH] clk: rockchip: rk3588: Add reset line for HDMI Receiver + +Export hdmirx_biu reset line required by the Synopsys +DesignWare HDMIRX Controller. + +Signed-off-by: Shreeya Patel +Link: https://lore.kernel.org/r/20240327225057.672304-3-shreeya.patel@collabora.com +Signed-off-by: Heiko Stuebner +--- + drivers/clk/rockchip/rst-rk3588.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/rockchip/rst-rk3588.c ++++ b/drivers/clk/rockchip/rst-rk3588.c +@@ -577,6 +577,7 @@ static const int rk3588_register_offset[ + + /* SOFTRST_CON59 */ + RK3588_CRU_RESET_OFFSET(SRST_A_HDCP1_BIU, 59, 6), ++ RK3588_CRU_RESET_OFFSET(SRST_A_HDMIRX_BIU, 59, 7), + RK3588_CRU_RESET_OFFSET(SRST_A_VO1_BIU, 59, 8), + RK3588_CRU_RESET_OFFSET(SRST_H_VOP1_BIU, 59, 9), + RK3588_CRU_RESET_OFFSET(SRST_H_VOP1_S_BIU, 59, 10), diff --git a/target/linux/rockchip/patches-6.6/050-21-v6.10-arm64-dts-rockchip-add-rk3588-pcie-and-php-IOMMUs.patch b/target/linux/rockchip/patches-6.6/050-21-v6.10-arm64-dts-rockchip-add-rk3588-pcie-and-php-IOMMUs.patch new file mode 100644 index 0000000000..48e09c29eb --- /dev/null +++ b/target/linux/rockchip/patches-6.6/050-21-v6.10-arm64-dts-rockchip-add-rk3588-pcie-and-php-IOMMUs.patch @@ -0,0 +1,74 @@ +From cd81d3a0695cc54ad6ac0ef4bbb67a7c8f55d592 Mon Sep 17 00:00:00 2001 +From: Niklas Cassel +Date: Thu, 2 May 2024 16:02:32 +0200 +Subject: [PATCH] arm64: dts: rockchip: add rk3588 pcie and php IOMMUs + +The mmu600_pcie is connected with the five PCIe controllers. +The mmu600_php is connected with the USB3 controller, the GMAC +controllers, and the SATA controllers. + +See 8.2 Block Diagram, in rk3588 TRM (Technical Reference Manual). + +The IOMMUs are disabled by default, as further patches are needed to +program the SID/SSIDs in to the IOMMUs. + +iommu: Default domain type: Translated +iommu: DMA domain TLB invalidation policy: strict mode +arm-smmu-v3 fc900000.iommu: ias 48-bit, oas 48-bit (features 0x001c1eaf) +arm-smmu-v3 fc900000.iommu: allocated 65536 entries for cmdq +arm-smmu-v3 fc900000.iommu: allocated 32768 entries for evtq +arm-smmu-v3 fc900000.iommu: msi_domain absent - falling back to wired irqs + +Additionally, the IOMMU correctly triggers an IOMMU fault when +a PCIe device performs a write (since the device hasn't been +assigned a SID/SSID): +arm-smmu-v3 fc900000.iommu: event 0x02 received: +arm-smmu-v3 fc900000.iommu: 0x0000010000000002 +arm-smmu-v3 fc900000.iommu: 0x0000000000000000 +arm-smmu-v3 fc900000.iommu: 0x0000000000000000 +arm-smmu-v3 fc900000.iommu: 0x0000000000000000 + +While this doesn't provide much value as is, having the devices as +disabled in the device tree will allow developers to see that the rk3588 +actually has IOMMUs on the SoC. + +Signed-off-by: Niklas Cassel +Link: https://lore.kernel.org/r/20240502140231.477049-2-cassel@kernel.org +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 24 +++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +@@ -558,6 +558,30 @@ + status = "disabled"; + }; + ++ mmu600_pcie: iommu@fc900000 { ++ compatible = "arm,smmu-v3"; ++ reg = <0x0 0xfc900000 0x0 0x200000>; ++ interrupts = , ++ , ++ , ++ ; ++ interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; ++ #iommu-cells = <1>; ++ status = "disabled"; ++ }; ++ ++ mmu600_php: iommu@fcb00000 { ++ compatible = "arm,smmu-v3"; ++ reg = <0x0 0xfcb00000 0x0 0x200000>; ++ interrupts = , ++ , ++ , ++ ; ++ interrupt-names = "eventq", "gerror", "priq", "cmdq-sync"; ++ #iommu-cells = <1>; ++ status = "disabled"; ++ }; ++ + pmu1grf: syscon@fd58a000 { + compatible = "rockchip,rk3588-pmugrf", "syscon", "simple-mfd"; + reg = <0x0 0xfd58a000 0x0 0x10000>; diff --git a/target/linux/rockchip/patches-6.6/055-04-v6.10-arm64-dts-rockchip-Enable-GPU-on-Orange-Pi-5.patch b/target/linux/rockchip/patches-6.6/055-04-v6.10-arm64-dts-rockchip-Enable-GPU-on-Orange-Pi-5.patch new file mode 100644 index 0000000000..901d12060c --- /dev/null +++ b/target/linux/rockchip/patches-6.6/055-04-v6.10-arm64-dts-rockchip-Enable-GPU-on-Orange-Pi-5.patch @@ -0,0 +1,28 @@ +From 8beafb228f2be5de03e73178ac1081847d0d411f Mon Sep 17 00:00:00 2001 +From: Jimmy Hon +Date: Thu, 25 Apr 2024 17:29:13 -0500 +Subject: [PATCH] arm64: dts: rockchip: Enable GPU on Orange Pi 5 + +Enable the Mali GPU in the Orange Pi 5 + +Signed-off-by: Jimmy Hon +Link: https://lore.kernel.org/r/20240425222913.1760-1-honyuenkwun@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts +@@ -146,6 +146,11 @@ + status = "okay"; + }; + ++&gpu { ++ mali-supply = <&vdd_gpu_s0>; ++ status = "okay"; ++}; ++ + &i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0m2_xfer>; diff --git a/target/linux/rockchip/patches-6.6/055-05-v6.10-arm64-dts-rockchip-add-USB-C-support-to-rk3588s-orangepi-.patch b/target/linux/rockchip/patches-6.6/055-05-v6.10-arm64-dts-rockchip-add-USB-C-support-to-rk3588s-orangepi-.patch new file mode 100644 index 0000000000..c9ab84c88f --- /dev/null +++ b/target/linux/rockchip/patches-6.6/055-05-v6.10-arm64-dts-rockchip-add-USB-C-support-to-rk3588s-orangepi-.patch @@ -0,0 +1,146 @@ +From c57d1a970275aabfbfab4c56001394ada3456d8e Mon Sep 17 00:00:00 2001 +From: Jimmy Hon +Date: Wed, 17 Apr 2024 22:52:33 -0500 +Subject: [PATCH] arm64: dts: rockchip: add USB-C support to rk3588s-orangepi-5 + +Add support for using the Orange Pi 5 USB-C port for USB in OHCI, EHCI +or XHCI mode. Displayport AltMode is not yet supported. + +Signed-off-by: Jimmy Hon +Link: https://lore.kernel.org/r/20240418035232.35344-2-honyuenkwun@gmail.com +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3588s-orangepi-5.dts | 94 +++++++++++++++++++ + 1 file changed, 94 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + #include "rk3588s.dtsi" + + / { +@@ -217,6 +218,56 @@ + pinctrl-0 = <&i2c6m3_xfer>; + status = "okay"; + ++ usbc0: usb-typec@22 { ++ compatible = "fcs,fusb302"; ++ reg = <0x22>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usbc0_int>; ++ vbus-supply = <&vbus_typec>; ++ status = "okay"; ++ ++ usb_con: connector { ++ compatible = "usb-c-connector"; ++ label = "USB-C"; ++ data-role = "dual"; ++ op-sink-microwatt = <1000000>; ++ power-role = "dual"; ++ sink-pdos = ++ ; ++ source-pdos = ++ ; ++ try-power-role = "source"; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ usbc0_hs: endpoint { ++ remote-endpoint = <&usb_host0_xhci_drd_sw>; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ usbc0_ss: endpoint { ++ remote-endpoint = <&usbdp_phy0_typec_ss>; ++ }; ++ }; ++ ++ port@2 { ++ reg = <2>; ++ usbc0_sbu: endpoint { ++ remote-endpoint = <&usbdp_phy0_typec_sbu>; ++ }; ++ }; ++ }; ++ }; ++ }; ++ + hym8563: rtc@51 { + compatible = "haoyu,hym8563"; + reg = <0x51>; +@@ -630,6 +681,14 @@ + status = "okay"; + }; + ++&u2phy0 { ++ status = "okay"; ++}; ++ ++&u2phy0_otg { ++ status = "okay"; ++}; ++ + &u2phy2 { + status = "okay"; + }; +@@ -651,6 +710,29 @@ + status = "okay"; + }; + ++&usbdp_phy0 { ++ mode-switch; ++ orientation-switch; ++ sbu1-dc-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>; ++ sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++ ++ port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ usbdp_phy0_typec_ss: endpoint@0 { ++ reg = <0>; ++ remote-endpoint = <&usbc0_ss>; ++ }; ++ ++ usbdp_phy0_typec_sbu: endpoint@1 { ++ reg = <1>; ++ remote-endpoint = <&usbc0_sbu>; ++ }; ++ }; ++}; ++ + &usb_host0_ehci { + status = "okay"; + }; +@@ -659,6 +741,18 @@ + status = "okay"; + }; + ++&usb_host0_xhci { ++ dr_mode = "otg"; ++ usb-role-switch; ++ status = "okay"; ++ ++ port { ++ usb_host0_xhci_drd_sw: endpoint { ++ remote-endpoint = <&usbc0_hs>; ++ }; ++ }; ++}; ++ + &usb_host1_ehci { + status = "okay"; + }; diff --git a/target/linux/rockchip/patches-6.6/100-rockchip-use-system-LED-for-OpenWrt.patch b/target/linux/rockchip/patches-6.6/100-rockchip-use-system-LED-for-OpenWrt.patch index 1954c1b736..33c000741f 100644 --- a/target/linux/rockchip/patches-6.6/100-rockchip-use-system-LED-for-OpenWrt.patch +++ b/target/linux/rockchip/patches-6.6/100-rockchip-use-system-LED-for-OpenWrt.patch @@ -449,7 +449,7 @@ Signed-off-by: David Bauer --- a/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts -@@ -10,11 +10,16 @@ +@@ -11,11 +11,16 @@ / { model = "Xunlong Orange Pi 5"; @@ -467,7 +467,7 @@ Signed-off-by: David Bauer }; chosen { -@@ -40,10 +45,9 @@ +@@ -41,10 +46,9 @@ pinctrl-names = "default"; pinctrl-0 =<&leds_gpio>; diff --git a/target/linux/rockchip/patches-6.6/120-01-arm64-dts-rockchip-rk3588-add-cpu-frequency-scaling.patch b/target/linux/rockchip/patches-6.6/120-01-arm64-dts-rockchip-rk3588-add-cpu-frequency-scaling.patch index bbfbbf3574..6e184bc42b 100644 --- a/target/linux/rockchip/patches-6.6/120-01-arm64-dts-rockchip-rk3588-add-cpu-frequency-scaling.patch +++ b/target/linux/rockchip/patches-6.6/120-01-arm64-dts-rockchip-rk3588-add-cpu-frequency-scaling.patch @@ -536,7 +536,7 @@ Signed-off-by: Sebastian Reichel timer { compatible = "arm,armv8-timer"; interrupts = , -@@ -611,6 +1053,16 @@ +@@ -635,6 +1077,16 @@ reg = <0x0 0xfd5ac000 0x0 0x4000>; }; diff --git a/target/linux/rockchip/patches-6.6/120-06-arm64-dts-rockchip-enable-RK3588-tsadc-by-default.patch b/target/linux/rockchip/patches-6.6/120-06-arm64-dts-rockchip-enable-RK3588-tsadc-by-default.patch index 8188444387..e5cafeba0a 100644 --- a/target/linux/rockchip/patches-6.6/120-06-arm64-dts-rockchip-enable-RK3588-tsadc-by-default.patch +++ b/target/linux/rockchip/patches-6.6/120-06-arm64-dts-rockchip-enable-RK3588-tsadc-by-default.patch @@ -12,7 +12,7 @@ Signed-off-by: Sebastian Reichel --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi -@@ -2813,7 +2813,6 @@ +@@ -2837,7 +2837,6 @@ pinctrl-1 = <&tsadc_shut>; pinctrl-names = "gpio", "otpout"; #thermal-sensor-cells = <1>; diff --git a/target/linux/rockchip/patches-6.6/801-05-arm64-dts-rockchip-rk3588s-add-rng-node.patch b/target/linux/rockchip/patches-6.6/801-05-arm64-dts-rockchip-rk3588s-add-rng-node.patch index 8011df4c13..15bc18155a 100644 --- a/target/linux/rockchip/patches-6.6/801-05-arm64-dts-rockchip-rk3588s-add-rng-node.patch +++ b/target/linux/rockchip/patches-6.6/801-05-arm64-dts-rockchip-rk3588s-add-rng-node.patch @@ -11,7 +11,7 @@ Change-Id: Ifb8964053daa6b593dd2c2c6a3b8caab8526e56d --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi -@@ -2228,6 +2228,16 @@ +@@ -2252,6 +2252,16 @@ status = "disabled"; }; diff --git a/target/linux/rockchip/patches-6.6/801-06-arm64-dts-rockchip-rk3588s-rng-use-scmi_clk.patch b/target/linux/rockchip/patches-6.6/801-06-arm64-dts-rockchip-rk3588s-rng-use-scmi_clk.patch index df6315f5bf..1fdbc5a21e 100644 --- a/target/linux/rockchip/patches-6.6/801-06-arm64-dts-rockchip-rk3588s-rng-use-scmi_clk.patch +++ b/target/linux/rockchip/patches-6.6/801-06-arm64-dts-rockchip-rk3588s-rng-use-scmi_clk.patch @@ -14,7 +14,7 @@ Change-Id: I49994529fcc209c2bc173c1abc497536fb920302 --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi -@@ -2232,7 +2232,7 @@ +@@ -2256,7 +2256,7 @@ compatible = "rockchip,trngv1"; reg = <0x0 0xfe378000 0x0 0x200>; interrupts = ;