[openwrt/openwrt] ramips: fix switch and MAC address for WHR-G300N

LEDE Commits lede-commits at lists.infradead.org
Fri Mar 23 12:44:58 PDT 2018


mkresin pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/e3bf92edf5564cf72de8234b32364f0d4919524f

commit e3bf92edf5564cf72de8234b32364f0d4919524f
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Fri Mar 23 14:59:39 2018 +0900

    ramips: fix switch and MAC address for WHR-G300N
    
    WHR-G300N has 5 ethernet ports (lan: 4, wan: 1), but there was no
    correct configuration in 02_network script and 6 ports was configured
    on the switch.
    Also, since the MAC address was not acquired from factory partition,
    incorrect values was set to LAN and WAN interfaces.
    
    This commit fixes these issues.
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 target/linux/ramips/base-files/etc/board.d/02_network | 4 +++-
 target/linux/ramips/dts/WHR-G300N.dts                 | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

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 03f718e..4441b22 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -110,6 +110,7 @@ ramips_setup_interfaces()
 	u7621-06-256M-16M|\
 	vr500|\
 	wf-2881|\
+	whr-g300n|\
 	witi|\
 	wl-wn575a3|\
 	wndr3700v5|\
@@ -440,7 +441,8 @@ ramips_setup_macs()
 	e1700)
 		wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
 		;;
-	gl-mt300n-v2)
+	gl-mt300n-v2|\
+	whr-g300n)
 		wan_mac=$(mtd_get_mac_binary factory 4)
 		;;
 	hc5*61|\
diff --git a/target/linux/ramips/dts/WHR-G300N.dts b/target/linux/ramips/dts/WHR-G300N.dts
index da861ce..a7c2834 100644
--- a/target/linux/ramips/dts/WHR-G300N.dts
+++ b/target/linux/ramips/dts/WHR-G300N.dts
@@ -107,6 +107,10 @@
 	};
 };
 
+&ethernet {
+	mtd-mac-address = <&factory 0x4>;
+};
+
 &esw {
 	mediatek,portmap = <0x2f>;
 };



More information about the lede-commits mailing list