ralink: set the mac addr via the dts file
authorJohn Crispin <john@openwrt.org>
Mon, 25 Nov 2013 08:33:42 +0000 (08:33 +0000)
committerJohn Crispin <john@openwrt.org>
Mon, 25 Nov 2013 08:33:42 +0000 (08:33 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 38902

60 files changed:
target/linux/ramips/base-files/etc/uci-defaults/02_network
target/linux/ramips/dts/3G-6200N.dts
target/linux/ramips/dts/3G300M.dts
target/linux/ramips/dts/AIR3GII.dts
target/linux/ramips/dts/ALL0239-3G.dts
target/linux/ramips/dts/ALL0256N-4M.dts
target/linux/ramips/dts/ALL0256N-8M.dts
target/linux/ramips/dts/ALL5002.dts
target/linux/ramips/dts/ARGUS_ATP52B.dts
target/linux/ramips/dts/ASL26555-16M.dts
target/linux/ramips/dts/ASL26555-8M.dts
target/linux/ramips/dts/BC2.dts
target/linux/ramips/dts/BR-6425.dts
target/linux/ramips/dts/BROADWAY.dts
target/linux/ramips/dts/CARAMBOLA.dts
target/linux/ramips/dts/D105.dts
target/linux/ramips/dts/DIR-300-B1.dts
target/linux/ramips/dts/DIR-300-B7.dts
target/linux/ramips/dts/DIR-320-B1.dts
target/linux/ramips/dts/DIR-600-B1.dts
target/linux/ramips/dts/DIR-610-A1.dts
target/linux/ramips/dts/DIR-615-H1.dts
target/linux/ramips/dts/DIR-620-A1.dts
target/linux/ramips/dts/DIR-620-D1.dts
target/linux/ramips/dts/DIR-810L.dts
target/linux/ramips/dts/ESR-9753.dts
target/linux/ramips/dts/F5D8235_V1.dts
target/linux/ramips/dts/F5D8235_V2.dts
target/linux/ramips/dts/FONERA20N.dts
target/linux/ramips/dts/FREESTATION5.dts
target/linux/ramips/dts/HG255D.dts
target/linux/ramips/dts/IP2202.dts
target/linux/ramips/dts/M3.dts
target/linux/ramips/dts/M4-4M.dts
target/linux/ramips/dts/M4-8M.dts
target/linux/ramips/dts/MPRA1.dts
target/linux/ramips/dts/MPRA2.dts
target/linux/ramips/dts/MZK-W300NH2.dts
target/linux/ramips/dts/NBG-419N.dts
target/linux/ramips/dts/NW718.dts
target/linux/ramips/dts/OMNI-EMB-HPM.dts
target/linux/ramips/dts/PSR-680W.dts
target/linux/ramips/dts/RT-N13U.dts
target/linux/ramips/dts/RT-N15.dts
target/linux/ramips/dts/RTN56U.dts
target/linux/ramips/dts/SL-R7205.dts
target/linux/ramips/dts/TEW-691GR.dts
target/linux/ramips/dts/TEW-692GR.dts
target/linux/ramips/dts/UR-326N4G.dts
target/linux/ramips/dts/UR-336UN.dts
target/linux/ramips/dts/W150M.dts
target/linux/ramips/dts/W306R_V20.dts
target/linux/ramips/dts/W502U.dts
target/linux/ramips/dts/WCR150GN.dts
target/linux/ramips/dts/WL-351.dts
target/linux/ramips/dts/WLI-TX4-AG300N.dts
target/linux/ramips/dts/WMR300.dts
target/linux/ramips/dts/WNCE2001.dts
target/linux/ramips/dts/X5.dts
target/linux/ramips/dts/X8.dts

index 5ee2381..79ad4b8 100755 (executable)
@@ -163,64 +163,30 @@ ramips_setup_macs()
        local wan_mac=""
 
        case $board in
-       all0256n | \
-       all5002 | \
-       dir-615-h1)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               ;;
-       3g-6200n | \
-       3g300m | \
-       w150m | \
-       air3gii | \
-       argus-atp52b | \
-       bc2 | \
-       br6425 | \
-       broadway | \
-       dir-620-d1 | \
-       f5d8235-v1 | \
-       ip2202 | \
-       mpr-a1 | \
-       mpr-a2 | \
-       dir-300-b7 | \
-       dir-320-b1 | \
-       mzk-w300nh2 | \
-       nw718 | \
-       psr-680w | \
-       rt-n15 | \
-       sl-r7205 | \
-       wmr300 | \
-       wl-351)
-               lan_mac=$(mtd_get_mac_binary factory 4)
+       *)
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
 
