diff --git a/rpi3/debugger/.gdbinit b/rpi3/debugger/.gdbinit new file mode 100644 index 0000000000000000000000000000000000000000..8cb296fb0802662e4faf4c77d2cfb52669e1d17b --- /dev/null +++ b/rpi3/debugger/.gdbinit @@ -0,0 +1,28 @@ +target extended-remote localhost:3333 + +# to debug single core: +# in u-boot: setenv smp off ; boot + +# substitute appropriate value from u-boot startup message (relocation offset) +add-symbol-file ../../../u-boot/u-boot 0x3af3a000 +add-symbol-file ../../../arm-trusted-firmware/build/rpi3/debug/bl31/bl31.elf 0x08400000 +add-symbol-file ../../../optee_os/out/arm/core/tee.elf 0x08420000 +add-symbol-file ../../../linux/vmlinux 0xffffffc000080800 + +mon gdb_breakpoint_override hard + +flushregs + +# bl31_entrypoint +#b *0x08400000 + +# TEE entrypoint +#b *0x08420000 + +# Linux; primary core entry. +# Symbols for initial setup _do not align with vmlinux (elf)_. Debug at instruction +# level only. +# Symbols post MMU enable are correct. +#b *0x080000 + +mon halt diff --git a/rpi3/debugger/pi3.cfg b/rpi3/debugger/pi3.cfg new file mode 100644 index 0000000000000000000000000000000000000000..4463be81167a601e8bc874adb52c8b8193d01aa7 --- /dev/null +++ b/rpi3/debugger/pi3.cfg @@ -0,0 +1,38 @@ +# RPi3b + +tcl_port 5555 +telnet_port 4444 +gdb_port 3333 + +transport select jtag + +adapter_khz 1000 + +jtag_ntrst_delay 100 +reset_config trst_only separate + +set _CHIPNAME rpi3b + +set _TARGETNAME_0 $_CHIPNAME.cpu0 +set _TARGETNAME_1 $_CHIPNAME.cpu1 +set _TARGETNAME_2 $_CHIPNAME.cpu2 +set _TARGETNAME_3 $_CHIPNAME.cpu3 + +jtag newtap $_CHIPNAME dap -irlen 4 -expected-id 0x4ba00477 + +target create $_TARGETNAME_0 aarch64 -chain-position $_CHIPNAME.dap -dbgbase 0x80010000 -ctibase 0x80018000 +#target create $_TARGETNAME_1 aarch64 -chain-position $_CHIPNAME.dap -dbgbase 0x80012000 -ctibase 0x80019000 +#target create $_TARGETNAME_2 aarch64 -chain-position $_CHIPNAME.dap -dbgbase 0x80014000 -ctibase 0x8001a000 +#target create $_TARGETNAME_3 aarch64 -chain-position $_CHIPNAME.dap -dbgbase 0x80016000 -ctibase 0x8001b000 + +#target smp $_CHIPNAME.cpu3 $_CHIPNAME.cpu2 $_CHIPNAME.cpu1 $_CHIPNAME.cpu0 + +proc rpi3b_gdb_attach {target} { + echo "gdb attach halt ..." + targets 0 + halt +} + +$_TARGETNAME_0 configure -event gdb-attach { + halt +}