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

MAC address EEPROM in TE0745

Started by julesvo, June 26, 2019, 05:16:41 PM

Previous topic - Next topic

julesvo

Hi,

I'm running the 2018.2 reference design on a TE0745 SoM. Is it normal that the MAC address is not loaded by default from the EEPROM? When I go into the preconfigured petalinux project and I go to petalinux-config and and go to ethernet settings, I see a 'standard' MAC adress that is being configured. When I build petalinux and run it on my module, everything works nicely, including RTC etc. but the MAC adress I see is the same as in the configuration. This surprises me because the configuration has not information of the content of the MAC adress EEPROM. I therefore conclude that the MAC adress EEPROM is not properly read out. Is this conclusion correct? If so, how can I configure my setup to use the MAC adress stored in the EEPROM?

Many thanks,

Jules

JH

Hi,
EEPROM is default not used.
With Vivado/Petalinux 18.3 you can use EEPROM when you remove mac from config:

       
  • Start with petalinux-config or petalinux-config --get-hw-description   --> Changes: CONFIG_SUBSYSTEM_ETHERNET_PS7_ETHERNET_0_MAC=""
And add on 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     0x53#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET  0xFA#endif
I heared Xilinx has changed procedure with 19.1 but I didn't test until now. --> in this  case check maybe petalinux-config -c u-boot
John

julesvo

Hi JH,

Thank you. This does not work in petalinux 2018.2? If not, I will download 2018.3 and try your suggestion today. This seems far more easy than the other instructions I found online.

Jules


JH

Hi,
18.2 should work also, maybe also 17.4 (If I remenber correctly this was the first time I saw the xilinx example).  I only test it with 18.3 on some other designs, for example on our TE0715.
br
John

julesvo

Hi John,

Just tested it with 18.2 and it works like a charm. Thank you very much!

Jules

celentan

Dear all,
I apologize for replying to an old post, but searching with google it seems to me this is the only specific post where this subject is discussed for the TE0745 board.

I have a TE0745 board: I am trying to set the MAC address from the value stored in the EEPROM (i2c address: 0x53) using u-boot. I am using Petalinux 2019.2

he first thing that I checked is if I can read that MAC address via the u-boot console.

These are the commands that I am using
Quote
Zynq> i2c dev 0
Zynq> i2c probe
Valid chip addresses: 53 57 6F 70
Zynq> i2c md 0x53 .0 32
0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
0030: ff ff    ..
This already looks strange. I'll try with another TE0745 board to check that, by change, the one I am using is corrupted. Anyow, FF:FF:FF:FF:FF:FF can be still a MAC address.

The content of my platform-top.h file is the following. I added the last lines after the comment.


#include <configs/platform-auto.h>
#define CONFIG_SYS_BOOTM_LEN 0xF000000
#define DFU_ALT_INFO_RAM \
                "dfu_ram_info=" \
        "setenv dfu_alt_info " \
        "image.ub ram $netstart 0x1e00000\0" \
        "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
        "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"

#define DFU_ALT_INFO_MMC \
        "dfu_mmc_info=" \
        "set dfu_alt_info " \
        "${kernel_image} fat 0 1\\\\;" \
        "dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0\0" \
        "thor_mmc=run dfu_mmc_info && thordown 0 mmc 0\0"


/*Required for uartless designs */
#ifndef CONFIG_BAUDRATE
#define CONFIG_BAUDRATE 115200
#ifdef CONFIG_DEBUG_UART
#undef CONFIG_DEBUG_UART
#endif
#endif

/*Dependencies for ENV to be stored in EEPROM. Ensure environment fits in eeprom size*/
#ifdef CONFIG_ENV_IS_IN_EEPROM
#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN         1
#define CONFIG_SYS_I2C_EEPROM_ADDR             0x54
#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS      4
#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS  5
#define CONFIG_SYS_EEPROM_SIZE                 1024 /* Bytes */
#define CONFIG_SYS_I2C_MUX_ADDR                0x74
#define CONFIG_SYS_I2C_MUX_EEPROM_SEL          0x4
#endif


/*A.C. 16/9/2020 to load eeprom MAC*/
#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     0x53
#define CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET  0xFA
#endif


The content of my system-user.dtsi file is the following (I have a custom kernel command line to load rootfs via nfs)


/include/ "system-conf.dtsi"
/ {
chosen {
     bootargs = "console=ttyPS0,115200 root=/dev/nfs nfsroot=192.168.0.1:/work/jdaq6/diskless/Centos7,v4,tcp ip=dhcp ro rootwait earlyprintk ignore_loglevel nfsrootdebug";
};
};


Whenever I change one of these files, my workflow is:

1) cd to the project main folder
2) petalinux-build
3) cd images/linux
4) petalinux-package --boot --fsbl zynq_fsbl.elf --fpga system.bit --u-boot --force
5) copy BOOT.bin and image.ub to the SD card, reboot the TE0745.

At the u-boot console, I get the following messages:


CPU:   Zynq 7z030
Silicon: v3.1
DRAM:  ECC disabled 1 GiB
MMC:   mmc@e0100000: 0
Loading Environment from SPI Flash... SF: Detected n25q512a with page size 256 Bytes, erase size 4 KiB, total 64 MiB
*** Warning - bad CRC, using default environment

In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
Net:   ZYNQ GEM: e000b000, phyaddr ffffffff, interface rgmii-id
eth0: ethernet@e000b000
U-BOOT for AndreaTest1


The MAC address of the ethernet device, however, is still the "default" value 00:0a:35:00:1e:53

Do you have any suggestion on how to move forward?

Thanks,
Bests,

Andrea Celentano

JH

Hi,
check the 19.2 reference design, Xilinx has change the procedure a little bit with 19.x.

  • You must add uboot parameters into uboot config (platform_top.h should be also possible, but you should check one time all parameter)
  • You must add eeprom into device tree (that's missing in your device tree)
You find our linux configuration here:
https://wiki.trenz-electronic.de/display/PD/TE0745+Test+Board#TE0745TestBoard-SoftwareDesign-PetaLinux
--> reference design includes also prebuilt binaries to test directly and petalinux template, with the configuration which is described in the wiki.

br
John

celentan

Dear John,
thanks for your quick reply! May I ask you how to specifically change a uboot parameter in the menu that I get after petalinux-config -c u-boot? In other words, if I want to change, for example, the parameter "CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW", how can I determine what is the menu entry that I should reach navigating through the different sub-menus in the text-based gui?

Thanks
Bests,
Andrea

celentan

Ah, I reply to myself!
Simply enter "/" and the search menu pops-up (I am quite new to this!)

JH

Hi,

QuoteSimply enter "/" and the search menu pops-up (I am quite new to this!)
The menu search is old but a bit hidden, with "?" you can sometimes get even more background information about selected items. This works on all configs.
I think Uboot config menue itself was introduced by xilinx with 2018.x

Important for you is also device tree, as long as the eeprom is not add to the device tree, it is no matter what you select on uboot config.

br
John