3.1 Adjustments to the Project specific for my case

3.1 Configuring and building U-Boot

3.1.1 USB-Ethernet dongle

I need to enable my USB - Ethernet dongle, it gives me Ethernet connection to "tftpboot" my executable file into RAM. We can configure U-Boot with 'petalinux-config':

$ petalinux-config -p u96v2_sbc_base_2023_2 -c u-boot

The command opens ncurses-based U-Boot config menu. I select option:

Device Drivers ---> USB support ---> USB to Ethernet Controller Drivers ---> Realtek RTL8152B/8153 Support

Done. Save. Exit.

Side note. 'petalinux-build' utility would make the same effect:

$ petalinux-build -p u96v2_sbc_base_2023_2 -c u-boot-xlnx -x menuconfig

3.1.2 U-Boot patching

For ZynqMP platforms, U-Boot switches from EL2 to EL1 when it executes "go" command. Which is reasonable, but not for the case when U-Boot runs a component that should be started at EL2 (in a debugging scenario). To solve it, I made a patch for 'zynqmp.c': Switch-To-EL2-if-debug.patch.

The patched U-Boot switches to EL1 with the standard "go" command, as usual:

ZynqMP> go [addr]

but stays in EL2 when the additional parameter "debug" is passed:

ZynqMP> go [addr] debug

If you fulfilled step 3.1.1 "USB-Ethernet dongle", than you already have U-Boot sources in the temporary workspace directory and you can apply the patch. Copy 'Switch-To-EL2-if-debug.patch' into

'u96v2_sbc_base_2023_2/build/tmp/work/u96v2_sbc_base_xczu3eg-xilinx-linux/u-boot-xlnx/1_v2023.01-...-r0/git'

and in that directory run:

$ patch -b -p1 < Switch-To-EL2-if-debug.patch

Done.

If you skipped step 3.1.1 "USB-Ethernet dongle", than you need to setup U-Boot sources into the temporary workspace directory first. Run command:

$ petalinux-build -p u96v2_sbc_base_2023_2 -c u-boot-xlnx -x configure

It will unpack sources into the workspace directory (along with succeeding default silent patching and configuring) so you can apply the patch as described above.

3.1.3 Building U-Boot

We build U-Boot with utility 'petalinux-build':

$ petalinux-build -p u96v2_sbc_base_2023_2 -c u-boot-xlnx

Last updated