68 lines
1.9 KiB
Plaintext
68 lines
1.9 KiB
Plaintext
; --------------------------------------------------------------------------------
|
|
; @Title: Usage example how to use U-Boot scripts
|
|
; @Description:
|
|
; This demonstrates how the bootloader u-boot can be debugged from the entry
|
|
; point and how relocations can be handled using the scripts
|
|
; load_uboot.cmm and load_uboot_symbols_reloc.cmm.
|
|
; This script is based on:
|
|
; http://www.denx.de/wiki/view/DULG/DebuggingUBoot
|
|
;
|
|
; Prerequisites:
|
|
; * u-boot file contains debug information
|
|
; * u-boot.bin is the pre-linked binary with DTB
|
|
;
|
|
; @Keywords: uboot u-boot bootloader
|
|
; @Props: Template
|
|
; @Author: AME
|
|
; @Copyright: (C) 1989-2022 Lauterbach GmbH, licensed for use with TRACE32(R) only
|
|
; --------------------------------------------------------------------------------
|
|
; $Id: example.cmm 18850 2022-01-26 18:41:29Z bschroefel $
|
|
|
|
PRIVATE &sPpd &sUbootFile
|
|
&sPpd=OS.PPD()
|
|
|
|
RESet
|
|
SYStem.RESet
|
|
SYStem.CPU <tbd>
|
|
; adjust bootcore for big.LITTLE/dynamiq SoCs
|
|
CORE.ASSIGN <tbd.bootcore>
|
|
; TBD: add board/SoC specific SYStem.Option,... here.
|
|
SYStem.Up
|
|
|
|
; TBD: adjust path here
|
|
&sUbootFile="<tbd.path to uboot builddir>/u-boot"
|
|
|
|
; Step 1: load symbols only, not the code
|
|
Data.LOAD.Elf &sUbootFile /NoCODE /NoRegister
|
|
|
|
; Step 2: use a Onchip Breakpoint to stop at u-boot entry
|
|
Go __image_copy_start /Onchip
|
|
WAIT !STATE.RUN() 10.s
|
|
IF TIMEOUT()
|
|
(
|
|
PRINT %ERROR "Sequence Error! Exiting ..."
|
|
ENDDO
|
|
)
|
|
|
|
; Step 3: [optional] run load_uboot script - downloads u-boot
|
|
DO ~~/demo/arm/bootloader/uboot/load_uboot.cmm "&sUbootFile"
|
|
|
|
; debug within u-boot _f/non-relocated phase
|
|
|
|
; Step 4: run to relocation point and reload symbols
|
|
Go relocate_done
|
|
WAIT !STATE.RUN() 10.s
|
|
IF TIMEOUT()
|
|
(
|
|
PRINT %ERROR "Sequence Error! Exiting ..."
|
|
ENDDO
|
|
)
|
|
|
|
Go.Up
|
|
WAIT !STATE.RUN()
|
|
; we are now at the first instruction in relocated phase
|
|
|
|
DO ~~/demo/arm/bootloader/uboot/load_uboot_symbols_reloc "&sUbootFile"
|
|
|
|
; debug within u-boot _r/relocated phase
|