[OpenWrt-Devel] [PATCH 1/3] ralink: add ethernet macaddr to dts for FireWRT

wengbj fl.service at t-firefly.com
Fri Jan 30 02:19:12 EST 2015


---
 .../linux/ramips/base-files/etc/board.d/02_network |    7 +++++++
 target/linux/ramips/dts/FIREWRT.dts                |    5 +++++
 2 files changed, 12 insertions(+)

diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index 7724c3e..dcb497a 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -340,6 +340,13 @@ ramips_setup_macs()
 		wan_mac=$(mtd_get_mac_binary factory 46)
 		;;
 
+	firewrt)
+		wan_mac=$(mtd_get_mac_binary factory 57350)
+		lan_mac=$(mtd_get_mac_binary factory 57344)
+		[ "${lan_mac}x" = "ff:ff:ff:ff:ff:ffx" ] && lan_mac=$(cat /sys/class/net/eth0/address)
+		[ "${wan_mac}x" = "ff:ff:ff:ff:ff:ffx" ] && wan_mac=$(macaddr_add "$lan_mac" 1)
+		;;
+
 	*)
 		lan_mac=$(cat /sys/class/net/eth0/address)
 		wan_mac=$(macaddr_add "$lan_mac" 1)
diff --git a/target/linux/ramips/dts/FIREWRT.dts b/target/linux/ramips/dts/FIREWRT.dts
index 2e5d26b..4e9e28b 100644
--- a/target/linux/ramips/dts/FIREWRT.dts
+++ b/target/linux/ramips/dts/FIREWRT.dts
@@ -78,4 +78,9 @@
 			};
 		};
 	};
+
+	ethernet at 1e100000 {
+		mtd-mac-address = <&factory 0xe000>;
+	};
+
 };
-- 
1.7.9.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list