diff mbox series

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

Message ID 20220413120554.9355-2-reinhard@m4x.de
State New
Headers show
Series [1/3] ramips: hlk-7621a-evb: remove WiFi support | expand

Commit Message

Reinhard Max April 13, 2022, 12:05 p.m. UTC
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@m4x.de>
---
 .../ramips/dts/mt7621_hilink_hlk-7621a-evb.dts    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Reinhard Max June 2, 2022, 5:25 p.m. UTC | #1
Hi,

Am 13.04.2022 13:42, schrieb Reinhard Max:
> 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

is there anything keeping this patch from being accepted for 22.03 and 
ideally also for 19.07, so that this device finally gets a stable MAC 
address?

cu
Reinhard
diff mbox series

Patch

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@e000 {
+		reg = <0xe000 0x6>;
+	};
+};