From 9270415d5193a524e6021890ccb6741eccecd0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Tue, 24 Mar 2026 10:17:41 +0100 Subject: [PATCH] qualcommax: ipq807x: use ascii-env driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use ascii-env driver for reading mac addresses directly from devinfo partition for: - Linksys MX5300 - Linksys HomeWRK Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/22592 Signed-off-by: Robert Marko --- .../linux/qualcommax/dts/ipq8072-mx5300.dts | 28 ++++++++++++------ .../linux/qualcommax/dts/ipq8174-homewrk.dts | 29 ++++++++++++++----- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/target/linux/qualcommax/dts/ipq8072-mx5300.dts b/target/linux/qualcommax/dts/ipq8072-mx5300.dts index 5c8ab8b757..28d84e07de 100644 --- a/target/linux/qualcommax/dts/ipq8072-mx5300.dts +++ b/target/linux/qualcommax/dts/ipq8072-mx5300.dts @@ -15,15 +15,6 @@ aliases { serial0 = &blsp1_uart5; - /* - * Aliases as required by u-boot - * to patch MAC addresses - */ - ethernet0 = &dp1; - ethernet1 = &dp2; - ethernet2 = &dp3; - ethernet3 = &dp4; - ethernet4 = &dp5; led-boot = &led_system_blue; led-running = &led_system_blue; led-failsafe = &led_system_red; @@ -296,6 +287,15 @@ label = "devinfo"; reg = <0x1060000 0x20000>; read-only; + + nvmem-layout { + compatible = "ascii-eq-delim-env"; + + hw_mac_addr: hw_mac_addr { + compatible = "mac-base"; + #nvmem-cell-cells = <1>; + }; + }; }; partition@1080000 { @@ -475,30 +475,40 @@ status = "okay"; phy-handle = <&qca8075_0>; label = "lan1"; + nvmem-cells = <&hw_mac_addr 0>; + nvmem-cell-names = "mac-address"; }; &dp2 { status = "okay"; phy-handle = <&qca8075_1>; label = "lan2"; + nvmem-cells = <&hw_mac_addr 0>; + nvmem-cell-names = "mac-address"; }; &dp3 { status = "okay"; phy-handle = <&qca8075_2>; label = "lan3"; + nvmem-cells = <&hw_mac_addr 0>; + nvmem-cell-names = "mac-address"; }; &dp4 { status = "okay"; phy-handle = <&qca8075_3>; label = "lan4"; + nvmem-cells = <&hw_mac_addr 0>; + nvmem-cell-names = "mac-address"; }; &dp5 { status = "okay"; phy-handle = <&qca8075_4>; label = "wan"; + nvmem-cells = <&hw_mac_addr 0>; + nvmem-cell-names = "mac-address"; }; &ssphy_0 { diff --git a/target/linux/qualcommax/dts/ipq8174-homewrk.dts b/target/linux/qualcommax/dts/ipq8174-homewrk.dts index e623036df9..3e028fc8c6 100644 --- a/target/linux/qualcommax/dts/ipq8174-homewrk.dts +++ b/target/linux/qualcommax/dts/ipq8174-homewrk.dts @@ -8,13 +8,6 @@ model = "Linksys HomeWRK"; compatible = "linksys,homewrk", "qcom,ipq8074"; - aliases { - ethernet1 = &dp2; - ethernet2 = &dp3; - ethernet3 = &dp4; - ethernet4 = &dp5; - }; - chosen { bootargs-append = " root=/dev/ubiblock0_1"; }; @@ -35,6 +28,20 @@ partitions { compatible = "qcom,smem-part"; + + partition-devinfo { + label = "devinfo"; + read-only; + + nvmem-layout { + compatible = "ascii-eq-delim-env"; + + mac_address: mac_address { + compatible = "mac-base"; + #nvmem-cell-cells = <1>; + }; + }; + }; }; }; }; @@ -43,24 +50,32 @@ status = "okay"; phy-handle = <&qca8075_1>; label = "wan"; + nvmem-cells = <&mac_address 0>; + nvmem-cell-names = "mac-address"; }; &dp3 { status = "okay"; phy-handle = <&qca8075_2>; label = "lan3"; + nvmem-cells = <&mac_address 1>; + nvmem-cell-names = "mac-address"; }; &dp4 { status = "okay"; phy-handle = <&qca8075_3>; label = "lan2"; + nvmem-cells = <&mac_address 1>; + nvmem-cell-names = "mac-address"; }; &dp5 { status = "okay"; phy-handle = <&qca8075_4>; label = "lan1"; + nvmem-cells = <&mac_address 1>; + nvmem-cell-names = "mac-address"; }; &wifi {