From: Stijn Tintel Date: Thu, 20 Oct 2022 00:23:20 +0000 (+0300) Subject: octeon: read SNIC10E MAC address from nvmem X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b61fc3ba000a8f43ef8dc34b3ff4a073d0798753;p=openwrt%2Fstaging%2Fstintel.git 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 --- 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>; }; };