From a9ad4e6cee6c8e61fb22427aed4740893603724e Mon Sep 17 00:00:00 2001 From: SongJun Li Date: Mon, 25 Mar 2024 10:42:08 +0800 Subject: [PATCH 1/4] rock 2a: add pwm and uart support Signed-off-by SongJun Li lisongjun@radxa.com --- .../overlays/rk3528-fiq-debugger-uart1m0.dts | 33 +++++++++++++++++++ .../overlays/rk3528-fiq-debugger-uart3m0.dts | 33 +++++++++++++++++++ .../overlays/rk3528-fiq-debugger-uart3m1.dts | 33 +++++++++++++++++++ .../overlays/rk3528-fiq-debugger-uart7m0.dts | 33 +++++++++++++++++++ .../dts/rockchip/overlays/rk3528-pwm0-m0.dts | 22 +++++++++++++ .../dts/rockchip/overlays/rk3528-pwm3-m0.dts | 22 +++++++++++++ .../dts/rockchip/overlays/rk3528-pwm4-m0.dts | 22 +++++++++++++ .../dts/rockchip/overlays/rk3528-pwm5-m0.dts | 22 +++++++++++++ .../dts/rockchip/overlays/rk3528-uart0-m0.dts | 30 +++++++++++++++++ .../dts/rockchip/overlays/rk3528-uart1-m0.dts | 22 +++++++++++++ .../dts/rockchip/overlays/rk3528-uart3-m0.dts | 22 +++++++++++++ .../dts/rockchip/overlays/rk3528-uart3-m1.dts | 22 +++++++++++++ .../dts/rockchip/overlays/rk3528-uart7-m0.dts | 22 +++++++++++++ 13 files changed, 338 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts new file mode 100644 index 00000000..4e83f8b4 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts @@ -0,0 +1,33 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable FIQ Debugger on UART1-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_A7", "GPIO4_A6"; + description = "Enable FIQ Debugger on UART1-M0."; + }; + + fragment@0 { + target-path = "/"; + + __overlay__ { + fiq-debugger { + status = "okay"; + rockchip,serial-id = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&uart1m0_xfer>; + }; + }; + }; + + fragment@1 { + target = <&uart1>; + + __overlay__ { + status = "disabled"; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts new file mode 100644 index 00000000..17b88111 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts @@ -0,0 +1,33 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable FIQ Debugger on UART3-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_B0", "GPIO4_B1"; + description = "Enable FIQ Debugger on UART3-M0."; + }; + + fragment@0 { + target-path = "/"; + + __overlay__ { + fiq-debugger { + status = "okay"; + rockchip,serial-id = <3>; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m0_xfer>; + }; + }; + }; + + fragment@1 { + target = <&uart3>; + + __overlay__ { + status = "disabled"; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts new file mode 100644 index 00000000..5fe3114b --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts @@ -0,0 +1,33 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable FIQ Debugger on UART3-M1"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_B7", "GPIO4_C0"; + description = "Enable FIQ Debugger on UART3-M1."; + }; + + fragment@0 { + target-path = "/"; + + __overlay__ { + fiq-debugger { + status = "okay"; + rockchip,serial-id = <3>; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m1_xfer>; + }; + }; + }; + + fragment@1 { + target = <&uart3>; + + __overlay__ { + status = "disabled"; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts new file mode 100644 index 00000000..7e2dfad3 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts @@ -0,0 +1,33 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable FIQ Debugger on UART7-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO3_B3", "GPIO3_B2"; + description = "Enable FIQ Debugger on UART7-M0."; + }; + + fragment@0 { + target-path = "/"; + + __overlay__ { + fiq-debugger { + status = "okay"; + rockchip,serial-id = <7>; + pinctrl-names = "default"; + pinctrl-0 = <&uart7m0_xfer>; + }; + }; + }; + + fragment@1 { + target = <&uart7>; + + __overlay__ { + status = "disabled"; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts new file mode 100644 index 00000000..59431d1d --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts @@ -0,0 +1,22 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable PWM0-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_C3"; + description = "Enable PWM0-M0.\nOn Radxa ROCK 2A this is pin 32."; + }; + + fragment@0 { + target = <&pwm0>; + + __overlay__ { + status = "okay"; + pinctrl-names = "active"; + pinctrl-0 = <&pwm0m0_pins>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts new file mode 100644 index 00000000..f5bb1747 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts @@ -0,0 +1,22 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable PWM3-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_C6"; + description = "Enable PWM3-M0.\nOn Radxa ROCK 2A this is pin 15."; + }; + + fragment@0 { + target = <&pwm3>; + + __overlay__ { + status = "okay"; + pinctrl-names = "active"; + pinctrl-0 = <&pwm3m0_pins>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts new file mode 100644 index 00000000..2da27dcf --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts @@ -0,0 +1,22 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable PWM4-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_B7"; + description = "Enable PWM5-M0.\nOn Radxa ROCK 2A this is pin 11."; + }; + + fragment@0 { + target = <&pwm4>; + + __overlay__ { + status = "okay"; + pinctrl-names = "active"; + pinctrl-0 = <&pwm4m0_pins>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts new file mode 100644 index 00000000..910609ec --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts @@ -0,0 +1,22 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable PWM5-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_C0"; + description = "Enable PWM5-M0.\nOn Radxa ROCK 2A this is pin 13."; + }; + + fragment@0 { + target = <&pwm5>; + + __overlay__ { + status = "okay"; + pinctrl-names = "active"; + pinctrl-0 = <&pwm5m0_pins>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts new file mode 100644 index 00000000..7304cb4b --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts @@ -0,0 +1,30 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable UART0-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_C7", "GPIO4_D0"; + description = "Enable UART0-M0.\nOn Radxa ROCK 2A this is RX pin 10 & TX pin 8."; + }; + + fragment@0 { + target-path = "/"; + + __overlay__ { + fiq-debugger { + status = "disabled"; + }; + }; + }; + + fragment@1 { + target = <&uart0>; + + __overlay__ { + status = "okay"; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts new file mode 100644 index 00000000..2585cf5e --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts @@ -0,0 +1,22 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable UART1-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_A7", "GPIO4_A6"; + description = "Enable UART1-M0.\nOn Radxa ROCK 2A this is RX pin 40 & TX pin 36."; + }; + + fragment@0 { + target = <&uart1>; + + __overlay__ { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart1m0_xfer>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts new file mode 100644 index 00000000..2166a17b --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts @@ -0,0 +1,22 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable UART3-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_B0", "GPIO4_B1"; + description = "Enable UART3-M0.\nOn Radxa ROCK 2A this is RX pin 16 & TX pin 18."; + }; + + fragment@0 { + target = <&uart3>; + + __overlay__ { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m0_xfer>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts new file mode 100644 index 00000000..953dd48d --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts @@ -0,0 +1,22 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable UART3-M1"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO4_B7", "GPIO4_C0"; + description = "Enable UART3-M1.\nOn Radxa ROCK 2A this is RX pin 11 & TX pin 13."; + }; + + fragment@0 { + target = <&uart3>; + + __overlay__ { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m1_xfer>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts new file mode 100644 index 00000000..66b125f3 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts @@ -0,0 +1,22 @@ +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Enable UART7-M0"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "GPIO3_B3", "GPIO3_B2"; + description = "Enable UART7-M0.\nOn Radxa ROCK 2A this is RX pin 27 & TX pin 28."; + }; + + fragment@0 { + target = <&uart7>; + + __overlay__ { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart7m0_xfer>; + }; + }; +}; From 4feb686265337e73a8871a9ed38d907b67706c5c Mon Sep 17 00:00:00 2001 From: SongJun Li Date: Mon, 25 Mar 2024 11:08:52 +0800 Subject: [PATCH 2/4] rock 2a: add pwm and uart support Signed-off-by SongJun Li lisongjun@radxa.com --- arch/arm64/boot/dts/rockchip/overlays/Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/overlays/Makefile b/arch/arm64/boot/dts/rockchip/overlays/Makefile index cd4fb32c..4088fe53 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/Makefile +++ b/arch/arm64/boot/dts/rockchip/overlays/Makefile @@ -8,6 +8,9 @@ endif ifeq ($(strip $(CONFIG_CPU_RK3399)), y) CONFIG_CLK_RK3399 ?= y endif +ifeq ($(strip $(CONFIG_CPU_RK3528)), y) + CONFIG_CLK_RK3528 ?= y +endif ifeq ($(strip $(CONFIG_CPU_RK3568)), y) CONFIG_CLK_RK3568 ?= y endif @@ -101,6 +104,21 @@ dtb-$(CONFIG_CPU_RK3399) += \ rock-4se-radxa-display-8hd.dtbo \ rock-4-radxa-display-10hd.dtbo +dtb-$(CONFIG_CLK_RK3528) += \ + rk3528-fiq-debugger-uart1m0.dtbo \ + rk3528-fiq-debugger-uart3m0.dtbo \ + rk3528-fiq-debugger-uart3m1.dtbo \ + rk3528-fiq-debugger-uart7m0.dtbo \ + rk3528-pwm0-m0.dtbo \ + rk3528-pwm3-m0.dtbo \ + rk3528-pwm4-m0.dtbo \ + rk3528-pwm5-m0.dtbo \ + rk3528-uart0-m0.dtbo \ + rk3528-uart1-m0.dtbo \ + rk3528-uart3-m0.dtbo \ + rk3528-uart3-m1.dtbo \ + rk3528-uart7-m0.dtbo + dtb-$(CONFIG_CLK_RK3568) += \ audioinjector-isolated-soundcard.dtbo \ radxa-cm3-io-camera-v2-imx219-cam1.dtbo \ From 66a55882a0d2957c99aefda812ddaa760e7c4c5a Mon Sep 17 00:00:00 2001 From: SongJun Li Date: Mon, 25 Mar 2024 20:27:25 +0800 Subject: [PATCH 3/4] rock 2a: fix format with some overlays Signed-off-by: SongJun Li lisongjun@radxa.com --- .../overlays/rk3528-fiq-debugger-uart1m0.dts | 28 +++++++------------ .../overlays/rk3528-fiq-debugger-uart3m0.dts | 28 +++++++------------ .../overlays/rk3528-fiq-debugger-uart3m1.dts | 28 +++++++------------ .../overlays/rk3528-fiq-debugger-uart7m0.dts | 28 +++++++------------ .../dts/rockchip/overlays/rk3528-pwm0-m0.dts | 14 ++++------ .../dts/rockchip/overlays/rk3528-pwm3-m0.dts | 14 ++++------ .../dts/rockchip/overlays/rk3528-pwm4-m0.dts | 14 ++++------ .../dts/rockchip/overlays/rk3528-pwm5-m0.dts | 14 ++++------ .../dts/rockchip/overlays/rk3528-uart0-m0.dts | 22 +++++---------- .../dts/rockchip/overlays/rk3528-uart1-m0.dts | 14 ++++------ .../dts/rockchip/overlays/rk3528-uart3-m0.dts | 14 ++++------ .../dts/rockchip/overlays/rk3528-uart3-m1.dts | 14 ++++------ .../dts/rockchip/overlays/rk3528-uart7-m0.dts | 14 ++++------ 13 files changed, 87 insertions(+), 159 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts index 4e83f8b4..890d6a7a 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts @@ -9,25 +9,17 @@ exclusive = "GPIO4_A7", "GPIO4_A6"; description = "Enable FIQ Debugger on UART1-M0."; }; +}; - fragment@0 { - target-path = "/"; - - __overlay__ { - fiq-debugger { - status = "okay"; - rockchip,serial-id = <1>; - pinctrl-names = "default"; - pinctrl-0 = <&uart1m0_xfer>; - }; - }; +&{/} { + fiq-debugger { + status = "okay"; + rockchip,serial-id = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&uart1m0_xfer>; }; +}; - fragment@1 { - target = <&uart1>; - - __overlay__ { - status = "disabled"; - }; - }; +&uart1 { + status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts index 17b88111..d4937d21 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts @@ -9,25 +9,17 @@ exclusive = "GPIO4_B0", "GPIO4_B1"; description = "Enable FIQ Debugger on UART3-M0."; }; +}; - fragment@0 { - target-path = "/"; - - __overlay__ { - fiq-debugger { - status = "okay"; - rockchip,serial-id = <3>; - pinctrl-names = "default"; - pinctrl-0 = <&uart3m0_xfer>; - }; - }; +&{/} { + fiq-debugger { + status = "okay"; + rockchip,serial-id = <3>; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m0_xfer>; }; +}; - fragment@1 { - target = <&uart3>; - - __overlay__ { - status = "disabled"; - }; - }; +&uart3 { + status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts index 5fe3114b..d007594a 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts @@ -9,25 +9,17 @@ exclusive = "GPIO4_B7", "GPIO4_C0"; description = "Enable FIQ Debugger on UART3-M1."; }; +}; - fragment@0 { - target-path = "/"; - - __overlay__ { - fiq-debugger { - status = "okay"; - rockchip,serial-id = <3>; - pinctrl-names = "default"; - pinctrl-0 = <&uart3m1_xfer>; - }; - }; +&{/} { + fiq-debugger { + status = "okay"; + rockchip,serial-id = <3>; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m1_xfer>; }; +}; - fragment@1 { - target = <&uart3>; - - __overlay__ { - status = "disabled"; - }; - }; +&uart3 { + status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts index 7e2dfad3..dfa858a7 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts @@ -9,25 +9,17 @@ exclusive = "GPIO3_B3", "GPIO3_B2"; description = "Enable FIQ Debugger on UART7-M0."; }; +}; - fragment@0 { - target-path = "/"; - - __overlay__ { - fiq-debugger { - status = "okay"; - rockchip,serial-id = <7>; - pinctrl-names = "default"; - pinctrl-0 = <&uart7m0_xfer>; - }; - }; +&{/} { + fiq-debugger { + status = "okay"; + rockchip,serial-id = <7>; + pinctrl-names = "default"; + pinctrl-0 = <&uart7m0_xfer>; }; +}; - fragment@1 { - target = <&uart7>; - - __overlay__ { - status = "disabled"; - }; - }; +&uart7 { + status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts index 59431d1d..e00ec2c5 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts @@ -9,14 +9,10 @@ exclusive = "GPIO4_C3"; description = "Enable PWM0-M0.\nOn Radxa ROCK 2A this is pin 32."; }; +}; - fragment@0 { - target = <&pwm0>; - - __overlay__ { - status = "okay"; - pinctrl-names = "active"; - pinctrl-0 = <&pwm0m0_pins>; - }; - }; +&pwm0 { + status = "disabled"; + pinctrl-names = "active"; + pinctrl-0 = <&pwm0m0_pins>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts index f5bb1747..ccecd1f7 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts @@ -9,14 +9,10 @@ exclusive = "GPIO4_C6"; description = "Enable PWM3-M0.\nOn Radxa ROCK 2A this is pin 15."; }; +}; - fragment@0 { - target = <&pwm3>; - - __overlay__ { - status = "okay"; - pinctrl-names = "active"; - pinctrl-0 = <&pwm3m0_pins>; - }; - }; +&pwm3 { + status = "disabled"; + pinctrl-names = "active"; + pinctrl-0 = <&pwm3m0_pins>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts index 2da27dcf..5f971f6f 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts @@ -9,14 +9,10 @@ exclusive = "GPIO4_B7"; description = "Enable PWM5-M0.\nOn Radxa ROCK 2A this is pin 11."; }; +}; - fragment@0 { - target = <&pwm4>; - - __overlay__ { - status = "okay"; - pinctrl-names = "active"; - pinctrl-0 = <&pwm4m0_pins>; - }; - }; +&pwm4 { + status = "disabled"; + pinctrl-names = "active"; + pinctrl-0 = <&pwm4m0_pins>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts index 910609ec..f3b2cc9f 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts @@ -9,14 +9,10 @@ exclusive = "GPIO4_C0"; description = "Enable PWM5-M0.\nOn Radxa ROCK 2A this is pin 13."; }; +}; - fragment@0 { - target = <&pwm5>; - - __overlay__ { - status = "okay"; - pinctrl-names = "active"; - pinctrl-0 = <&pwm5m0_pins>; - }; - }; +&pwm5 { + status = "disabled"; + pinctrl-names = "active"; + pinctrl-0 = <&pwm5m0_pins>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts index 7304cb4b..e6f166b5 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts @@ -9,22 +9,14 @@ exclusive = "GPIO4_C7", "GPIO4_D0"; description = "Enable UART0-M0.\nOn Radxa ROCK 2A this is RX pin 10 & TX pin 8."; }; +}; - fragment@0 { - target-path = "/"; - - __overlay__ { - fiq-debugger { - status = "disabled"; - }; - }; +&{/} { + fiq-debugger { + status = "disabled"; }; +}; - fragment@1 { - target = <&uart0>; - - __overlay__ { - status = "okay"; - }; - }; +&uart0 { + status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts index 2585cf5e..f38c269d 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts @@ -9,14 +9,10 @@ exclusive = "GPIO4_A7", "GPIO4_A6"; description = "Enable UART1-M0.\nOn Radxa ROCK 2A this is RX pin 40 & TX pin 36."; }; +}; - fragment@0 { - target = <&uart1>; - - __overlay__ { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&uart1m0_xfer>; - }; - }; +&uart1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart1m0_xfer>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts index 2166a17b..ae955b0f 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts @@ -9,14 +9,10 @@ exclusive = "GPIO4_B0", "GPIO4_B1"; description = "Enable UART3-M0.\nOn Radxa ROCK 2A this is RX pin 16 & TX pin 18."; }; +}; - fragment@0 { - target = <&uart3>; - - __overlay__ { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&uart3m0_xfer>; - }; - }; +&uart3 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m0_xfer>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts index 953dd48d..880ac3cf 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts @@ -9,14 +9,10 @@ exclusive = "GPIO4_B7", "GPIO4_C0"; description = "Enable UART3-M1.\nOn Radxa ROCK 2A this is RX pin 11 & TX pin 13."; }; +}; - fragment@0 { - target = <&uart3>; - - __overlay__ { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&uart3m1_xfer>; - }; - }; +&uart3 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart3m1_xfer>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts index 66b125f3..31a98d90 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts @@ -9,14 +9,10 @@ exclusive = "GPIO3_B3", "GPIO3_B2"; description = "Enable UART7-M0.\nOn Radxa ROCK 2A this is RX pin 27 & TX pin 28."; }; +}; - fragment@0 { - target = <&uart7>; - - __overlay__ { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&uart7m0_xfer>; - }; - }; +&uart7 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart7m0_xfer>; }; From 908b769f28a907d65b6defa64de21c017bd98f35 Mon Sep 17 00:00:00 2001 From: SongJun Li Date: Tue, 26 Mar 2024 15:02:32 +0800 Subject: [PATCH 4/4] rock 2a: fix format and add usb otg support Signed-off-by: SongJun Li --- arch/arm64/boot/dts/rockchip/overlays/Makefile | 1 + .../dts/rockchip/overlays/rk3528-dwc3-otg.dts | 18 ++++++++++++++++++ .../overlays/rk3528-fiq-debugger-uart1m0.dts | 2 +- .../overlays/rk3528-fiq-debugger-uart3m0.dts | 2 +- .../overlays/rk3528-fiq-debugger-uart3m1.dts | 2 +- .../overlays/rk3528-fiq-debugger-uart7m0.dts | 2 +- .../dts/rockchip/overlays/rk3528-pwm0-m0.dts | 2 +- .../dts/rockchip/overlays/rk3528-pwm3-m0.dts | 2 +- .../dts/rockchip/overlays/rk3528-pwm4-m0.dts | 2 +- .../dts/rockchip/overlays/rk3528-pwm5-m0.dts | 2 +- .../dts/rockchip/overlays/rk3528-uart0-m0.dts | 2 +- .../dts/rockchip/overlays/rk3528-uart1-m0.dts | 2 +- .../dts/rockchip/overlays/rk3528-uart3-m0.dts | 2 +- .../dts/rockchip/overlays/rk3528-uart3-m1.dts | 2 +- .../dts/rockchip/overlays/rk3528-uart7-m0.dts | 2 +- 15 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 arch/arm64/boot/dts/rockchip/overlays/rk3528-dwc3-otg.dts diff --git a/arch/arm64/boot/dts/rockchip/overlays/Makefile b/arch/arm64/boot/dts/rockchip/overlays/Makefile index 4088fe53..d3177d32 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/Makefile +++ b/arch/arm64/boot/dts/rockchip/overlays/Makefile @@ -105,6 +105,7 @@ dtb-$(CONFIG_CPU_RK3399) += \ rock-4-radxa-display-10hd.dtbo dtb-$(CONFIG_CLK_RK3528) += \ + rk3528-dwc3-otg.dtbo \ rk3528-fiq-debugger-uart1m0.dtbo \ rk3528-fiq-debugger-uart3m0.dtbo \ rk3528-fiq-debugger-uart3m1.dtbo \ diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-dwc3-otg.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-dwc3-otg.dts new file mode 100644 index 00000000..2895a65c --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-dwc3-otg.dts @@ -0,0 +1,18 @@ +// ROCK 2A USB OTG +/dts-v1/; +/plugin/; + +/ { + metadata { + title = "Set OTG port to be controlled by hardware switch"; + compatible = "radxa,rock-2a"; + category = "misc"; + exclusive = "usbdrd_dwc3-dr_mode"; + description = "Set OTG port to be controlled by hardware switch."; + }; +}; + +&usbdrd_dwc3 { + status = "okay"; + dr_mode = "otg"; +}; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts index 890d6a7a..37076830 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart1m0.dts @@ -21,5 +21,5 @@ }; &uart1 { - status = "disabled"; + status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts index d4937d21..55f38873 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m0.dts @@ -21,5 +21,5 @@ }; &uart3 { - status = "disabled"; + status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts index d007594a..3f982cd5 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart3m1.dts @@ -21,5 +21,5 @@ }; &uart3 { - status = "disabled"; + status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts index dfa858a7..13fe4e60 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-fiq-debugger-uart7m0.dts @@ -21,5 +21,5 @@ }; &uart7 { - status = "disabled"; + status = "disabled"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts index e00ec2c5..cb1aae8f 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm0-m0.dts @@ -12,7 +12,7 @@ }; &pwm0 { - status = "disabled"; + status = "disabled"; pinctrl-names = "active"; pinctrl-0 = <&pwm0m0_pins>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts index ccecd1f7..0b0c34eb 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm3-m0.dts @@ -12,7 +12,7 @@ }; &pwm3 { - status = "disabled"; + status = "disabled"; pinctrl-names = "active"; pinctrl-0 = <&pwm3m0_pins>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts index 5f971f6f..9cdb6f7a 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm4-m0.dts @@ -12,7 +12,7 @@ }; &pwm4 { - status = "disabled"; + status = "disabled"; pinctrl-names = "active"; pinctrl-0 = <&pwm4m0_pins>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts index f3b2cc9f..cf0501f4 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-pwm5-m0.dts @@ -12,7 +12,7 @@ }; &pwm5 { - status = "disabled"; + status = "disabled"; pinctrl-names = "active"; pinctrl-0 = <&pwm5m0_pins>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts index e6f166b5..200d782b 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart0-m0.dts @@ -18,5 +18,5 @@ }; &uart0 { - status = "okay"; + status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts index f38c269d..f29b3d90 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart1-m0.dts @@ -12,7 +12,7 @@ }; &uart1 { - status = "okay"; + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&uart1m0_xfer>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts index ae955b0f..79e76979 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m0.dts @@ -12,7 +12,7 @@ }; &uart3 { - status = "okay"; + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&uart3m0_xfer>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts index 880ac3cf..1a43b974 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart3-m1.dts @@ -12,7 +12,7 @@ }; &uart3 { - status = "okay"; + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&uart3m1_xfer>; }; diff --git a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts index 31a98d90..8c1eac2c 100644 --- a/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts +++ b/arch/arm64/boot/dts/rockchip/overlays/rk3528-uart7-m0.dts @@ -12,7 +12,7 @@ }; &uart7 { - status = "okay"; + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&uart7m0_xfer>; };