UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
10,453 Views
Registered: ‎03-13-2014

How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

Hi,

 

I have a serial eeprom on my carrier card for a PicoZed, (like is standard on a Zybo). I have a modified FSBL which reads the mac address from the eeprom and configures the mac. However in the U Boot that is over written with a fixed mac address. And there seems to be no way to stop that because petalinux-config only has options for fixed or random mac address. I want to use the mac address from the eeprom.

 

By the way with prebuild u boot (I think 2014.2 ) direct from the Xilinx site this feature worked.

 

Does anyone have any ideas as to what to do. I have found that file platform-auto.h in ./subsystems/linux/configs/u-boot has

 

/* ethernet - ps7_ethernet_0 */
#define CONFIG_ZYNQ_GEM0
#define CONFIG_ZYNQ_GEM_PHY_ADDR0 7
#define CONFIG_ZYNQ_GEM
#define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
#define CONFIG_SYS_ENET
#define CONFIG_PHYLIB
#define CONFIG_MII
#define CONFIG_PHY_GIGE
#define CONFIG_PHY_MARVELL
#define CONFIG_CMD_PING
#define CONFIG_NET_MULTI
#define CONFIG_CMD_DHCP
#define CONFIG_CMD_NET
#define CONFIG_BOOTP_MAY_FAIL
#define CONFIG_NETCONSOLE 1
#define CONFIG_ETHADDR 00:0a:35:00:22:01
#define CONFIG_SERVERIP 192.168.74.128
#define CONFIG_IPADDR 10.0.0.42
#define CONFIG_GATEWAYIP 10.0.0.1
#define CONFIG_NETMASK 255.255.255.0

 

But that is autogenerated.

 

Dave

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
19,829 Views
Registered: ‎09-10-2008

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

Hi Dave,

 

There is also the platform-top.h that can be used to override items that are auto generated.

 

Maybe you can undef the MAC address in the platform-top.h of u-boot?

 

Thanks

John

9 Replies
Xilinx Employee
Xilinx Employee
19,830 Views
Registered: ‎09-10-2008

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

Hi Dave,

 

There is also the platform-top.h that can be used to override items that are auto generated.

 

Maybe you can undef the MAC address in the platform-top.h of u-boot?

 

Thanks

John

Explorer
Explorer
10,438 Views
Registered: ‎03-13-2014

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

John,

 

Thanks that done it

 

Dave

0 Kudos
Visitor diplomat
Visitor
10,308 Views
Registered: ‎07-15-2010

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

Hi!

 

Even though this post already is a bit old: How did you configure your fsbl to read the MAC Address from Prom and did you have to modify anything else to make it run?

 

H

0 Kudos
Xilinx Employee
Xilinx Employee
10,302 Views
Registered: ‎09-10-2008

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution
Hi,

You could use the standalone (bare metal) drivers in the Xilinx SDK for the I2C driver in the FSBL to read the MAC address. There's really no configuring it to do it as you need to do it yourself. The I2C driver in the SDK (data\embeddedsw\XilinxProcessorIPLib\drivers\iicps_v3_0\examples in 2015.2 install) has an eeprom example. You can develop the eeprom reading example independent of the FSBL then once it's work integrate it into FSBL pretty easily. There are hooks in FSBL for before handoff to the application.

Thanks
John
0 Kudos
Visitor diplomat
Visitor
10,291 Views
Registered: ‎07-15-2010

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

Thanks for your explanation. I will try later today.

 

Greetings,

 

H

0 Kudos
Explorer
Explorer
10,082 Views
Registered: ‎10-14-2015

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

Hi,

I managed to create an application that update the MAC address from the EEPROM using the example code in SDK.

My problem is, I need to load the bitstream file first in order to access the EEPROM, otherwise it can configure the I2C interface but it hangs on polling the answer from the EEPROM.

 

I thought that bitstream file only program the PL part of the zynq, that I don't need it to access peripherals connected to the PS ports (my EEPROM is connected to the ps_i2c_1 port)

 

am I doing something wrong or I need always to load the bitsream file first?

 

Best Regards,

Rocco 

0 Kudos
Xilinx Employee
Xilinx Employee
10,062 Views
Registered: ‎09-10-2008

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

If you connected the I2C thru EMIO you would need the PL up for it to work.  If you are doing this from FSBL there is a hook function for before handoff to the application that would work.

 

Thanks

John

0 Kudos
Explorer
Explorer
10,059 Views
Registered: ‎10-14-2015

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

thanks, that is the cause. my I2C pins go through EMIO.

 

Regards,

Rocco

0 Kudos
Explorer
Explorer
9,986 Views
Registered: ‎03-13-2014

Re: How to get mac address from serial eeprom on Petalinux 2014.4?

Jump to solution

Hi,

 

I know this is an old post but if anyone is interested the mods to the fsbl were taken from the ZYBO info on the Digilent site. Basically it uses the standard bare metal drivers.

 

Dave

0 Kudos