# U-boot and ethernet MAC address from eeprom

**URL:** <https://discuss.pynq.io/t/u-boot-and-ethernet-mac-address-from-eeprom/757>\
**Category:** Support\
**Created:** [December 14, 2019, 9:17pm UTC](https://discuss.pynq.io/t/u-boot-and-ethernet-mac-address-from-eeprom/757 "2019-12-14T21:17:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![skorolcz](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@skorolcz](https://discuss.pynq.io/u/skorolcz)\
**Post date:** [December 14, 2019, 9:17pm UTC](https://discuss.pynq.io/t/u-boot-and-ethernet-mac-address-from-eeprom/757/1 "2019-12-14T21:17:42Z")

</div>

Hello,  
For PYNQ 2.4 (Petalinux 2018.3) and custom Zynq borad , 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  
but PYNQ 2.5 uses Petalinux 2019.1 and u-boot i2c driver in this version was changed to cadence. I’ve found eeprom mac address support for ZCU104 ZynqMP in PYNQ sources. Using this settings with proper addresses for Zynq is not working. What I should I change for Zynq support and mac address stored in eeprom? I have no I2C mux or switch - 24AA025E48T-I/OT is directly connected to PS.  
Stefan

---

<div class="post-metadata">

**Author:** ![skorolcz](https://avatars.discourse-cdn.com/v4/letter/s/94ad74/32.png) [@skorolcz](https://discuss.pynq.io/u/skorolcz)\
**Post date:** [December 16, 2019, 9:51am UTC](https://discuss.pynq.io/t/u-boot-and-ethernet-mac-address-from-eeprom/757/2 "2019-12-16T09:51:49Z")

</div>

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 may be easily merge in custom board files for PYNQ.

Stefan

---

<div class="post-metadata">

**Author:** ![gnatale](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/gnatale/32/11_2.png) [@gnatale](https://discuss.pynq.io/u/gnatale)\
**Post date:** [December 17, 2019, 5:40pm UTC](https://discuss.pynq.io/t/u-boot-and-ethernet-mac-address-from-eeprom/757/3 "2019-12-17T17:40:08Z")

</div>

Thanks for reporting this.

I suggest you do a PR with this change, it will be good to have a contribution from the community and also if a PR comes from an external resource, it will trigger a review process and discussion within the team.
