News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

u-boot and ethernet MAC address from eeprom

Started by skorolcz, December 12, 2019, 11:19:02 PM

Previous topic - Next topic

skorolcz

Hello,
For Petalinux 2018.3 and Zynq board TE0715-04-15-2I with  TE0701-06 , reading MAC address from EEPROM works perfect using:
in project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h
#define CONFIG_ZYNQ_EEPROM
#ifdef CONFIG_ZYNQ_EEPROM
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  1
#define CONFIG_CMD_EEPROM
#define CONFIG_ZYNQ_EEPROM_BUS          0
#define CONFIG_ZYNQ_GEM_EEPROM_ADDR     0x50
#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET  0xFA
#endif
This is  solution from Trenz Reference_Design. On Petalinux 2019.1 petalinux-build failed. I am guessing that CONFIG_CMD_EEPROM is the reason. Using petalinux-config -c u-boot I've disabled DM_I2C becouse it is in conflict with CMD_EEPROM but this is not enought for passing petalinux-build successfuly.

How to read MAC address from eeprom on early booting stage for petalinux 2019.1 ?

JH

Hi,

for 19.1 and newer check uboot config. -->petalinux-config -c u-boot

We will skip 19.1. Next update will be 19.2 with Vitis, there I will check if it works with uboot config.

br
John

skorolcz

I'v got the solution. For PetaLinux 2019.1

/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h

added:

#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



/project-spec/meta-user/recipes-bsp/device-tree/file/system-user.dtsi

/include/ "system-conf.dtsi"
/ {
chosen {
bootargs = "earlycon";
stdout-path = "serial0:115200n8";
xlnx,eeprom = &eeprom;
};
};

&i2c1 {
eeprom: eeprom@50 { /* u88 */
compatible = "atmel,24c08";
reg = <0x50>;
};
};

Now MAC is taken from EEPROM. This solution should works in 19.2. Please let me know if this will help you.

Stefan

JH

Hi,

thanks!

It works also with 19.2 --> tested on TE0820 module.
PS: instead add define in platform-top.h you can also use Uboot config: --> petalinux-config -c u-boot
But at the end it's the same :-)

br
John