-       asl26555)
-               lan_mac=$(mtd_get_mac_binary devdata 16388)
-               ;;
-
        w306r-v20)
-               lan_mac=$(mtd_get_mac_binary factory 4)
                wan_mac=$(macaddr_add "$lan_mac" 5)
                ;;
 
-       rt-n13u | \
-       hg255d  | \
-       fonera20n | \
-       dir-810l)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
+       tew-691gr)
+               wan_mac=$(macaddr_add "$lan_mac" 3)
                ;;
 
-       dir-300-b1 |\
-       dir-300-b2 |\
-       dir-600-b1 |\
-       dir-610-a1)
-               lan_mac=$(mtd_get_mac_binary devdata 16388)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
+       tew-692gr)
+               wan_mac=$(macaddr_add "$lan_mac" 4)
+               ;;
+
+       m3 |\
+       m4 |\
+       x5 |\
+       x8)
+               lan_mac=$(macaddr_add "$lan_mac" -1)
                ;;
 
        dir-620-a1)
-               lan_mac=$(mtd_get_mac_binary factory 4)
                lan_mac=$(macaddr_setbit_la "$lan_mac")
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
@@ -230,57 +196,20 @@ ramips_setup_macs()
                wan_mac=$(mtd_get_mac_ascii nvram wanmac)
                ;;
 
-       esr-9753 | \
-       ur-326n4g | \
-       ur-336un)
-               lan_mac=$(mtd_get_mac_binary devdata 16388)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
-               ;;
-
-       m3 |\
-       m4 |\
-       x5 |\
-       x8)
-               lan_mac=$(mtd_get_mac_binary factory 4)
-               lan_mac=$(macaddr_add "$lan_mac" -1)
-               ;;
-
        nbg-419n | \
        wcr-150gn)
-                lan_mac=$(mtd_get_mac_binary factory 4)
                 wan_mac=$(mtd_get_mac_binary factory 40)
                ;;
 
-       omni-emb-hpm)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               ;;
-
-       f5d8235-v2)
-               lan_mac=$(mtd_get_mac_binary "u-boot" 262148)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
-               ;;
-
        rt-n56u)
-               lan_mac=$(mtd_get_mac_binary factory 4)
                wan_mac=$(mtd_get_mac_binary factory 32772)
                ;;
 
-       tew-691gr)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               wan_mac=$(macaddr_add "$lan_mac" 3)
-               ;;
-
-       tew-692gr)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               wan_mac=$(macaddr_add "$lan_mac" 4)
-               ;;
-
        all0239-3g | \
        carambola | \
        freestation5 | \
        w502u | \
        wnce2001)
-               lan_mac=$(mtd_get_mac_binary factory 40)
                wan_mac=$(mtd_get_mac_binary factory 46)
                ;;
 
@@ -289,11 +218,6 @@ ramips_setup_macs()
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
 
-       d105 | \
-       wli-tx4-ag300n)
-               lan_mac=$(mtd_get_mac_binary factory 4)
-               ;;
-
        esac
 
        [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac
index dc34243..0be8c72 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 62683cc..93e864f 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index f9fcf07..1276574 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 335aea8..fe1eba9 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                status = "okay";
                ralink,portmap = <0x3e>;
index 7351675..e92118f 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3f>;
        };
index 8c825a9..6a704f1 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3f>;
        };
index 60c9c1f..827e9df 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3f>;
        };
index b8e246b..fb04f01 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3e>;
        };
index 8bc98df..8aeeba8 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4004>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x1e>;
        };
index f1501eb..1ddbb1c 100644 (file)
@@ -26,8 +26,8 @@
                                        reg = <0x0 0x30000>;
                                        read-only;
                                };
-                               partition@30000 {
-                                       label = "devdata";
+                               factory: partition@30000 {
+                                       label = "factory";
                                        reg = <0x30000 0x10000>;
                                        read-only;
                                };
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4004>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x1e>;
        };
index 8877743..54adbaf 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 913df05..7df63c6 100644 (file)
                #size-cells = <1>;
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 3f00ad7..25e3b89 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3e>;
        };
index 5c63e03..520450a 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3f>;
        };
