octeon: read SNIC10E MAC address from nvmem
authorStijn Tintel <stijn@linux-ipv6.be>
Thu, 20 Oct 2022 00:23:20 +0000 (03:23 +0300)
committerStijn Tintel <stijn@linux-ipv6.be>
Thu, 9 Nov 2023 12:35:03 +0000 (14:35 +0200)
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 <stijn@linux-ipv6.be>
target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/snic10e.dts

index c9a3c7ae810ad9e34e568ac891782542f84af5c1..af983c06564e2c190df692e63a5a389091a24f90 100644 (file)
                                compatible = "atmel,24c256";
                                reg = <0x53>;
                                pagesize = <64>;
+
+                               macaddr_tlv: macaddr@3c {
+                                       reg = <0x3c 0x6>;
+                               };
                        };
                };
 
                                        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>;
                                };
                        };
                                        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>;
                                };
                        };