You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Zynq FSBL

As standard option FSBL for TE modules does read and optionally display on UART console the MAC address that is stored on the module. If u-boot does not overwrite it, then it will persist and be used in Linux as well.

This is done in fsbl_hooks.c in the FsblHookBeforeHandoff function. When using TE supplied BSP's for Petalinux the FSBL code is already including this. If creating FSBL from scratch using Xilinx SDK Wizard then the hook code must be inserted manually (or the fsbl_hooks.c replaced completely). The way MAC Address is read from Hardware is module dependent, so proper files should be used.

MAC Address in u-boot

U-boot Ethernet driver guide says that:

	/* if your device has dedicated hardware storage for the
	 * MAC, read it and initialize dev->enetaddr with it
	 */

Unfortunately Xilinx u-boot Ethernet drivers (xilinx_axi_emac, xilinx_axilite, zynq_gem) do not implement this functionality.

In u-boot documentataion README.ethernet it says:

Correct flow of setting up the MAC address (summarized):

1. Read from hardware in initialize() function
2. Read from environment in net/eth.c after initialize()
3. The environment variable will be compared to the driver initialized
   struct eth_device->enetaddr. If they differ, a warning is printed, and the
   environment variable will be used unchanged.
   If the environment variable is not set, it will be initialized from
   eth_device->enetaddr, and a warning will be printed.
4. Program the address into hardware if the following conditions are met:
	a) The relevant driver has a 'write_addr' function
	b) The user hasn't set an 'ethmacskip' environment variable
	c) The address is valid (unicast, not all-zeros)

Xilinx u-boot and u-boot drivers for Zynq and MicroBlaze do not support any kind of reading of the MAC, they do not support the setting of MAC in Ethernet driver and they do not provide any means to add this functions without patching Xilinx u-boot source code.

Xilinx document UG983 explains how to set MAC address from u-boot prompt.

  • No labels