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

te0720 MAC address in petalinux2020.2

Started by akarcher, October 11, 2021, 11:02:07 PM

Previous topic - Next topic

akarcher

I am trying to move my design from 2019.2 to 2020.2.
I tried with the prebuilt code, and everything seems to work correctly. I added my hardware design and built a petalinux. Now it does not seem to pick up the MAC from the FSBL, but it uses the devicetree MAC:
Any hints would be apreciated.
--------------------------------------------------------------------------------
Xilinx First Stage Boot Loader (TE modified)
Release 2020.2  Oct 11 2021-18:54:30

Device IDCODE: 23727093
Device Name: 7z020 (7)
Device Revision: 2
--------------------------------------------------------------------------------
TE0720 TE_FsblHookBeforeHandoff_Custom

SoM: TE0720-03-1C  F SC REV:05
MAC: 80 1F 12 E0 8A 3B

--------------------------------------------------------------------------------


U-Boot 2020.01 (Oct 11 2021 - 18:58:51 +0000)

CPU:   Zynq 7z020
Silicon: v3.1
DRAM:  ECC disabled 1 GiB
Flash: 0 Bytes
NAND:  0 MiB
MMC:   mmc@e0100000: 0, mmc@e0101000: 1
In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
Net:
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 0, interface rgmii-id

Warning: ethernet@e000b000 using MAC address from DT

JH


akarcher

It seems the Petalinux project in the Trenz 20.2 example has the u-boot 'Enable Preboot' option set with an empty argument, which seems to overwrite the config in meta-user.
I will try unsetting the option and re-building.

JH

Hi,
I didn't checked again as I've generate the design, but when petalinux overwrite user setup now, than it's a bug of petalinux release. This should not happens.
br
John

masc

Hello!

What is the solution for this? I have same problem here.
Thanx in advance!
Bye, Marc

masc

I've tried https://wiki.trenz-electronic.de/display/PD/TE0720+Test+Board#TE0720TestBoard-U-Boot

I can successfully read and load the eth addr with env import -t 0xFFFFFC04. But still: for some reason this eth addr is overwritten with the one from device tree. I don't know why.
Any help an this?

Device IDCODE: 23727093
Device Name: 7z020 (7)
Device Revision: 2
--------------------------------------------------------------------------------
TE0720 TE_FsblHookBeforeHandoff_Custom

SoM: TE0720-03-1C  F SC REV:05
MAC: 54 10 EC XX XX XX

--------------------------------------------------------------------------------
SUCCESSFUL_HANDOFF
FSBL Status = 0x1


U-Boot 2020.01 (Dec 14 2022 - 15:33:01 +0000)

CPU:   Zynq 7z020
Silicon: v3.1
DRAM:  ECC disabled 1 GiB
Flash: 0 Bytes
NAND:  0 MiB
MMC:   mmc@e0100000: 0, mmc@e0101000: 1
In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
Net:
ZYNQ GEM: e000b000, mdio bus e000b000, phyaddr 0, interface rgmii-id

Warning: ethernet@e000b000 using MAC address from DT
eth0: ethernet@e000b000

JH

Hi,
current wiki documentation is for Vivado/Vitis/Petalinux 21.2
Older documentation is available as PDF on the download area:
https://shop.trenz-electronic.de/de/Download/?path=Trenz_Electronic/Modules_and_Module_Carriers/4x5/TE0720/Reference_Design/2020.2/test_board
https://shop.trenz-electronic.de/trenzdownloads/Trenz_Electronic/Modules_and_Module_Carriers/4x5/TE0720/Reference_Design/2020.2/test_board/TE0720-test_board-vivado_2020.2-build_9_v.49-01_17_2022.pdf
there we  use platform-top.h to add eeprom mac. IF I understand akarcher correctly petalinux will overwrite platform-top.h when you will load xsa again...so maybe check platform-top.h before you start build process.

I would recommend to use 21.2 or is there a reason to use 20.x?
br
John

akarcher

The issue that somehow in the petalinux configuration that is included in the 20.2 reference design has CONFIG PREBOOT configured, but does not have any valid value set. Since this is written during the petalinux-config step it overwrites or prepends any strings stored in meta-user. If you simply unselect 'Enable Preboot' in petalinux-config under U-Boot it will clear this config argument, you can then build and it will generate Uboot to read the environment variables.
You can probably also edit the config file and set CONFIG PREBOOT = NO, but I used the petalinux-config to define the config settings.

masc

Thanx for the answers, but I can't get it running.
What i do:

- petalinux-config --get-hw-description
- petalinux-config -c u-boot
  - deactivate "Enable preeboot"
- check /test_board/os/petalinux/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h
it contains:
#define CONFIG_PREBOOT    "echo U-BOOT for petalinux;echo importing env from FSBL shared area at 0xFFFFFC00; if itest *0xFFFFFC00 == 0xCAFEBABE; then echo Found valid magic; env import -t 0xFFFFFC04; fi;setenv preboot; echo Done (platform-auto.h).;"

- petalinux-package with te-fsbl

Sorry for possible misunderstanding: if "CONFIG_PREBOOT" is disabled, how will u-boot eventually executes commands, i add by platform-top.h? Apparently it is not executed.

I also tried to insert the preboot string via petalinux-config, but this also changes nothing.

What is my misunderstanding?
Thanx in advance!
Bye, Marc.

masc

I'm still with 2020.2 because migration always takes time and is never fun... :-/

akarcher

What you did seems correct. After disabling 'enable preboot' in petalinux-config it should take the correct value from platform-top.h
My understanding is that setting enable preboot in petalinux-config is just one way of defining the CONFIG_PREBOOT variable, and using .h files in meta-user is another way to do the same thing.
There seems to be some conflict if you try to do both.
In your description it does not say that you did a petalinux-build before the petalinux-package. A build is necessary to get the proper actions implemented.

Another option is using a prebuilt u-boot from TRENZ. For many of my projects it is only required to adapt the device tree, kernel and rootfs. Using the default u-boot is not an issue unless you need access to custom peripherals during boot. Copy the prebuilt u-boot into images/linux before petalinux-package to do so. Note that petalinux-build overwrites everything in images/linux.