diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index 6e0e0e7e034..aacbef77b4f 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -41,7 +41,7 @@ hpe,1920-24g) ;; tplink,sg2008p-v1|\ tplink,sg2452p-v4) - label_mac=$(mtd_get_mac_binary para 0xfdff4) + label_mac=$(get_mac_label) lan_mac="$label_mac" ;; *) diff --git a/target/linux/realtek/dts-5.10/rtl8380_tplink_sg2xxx.dtsi b/target/linux/realtek/dts-5.10/rtl8380_tplink_sg2xxx.dtsi index 8aa82831ab7..20e96af2e73 100644 --- a/target/linux/realtek/dts-5.10/rtl8380_tplink_sg2xxx.dtsi +++ b/target/linux/realtek/dts-5.10/rtl8380_tplink_sg2xxx.dtsi @@ -11,6 +11,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; + label-mac-device = ðernet0; }; memory@0 { @@ -128,15 +129,25 @@ reg = <0x1b00000 0x400000>; }; partition@1f00000 { + compatible = "nvmem-cells"; label = "para"; reg = <0x1f00000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + factory_macaddr: macaddr@fdff4 { + reg = <0xfdff4 0x6>; + }; }; }; }; }; ðernet0 { + nvmem-cells = <&factory_macaddr>; + nvmem-cell-names = "mac-address"; + mdio: mdio-bus { compatible = "realtek,rtl838x-mdio"; #address-cells = <1>; diff --git a/target/linux/realtek/dts-5.10/rtl8393_tplink_sg2452p-v4.dts b/target/linux/realtek/dts-5.10/rtl8393_tplink_sg2452p-v4.dts index 0649c9fb37b..b7300cfcbee 100644 --- a/target/linux/realtek/dts-5.10/rtl8393_tplink_sg2452p-v4.dts +++ b/target/linux/realtek/dts-5.10/rtl8393_tplink_sg2452p-v4.dts @@ -20,6 +20,7 @@ led-failsafe = &led_sys; led-running = &led_sys; led-upgrade = &led_sys; + label-mac-device = ðernet0; }; chosen { @@ -261,15 +262,25 @@ reg = <0x1b00000 0x400000>; }; partition@1f00000 { + compatible = "nvmem-cells"; label = "para"; reg = <0x1f00000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; read-only; + + factory_macaddr: macaddr@fdff4 { + reg = <0xfdff4 0x6>; + }; }; }; }; }; ðernet0 { + nvmem-cells = <&factory_macaddr>; + nvmem-cell-names = "mac-address"; + mdio: mdio-bus { compatible = "realtek,rtl838x-mdio"; #address-cells = <1>;