-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
r40-bananapi-m2-berry: add script for U-Boot(spl/r) debugging
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
- Loading branch information
1 parent
e88222f
commit 627c308
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
; -------------------------------------------------------------------------------- | ||
; @Title: R40-Bananapi-M2-Berry U-Boot debugging Allwinner R40 | ||
; @Description: | ||
; The example is generated for R40-Bananapi-M2-Berry* boards using an ICD. | ||
; It will NOT run on any other board, but may be used as a template | ||
; for others. | ||
; @Keywords: uboot, Allwinner, r40*, R40* | ||
; @Author: Giulio Benetti <giulio.benetti@benettiengineering.com> | ||
; @Board: R40-Bananapi-M2-Berry* | ||
; @Chip: R40* | ||
; @Copyright: (C) 2023 Benetti Engineering sas, licensed for use with TRACE32(R) only | ||
; -------------------------------------------------------------------------------- | ||
|
||
LOCAL &uboot_path | ||
|
||
&uboot_path="/home/giuliobenetti/git/upstream/output-bananapi-m2-berry/build/uboot-2023.10" | ||
|
||
; Debugger Reset | ||
WinPAGE.RESet | ||
AREA.RESet | ||
WinPOS 0. 25. 75. 9. 0. 0. W000 | ||
AREA.view | ||
|
||
PRINT "resetting..." | ||
|
||
RESet | ||
SYStem.CPU CortexA7MPCore | ||
SYStem.CONFIG CoreNumber 4. | ||
CORE.ASSIGN 1. | ||
|
||
SYSTEM.RESETOUT ; hard reset | ||
SYStem.JTAGCLOCK 20MHz | ||
|
||
; Allwinner R40 Details | ||
SYStem.CONFIG.MEMORYAP1.Port 0. | ||
SYStem.CONFIG.DEBUGAP1.Port 1. | ||
SYStem.CONFIG.COREDEBUG.Base 0x80110000 0x80112000 0x80114000 0x80116000 | ||
SYStem.CONFIG.BMC.Base 0x80111000 0x80113000 0x80115000 0x80117000 | ||
|
||
SYStem.Option DACR ON ; give Debugger global write permissions | ||
TrOnchip.Set DABORT OFF ; used by Linux for page miss! | ||
TrOnchip.Set PABORT OFF ; used by Linux for page miss! | ||
TrOnchip.Set UNDEF OFF ; my be used by Linux for FPU detection | ||
SYStem.Option MMUSPACES OFF ; enable space ids to virtual addresses | ||
SYStem.Option EnReset OFF | ||
SYStem.Option TRST ON | ||
|
||
; Allwinner R40 BROM | ||
MAP.BONCHIP 0xffff0000--0xffff8fff | ||
|
||
SETUP.IMASKASM ON ; lock interrupts while single stepping | ||
SETUP.IMASKHLL ON ; lock interrupts while single stepping in HLL | ||
|
||
SYStem.Up | ||
|
||
; Load spl in sram | ||
data.load.auto &uboot_path/spl/u-boot-spl | ||
|
||
; Start and wait for spl to setup sdram | ||
go.direct board_init_f | ||
WAIT !run() | ||
|
||
; Load real uboot | ||
Data.LOAD.Binary &uboot_path/u-boot.bin 0x4a000000 /NoClear | ||
data.load.auto &uboot_path/u-boot /NoCODE | ||
Register.Init | ||
r.s pc 0x4a000000 | ||
|
||
Mode.Hll | ||
List | ||
|
||
enddo |