ath79: fix MAC address setup for TP-Link TL-WDR3600/TL-WDR4300
authorSungbo Eo <mans0n@gorani.run>
Sun, 15 Dec 2019 09:11:45 +0000 (18:11 +0900)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Fri, 20 Dec 2019 23:27:39 +0000 (00:27 +0100)
The current ethernet MAC address setup of TL-WDR4300 board is different
from the setup of stock firmware:

OpenWrt: lan = label_mac -2, wan = label_mac -2
  stock: lan = label_mac,    wan = label_mac +1

The full address assignment is as follows:
LAN  label
WAN  label + 1
5G   label
2G   label - 1

This patch changes all devices using TL-WDR4300 board:
TL-WDR3600 v1 (checked on device)
TL-WDR4300 v1 (checked on device)
TL-WDR4300 v1 (IL)

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[rephrase/extend commit title/message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ath79/dts/ar9344_tplink_tl-wdr4300.dtsi
target/linux/ath79/generic/base-files/etc/board.d/02_network

index 7071d35e2456e51a4e852de2ffecc5f7b29d5abc..dc85075bcf72f556c2059f8e3a58566105118337 100644 (file)
        pll-data = <0x06000000 0x00000101 0x00001616>;
 
        mtd-mac-address = <&uboot 0x1fc00>;
-       mtd-mac-address-increment = <(-2)>;
 
        phy-mode = "rgmii";
        phy-handle = <&phy0>;
index d16ae670b4a9734221304fcb7ddb60edffd7603a..b1b40087ef1fcb909d3cb625362e3e7b8694c7c8 100755 (executable)
@@ -390,6 +390,12 @@ ath79_setup_macs()
                base_mac=$(mtd_get_mac_binary info 0x8)
                wan_mac=$(macaddr_add "$base_mac" 1)
                ;;
+       tplink,tl-wdr3600-v1|\
+       tplink,tl-wdr4300-v1|\
+       tplink,tl-wdr4300-v1-il)
+               base_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
+               wan_mac=$(macaddr_add "$base_mac" 1)
+               ;;
        trendnet,tew-823dru)
                lan_mac=$(mtd_get_mac_text mac 0x4)
                wan_mac=$(mtd_get_mac_text mac 0x18)