ramips: fix BR-6478ACv2 support
authorDaniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
Mon, 6 Aug 2018 17:52:28 +0000 (10:52 -0700)
committerMathias Kresin <dev@kresin.me>
Mon, 13 Aug 2018 06:37:19 +0000 (08:37 +0200)
The wholesale changes introduced in commit f9b8328 missed this DTS file
because it hadn't been merged yet. This patch brings it in line to match
the other mt7620a devices' DTS files.

Additionally, the Internet LED is now labeled correctly and set to unused
by default, since the WAN interface is not known in every configuration.

Using sysupgrade between images before and after this commit will require
the -F flag.

Tested-by: Rohan Murch <rohan.murch@gmail.com>
Signed-off-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
[drop internet led default setting]
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/BR-6478AC-V2.dts
target/linux/ramips/image/mt7620.mk

index 5d833e4410ba1e0ccdf5f7b50dd03d72c58b730f..b64e9d14c56c4392ecd4ee138e46f50321be3170 100755 (executable)
@@ -86,12 +86,6 @@ asl26555-16M)
 bc2)
        set_usb_led "$boardname:blue:usb"
        ;;
-br-6478ac-v2)
-       ucidef_set_led_default "power" "POWER" "$boardname:white:power" "1"
-       ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2"
-       set_wifi_led "$boardname:blue:wlan"
-       set_usb_led "$boardname:blue:usb"
-       ;;
 broadway)
        set_usb_led "$boardname:red:diskmounted"
        set_wifi_led "$boardname:red:wps_active"
@@ -185,6 +179,10 @@ vr500)
 dir-860l-b1)
        ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2"
        ;;
+edimax,br-6478ac-v2)
+       set_wifi_led "$boardname:blue:wlan"
+       set_usb_led "$boardname:blue:usb"
+       ;;
 ex2700|\
 wn3000rpv3)
        set_wifi_led "$boardname:green:router"
index 28bf815ee9afb60f38b570fb384c8d563598605b..3ae01448b513deb5a252a394785efc406dd13458 100755 (executable)
@@ -283,6 +283,11 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch1" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
                ;;
+       edimax,br-6478ac-v2|\
+       tplink,c2-v1)
+               ucidef_add_switch "switch1" \
+                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
+               ;;
        hc5*61|\
        y1s)
                ucidef_add_switch "switch0" \
@@ -342,11 +347,6 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
                ;;
-       br-6478ac-v2|\
-       tplink,c2-v1)
-               ucidef_add_switch "switch1" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
-               ;;
        tplink,tl-wr902ac-v3)
                ucidef_add_switch "switch0" \
                        "4:lan" "6@eth0"
@@ -448,10 +448,6 @@ ramips_setup_macs()
                lan_mac=$(cat /sys/class/net/eth0/address)
                wan_mac=$(mtd_get_mac_binary devdata 7)
                ;;
-       br-6478ac-v2)
-               lan_mac=$(cat /sys/class/net/eth0/address)
-               wan_mac=$(macaddr_add "$lan_mac" 2)
-               ;;
        cy-swr1100|\
        dch-m225)
                lan_mac=$(mtd_get_mac_ascii factory lanmac)
@@ -472,6 +468,10 @@ ramips_setup_macs()
        e1700)
                wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
                ;;
+       edimax,br-6478ac-v2)
+               lan_mac=$(cat /sys/class/net/eth0/address)
+               wan_mac=$(macaddr_add "$lan_mac" 2)
+               ;;
        elecom,wrc-1167ghbk2-s|\
        elecom,wrc-2533gst|\
        sk-wb8)
index 986fbdc527dad05e119fe185aa829b21e3da86f3..5741cbd2ee13f309dc5cc93f1d48f5a97e0da970 100755 (executable)
@@ -82,9 +82,6 @@ ramips_board_detect() {
        *"BR-6475nD")
                name="br-6475nd"
                ;;
-       *"BR-6478AC v2")
-               name="br-6478ac-v2"
-               ;;
        *"Broadway")
                name="broadway"
                ;;
