mpc85xx: correct TP-LINK TL-WDR4900 MAC addresses
authorDavid Bauer <mail@david-bauer.net>
Sun, 13 Oct 2019 21:37:59 +0000 (23:37 +0200)
committerDavid Bauer <mail@david-bauer.net>
Sat, 19 Oct 2019 21:05:27 +0000 (23:05 +0200)
This commit fixes TP-Link TL-WDR4900 v1 MAC address assignment.
Previously, the MAC addrss was read for the ethernet from the "config"
partition. However, the content of this partition is dependent on the
firmware which was previously installed on the device.

Switch the MAC address source to the U-Boot partition, where the MAC
address is always present at a fixed partition. The partition was
previously already used for the WiFi MAC-addresses.

Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 07e555d8735e8fa272e3f6abd35acc9f1ab44367)
Signed-off-by: David Bauer <mail@david-bauer.net>
target/linux/mpc85xx/base-files/etc/board.d/02_network
target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts

index d6b4eebf14826dcadc72c033c66712a18373a0ce..aa33a4af963e7212d6c7eea94ac65c7b030d8c81 100755 (executable)
@@ -21,7 +21,7 @@ ocedo,panda)
 tplink,tl-wdr4900-v1)
        ucidef_add_switch "switch0" \
                "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
-       ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary config 332)"
+       ucidef_set_interface_macaddr "wan" "$(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) 1)"
        ;;
 *)
        ucidef_set_interfaces_lan_wan "eth0" "eth1"
index f9fdfc646527d2b8aa48b10e6e35b9aa0c9f5209..7b81347e1ef180f78ba844ce874ea9764f956c22 100644 (file)
@@ -48,7 +48,7 @@
                                        #address-cells = <1>;
                                        #size-cells = <1>;
 
-                                       partition@0 {
+                                       uboot: partition@0 {
                                                reg = <0x0 0x0050000>;
                                                label = "u-boot";
                                                read-only;
@@ -66,7 +66,7 @@
                                                label = "firmware";
                                        };
 
-                                       config: partition@fe0000 {
+                                       partition@fe0000 {
                                                reg = <0x00fe0000 0x00010000>;
                                                label = "config";
                                                read-only;
                enet0: ethernet@b0000 {
                        phy-handle = <&phy0>;
                        phy-connection-type = "rgmii-id";
-                       mtd-mac-address = <&config 0x144>;
+                       mtd-mac-address = <&uboot 0x4fc00>;
                };
 
                enet1: ethernet@b1000 {