From b61fc3ba000a8f43ef8dc34b3ff4a073d0798753 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 20 Oct 2022 03:23:20 +0300 Subject: [PATCH] octeon: read SNIC10E MAC address from nvmem The tlv-eeprom contains a MAC address at offset 0x3c. On some boards, the U-Boot environment contains a variable ethaddr with the same MAC address as that in the tlv-eeprom, and a variable eth1addr with that MAC incremented with 1. Read the MAC address from nvmem, and use it for the ethernet interfaces on the SNIC10E. Signed-off-by: Stijn Tintel --- .../files/arch/mips/boot/dts/cavium-octeon/snic10e.dts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/snic10e.dts b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/snic10e.dts index c9a3c7ae81..af983c0656 100644 --- a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/snic10e.dts +++ b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/snic10e.dts @@ -78,6 +78,10 @@ compatible = "atmel,24c256"; reg = <0x53>; pagesize = <64>; + + macaddr_tlv: macaddr@3c { + reg = <0x3c 0x6>; + }; }; }; @@ -643,6 +647,8 @@ compatible = "cavium,octeon-3860-pip-port"; reg = <0x0>; /* Port */ local-mac-address = [ 00 00 00 00 00 00 ]; + nvmem-cells = <&macaddr_tlv>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; }; }; @@ -656,6 +662,9 @@ compatible = "cavium,octeon-3860-pip-port"; reg = <0x0>; /* Port */ local-mac-address = [ 00 00 00 00 00 00 ]; + mac-address-increment = <(1)>; + nvmem-cells = <&macaddr_tlv>; + nvmem-cell-names = "mac-address"; phy-handle = <&phy1>; }; }; -- 2.30.2