11-03-2020 06:01 AM - edited 11-03-2020 06:05 AM
Hi,
I'm working with petalinux and 10G/25G ethernet sybsystem on a custom board. I would like to load the mac address during u-boot, i followed this post (https://forums.xilinx.com/t5/Embedded-Linux/u-boot-and-ethernet-MAC-address-from-eeprom/td-p/1054180) but i can't get it working, i don't get errors but it don't load the mac. I can read correctly the i2c eeprom from petalinux via i2c-tools.
In my system-user file I added this node:
&i2c0 {
eeprom: eeprom@50 {
status = "okay";
compatible = "atmel,24c512";
reg = <0x50>;
};
};
and inside platform-top.h i added these lines:
#define CONFIG_I2C_EEPROM
#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
#define CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW 0x0
#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET 0xFA
11-24-2020 12:13 AM
Hi andrea@ross
any news?
Same problem here and no clear documentation around, only hints like "this worked for me..."
The solution proposed in your link at boot makes a read EEPROM but only the first byte, so not in the right position and not the right byte size of the MAC.
Regards
11-25-2020 06:32 AM
I have no news, I'm always stuck at the same point as you.
11-25-2020 01:08 PM
I'm not sure how to do it in Petalinux, but the newer u-boots require an entry in the "chosen" node of the device tree that points to the eeprom that has a MAC address. You can see the nuts and bolts in board/xilinx/common/board.c
The requirements are:
1. In the menuconfig for u-boot, make sure that CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET is set (you might be able to do this in your config header as well). It is found in Device Drivers -> Multifunction device drivers -> enable driver for generic I2C-attached EEPROMS, and then set the "Set the I2C MAC offset" field to something like 0xFA
2. Add a "xlnx,eeprom" node to the chosen group in the device tree. Something like this:
chosen {
bootargs = "earlyprintk";
stdout-path = "serial0:115200n8";
xlnx,eeprom = &mac_eeprom;
};
...
&i2c0 {
status = "okay";
mac_eeprom: eeprom@50 {
compatible = "microchip,24aa02e48";
i2c-max-frequency = <400000>;
reg = <0x50>;
};
};
This works for me on a Zynq based board using a Microchip EEPROM with EUI-48 address.
11-26-2020 02:03 AM
Hi @slocke
thank you for your feedback but it's what andrea@ross has already done.
I tried your solution as I use a microchip EEPROM but with that setting I don't see any EEPROM read.
With the previous setup at least I see a read of a single byte at address 0x00.
Another difference is that I'm working with a zynq ultrascale+ and I want to use only the 10GbE on PL but I don't have found any other particular setup to solve this problem
Regards
11-26-2020 11:24 AM
The zcu10x boards use the Eprom for the MAC address. So maybe have a look here.
Also, can you try i2c utility in uboot manually to see if you can access the eeprom
Finally, always worth debugging the uboot
11-26-2020 11:56 PM
Hi @stephenm
thanks for your reply, with i2c utility I can read the eeprom properly, during the boot with a logic analyzer I can see that the eemprom is read but only one byte in the wrong position (not in the 0xFA address position).
Your link point to debug the uboot with Vitis, it means that I need to move to 2019.2 or greater, that introduces me to a lot of problems with software compatibility issues that I want to avoid as possible.
Regards
11-27-2020 01:44 AM
The blog uses Vitis. However, the same concept will apply to SDK
11-27-2020 01:45 AM
Can you give a screenshot of what you see in the i2c utility.
11-27-2020 01:49 AM
11-27-2020 01:55 AM
Ok, if the i2cget works. then at least you know the HW is working. with respect to debug, you can just enable the debug too, and see what is happening.