ath79: add support for indicating the boot state using multiple leds

Use diag.sh version used for apm821xx, ipq40xx and ipq806x, which
supports different leds for the different boot states.

The existing led sequences should be the same as before.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
[reword commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
master
Dmitry Tunin 6 years ago committed by Mathias Kresin
parent 37af596593
commit 7a873974f7
  1. 29
      target/linux/ath79/base-files/etc/diag.sh
  2. 5
      target/linux/ath79/dts/ar7161_dlink_dir-825-b1.dts
  3. 5
      target/linux/ath79/dts/ar7161_netgear_wndr3700.dtsi
  4. 7
      target/linux/ath79/dts/ar7240_netgear_wnr612-v2.dtsi
  5. 5
      target/linux/ath79/dts/ar7240_tplink_tl-wr74xn-v1.dtsi
  6. 5
      target/linux/ath79/dts/ar7241_tplink.dtsi
  7. 5
      target/linux/ath79/dts/ar7241_ubnt_unifi.dts
  8. 5
      target/linux/ath79/dts/ar7242_avm_fritz300e.dts
  9. 5
      target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts
  10. 5
      target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts
  11. 5
      target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts
  12. 4
      target/linux/ath79/dts/ar9330_glinet_ar150.dts
  13. 5
      target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts
  14. 5
      target/linux/ath79/dts/ar9331_pisen_wmm003n.dts
  15. 5
      target/linux/ath79/dts/ar9331_tplink_tl-mr3020-v1.dts
  16. 7
      target/linux/ath79/dts/ar9331_tplink_tl-wr703n_tl-mr10u.dtsi
  17. 7
      target/linux/ath79/dts/ar9331_tplink_tl-wr741nd-v4.dtsi
  18. 5
      target/linux/ath79/dts/ar9341_pcs_cr3000.dts
  19. 5
      target/linux/ath79/dts/ar9344_ocedo_raccoon.dts
  20. 5
      target/linux/ath79/dts/ar9344_pcs_cap324.dts
  21. 5
      target/linux/ath79/dts/ar9344_pcs_cr5000.dts
  22. 5
      target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi
  23. 5
      target/linux/ath79/dts/qca9533_tplink_tl-wr841-v11.dts
  24. 5
      target/linux/ath79/dts/qca9533_tplink_tl-wr841-v9.dts
  25. 5
      target/linux/ath79/dts/qca9557_iodata_wn-ac1600dgr2.dts
  26. 5
      target/linux/ath79/dts/qca9558_buffalo_bhr-4grv2.dts
  27. 5
      target/linux/ath79/dts/qca9558_ocedo_koala.dts
  28. 5
      target/linux/ath79/dts/qca9558_tplink_archer-c7.dtsi
  29. 5
      target/linux/ath79/dts/qca9558_tplink_tl-wdr4900-v2.dts
  30. 5
      target/linux/ath79/dts/qca9558_tplink_tl-wr1043nd.dtsi
  31. 5
      target/linux/ath79/dts/qca9563_phicomm_k2t.dts
  32. 5
      target/linux/ath79/dts/qca9563_tplink_re450-v2.dts
  33. 5
      target/linux/ath79/dts/qca9563_tplink_tl-wr1043n.dtsi

@ -2,21 +2,46 @@
. /lib/functions/leds.sh
status_led="$(get_dt_led status)"
boot="$(get_dt_led boot)"
failsafe="$(get_dt_led failsafe)"
running="$(get_dt_led running)"
upgrade="$(get_dt_led upgrade)"
get_status_led() {
status_led="$boot"
}
set_state() {
status_led="$boot"
case "$1" in
preinit)
status_led_blink_preinit
;;
failsafe)
status_led_off
[ -n "$running" ] && {
status_led="$running"
status_led_off
}
status_led="$failsafe"
status_led_blink_failsafe
;;
preinit_regular)
status_led_blink_preinit_regular
;;
upgrade)
[ -n "$running" ] && {
status_led="$upgrade"
status_led_blink_preinit_regular
}
;;
done)
status_led_on
status_led_off
[ -n "$running" ] && {
status_led="$running"
status_led_on
}
;;
esac
}

