From: Chukun Pan Date: Tue, 19 Dec 2023 15:15:38 +0000 (+0800) Subject: mediatek: Cetron CT3003: move mac address setup to dts X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d55517796005cf63b753cf6e98a3a3a730bcec6e;p=openwrt%2Fstaging%2Fthess.git mediatek: Cetron CT3003: move mac address setup to dts It looks like we can put the mac address setting into the device tree. Compile test only. Signed-off-by: Chukun Pan --- diff --git a/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts b/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts index 4949cdb3d7..281c96e275 100644 --- a/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts +++ b/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts @@ -12,6 +12,7 @@ aliases { serial0 = &uart0; + label-mac-device = &gmac0; led-boot = &led_status_red; led-failsafe = &led_status_red; led-running = &led_status_green; @@ -65,7 +66,7 @@ reg = <0>; phy-mode = "2500base-x"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -134,7 +135,9 @@ #size-cells = <1>; macaddr_art_0: macaddr@0 { + compatible = "mac-base"; reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; }; }; }; @@ -192,6 +195,8 @@ port@3 { reg = <3>; label = "wan"; + nvmem-cells = <&macaddr_art_0 3>; + nvmem-cell-names = "mac-address"; }; port@6 { diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 2a6a97919d..b86c376d74 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -111,11 +111,6 @@ mediatek_setup_macs() bananapi,bpi-r3) wan_mac=$(macaddr_add $(cat /sys/class/net/eth0/address) 1) ;; - cetron,ct3003) - lan_mac=$(mtd_get_mac_binary "art" 0) - wan_mac=$(macaddr_add "$lan_mac" 3) - label_mac=$lan_mac - ;; cmcc,rax3000m) case "$(cmdline_get_var root)" in /dev/mmc*)