]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
rockchip: add reset button support for NanoPi R5S LTS 22700/head
authorRoman Pyatikonov <moyciti.volga.bk.ru92@gmail.com>
Mon, 30 Mar 2026 20:11:59 +0000 (23:11 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 5 Apr 2026 00:08:54 +0000 (02:08 +0200)
Backport upstream commit 954f07012794 ("arm64: dts: rockchip:
Add reset button to NanoPi R5S").

The NanoPi R5S LTS variant has a reset button wired to GPIO4_A0,
but the current OpenWrt rockchip 6.12 patch set lacks the
corresponding gpio-keys definition in rk3568-nanopi-r5s.dts.

As a result, pressing the button generates no reset event.
rockchip already includes kmod-gpio-button-hotplug by default,
so backporting the upstream DTS change restores the expected
behavior.

Rename the patch to
011-v6.17-arm64-dts-rockchip-Add-reset-button-to-NanoPi-R5S.patch
to match the upstream source.

The non-LTS NanoPi R5S leaves this pin unconnected, matching the
upstream rationale for using the shared rk3568-nanopi-r5s.dts.

Link: https://lore.kernel.org/r/20250711142138.197445-1-didi.debian@cknow.org
Signed-off-by: Roman Pyatikonov <moyciti.volga.bk.ru92@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22700
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/rockchip/patches-6.12/011-v6.17-arm64-dts-rockchip-Add-reset-button-to-NanoPi-R5S.patch [new file with mode: 0644]
target/linux/rockchip/patches-6.12/110-arm64-dts-rockchip-Update-LED-properties-for-NanoPi-.patch

diff --git a/target/linux/rockchip/patches-6.12/011-v6.17-arm64-dts-rockchip-Add-reset-button-to-NanoPi-R5S.patch b/target/linux/rockchip/patches-6.12/011-v6.17-arm64-dts-rockchip-Add-reset-button-to-NanoPi-R5S.patch
new file mode 100644 (file)
index 0000000..30c7737
--- /dev/null
@@ -0,0 +1,52 @@
+From 954f07012794a3aa7ae89e56f070eaa1643af50b Mon Sep 17 00:00:00 2001
+From: Diederik de Haas <didi.debian@cknow.org>
+Date: Fri, 11 Jul 2025 16:20:37 +0200
+Subject: [PATCH] arm64: dts: rockchip: Add reset button to NanoPi R5S
+
+The NanoPi R5S LTS version has a reset button, which is connected via
+GPIO. Note that the non-LTS version does not have the reset button and
+therefore on page 19 of the schematic version 2204 it is marked 'NC',
+but it is connected on the LTS version.
+
+Link: https://lore.kernel.org/r/20250711142138.197445-1-didi.debian@cknow.org
+Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
+Signed-off-by: Heiko Stuebner <heiko@sntech.de>
+---
+ arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+--- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
++++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
+@@ -17,6 +17,19 @@
+               ethernet0 = &gmac0;
+       };
++      gpio-keys {
++              compatible = "gpio-keys";
++              pinctrl-0 = <&gpio4_a0_k1_pin>;
++              pinctrl-names = "default";
++
++              button-reset {
++                      debounce-interval = <50>;
++                      gpios = <&gpio4 RK_PA0 GPIO_ACTIVE_LOW>;
++                      label = "RESET";
++                      linux,code = <KEY_RESTART>;
++              };
++      };
++
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+@@ -116,6 +129,12 @@
+               };
+       };
++      gpio-keys {
++              gpio4_a0_k1_pin: gpio4-a0-k1-pin {
++                      rockchip,pins = <4 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
++              };
++      };
++
+       gpio-leds {
+               lan1_led_pin: lan1-led-pin {
+                       rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
index c22fdd52b8a7896dacf31f0c60c6e74dc16133fe..e10d4b17026361ad749ff47f527899ffb892fe21 100644 (file)
@@ -21,7 +21,7 @@ Signed-off-by: Tianling Shen <cnsztl@gmail.com>
  
 --- a/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
 +++ b/arch/arm64/boot/dts/rockchip/rk3568-nanopi-r5s.dts
-@@ -39,7 +39,6 @@
+@@ -52,7 +52,6 @@
                power_led: led-power {
                        color = <LED_COLOR_ID_RED>;
                        function = LED_FUNCTION_POWER;