ramips: improve Skylab SKW92A support
authorMathias Kresin <dev@kresin.me>
Mon, 26 Nov 2018 11:34:48 +0000 (12:34 +0100)
committerMathias Kresin <dev@kresin.me>
Mon, 26 Nov 2018 14:54:22 +0000 (15:54 +0100)
Use the generic board detection instead of the target specific one as
all recent additions are doing.

Add the wireless led according the gpio number from the datasheet.
Rename the board part of the leds to match the name used for the
compatible string. Finally, do not hijack the wps led for boot status
indication longer than necessary.

Merge userspace config into existing cases.

Include the manufacture Name in the dts model string.

Signed-off-by: Mathias Kresin <dev@kresin.me>
target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/SKW92A.dts
target/linux/ramips/image/mt76x8.mk

index 2f83f221f1c7a52ce5164039318f07357d9dc99f..6d4bca8029ed91071b0df50a415baff9abc371ba 100755 (executable)
@@ -17,6 +17,7 @@ case $board in
        set_wifi_led "$boardname:amber:wlan"
        ;;
 3g-6200nl|\
+skylab,skw92a|\
 wnce2001)
        set_wifi_led "$boardname:green:wlan"
        ;;
@@ -287,9 +288,6 @@ rt-n14u)
        ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" eth0.2
        set_wifi_led "$boardname:blue:air"
        ;;
-skw92a)
-       set_wifi_led "$boardname:green:wlan"
-       ;;
 tama,w06)
        ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
        ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
index 862eae1d4a5ab32c14d97dc41b6ac21bea16b367..12d7c86e2b5b4428736524bfb0f179e4d6654ffb 100755 (executable)
@@ -219,6 +219,7 @@ ramips_setup_interfaces()
        tl-wr840n-v4|\
        tl-wr840n-v5|\
        tl-wr841n-v13|\
+       skylab,skw92a|\
        u7628-01-128M-16M|\
        ubnt-erx|\
        ubnt-erx-sfp|\
@@ -345,10 +346,6 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8@eth0"
                ;;
-       skw92a)
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
-               ;;
        tew-638apb-v2)
                ucidef_add_switch "switch0" \
                        "4:lan" "6@eth0"
@@ -561,7 +558,7 @@ ramips_setup_macs()
                lan_mac=$(macaddr_setbit_la "$lan_mac")
                wan_mac=$(mtd_get_mac_binary factory 32772)
                ;;
-       skw92a)
+       skylab,skw92a)
                lan_mac=$(mtd_get_mac_binary factory 40)
                wan_mac=$(mtd_get_mac_binary factory 46)
                ;;
index 28d5073525ceae57b2e3340de273acfb3a041fa2..ba6a13b65becf4aa55fbd752b0a4ba321ed99534 100755 (executable)
@@ -472,9 +472,6 @@ ramips_board_detect() {
        *"SAP-G3200U3")
                name="sap-g3200u3"
                ;;
-       *"SKW92A")
-               name="skw92a"
-               ;;
        *"SL-R7205"*)
                name="sl-r7205"
                ;;
index ecc4650f68df64cd58625278157d227622ed4dd1..cb6e5c1b5a0beaf1a148577bdca16fd732ff7c85 100755 (executable)
@@ -151,7 +151,7 @@ platform_check_image() {
        rut5xx|\
        sap-g3200u3|\
        sk-wb8|\
-       skw92a|\
+       skylab,skw92a|\
        sl-r7205|\
        tama,w06|\
        tew-638apb-v2|\
index c43f9e53ea9f58fdf82002f65d12fc8558a5dada..5aaf3ce161bb6cd4969fca6e3bcd122ecc6ef6e1 100644 (file)
@@ -8,13 +8,11 @@
 
 /{
        compatible = "skylab,skw92a", "mediatek,mt7628an-soc";
-       model = "SKW92A";
+       model = "SKYLAB SKW92A";
 
        aliases {
                led-boot = &led_power;
                led-failsafe = &led_power;
-               led-running = &led_power;
-               led-upgrade = &led_power;
        };
 
        chosen {
                compatible = "gpio-leds";
 
                led_power: wps {
-                       label = "skw92:green:wps";
+                       label = "skw92a:green:wps";
                        gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
                };
+
+               wlan {
+                       label = "skw92a:green:wlan";
+                       gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
+               };
        };
 
        gpio-keys {
                        gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
-
        };
 };
 
 &pinctrl {
        state_default: pinctrl0 {
                gpio {
-                       ralink,group = "wdt", "refclk", "gpio";
+                       ralink,group = "wdt", "refclk", "wled_an";
                        ralink,function = "gpio";
                };
        };
@@ -69,7 +71,7 @@
 &spi0 {
        status = "okay";
 
-       m25p80@0 {
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
index 5f40262e843c1b421a92435ea583f8c662a41c1d..3174988f491a147b8d266e7f2b07a4218847a24c 100644 (file)
@@ -150,13 +150,13 @@ define Device/pbr-d1
 endef
 TARGET_DEVICES += pbr-d1
 
-define Device/skw92a
+define Device/skylab_skw92a
   DTS := SKW92A
   IMAGE_SIZE := 16064k
   DEVICE_TITLE := Skylab SKW92A
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
 endef
-TARGET_DEVICES += skw92a
+TARGET_DEVICES += skylab_skw92a
 
 define Device/tplink_tl-wa801nd-v5
   $(Device/tplink)