riscv: defconfig: enable "heartbeat" led trigger
Subsystems (3)
PATCH v3 1/4 riscv: defconfig: enable "heartbeat" led trigger
following JH7110 based boards have a LED for heartbeat.
- Milk-V Mars
- Pine64 Star64
- StarFive VisionFive 2
This patch adds and enables related configuration for it.
Changes in v2:
- reword commit message to include other JH7110 based boards
--- arch/riscv/configs/defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
arch/riscv/configs/defconfig +6 -0
@@ -147,6 +147,7 @@ CONFIG_MICREL_PHY=y CONFIG_MICROSEMI_PHY=y CONFIG_MOTORCOMM_PHY=y CONFIG_CAN_RCAR_CANFD=m +# CONFIG_INPUT_LEDS is not set CONFIG_INPUT_MOUSEDEV=y CONFIG_KEYBOARD_SUN4I_LRADC=m CONFIG_SERIAL_8250=y
@@ -246,6 +247,11 @@ CONFIG_MMC_DW=y CONFIG_MMC_DW_STARFIVE=y CONFIG_MMC_SDHI=y CONFIG_MMC_SUNXI=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_SUN6I=y CONFIG_DMADEVICES=y
Signature · 1 line
2.43.0
PATCH v3 2/4 riscv: dts: starfive: enable heartbeat LED for Milk-V Mars
Milk-V Mars has a green LED to show system load[1]. This patch enables a green LED as a heartbeat LED.
Changes in v3:
- add default-state = "on" to turn LED on at U-Boot (not enabled yet) Changes in v2:
- reorder properties in led-0
--- arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts +14 -0
@@ -4,11 +4,25 @@ */ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/leds/common.h> #include "jh7110-common.dtsi" / { model = "Milk-V Mars"; compatible = "milkv,mars", "starfive,jh7110"; + + leds { + compatible = "gpio-leds"; + + led-0 { + gpios = <&aongpio 3 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_GREEN>; + default-state = "on"; + function = LED_FUNCTION_HEARTBEAT; + linux,default-trigger = "heartbeat"; + }; + }; }; &gmac0 {
Signature · 1 line
2.43.0
Re: [PATCH v3 2/4] riscv: dts: starfive: enable heartbeat LED for Milk-V Mars
Quoted 32 lines · FUKAUMI Naoki
Milk-V Mars has a green LED to show system load[1]. This patch enables a green LED as a heartbeat LED.
Signed-off-by FUKAUMI Naoki <[email protected]>Changes in v3:
- add default-state = "on" to turn LED on at U-Boot (not enabled yet) Changes in v2:
- reorder properties in led-0--- arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts +4
-0@@ -4,11 +4,25 @@ */ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/leds/common.h> #include "jh7110-common.dtsi" / { model = "Milk-V Mars"; compatible = "milkv,mars", "starfive,jh7110"; + + leds {
arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts line 25
Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts +10
-0+ compatible = "gpio-leds"; + + led-0 { + gpios = <&aongpio 3 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_GREEN>; + default-state = "on"; + function = LED_FUNCTION_HEARTBEAT; + linux,default-trigger = "heartbeat"; + }; + };
Hi Naoki
Thanks for adding the other boards too. As mentioned previously [1] boards should not add functions to LEDs unless the hardware clearly defines a function for them, and nothing on these boards mention that it should be a heartbeeat. As you said on IRC userland can easily add whatever function they want.
Also please add a cover letter when you're sending multiple patches. Eg. use git format-patch --cover-letter
/Emil
Quoted 6 lines
arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts +0
-1}; &gmac0 { --2.43.0
Re: [PATCH v3 2/4] riscv: dts: starfive: enable heartbeat LED for Milk-V Mars
Hi
On 7/1/24 21:28, Emil Renner Berthing wrote:
(snip)
Quoted 6 lines
Hi Naoki
Thanks for adding the other boards too. As mentioned previously [1] boards should not add functions to LEDs unless the hardware clearly defines a function for them, and nothing on these boards mention that it should be a heartbeeat. As you said on IRC userland can easily add whatever function they want.
on behalf of MilkV Technology, what should we do to add function to LED?
I think even if hardware clearly defines a function, you'll say userland can easily do it. any objections?
--
FUKAUMI Naoki
Shenzhen MilkV Technology Co., Ltd.
Quoted 15 lines
Also please add a cover letter when you're sending multiple patches. Eg. use git format-patch --cover-letter
/Emil
Quoted 6 lines
};&gmac0 {
--
2.43.0
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
PATCH v3 3/4 riscv: dts: starfive: enable heartbeat LED for Pine64 Star64
In reply to FUKAUMI NaokiPine64 Star64 has a blue LED to show system load[1]. This patch enables a blue LED as a heartbeat LED.
Changes in v3:
- add default-state = "on" to turn LED on at U-Boot (not enabled yet) Changes in v2:
- new
--- .../boot/dts/starfive/jh7110-pine64-star64.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts +14 -0
@@ -4,6 +4,8 @@ */ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/leds/common.h> #include "jh7110-common.dtsi" / {
@@ -12,6 +14,18 @@ / { aliases { ethernet1 = &gmac1; }; + + leds { + compatible = "gpio-leds"; + + led-0 { + gpios = <&aongpio 3 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_BLUE>; + default-state = "on"; + function = LED_FUNCTION_HEARTBEAT; + linux,default-trigger = "heartbeat"; + }; + }; }; &gmac0 {
Signature · 1 line
2.43.0
PATCH v3 4/4 riscv: dts: starfive: enable heartbeat LED for StarFive VisionFive 2
In reply to FUKAUMI NaokiStarFive VisionFive 2 has a green LED to show system load[1]. This patch enables a green LED as a heartbeat LED.
Changes in v3:
- add default-state = "on" to turn LED on at U-Boot (not enabled yet) Changes in v2:
- new
--- .../dts/starfive/jh7110-starfive-visionfive-2.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +14 -0
@@ -5,12 +5,26 @@ */ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/leds/common.h> #include "jh7110-common.dtsi" / { aliases { ethernet1 = &gmac1; }; + + leds { + compatible = "gpio-leds"; + + led-0 { + gpios = <&aongpio 3 GPIO_ACTIVE_HIGH>; + color = <LED_COLOR_ID_GREEN>; + default-state = "on"; + function = LED_FUNCTION_HEARTBEAT; + linux,default-trigger = "heartbeat"; + }; + }; }; &gmac1 {
Signature · 1 line
2.43.0