index c4171c0..c19e0da 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 8efef3c..4623af2 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4004>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 22c4cb2..492fd4c 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
         esw@10110000 {
                 ralink,portmap = <0x2f>;
                 ralink,led_polarity = <0x17>;
index f07e528..34d7944 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
                ralink,led_polarity = <0x17>;
index 2c75465..e43a0d7 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4004>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 67c92b4..e6c1041 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4004>;
+       };
+
        esw@10110000 {
                status = "okay";
                ralink,portmap = <0x2f>;
index 5cb2beb..13d7f88 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 649b3ab..070edaf 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 71d3ec2..c8632f0 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 95017d9..d8a035a 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        gsw@10110000 {
                ralink,port4 = "ephy";
 
index 755196b..3760a46 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4004>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3e>;
        };
index 36026c2..e021565 100644 (file)
@@ -55,6 +55,7 @@
 
        ethernet@400000 {
                status = "okay";
+               mtd-mac-address = <&factory 0x4>;
 
                 port@0 {
                        ralink,fixed-link = <1000 1 1 1>;
index 237709f..1b96cea 100644 (file)
@@ -24,7 +24,7 @@
                #address-cells = <1>;
                #size-cells = <1>;
 
-               partition@0 {
+               uboot: partition@0 {
                        label = "u-boot";
                        reg = <0x0 0x50000>;
                        read-only;
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&uboot 0x40004>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3f>;
        };
index 5c48103..bb85bab 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
 
index 0ec390c..603ec36 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x01>;
        };
index 68e5e8a..7496ca5 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index ea5dc78..dc2af40 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index bae84ce..f3c3aa4 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
                ralink,led_polarity = <1>;
index 4522fb8..2d2ebc4 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
                ralink,led_polarity = <1>;
index c8e7ff5..23d8449 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
                ralink,led_polarity = <1>;
index f363a57..a869427 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 00c5d11..4414141 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 78c120a..43a98ce 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index c7d66c4..07c5b3c 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index d55f226..c67b832 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 9bceb00..fa7d515 100644 (file)
@@ -60,6 +60,7 @@
        ethernet@10100000 {
                phy-handle = <&phy0>;
                phy-mode = "rgmii";
+               mtd-mac-address = <&factory 0x28>;
 
                mdio-bus {
                        status = "okay";
index ec06fee..62e5f72 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3e>;
        };
index b6a649c..ed34485 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 0b9d0d9..27b0da9 100644 (file)
@@ -53,6 +53,7 @@
 
        ethernet@400000 {
                status = "okay";
+               mtd-mac-address = <&factory 0x4>;
 
                 port@0 {
                        ralink,fixed-link = <1000 1 1 1>;
index 6dfe3f4..ec9163a 100644 (file)
@@ -22,7 +22,8 @@
        };
 
        ethernet@10100000 {
-                port@0 {
+                       mtd-mac-address = <&factory 0x4>;
+               port@0 {
                        ralink,fixed-link = <1000 1 1 1>;
                };
        };
index 589fd10..24bf940 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3e>;
        };
index 98d45fc..1d61529 100644 (file)
@@ -22,6 +22,7 @@
        };
 
        ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
                port@0 {
                        phy-handle = <&phy0>;
                        phy-mode = "rgmii";
index 6c07c77..3d7dc9f 100644 (file)
@@ -23,6 +23,7 @@
 
        ethernet@10100000 {
                status = "okay";
+               mtd-mac-address = <&factory 0x28>;
                port@0 {
                        phy-handle = <&phy0>;
                        phy-mode = "rgmii";
index d97ca05..4af10bb 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4004>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index b137703..5ce7fa9 100644 (file)
                #size-cells = <1>;
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4004>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 76ad658..f3ab719 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index 16d9ad4..3f57b35 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3e>;
        };
index 54e8d58..d11a7ad 100644 (file)
@@ -1,3 +1,7 @@
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
 /dts-v1/;
 
 /include/ "rt3050.dtsi"
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3e>;
        };
index 601883d..e59fc8d 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
        };
index bc12294..1e6705c 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x3f>;
                ralink,fct2 = <0x0002500c>;
index 62c2a79..0ea5e29 100644 (file)
@@ -52,6 +52,7 @@
 
        ethernet@400000 {
                status = "okay";
+               mtd-mac-address = <&factory 0x4>;
 
                 port@0 {
                        ralink,fixed-link = <1000 1 1 1>;
index dbee9ad..56cf6a6 100644 (file)
@@ -49,6 +49,7 @@
        };
 
        ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
                ralink,port-map = "wllll";
        };
 
index bbf6625..10910af 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x28>;
+       };
+
        gpio-leds {
                compatible = "gpio-leds";
                power-green {
index 0a4f1b3..a19bf4d 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
                ralink,led_polarity = <1>;
index b7591de..cadbc3a 100644 (file)
                };
        };
 
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
        esw@10110000 {
                ralink,portmap = <0x2f>;
                ralink,led_polarity = <1>;