]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
starfive: add GPIO LEDs to VF1 and VF2
authorZoltan HERPAI <wigyori@uid0.hu>
Sun, 1 Jun 2025 13:18:38 +0000 (13:18 +0000)
committerZoltan HERPAI <wigyori@uid0.hu>
Sun, 22 Mar 2026 11:41:54 +0000 (12:41 +0100)
Both boards have status LEDs, which we can use to
indicate running state.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
target/linux/starfive/image/Makefile
target/linux/starfive/patches-6.12/1023-riscv-dts-starfive-visionfive2-add-SYSLED-support.patch [new file with mode: 0644]
target/linux/starfive/patches-6.12/1024-riscv-dts-starfive-visionfive2-add-LED-aliases-and-s.patch [new file with mode: 0644]

index 2d6aacad6a419678a0bb31537185540848e735c5..7099f7592ae76e8ca39e453b92597021e0ea3e53 100644 (file)
@@ -52,7 +52,7 @@ define Device/visionfive2-v1.2a
   DEVICE_VENDOR := StarFive
   DEVICE_MODEL := VisionFive2 v1.2a
   DEVICE_DTS := starfive/jh7110-starfive-visionfive-2-v1.2a
-  DEVICE_PACKAGES := kmod-eeprom-at24
+  DEVICE_PACKAGES := kmod-eeprom-at24 kmod-leds-gpio
 endef
 TARGET_DEVICES += visionfive2-v1.2a
 
@@ -60,7 +60,7 @@ define Device/visionfive2-v1.3b
   DEVICE_VENDOR := StarFive
   DEVICE_MODEL := VisionFive2 v1.3b
   DEVICE_DTS := starfive/jh7110-starfive-visionfive-2-v1.3b
-  DEVICE_PACKAGES := kmod-eeprom-at24
+  DEVICE_PACKAGES := kmod-eeprom-at24 kmod-leds-gpio
 endef
 TARGET_DEVICES += visionfive2-v1.3b
 
@@ -77,7 +77,8 @@ define Device/visionfive-v1
   DEVICE_VENDOR := StarFive
   DEVICE_MODEL := VisionFive v1
   DEVICE_DTS := starfive/jh7100-starfive-visionfive-v1
-  DEVICE_PACKAGES := kmod-eeprom-at24 kmod-brcmfmac cypress-firmware-43430-sdio wpad-basic-mbedtls
+  DEVICE_PACKAGES := kmod-eeprom-at24 kmod-brcmfmac cypress-firmware-43430-sdio wpad-basic-mbedtls \
+                       kmod-leds-gpio
 endef
 TARGET_DEVICES += visionfive-v1
 
diff --git a/target/linux/starfive/patches-6.12/1023-riscv-dts-starfive-visionfive2-add-SYSLED-support.patch b/target/linux/starfive/patches-6.12/1023-riscv-dts-starfive-visionfive2-add-SYSLED-support.patch
new file mode 100644 (file)
index 0000000..c589847
--- /dev/null
@@ -0,0 +1,34 @@
+From 3a92ee5a97f030bdb1e88272a5d277ecb76836d6 Mon Sep 17 00:00:00 2001
+From: Zoltan HERPAI <wigyori@uid0.hu>
+Date: Sun, 1 Jun 2025 14:03:30 +0000
+Subject: [PATCH 7/8] riscv: dts: starfive: visionfive2: add SYSLED support
+
+A SYS LED is available at aongpio-3. Add standard heartbeat
+support for it.
+
+Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
+---
+ .../dts/starfive/jh7110-starfive-visionfive-2.dtsi   | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
++++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
+@@ -21,6 +21,18 @@
+                       reg = <0x0 0x6ce00000 0x0 0x1600000>;
+               };
+       };
++
++      leds {
++              compatible = "gpio-leds";
++
++              led-ack {
++                      gpios = <&aongpio 3 GPIO_ACTIVE_HIGH>;
++                      color = <LED_COLOR_ID_GREEN>;
++                      function = LED_FUNCTION_HEARTBEAT;
++                      linux,default-trigger = "heartbeat";
++                      label = "ack";
++              };
++      };
+ };
+ &gmac1 {
diff --git a/target/linux/starfive/patches-6.12/1024-riscv-dts-starfive-visionfive2-add-LED-aliases-and-s.patch b/target/linux/starfive/patches-6.12/1024-riscv-dts-starfive-visionfive2-add-LED-aliases-and-s.patch
new file mode 100644 (file)
index 0000000..cbb6c7e
--- /dev/null
@@ -0,0 +1,43 @@
+From d930d3d22dcca6946dbdc822d7b8681f0d6372e5 Mon Sep 17 00:00:00 2001
+From: Zoltan HERPAI <wigyori@uid0.hu>
+Date: Sun, 1 Jun 2025 14:06:04 +0000
+Subject: [PATCH 8/8] riscv: dts: starfive: visionfive2: add LED aliases and
+ stop heartbeat
+
+Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
+---
+ .../boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi   | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
++++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
+@@ -6,10 +6,15 @@
+ /dts-v1/;
+ #include "jh7110-common.dtsi"
++#include <dt-bindings/leds/common.h>
+ / {
+       aliases {
+               ethernet1 = &gmac1;
++              led-boot = &led_ack;
++              led-failsafe = &led_ack;
++              led-running = &led_ack;
++              led-upgrade = &led_ack;
+       };
+       reserved-memory {
+@@ -25,11 +30,11 @@
+       leds {
+               compatible = "gpio-leds";
+-              led-ack {
++              led_ack: led-ack {
+                       gpios = <&aongpio 3 GPIO_ACTIVE_HIGH>;
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_HEARTBEAT;
+-                      linux,default-trigger = "heartbeat";
++                      default-state = "on";
+                       label = "ack";
+               };
+       };