kirkwood: use generic diag.sh
This commit removes the target-specific diag.sh script. This way, the generic one is used for the target, which uses DT-aliases to specify the LEDs used. Generic diag.sh allow to use different LEDs to indicate different states. Non-red status LEDs for indicating boot and a running system. Where possible, the red or orange LEDs are used to indicate failsafe mode and a running upgrade. Compile-tested: all target devices. Run-tested: CheckPoint L-50 Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> [remove unrelated cosmetic changes, rename some labels, add pogo_e02] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>master
parent
a9b5473c92
commit
ae67f5ffae
@ -1,55 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2014 OpenWrt.org
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/leds.sh
|
||||
|
||||
get_status_led() {
|
||||
case $(board_name) in
|
||||
cisco,on100)
|
||||
status_led="on100:green:health"
|
||||
;;
|
||||
cloudengines,pogoe02)
|
||||
status_led="pogo_e02:orange:fault"
|
||||
;;
|
||||
cloudengines,pogoplugv4)
|
||||
status_led="pogoplugv4:green:health"
|
||||
;;
|
||||
iom,ix2-200)
|
||||
status_led="status:white:power_led"
|
||||
;;
|
||||
linksys,audi)
|
||||
status_led="audi:green:power"
|
||||
;;
|
||||
linksys,viper)
|
||||
status_led="viper:white:health"
|
||||
;;
|
||||
seagate,dockstar|\
|
||||
seagate,goflexhome|\
|
||||
seagate,goflexnet)
|
||||
status_led="status:orange:fault"
|
||||
;;
|
||||
zyxel,nsa310b)
|
||||
status_led="nsa310:green:sys"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
set_state() {
|
||||
get_status_led
|
||||
|
||||
case "$1" in
|
||||
preinit)
|
||||
status_led_blink_preinit
|
||||
;;
|
||||
failsafe)
|
||||
status_led_blink_failsafe
|
||||
;;
|
||||
preinit_regular)
|
||||
status_led_blink_preinit_regular
|
||||
;;
|
||||
done)
|
||||
status_led_on
|
||||
;;
|
||||
esac
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
--- a/arch/arm/boot/dts/kirkwood-pogo_e02.dts
|
||||
+++ b/arch/arm/boot/dts/kirkwood-pogo_e02.dts
|
||||
@@ -22,6 +22,13 @@
|
||||
compatible = "cloudengines,pogoe02", "marvell,kirkwood-88f6281",
|
||||
"marvell,kirkwood";
|
||||
|
||||
+ aliases {
|
||||
+ led-boot = &led_health;
|
||||
+ led-failsafe = &led_fault;
|
||||
+ led-running = &led_health;
|
||||
+ led-upgrade = &led_fault;
|
||||
+ };
|
||||
+
|
||||
memory {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x10000000>;
|
||||
@@ -35,12 +42,11 @@
|
||||
gpio-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
- health {
|
||||
+ led_health: health {
|
||||
label = "pogo_e02:green:health";
|
||||
gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
|
||||
- default-state = "keep";
|
||||
};
|
||||
- fault {
|
||||
+ led_fault: fault {
|
||||
label = "pogo_e02:orange:fault";
|
||||
gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
|
||||
};
|
@ -0,0 +1,31 @@
|
||||
--- a/arch/arm/boot/dts/kirkwood-pogo_e02.dts
|
||||
+++ b/arch/arm/boot/dts/kirkwood-pogo_e02.dts
|
||||
@@ -20,6 +20,13 @@
|
||||
compatible = "cloudengines,pogoe02", "marvell,kirkwood-88f6281",
|
||||
"marvell,kirkwood";
|
||||
|
||||
+ aliases {
|
||||
+ led-boot = &led_health;
|
||||
+ led-failsafe = &led_fault;
|
||||
+ led-running = &led_health;
|
||||
+ led-upgrade = &led_fault;
|
||||
+ };
|
||||
+
|
||||
memory {
|
||||
device_type = "memory";
|
||||
reg = <0x00000000 0x10000000>;
|
||||
@@ -33,12 +40,11 @@
|
||||
gpio-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
- health {
|
||||
+ led_health: health {
|
||||
label = "pogo_e02:green:health";
|
||||
gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
|
||||
- default-state = "keep";
|
||||
};
|
||||
- fault {
|
||||
+ led_fault: fault {
|
||||
label = "pogo_e02:orange:fault";
|
||||
gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
|
||||
};
|
Loading…
Reference in New Issue