mediatek: filogic: prevent faulty mac address assignment
authorLeon M. Busch-George <leon@georgemail.eu>
Fri, 17 May 2024 18:10:25 +0000 (20:10 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 25 May 2024 10:41:26 +0000 (12:41 +0200)
The vendor U-Boot on the Cudy M3000 and the Yuncore AX835 assign random
mac addresses on boot and set the 'local-mac-address' property which
prevents Openwrt from assigning the correct address from evmem.

This patch removes the alias for ethernet0 so that U-Boot doesn't add the
property, removes the workaround from 02_network, and adds back the nvmem
definition for the M3000.

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
target/linux/mediatek/dts/mt7981b-cudy-m3000-v1.dts
target/linux/mediatek/dts/mt7981b-yuncore-ax835.dts
target/linux/mediatek/filogic/base-files/etc/board.d/02_network

index e700d3728abe70fb2ede97f1a35b84c7cbad4a9f..85bdabe47488e4644c38767c8560a4bb84418183 100644 (file)
@@ -9,7 +9,6 @@
        compatible = "cudy,m3000-v1", "mediatek,mt7981-spim-snand-rfb";
 
        aliases {
-               ethernet0 = &gmac0;
                label-mac-device = &gmac0;
                led-boot = &led_status;
                led-failsafe = &led_status;
@@ -87,7 +86,8 @@
                phy-mode = "2500base-x";
                phy-handle = <&rtl8221b_phy>;
 
-               /* the MAC address assignment using nvmem-cells doesn't work, so it's done through 02_network */
+               nvmem-cell-names = "mac-address";
+               nvmem-cells = <&macaddr_bdinfo_de00 1>;
        };
 
        gmac1: mac@1 {
index 4e6e834276df49fe370c1febf8b5bfe0901e1565..8b716e8742dde16f229f657483a602ba72c837d3 100644 (file)
@@ -9,7 +9,6 @@
        model = "YunCore AX835";
 
        aliases {
-               ethernet0 = &gmac0;
                led-boot = &led_system;
                led-failsafe = &led_system;
                led-running = &led_system;
index 3e3d30cc23c58ee6fa556a156fa43a48878ea2de..fcaeb698d7735dcc7658cc33d09de99371a4eb0d 100644 (file)
@@ -137,9 +137,6 @@ mediatek_setup_macs()
                ;;
                esac
                ;;
-       cudy,m3000-v1)
-               wan_mac=$(macaddr_add $(cat /sys/class/net/eth1/address) 1)
-               ;;
        h3c,magic-nx30-pro)
                wan_mac=$(mtd_get_mac_ascii pdt_data_1 ethaddr)
                lan_mac=$(macaddr_add "$wan_mac" 1)