ath79: Fix support for TP-LINK Archer C7 v2
authorChuanhong Guo <gch981213@gmail.com>
Tue, 17 Jul 2018 09:09:14 +0000 (17:09 +0800)
committerJohn Crispin <john@phrozen.org>
Mon, 30 Jul 2018 08:43:34 +0000 (10:43 +0200)
Remove mdio1 and phy1 handle. AR8327N is controlled through mdio0.
Add gmac-config for Archer C7.
Remove ucidef_set_interfaces_lan_wan. They can be determined by config_generate automatically.

The following are for adding support for WDR4900 v2/Archer C7 v1 and other
devices that shared the same machine file in ar71xx:
Move mtd partitions to archer-c7-v2.dts. Only Archer C7 v2 has 16M flash.
Flash on Archer C7 v1/TL-WDR4900 v2 is 8M.
Add label for wlan leds. The default trigger for archer c7/wdr4900 is different.
Move wlan5g led to archer-c7-v2.dts. 5G led on WDR4900 is connected to ar9380.
Move rfkill definition to archer-c7-v2.dts. There is no such a button on wdr4900 v2.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
target/linux/ath79/base-files/etc/board.d/02_network
target/linux/ath79/dts/qca9558_tl-archer-c7-v2.dts
target/linux/ath79/dts/qca9558_tl-archer-c7.dtsi

index 55c1a31e9fb475e9ab911938540ca1499c456189..b209bdad29068d0033f788b1e7e95aade502ac6d 100755 (executable)
@@ -50,7 +50,6 @@ ath79_setup_interfaces()
                ;;
 
        "tplink,tl-archer-c7-v2")
-               ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
                ucidef_add_switch "switch0" \
                        "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
                ;;
index 980aa35b91957fd586bd21b3f0a11c0c4851dcfe..fdb35a1791152c2f1d68ea105679bca38a6328f6 100644 (file)
        model = "TP-Link Archer C7 Version 2";
 };
 
-&rfkill {
-       gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+&gpio_keys {
+       rfkill {
+               gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+               linux,code = <KEY_RFKILL>;
+               linux,input-type = <EV_SW>;
+               debounce-interval = <60>;
+       };
 };
+
+&gpio_leds {
+       wlan5g {
+               label = "tp-link:green:wlan5g";
+               gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+               default-state = "off";
+               linux,default-trigger = "phy0tpt";
+       };
+};
+
+&mtdparts {
+       uboot: u-boot@0 {
+               reg = <0x000000 0x020000>;
+               read-only;
+       };
+
+       firmware@20000 {
+               reg = <0x020000 0xfd0000>;
+       };
+
+       art: art@ff0000 {
+               reg = <0xff0000 0x010000>;
+               read-only;
+       };
+};
\ No newline at end of file
index 08b8e9257c0d8b60d698cb3c51b0a0f3dda6a311..546a5e33c3dac22584890945f0eadb1744e7fd69 100644 (file)
@@ -15,7 +15,7 @@
                led-status = &system;
        };
 
-       leds {
+       gpio_leds: leds {
                compatible = "gpio-leds";
 
                system: system {
@@ -40,7 +40,7 @@
                        linux,default-trigger = "usbport";
                };
 
-               wlan2g {
+               led_wlan2g: wlan2g {
                        label = "tp-link:green:wlan2g";
                        gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                        gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                };
-
-               wlan5g {
-                       label = "tp-link:green:wlan5g";
-                       gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
-                       default-state = "off";
-                       linux,default-trigger = "phy0tpt";
-               };
        };
 
-       keys {
+       gpio_keys: keys {
                compatible = "gpio-keys";
                #address-cells = <1>;
                #size-cells = <0>;
                        gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
                        debounce-interval = <60>;
                };
-
-               rfkill: wifi {
-                       linux,code = <KEY_RFKILL>;
-                       linux,input-type = <EV_SW>;
-                       debounce-interval = <60>;
-               };
        };
 
        gpio-export {
                reg = <0>;
                spi-max-frequency = <25000000>;
 
-               partitions {
+               mtdparts: partitions {
                        compatible = "fixed-partitions";
                        #address-cells = <1>;
                        #size-cells = <1>;
-
-                       uboot: partition@0 {
-                               label = "u-boot";
-                               reg = <0x000000 0x020000>;
-                               read-only;
-                       };
-
-                       partition@20000 {
-                               label = "firmware";
-                               reg = <0x020000 0xfd0000>;
-                       };
-
-                       art: partition@ff0000 {
-                               label = "art";
-                               reg = <0xff0000 0x010000>;
-                               read-only;
-                       };
                };
        };
 };
        };
 };
 
-&mdio1 {
-       status = "okay";
-
-       phy1: ethernet-phy@1 {
-               reg = <1>;
-       };
-};
-
 &eth0 {
        status = "okay";
 
        mtd-mac-address = <&uboot 0x1fc00>;
        mtd-mac-address-increment = <1>;
        phy-handle = <&phy0>;
+
+       gmac-config {
+               device = <&gmac>;
+               rgmii-enabled = <1>;
+       };
 };
 
 &eth1 {
        status = "okay";
 
        mtd-mac-address = <&uboot 0x1fc00>;
-       phy-handle = <&phy1>;
 
        fixed-link {
                speed = <1000>;