@ -11,7 +11,10 @@
model = "D-Link DIR825B1";
aliases {
led-status = &orange_power;
led-boot = &orange_power;
led-failsafe = &orange_power;
led-running = &orange_power;
led-upgrade = &orange_power;
};
chosen {

@ -8,7 +8,10 @@
/ {
aliases {
led-status = &power_green;
led-boot = &power_green;
led-failsafe = &power_green;
led-running = &power_green;
led-upgrade = &power_green;
};
chosen {

@ -11,7 +11,10 @@
model = "Netgear WNR612 V2";
aliases {
led-status = &led_power;
led-boot = &power;
led-failsafe = &power;
led-running = &power;
led-upgrade = &power;
};
gpio-keys-polled {
@ -28,7 +31,7 @@
gpio-leds {
compatible = "gpio-leds";
led_power: power {
power: power {
label = "netgear:green:power";
gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
};

@ -7,7 +7,10 @@
/ {
aliases {
led-status = &led_system;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
};
gpio-keys-polled {

@ -7,7 +7,10 @@
/ {
aliases {
led-status = &led_system;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
};
gpio-keys-polled {

@ -11,7 +11,10 @@
model = "Ubiquiti UniFi AP";
aliases {
led-status = &dome_green;
led-boot = &dome_green;
led-failsafe = &dome_green;
led-running = &dome_green;
led-upgrade = &dome_green;
};
extosc: ref {

@ -11,7 +11,10 @@
model = "AVM FRITZ!WLAN Repeater 300E";
aliases {
led-status = &power;
led-boot = &power;
led-failsafe = &power;
led-running = &power;
led-upgrade = &power;
};
gpio-keys {

@ -11,7 +11,10 @@
model = "TP-LINK TL-WR2543N/ND";
aliases {
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
chosen {

@ -11,7 +11,10 @@
model = "TP-Link TL-WR1043ND Version 1";
aliases {
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
extosc: ref {

@ -11,7 +11,10 @@
model = "TP-Link TL-WR941N/ND v2/v3";
aliases {
led-status = &led_system;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
};
keys {

@ -12,7 +12,9 @@
aliases {
serial0 = &uart;
led-status = &wlan;
led-boot = &wlan;
led-failsafe = &wlan;
led-upgrade = &wlan;
};
leds {

@ -11,7 +11,10 @@
compatible = "embeddedwireless,dorin", "qca,ar9331";
aliases {
led-status = &status;
led-boot = &status;
led-failsafe = &status;
led-running = &status;
led-upgrade = &status;
serial0 = &uart;
};

@ -12,7 +12,10 @@
aliases {
serial0 = &uart;
led-status = &led_system;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
};
gpio-keys-polled {

@ -12,7 +12,10 @@
aliases {
serial0 = &uart;
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
leds {

@ -9,7 +9,10 @@
/ {
aliases {
serial0 = &uart;
led-status = &led_system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
gpio-keys-polled {
@ -27,7 +30,7 @@
gpio-leds {
compatible = "gpio-leds";
led_system: system {
system: system {
label = "tl-wr703n:blue:system";
gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
};

@ -12,7 +12,10 @@
aliases {
serial0 = &uart;
led-status = &led_system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
gpio-keys-polled {
@ -64,7 +67,7 @@
gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
};
led_system: system {
system: system {
label = "tp-link:green:system";
gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
};

@ -12,7 +12,10 @@
aliases {
serial0 = &uart;
led-status = &status;
led-boot = &status;
led-failsafe = &status;
led-running = &status;
led-upgrade = &status;
};
keys {

@ -15,7 +15,10 @@
};
aliases {
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
leds {

@ -12,7 +12,10 @@
aliases {
serial0 = &uart;
led-status = &status;
led-boot = &status;
led-failsafe = &status;
led-running = &status;
led-upgrade = &status;
};
keys {

@ -12,7 +12,10 @@
aliases {
serial0 = &uart;
led-status = &status;
led-boot = &status;
led-failsafe = &status;
led-running = &status;
led-upgrade = &status;
};
keys {

@ -10,7 +10,10 @@
compatible = "tplink,tl-wdr4300";
aliases {
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
leds {

@ -11,7 +11,10 @@
model = "TP-Link TL-WR841N/ND Version 11";
aliases {
led-status = &system_led;
led-boot = &system_led;
led-failsafe = &system_led;
led-running = &system_led;
led-upgrade = &system_led;
};
};

@ -11,6 +11,9 @@
model = "TP-Link TL-WR841N/ND Version 9";
aliases {
led-status = &qss_led;
led-boot = &qss_led;
led-failsafe = &qss_led;
led-running = &qss_led;
led-upgrade = &qss_led;
};
};

@ -11,7 +11,10 @@
model = "I-O DATA WN-AC1600DGR2";
aliases {
led-status = &power;
led-boot = &power;
led-failsafe = &power;
led-running = &power;
led-upgrade = &power;
};
chosen {

@ -11,7 +11,10 @@
model = "Buffalo BHR-4GRV2";
aliases {
led-status = &power;
led-boot = &power;
led-failsafe = &power;
led-running = &power;
led-upgrade = &power;
};
chosen {

@ -15,7 +15,10 @@
};
aliases {
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
leds {

@ -12,7 +12,10 @@
};
aliases {
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
gpio_leds: leds {

@ -15,7 +15,10 @@
};
aliases {
led-status = &led_system;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
};
gpio_leds: leds {

@ -12,7 +12,10 @@
};
aliases {
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
leds {

@ -11,7 +11,10 @@
compatible = "phicomm,k2t";
aliases {
led-status = &status_red;
led-boot = &status_red;
led-failsafe = &status_red;
led-running = &status_red;
led-upgrade = &status_red;
};
chosen {

@ -15,7 +15,10 @@
};
aliases {
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
mdio-gpio0 = &mdio2;
};

@ -12,7 +12,10 @@
};
aliases {
led-status = &system;
led-boot = &system;
led-failsafe = &system;
led-running = &system;
led-upgrade = &system;
};
gpio_leds: leds {

Loading…
Cancel
Save