Hi, has anyone had experience of getting U-Boot in Petalinux 2023.1 to read the MAC Address out of the AT24MAC602 EEPROM at startup and use it rather than the random one?
Warning: ethernet@ff0d0000 (eth0) using random MAC address - XX:XX:XX:XX:XX:XX
I've successfully been able to read the MAC Address and serial number out of the EEPROM's special area (device address mapped to 0x58) using debug commands in both U-Boot and Linux.
Reading 6 octets from device address 0x58, address 0x9a in Linux yields the MAC Address (Atmel OUI retained here for confirmation).
sudo i2ctransfer -y 0 w1@0x58 0x9a r6
0xfc 0xc2 0x3d 0xXX 0xXX 0xXX
U-Boot
ZynqMP> i2c dev 0
Setting bus to 0
ZynqMP> i2c md 0x58 0x9a 6
009a: fc c2 3d XX XX XX
I believe since 2022 U-Boot has removed some of the compile defines and how the EEPROM is used so I believe it needs something like this:
components/plnx_workspace/device-tree/device-tree/system-top.dts
/ {
aliases {
nvmem0 = &eeprom;
};
};
project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
&i2c0 {
eeprom: eeprom@58{
compatible = "atmel,24c02";
reg = <0x58>;
read-only;
pagesize = <16>;
eth0_addr: eth-mac-addr@9A { /* 9A is the address in the EEPROM */
reg = <0x9A 0x06>;
};
};
};
But U-Boot is still using the randomised address.
Any pointers would be helpful.
Thanks