ramips: improve F5D8235 V1 support
authorTobias Wolf <git-NTEO@vplace.de>
Thu, 1 Dec 2016 14:08:22 +0000 (15:08 +0100)
committerMathias Kresin <dev@kresin.me>
Sun, 4 Dec 2016 06:03:17 +0000 (07:03 +0100)
This fixes the partition name for the firmware splitter, the cfi
address and adds the mtd-eeprom address for wmac. It adds additional
LEDs and make use of them in diag.sh and 01_leds.

Please note that the ":blue:wired" LED is used because the
":blue:router" behaviour is unpredictable for failsafe indication. The
issue with the router LED is that you have two states only.
"off" is steady on and "on" blinks. Therefore the wired LED is more
suitable.

Furthermore it reuses the correct switch configuration definition to
reflect the device ports and numbering. Additionally fixes the issue
that the default configuration is not applied as no port 6 exists on
this device.

Signed-off-by: Tobias Wolf <github-NTEO@vplace.de>
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/etc/diag.sh
target/linux/ramips/dts/F5D8235_V1.dts

index f6dbf30a58772d743f715709fc8ccf885d3286d2..ab077bff13d3be31dbd6f25306a70de7fa6ec29c 100755 (executable)
@@ -158,7 +158,11 @@ ex2700)
        ucidef_set_led_default "power_r" "POWER (red)" "$board:red:power" "0"
        set_wifi_led "$board:green:router"
        ;;
-f5d8235-v1|\
+f5d8235-v1)
+       ucidef_set_led_default "lan" "lan" "$board:blue:wired" "0"
+       set_usb_led "$board:blue:storage"
+       set_wifi_led "$board:blue:wireless"
+       ;;
 f5d8235-v2)
        set_usb_led "$board:blue:storage"
        ;;
index e3e65506a9649ae3ee6689186b17a16e9136890a..0eaa440eb26f7cac96ed70b0c93cc4bb683ae915 100755 (executable)
@@ -130,7 +130,6 @@ ramips_setup_interfaces()
        c50|\
        dir-645|\
        dir-860l-b1|\
-       f5d8235-v1|\
        f5d8235-v2|\
        gl-mt300a|\
        gl-mt300n|\
@@ -236,6 +235,7 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
                ;;
+       f5d8235-v1|\
        tew-714tru|\
        v11st-fe|\
        wzr-agl300nh)
index 6bcdc0f5bcaf634c9375fd61b9f5e207baba9597..abbe147d840332c36916176b4837b04765dc2755 100644 (file)
@@ -126,6 +126,9 @@ get_status_led() {
        pbr-d1)
                status_led="$board:orange:power"
                ;;
+       f5d8235-v1)
+               status_led="$board:blue:wired"
+               ;;
        f5d8235-v2)
                status_led="$board:blue:router"
                ;;
index 74e423c26544e9bc010b04c948a002effa7a5ba0..4d95860aa2c23aeeaedf11b1b6b38aa254f1ccbf 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "rt2880.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
 / {
@@ -12,7 +13,7 @@
 
        cfi@1f000000 {
                compatible = "cfi-flash";
-               reg = <0x1f000000 0x800000>;
+               reg = <0xbc400000 0x800000>;
                bank-width = <2>;
                device-width = <2>;
                #address-cells = <1>;
                };
 
                partition@50000 {
-                       label = "linux";
-                       reg = <0x50000 0x3b0000>;
+                       label = "firmware";
+                       reg = <0x50000 0x7b0000>;
                };
        };
 
        rtl8366s {
                compatible = "realtek,rtl8366s";
-               gpio-sda = <&gpio0 1 0>;
-               gpio-sck = <&gpio0 2 0>;
+               gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
+               gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
        };
 
        gpio-keys-polled {
 
                wps {
                        label = "wps";
-                       gpios = <&gpio0 0 1>;
+                       gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WPS_BUTTON>;
                };
 
                reset {
                        label = "reset";
-                       gpios = <&gpio0 9 1>;
+                       gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
                };
        };
        gpio-leds {
                compatible = "gpio-leds";
 
+               internet {
+                       label = "f5d8235-v1:blue:internet";
+                       gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
+               };
+
+               internet2 {
+                       label = "f5d8235-v1:amber:internet";
+                       gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
+               };
+
+               modem {
+                       label = "f5d8235-v1:blue:modem";
+                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+               };
+
+               modem2 {
+                       label = "f5d8235-v1:amber:modem";
+                       gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
+               };
+
+               router {
+                       label = "f5d8235-v1:blue:router";
+                       gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
+               };
+
                storage {
                        label = "f5d8235-v1:blue:storage";
-                       gpios = <&gpio0 7 1>;
+                       gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
                };
 
                storage2 {
-                       label = "f5d8235-v1:orange:storage";
-                       gpios = <&gpio0 8 1>;
+                       label = "f5d8235-v1:amber:storage";
+                       gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
+               };
+
+               security {
+                       label = "f5d8235-v1:blue:security";
+                       gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
+               };
+
+               security2 {
+                       label = "f5d8235-v1:amber:security";
+                       gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+               };
+
+               wired {
+                       label = "f5d8235-v1:blue:wired";
+                       gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
+               };
+
+               wired2 {
+                       label = "f5d8235-v1:amber:wired";
+                       gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
+               };
+
+               wireless {
+                       label = "f5d8235-v1:blue:wireless";
+                       gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+               };
+
+               wireless2 {
+                       label = "f5d8235-v1:amber:wireless";
+                       gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
                };
        };
 };
 &pinctrl {
        state_default: pinctrl0 {
                gpio {
-                       ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+                       ralink,group = "spi", "i2c", "jtag", "mdio", "uartlite";
                        ralink,function = "gpio";
                };
        };
        };
 };
 
-/* FIXME: no u-boot partition and 0x40000@uboot is out of boundaries */
-/*&wmac {
+&wmac {
        status = "okay";
-       ralink,mtd-eeprom = <&u-boot 0x40000>;
+       ralink,mtd-eeprom = <&factory 0x0>;
 };
-*/
-