index 51691e30fbcc84c8247b653d714bb0878bbe7650..a46925a43be196720186afca2903706865016387 100755 (executable)
@@ -241,7 +241,7 @@ platform_check_image() {
        3g-6200n|\
        3g-6200nl|\
        br-6475nd|\
-       br-6478ac-v2)
+       edimax,br-6478ac-v2)
                [ "$magic" != "43535953" ] && {
                        echo "Invalid image type."
                        return 1
index d0da5efdcd00706845aca2657eabafa65128074d..b38be1e2c27e7e376b123efe6c273cdbf6b10fa9 100644 (file)
@@ -32,8 +32,6 @@
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <20>;
 
                reset_wps {
@@ -50,8 +48,8 @@
                        label = "br-6478ac-v2:white:power";
                        gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
                };
-               wan {
-                       label = "br-6478ac-v2:blue:wan";
+               internet {
+                       label = "br-6478ac-v2:blue:internet";
                        gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
                };
                wlan {
@@ -71,7 +69,7 @@
                usb-power {
                        gpio-export,name="usb-power";
                        gpio-export,output=<1>;
-                       gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;  /* pin45 */
+                       gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
                };
        };
 };
        status = "okay";
 };
 
-
 &spi0 {
        status = "okay";
 
-       m25p80@0 {
-               #address-cells = <1>;
-               #size-cells = <1>;
+       flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0 0>;
-               linux,modalias = "m25p80", "mx25l6405d";
                spi-max-frequency = <10000000>;
 
-               partition@0 {
-                       label = "u-boot";
-                       reg = <0x0 0x30000>;
-                       read-only;
-               };
-
-               partition@30000 {
-                       label = "u-boot-env";
-                       reg = <0x30000 0x10000>;
-                       read-only;
-               };
-
-               factory: partition@40000 {
-                       label = "factory";
-                       reg = <0x40000 0x10000>;
-                       read-only;
-               };
-
-               partition@50000 {
-                       label = "cimage";
-                       reg = <0x50000 0x20000>;
-                       read-only;
-               };
-
-               partition@70000 {
-                       label = "firmware";
-                       reg = <0x00070000 0x00790000>;
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x0 0x30000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "u-boot-env";
+                               reg = <0x30000 0x10000>;
+                               read-only;
+                       };
+
+                       factory: partition@40000 {
+                               label = "factory";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@50000 {
+                               label = "cimage";
+                               reg = <0x50000 0x20000>;
+                               read-only;
+                       };
+
+                       partition@70000 {
+                               label = "firmware";
+                               reg = <0x00070000 0x00790000>;
+                       };
                };
        };
 };
 &pinctrl {
        state_default: pinctrl0 {
                gpio {
-                       ralink,group = "i2c", "uartf", "wdt", "pa",
-                                       "ephy", "nd_sd", "wled";
+                       ralink,group = "i2c", "uartf", "nd_sd";
                        ralink,function = "gpio";
                };
        };
        mediatek,port4 = "gmac";
 };
 
-
 &wmac {
        ralink,mtd-eeprom = <&factory 0>;
 };
 
 &pcie {
        status = "okay";
+};
 
-       pcie-bridge {
-               mt76@0,0 {
-                       reg = <0x0000 0 0 0 0>;
-                       device_type = "pci";
-                       mediatek,mtd-eeprom = <&factory 0x8000>;
-                       mediatek,2ghz = <0>;
-               };
+&pcie0 {
+       wifi@0,0 {
+               reg = <0x0000 0 0 0 0>;
+               mediatek,mtd-eeprom = <&factory 0x8000>;
+               mediatek,2ghz = <0>;
        };
-
 };
 
 &ehci {
index 0edea9f13ce13e3a98b4cc9cb0998049e3a1862a..c759a89f24b44237c07c55866e81ff468979a5d2 100644 (file)
@@ -475,7 +475,7 @@ define Device/tiny-ac
 endef
 TARGET_DEVICES += tiny-ac
 
-define Device/br-6478ac-v2
+define Device/edimax_br-6478ac-v2
   DTS := BR-6478AC-V2
   DEVICE_TITLE := Edimax BR-6478AC V2
   BLOCKSIZE := 64k
@@ -483,9 +483,9 @@ define Device/br-6478ac-v2
   IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
        edimax-header -s CSYS -m RN68 -f 0x70000 -S 0x01100000 | pad-rootfs | \
        append-metadata | check-size $$$$(IMAGE_SIZE)
-  DEVICE_PACKAGES := kmod-mt76
+  DEVICE_PACKAGES := kmod-mt76 kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
 endef
-TARGET_DEVICES += br-6478ac-v2
+TARGET_DEVICES += edimax_br-6478ac-v2
 
 define Device/tplink_c2-v1
   $(Device/Archer)