RK3576 boards without dedicated storage for a MAC address only get a stable one if the bootloader derives it from the CPU ID and patches it into the device tree, which not every boot flow does. Mark the CPU ID cell as such and reference it from both GMACs, so that the addresses can be derived from the device tree alone, whatever the bootloader. Boards which store a MAC address of their own can override the reference with a cell of their choosing. Note that the GMACs then depend on the OTP memory being accessible, as the thermal sensors already do for their trim values. Signed-off-by: Alexey Charkov --- arch/arm64/boot/dts/rockchip/rk3576.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3576.dtsi b/arch/arm64/boot/dts/rockchip/rk3576.dtsi index 2e83a73ddbb2..55892f4afe60 100644 --- a/arch/arm64/boot/dts/rockchip/rk3576.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3576.dtsi @@ -2070,6 +2070,8 @@ gmac0: ethernet@2a220000 { interrupts = , ; interrupt-names = "macirq", "eth_wake_irq"; + nvmem-cells = <&otp_id 0>; + nvmem-cell-names = "mac-address"; power-domains = <&power RK3576_PD_SDGMAC>; resets = <&cru SRST_A_GMAC0>; reset-names = "stmmaceth"; @@ -2118,6 +2120,8 @@ gmac1: ethernet@2a230000 { interrupts = , ; interrupt-names = "macirq", "eth_wake_irq"; + nvmem-cells = <&otp_id 1>; + nvmem-cell-names = "mac-address"; power-domains = <&power RK3576_PD_SDGMAC>; resets = <&cru SRST_A_GMAC1>; reset-names = "stmmaceth"; @@ -2317,7 +2321,9 @@ otp_cpu_version: cpu-version@5 { bits = <3 3>; }; otp_id: id@a { + compatible = "rockchip,cpuid"; reg = <0x0a 0x10>; + #nvmem-cell-cells = <1>; }; cpub_leakage: cpub-leakage@1e { reg = <0x1e 0x1>; -- 2.56.0