From 869a0183b953db6dbbced296294f667ce2b2353c Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 16 Aug 2019 15:39:43 +0200 Subject: [PATCH] ramips: fix MAC address setup for Newifi Y1 and Y1S So far, MAC address setup for those devices has been using local addresses although additional MAC addresses are available on flash. On device, we found the following situation: position Y1 Y1S 0x4 *:d4 *:e4 0x8004 *:d6 *:e8 0x28 *:d4 *:e4 0x2e *:d7 *:eb Since 0x4 and 0x28 yield the same address, the former was set for ðernet in DTS. However, the typical location on this architecture is 0x28, so this patch changes that. For further setup in 02_network, the local bit for lan_mac is removed, so the address from ðernet is used at all. For wan_mac, instead of calculating an address with local bit set, this patch exploits the previously unused address in 0x2e. Signed-off-by: Adrian Schmutzler --- target/linux/ramips/base-files/etc/board.d/02_network | 4 ++-- target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts | 2 +- target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 b80041c2abc2..b4634e09285e 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -512,6 +512,8 @@ ramips_setup_macs() alfa-network,w502u|\ arcwireless,freestation5|\ cudy,wr1000|\ + lenovo,newifi-y1|\ + lenovo,newifi-y1s|\ netgear,wnce2001|\ ohyeah,oy-0001|\ phicomm,k2g|\ @@ -528,8 +530,6 @@ ramips_setup_macs() huawei,d105|\ hilink,hlk-7628n|\ hilink,hlk-rm04|\ - lenovo,newifi-y1|\ - lenovo,newifi-y1s|\ nexaira,bc2|\ petatel,psr-680w|\ skyline,sl-r7205) diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts index c573a28d73d6..b8c0ec8a8369 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1.dts @@ -53,6 +53,6 @@ ðernet { pinctrl-names = "default"; pinctrl-0 = <&ephy_pins>; - mtd-mac-address = <&factory 0x4>; + mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts index 007e0e69e81a..bf51329114c4 100644 --- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts +++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts @@ -78,7 +78,7 @@ ðernet { status = "okay"; - mtd-mac-address = <&factory 0x4>; + mtd-mac-address = <&factory 0x28>; pinctrl-names = "default"; pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; mediatek,portmap = "wllll"; -- 2.30.2