ralink: set the mac addr via the dts file

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38902
owl
John Crispin 2013-11-25 08:33:42 +00:00
parent 6cbad59ead
commit 5b437e204f
60 changed files with 232 additions and 92 deletions

View File

@ -163,64 +163,30 @@ ramips_setup_macs()
local wan_mac="" local wan_mac=""
case $board in 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) wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
asl26555)
lan_mac=$(mtd_get_mac_binary devdata 16388)
;;
w306r-v20) w306r-v20)
lan_mac=$(mtd_get_mac_binary factory 4)
wan_mac=$(macaddr_add "$lan_mac" 5) wan_mac=$(macaddr_add "$lan_mac" 5)
;; ;;
rt-n13u | \ tew-691gr)
hg255d | \ wan_mac=$(macaddr_add "$lan_mac" 3)
fonera20n | \
dir-810l)
lan_mac=$(mtd_get_mac_binary factory 40)
wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
dir-300-b1 |\ tew-692gr)
dir-300-b2 |\ wan_mac=$(macaddr_add "$lan_mac" 4)
dir-600-b1 |\ ;;
dir-610-a1)
lan_mac=$(mtd_get_mac_binary devdata 16388) m3 |\
wan_mac=$(macaddr_add "$lan_mac" 1) m4 |\
x5 |\
x8)
lan_mac=$(macaddr_add "$lan_mac" -1)
;; ;;
dir-620-a1) dir-620-a1)
lan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$(macaddr_setbit_la "$lan_mac") lan_mac=$(macaddr_setbit_la "$lan_mac")
wan_mac=$(macaddr_add "$lan_mac" 1) wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
@ -230,57 +196,20 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_ascii nvram wanmac) 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 | \ nbg-419n | \
wcr-150gn) wcr-150gn)
lan_mac=$(mtd_get_mac_binary factory 4)
wan_mac=$(mtd_get_mac_binary factory 40) 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) rt-n56u)
lan_mac=$(mtd_get_mac_binary factory 4)
wan_mac=$(mtd_get_mac_binary factory 32772) 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 | \ all0239-3g | \
carambola | \ carambola | \
freestation5 | \ freestation5 | \
w502u | \ w502u | \
wnce2001) wnce2001)
lan_mac=$(mtd_get_mac_binary factory 40)
wan_mac=$(mtd_get_mac_binary factory 46) wan_mac=$(mtd_get_mac_binary factory 46)
;; ;;
@ -289,11 +218,6 @@ ramips_setup_macs()
wan_mac=$(macaddr_add "$lan_mac" 1) wan_mac=$(macaddr_add "$lan_mac" 1)
;; ;;
d105 | \
wli-tx4-ag300n)
lan_mac=$(mtd_get_mac_binary factory 4)
;;
esac esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac

View File

@ -54,6 +54,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -97,6 +97,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -56,6 +56,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
status = "okay"; status = "okay";
ralink,portmap = <0x3e>; ralink,portmap = <0x3e>;

View File

@ -56,6 +56,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3f>; ralink,portmap = <0x3f>;
}; };

View File

@ -56,6 +56,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3f>; ralink,portmap = <0x3f>;
}; };

View File

@ -56,6 +56,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3f>; ralink,portmap = <0x3f>;
}; };

View File

@ -75,6 +75,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3e>; ralink,portmap = <0x3e>;
}; };

View File

@ -68,6 +68,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4004>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x1e>; ralink,portmap = <0x1e>;
}; };

View File

@ -26,8 +26,8 @@
reg = <0x0 0x30000>; reg = <0x0 0x30000>;
read-only; read-only;
}; };
partition@30000 { factory: partition@30000 {
label = "devdata"; label = "factory";
reg = <0x30000 0x10000>; reg = <0x30000 0x10000>;
read-only; read-only;
}; };
@ -63,6 +63,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4004>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x1e>; ralink,portmap = <0x1e>;
}; };

View File

@ -68,6 +68,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -25,6 +25,10 @@
#size-cells = <1>; #size-cells = <1>;
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3e>; ralink,portmap = <0x3e>;
}; };

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3f>; ralink,portmap = <0x3f>;
}; };

View File

