mpc85xx: use generic diag.sh
authorDavid Bauer <mail@david-bauer.net>
Wed, 16 Jan 2019 23:43:12 +0000 (00:43 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 26 Jan 2019 16:10:19 +0000 (17:10 +0100)
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.

This way, we are also able to use different LEDs to indicate different
states. We use green status LEDs for indicating boot and a running
system. Where possible, the red status LED is used to indicate failsafe
mode and a running upgrade.

Signed-off-by: David Bauer <mail@david-bauer.net>
target/linux/mpc85xx/base-files/etc/diag.sh [deleted file]
target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts

diff --git a/target/linux/mpc85xx/base-files/etc/diag.sh b/target/linux/mpc85xx/base-files/etc/diag.sh
deleted file mode 100644 (file)
index e344d4b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2013 OpenWrt.org
-
-. /lib/functions.sh
-. /lib/functions/leds.sh
-
-get_status_led() {
-       case $(board_name) in
-       aerohive,hiveap-330)
-               status_led="hiveap-330:green:tricolor0"
-               ;;
-       sophos,red-15w-rev1)
-               status_led="red-15w-rev1:green:system"
-               ;;
-       tplink,tl-wdr4900-v1)
-               status_led="tp-link:blue:system"
-               ;;
-       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
-}
index 5e732664aa736628e59dbabe6e7c7c4dd52a4394..c4abc905e9802d1080e6fdbbf2396f3f029933e2 100644 (file)
        model = "Aerohive HiveAP-330";
        compatible = "aerohive,hiveap-330";
 
+       aliases {
+               led-boot = &tricolor_green;
+               led-failsafe = &tricolor_red;
+               led-running = &tricolor_green;
+               led-upgrade = &tricolor_red;
+       };
+
        chosen {
                bootargs-override = "console=ttyS0,9600";
        };
                                compatible = "national,lp5521";
                                reg = <0x32>;
                                clock-mode = /bits/ 8 <2>;
-                               chan0 {
+                               tricolor_red: chan0 {
                                        chan-name = "hiveap-330:red:tricolor0";
                                        led-cur = /bits/ 8 <0x2f>;
                                        max-cur = /bits/ 8 <0x5f>;
                                };
-                               chan1 {
+                               tricolor_green:chan1 {
                                        chan-name = "hiveap-330:green:tricolor0";
                                        led-cur = /bits/ 8 <0x2f>;
                                        max-cur = /bits/ 8 <0x5f>;
index 600426bb6e1e16a5104a018315bb150314ee1554..40b8014a53e05700b2850774201e41036401d0c2 100644 (file)
@@ -6,6 +6,13 @@
        model = "Sophos RED 15w Rev.1";
        compatible = "sophos,red-15w-rev1";
 
+       aliases {
+               led-boot = &system_green;
+               led-failsafe = &system_red;
+               led-running = &system_green;
+               led-upgrade = &system_red;
+       };
+
        memory {
                device_type = "memory";
        };
        leds {
                compatible = "gpio-leds";
 
-               system_green {
+               system_green: system_green {
                        gpios = <&gpio0 7 0>;
                        label = "red-15w-rev1:green:system";
                };
 
-               system_red {
+               system_red: system_red {
                        gpios = <&gpio0 3 0>;
                        label = "red-15w-rev1:red:system";
                };
index 0969b272a84b845c5e5c584758801e411b31b2f9..ab4952aad579b0d406027c469ec9f86286111f30 100644 (file)
 
        aliases {
                spi0 = &spi0;
+               led-boot = &system_green;
+               led-failsafe = &system_green;
+               led-running = &system_green;
+               led-upgrade = &system_green;
        };
 
        memory {
        leds {
                compatible = "gpio-leds";
 
-               system {
+               system_green: system {
                        gpios = <&gpio0 2 1>; /* active low */
                        label = "tp-link:blue:system";
                };