You are currently reviewing an older revision of this page.
The Arm Total Compute Platform uses U-Boot as the bootloader for the non-secure world. U-Boot loads the Linux kernel, device tree, and root filesystem。 By providing the necessary foundation for the operating system to initialize, U-boot enables the Total Compute Platform to seamlessly boot into Linux.
This guide describes how to :
This guide assumes that you already set up the debugging environment as described in the Guide to Set Up Debugging Environment for Total Compute Software Stack.
The guidance given in this guide is based on the Total Compute TC23.1 code.Note: Future code updates might introduce changes, so the guidance might not apply to all cases.
The Guide to Set Up Debugging Environment for Total Compute Software Stack describes how to set up the Total Compute debugging environment in Arm DS.
There are some considerations to be aware of when setting up the U-boot debugging environment.
Select ARM_Cortex-A520x2 SMP Cluster 0 as your target as follows, when debugging the U-boot.
U-Boot is compiled as position-independent code and is loaded to a specified location by BL2 of the TF-A. This location is determined by the code in both TF-A and U-Boot:The following code in the src/trusted-firmware-a/include/plat/arm/css/common/css_def.h file:#define PLAT_ARM_NS_IMAGE_BASE U(0xE0000000) the following code in src/u-boot/configs/total_compute_defconfig file:CONFIG_TEXT_BASE=0xe0000000
#define PLAT_ARM_NS_IMAGE_BASE U(0xE0000000)
CONFIG_TEXT_BASE=0xe0000000
During the U-Boot initialization phase, the U-boot relocates itself to a different address. You can reference the code in the file src/u-boot/arch/arm/lib/relocate_64.S as follows:ENTRY(relocate_code) stp x29, x30, [sp, #-32]! /* create a stack frame */ mov x29, sp str x0, [sp, #16] /* * Copy u-boot from flash to RAM */ adrp x1, __image_copy_start /* x1 <- address bits [31:12] */ add x1, x1, :lo12:__image_copy_start/* x1 <- address bits [11:00] */ subs x9, x0, x1 /* x9 <- Run to copy offset */ b.eq relocate_done /* skip relocation */To debug the code after relocating, you need to identify the relocation offset. This is necessary to match the symbols in the symbol table with their corresponding runtime addresses. You can get this offset by using the following commands after the U-Boot is booted to the command line:TOTAL_COMPUTE# bdinfo boot_params = 0x0000000000000000 DRAM bank = 0x0000000000000000 -> start = 0x0000000080000000 -> size = 0x0000000079000000 DRAM bank = 0x0000000000000001 -> start = 0x0000000880000000 -> size = 0x0000000170000000 flashstart = 0x0000000000000000 flashsize = 0x0000000000000000 flashoffset = 0x0000000000000000 baudrate = 115200 bps relocaddr = 0x00000000f875c000 reloc off = 0x000000001875c000 Build = 64-bit fdt_blob = 0x00000000f2b58b90 new_fdt = 0x00000000f2b58b90 fdt_size = 0x0000000000003220 lmb_dump_all: memory.cnt = 0x2 / max = 0x10 memory[0] [0x80000000-0xf8ffffff], 0x79000000 bytes flags: 0 memory[1] [0x880000000-0x9efffffff], 0x170000000 bytes flags: 0 reserved.cnt = 0x3 / max = 0x10 reserved[0] [0xf1b54000-0xf8ffffff], 0x074ac000 bytes flags: 0 reserved[1] [0xf2b54590-0xf8ffffff], 0x064aba70 bytes flags: 0 reserved[2] [0x880000000-0x9efffffff], 0x170000000 bytes flags: 0 devicetree = board arch_number = 0x0000000000000000 TLB addr = 0x00000000f87f0000 irq_sp = 0x00000000f2b58b80 sp start = 0x00000000f2b58b80 Early malloc usage: 910 / 2000The "reloc off" is the value that will be used in the add-symbol-file commands. If you debug both the code before and after relocation, you must add the symbol table twice, as follows:add-symbol-file /workspace/arm/tc23.1/output/tc3/buildroot/fvp/tmp_build/u-boot/u-boot EL2N:0 add-symbol-file /workspace/arm/tc23.1/output/tc3/buildroot/fvp/tmp_build/u-boot/u-boot EL2N:0x000000001875c000
ENTRY(relocate_code) stp x29, x30, [sp, #-32]! /* create a stack frame */ mov x29, sp str x0, [sp, #16] /* * Copy u-boot from flash to RAM */ adrp x1, __image_copy_start /* x1 <- address bits [31:12] */ add x1, x1, :lo12:__image_copy_start/* x1 <- address bits [11:00] */ subs x9, x0, x1 /* x9 <- Run to copy offset */ b.eq relocate_done /* skip relocation */
TOTAL_COMPUTE# bdinfo boot_params = 0x0000000000000000 DRAM bank = 0x0000000000000000 -> start = 0x0000000080000000 -> size = 0x0000000079000000 DRAM bank = 0x0000000000000001 -> start = 0x0000000880000000 -> size = 0x0000000170000000 flashstart = 0x0000000000000000 flashsize = 0x0000000000000000 flashoffset = 0x0000000000000000 baudrate = 115200 bps relocaddr = 0x00000000f875c000 reloc off = 0x000000001875c000 Build = 64-bit fdt_blob = 0x00000000f2b58b90 new_fdt = 0x00000000f2b58b90 fdt_size = 0x0000000000003220 lmb_dump_all: memory.cnt = 0x2 / max = 0x10 memory[0] [0x80000000-0xf8ffffff], 0x79000000 bytes flags: 0 memory[1] [0x880000000-0x9efffffff], 0x170000000 bytes flags: 0 reserved.cnt = 0x3 / max = 0x10 reserved[0] [0xf1b54000-0xf8ffffff], 0x074ac000 bytes flags: 0 reserved[1] [0xf2b54590-0xf8ffffff], 0x064aba70 bytes flags: 0 reserved[2] [0x880000000-0x9efffffff], 0x170000000 bytes flags: 0 devicetree = board arch_number = 0x0000000000000000 TLB addr = 0x00000000f87f0000 irq_sp = 0x00000000f2b58b80 sp start = 0x00000000f2b58b80 Early malloc usage: 910 / 2000
add-symbol-file
add-symbol-file /workspace/arm/tc23.1/output/tc3/buildroot/fvp/tmp_build/u-boot/u-boot EL2N:0 add-symbol-file /workspace/arm/tc23.1/output/tc3/buildroot/fvp/tmp_build/u-boot/u-boot EL2N:0x000000001875c000
In the Debugger tab of the U-boot debug configuration, include corresponding commands in Execute Debugger Commands to add symbol tables, as shown in the following figure. Each time the debugging connection starts, these commands are automatically executed to load the symbol table files.You can also add other commands here, such as setting breakpoints:break _main break do_bdinfoThe commands are automatically executed after the target is connected as follows:
break _main break do_bdinfo
When connecting the U-boot debug connection, all cores are powered down and the Continue button is grey.To power up the Application Processor core, create a SCP debug connection according to the Guide to Debug RSS Firmware Booting on Total Compute Platform, and connect the SCP target as follows: You can set any breakpoints at the U-boot connection and then click the Continue button at the SCP connection. The application processor core 0 is powered up by the SCP as follows: The application processor stops at the breakpoint and you can use the Continue button to continue debugging the u-boot as follows: