mediatek: Cetron CT3003: move mac address setup to dts
authorChukun Pan <amadeus@jmu.edu.cn>
Tue, 19 Dec 2023 15:15:38 +0000 (23:15 +0800)
committerDaniel Golle <daniel@makrotopia.org>
Sun, 14 Jan 2024 23:11:57 +0000 (23:11 +0000)
It looks like we can put the mac address setting
into the device tree. Compile test only.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts
target/linux/mediatek/filogic/base-files/etc/board.d/02_network

index 4949cdb3d77da76bf6b6770b0ee94f97c20b821a..281c96e275ef5bacbec333947988588bd7f79165 100644 (file)
@@ -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 {
                                        #size-cells = <1>;
 
                                        macaddr_art_0: macaddr@0 {
+                                               compatible = "mac-base";
                                                reg = <0x0 0x6>;
+                                               #nvmem-cell-cells = <1>;
                                        };
                                };
                        };
                port@3 {
                        reg = <3>;
                        label = "wan";
+                       nvmem-cells = <&macaddr_art_0 3>;
+                       nvmem-cell-names = "mac-address";
                };
 
                port@6 {
index 2a6a97919df4ee6bd6b851f0b521b3a302496705..b86c376d74176a7739582290c566f8ad57ce5635 100644 (file)
@@ -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*)