]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
ramips: iptime,t5004: use nvmem for ubootenv
authorRosen Penev <rosenp@gmail.com>
Wed, 12 Jun 2024 21:03:49 +0000 (14:03 -0700)
committerRobert Marko <robimarko@gmail.com>
Sat, 14 Mar 2026 20:34:29 +0000 (21:34 +0100)
Userspace handling is deprecated.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14182
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/ramips/dts/mt7621_iptime_t5004.dts
target/linux/ramips/mt7621/base-files/etc/board.d/02_network

index 4a7f9aaaa1b84179a0add53ca4edb6ef47327b67..19c72884b4e2b402cf11190861b6acb203083eef 100644 (file)
                partition@80000 {
                        label = "u-boot-env";
                        reg = <0x80000 0xc0000>;
+
+                       nvmem-layout {
+                               compatible = "u-boot,env";
+                               env-size = <0x1000>;
+
+                               macaddr_uboot_ethaddr: ethaddr {
+                                       #nvmem-cell-cells = <1>;
+                               };
+                       };
                };
 
                partition@140000 {
        };
 };
 
+&gmac0 {
+       nvmem-cells = <&macaddr_uboot_ethaddr 0>;
+       nvmem-cell-names = "mac-address";
+};
+
 &gmac1 {
        status = "okay";
        label = "wan";
        phy-handle = <&ethphy0>;
+
+       nvmem-cells = <&macaddr_uboot_ethaddr 1>;
+       nvmem-cell-names = "mac-address";
 };
 
 &ethphy0 {
index 493811893b070af10fdadb00e2f5e51981d54bca..c6e440b8e9e573b7befc21ac1837d4afd0659b47 100644 (file)
@@ -274,10 +274,6 @@ ramips_setup_macs()
                wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
                label_mac=$wan_mac
                ;;
-       iptime,t5004)
-               lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
-               ;;
        jdcloud,re-sp-01b)
                lan_mac=$(mtd_get_mac_ascii config mac)
                wan_mac=$lan_mac