Skip to content

Commit

Permalink
r40-bananapi-m2-berry: add script for U-Boot(spl/r) debugging
Browse files Browse the repository at this point in the history
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
  • Loading branch information
giuliobenetti committed Nov 15, 2023
1 parent e88222f commit 627c308
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions r40-bananapi-m2-berry/r40-bananapi-m2-berry-uboot.cmm
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

0 comments on commit 627c308

Please sign in to comment.