@ -72,6 +72,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4004>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
ralink,led_polarity = <0x17>; ralink,led_polarity = <0x17>;

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
ralink,led_polarity = <0x17>; ralink,led_polarity = <0x17>;

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4004>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4004>;
};
esw@10110000 { esw@10110000 {
status = "okay"; status = "okay";
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;

View File

@ -60,6 +60,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -60,6 +60,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -77,6 +77,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
gsw@10110000 { gsw@10110000 {
ralink,port4 = "ephy"; ralink,port4 = "ephy";

View File

@ -77,6 +77,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4004>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3e>; ralink,portmap = <0x3e>;
}; };

View File

@ -55,6 +55,7 @@
ethernet@400000 { ethernet@400000 {
status = "okay"; status = "okay";
mtd-mac-address = <&factory 0x4>;
port@0 { port@0 {
ralink,fixed-link = <1000 1 1 1>; ralink,fixed-link = <1000 1 1 1>;

View File

@ -24,7 +24,7 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
partition@0 { uboot: partition@0 {
label = "u-boot"; label = "u-boot";
reg = <0x0 0x50000>; reg = <0x0 0x50000>;
read-only; read-only;
@ -46,6 +46,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&uboot 0x40004>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3f>; ralink,portmap = <0x3f>;
}; };

View File

@ -82,6 +82,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x01>; ralink,portmap = <0x01>;
}; };

View File

@ -104,6 +104,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
ralink,led_polarity = <1>; ralink,led_polarity = <1>;

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
ralink,led_polarity = <1>; ralink,led_polarity = <1>;

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
ralink,led_polarity = <1>; ralink,led_polarity = <1>;

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -54,6 +54,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -60,6 +60,7 @@
ethernet@10100000 { ethernet@10100000 {
phy-handle = <&phy0>; phy-handle = <&phy0>;
phy-mode = "rgmii"; phy-mode = "rgmii";
mtd-mac-address = <&factory 0x28>;
mdio-bus { mdio-bus {
status = "okay"; status = "okay";

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3e>; ralink,portmap = <0x3e>;
}; };

View File

@ -82,6 +82,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -53,6 +53,7 @@
ethernet@400000 { ethernet@400000 {
status = "okay"; status = "okay";
mtd-mac-address = <&factory 0x4>;
port@0 { port@0 {
ralink,fixed-link = <1000 1 1 1>; ralink,fixed-link = <1000 1 1 1>;

View File

@ -22,7 +22,8 @@
}; };
ethernet@10100000 { ethernet@10100000 {
port@0 { mtd-mac-address = <&factory 0x4>;
port@0 {
ralink,fixed-link = <1000 1 1 1>; ralink,fixed-link = <1000 1 1 1>;
}; };
}; };

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3e>; ralink,portmap = <0x3e>;
}; };

View File

@ -22,6 +22,7 @@
}; };
ethernet@10100000 { ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
port@0 { port@0 {
phy-handle = <&phy0>; phy-handle = <&phy0>;
phy-mode = "rgmii"; phy-mode = "rgmii";

View File

@ -23,6 +23,7 @@
ethernet@10100000 { ethernet@10100000 {
status = "okay"; status = "okay";
mtd-mac-address = <&factory 0x28>;
port@0 { port@0 {
phy-handle = <&phy0>; phy-handle = <&phy0>;
phy-mode = "rgmii"; phy-mode = "rgmii";

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4004>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -25,6 +25,10 @@
#size-cells = <1>; #size-cells = <1>;
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4004>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -93,6 +93,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3e>; ralink,portmap = <0x3e>;
}; };

View File

@ -1,3 +1,7 @@
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
/dts-v1/; /dts-v1/;
/include/ "rt3050.dtsi" /include/ "rt3050.dtsi"
@ -52,6 +56,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3e>; ralink,portmap = <0x3e>;
}; };

View File

@ -77,6 +77,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
}; };

View File

@ -48,6 +48,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x3f>; ralink,portmap = <0x3f>;
ralink,fct2 = <0x0002500c>; ralink,fct2 = <0x0002500c>;

View File

@ -52,6 +52,7 @@
ethernet@400000 { ethernet@400000 {
status = "okay"; status = "okay";
mtd-mac-address = <&factory 0x4>;
port@0 { port@0 {
ralink,fixed-link = <1000 1 1 1>; ralink,fixed-link = <1000 1 1 1>;

View File

@ -49,6 +49,7 @@
}; };
ethernet@10100000 { ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
ralink,port-map = "wllll"; ralink,port-map = "wllll";
}; };

View File

@ -73,6 +73,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x28>;
};
gpio-leds { gpio-leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
power-green { power-green {

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
ralink,led_polarity = <1>; ralink,led_polarity = <1>;

View File

@ -52,6 +52,10 @@
}; };
}; };
ethernet@10100000 {
mtd-mac-address = <&factory 0x4>;
};
esw@10110000 { esw@10110000 {
ralink,portmap = <0x2f>; ralink,portmap = <0x2f>;
ralink,led_polarity = <1>; ralink,led_polarity = <1>;