[PATCH 2/3] ramips: hlk-7621a-evb: read MAC address from flash

Reinhard Max reinhard at m4x.de
Wed Apr 13 05:05:53 PDT 2022


Two MAC addresses are apparently located at offsets 0xe000 and 0xe006 in
the factory partition on these devices. Change the dts to use the first
one.

See also:
https://github.com/openwrt/openwrt/pull/4046#issuecomment-1091596559

Signed-off-by: Reinhard Max <reinhard at m4x.de>
---
 .../ramips/dts/mt7621_hilink_hlk-7621a-evb.dts    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts
index b96436e03d..20e99352f3 100644
--- a/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts
+++ b/target/linux/ramips/dts/mt7621_hilink_hlk-7621a-evb.dts
@@ -100,3 +100,18 @@
 		function = "gpio";
 	};
 };
+
+&gmac0 {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&factory {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_factory_e000: macaddr at e000 {
+		reg = <0xe000 0x6>;
+	};
+};
-- 
2.34.1




More information about the openwrt-devel mailing list