Several devices in mt76x8 subtarget use the following line to set
up wmac in their DTS(I) files:

ralink,mtd-eeprom = <&factory 0x4>

This is strange for several reasons:
- They should use mediatek,mtd-eeprom on this SOC
- The caldata is supposed to start at 0x0
- The parent DTSI mt7628an.dtsi specifies mediatek,mtd-eeprom anyway,
  starting from 0x0
- The offset coincides with the default location of the MAC address
  in caldata

Based on the comment in b28e94d4bfa1 ("ramips: MiWiFi Nano fixes"),
it looks like the author for this device wanted to actually use
mtd-mac-address instead of ralink,mtd-eeprom. A check on the same
device revealed that actually the MAC address start at offset 4 there,
so the correct caldata offset is 0x0.

Based on these findings, and the fact that the expected location on
this SOC is 0x0, we remove the "ralink,mtd-eeprom = <&factory 0x4>"
statement from all devices in ramips (being only mt7628an anyway).

Thanks to Sungbo Eo for finding and researching this.

Reported-by: Sungbo Eo <man...@gorani.run>
Fixes: b28e94d4bfa1 ("ramips: MiWiFi Nano fixes")
Signed-off-by: Adrian Schmutzler <freif...@adrianschmutzler.de>
---
 target/linux/ramips/dts/mt7628an_cudy_wr1000.dts             | 1 -
 target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts      | 1 -
 target/linux/ramips/dts/mt7628an_totolink_lr1200.dts         | 1 -
 target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi         | 1 -
 target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts      | 1 -
 target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts      | 1 -
 target/linux/ramips/mt76x8/base-files/etc/board.d/02_network | 4 ++--
 7 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts 
b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts
index aa3f01e68e..a23a8ad07c 100644
--- a/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts
+++ b/target/linux/ramips/dts/mt7628an_cudy_wr1000.dts
@@ -134,7 +134,6 @@
 
 &wmac {
        status = "okay";
-       ralink,mtd-eeprom = <&factory 0x4>;
 };
 
 &ethernet {
diff --git a/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts 
b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts
index 1316a290d7..00ae2b1a45 100644
--- a/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts
+++ b/target/linux/ramips/dts/mt7628an_rakwireless_rak633.dts
@@ -95,5 +95,4 @@
 
 &wmac {
        status = "okay";
-       ralink,mtd-eeprom = <&factory 0x4>;
 };
diff --git a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts 
b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts
index 4a712e917a..242a54e058 100644
--- a/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts
+++ b/target/linux/ramips/dts/mt7628an_totolink_lr1200.dts
@@ -110,7 +110,6 @@
 
 &wmac {
        status = "okay";
-       ralink,mtd-eeprom = <&factory 0x4>;
 };
 
 &ethernet {
diff --git a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi 
b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi
index 6a312ff0b1..2e604aee59 100644
--- a/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi
+++ b/target/linux/ramips/dts/mt7628an_vocore_vocore2.dtsi
@@ -23,7 +23,6 @@
 
 &wmac {
        status = "okay";
-       ralink,mtd-eeprom = <&factory 0x4>;
 };
 
 &ethernet {
diff --git a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts 
b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts
index 8b2a3d6c9d..76bc798bb8 100644
--- a/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts
+++ b/target/linux/ramips/dts/mt7628an_xiaomi_miwifi-nano.dts
@@ -69,7 +69,6 @@
 
 &wmac {
        status = "okay";
-       ralink,mtd-eeprom = <&factory 0x4>;
 };
 
 &ethernet {
diff --git a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts 
b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts
index b89e689508..dc7ee82f35 100644
--- a/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts
+++ b/target/linux/ramips/dts/mt7628an_zbtlink_zbt-we1226.dts
@@ -105,7 +105,6 @@
 
 &wmac {
        status = "okay";
-       ralink,mtd-eeprom = <&factory 0x4>;
 };
 
 &ethernet {
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network 
b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
index aeaf296984..23d045614e 100755
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
@@ -134,7 +134,7 @@ ramips_setup_macs()
                ;;
        cudy,wr1000)
                wan_mac=$(mtd_get_mac_binary factory 0x2e)
-               label_mac=$(mtd_get_mac_binary factory 0x8)
+               label_mac=$(mtd_get_mac_binary factory 0x4)
                ;;
        duzun,dm06|\
        netgear,r6120|\
@@ -194,7 +194,7 @@ ramips_setup_macs()
                ;;
        vocore,vocore2|\
        vocore,vocore2-lite)
-               label_mac=$(mtd_get_mac_binary factory 0x8)
+               label_mac=$(mtd_get_mac_binary factory 0x4)
                ;;
        wavlink,wl-wn570ha1|\
        zbtlink,zbt-we1226)
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to