Joakim Bech | 13dc81c | 2019-02-04 15:13:17 +0100 | [diff] [blame] | 1 | # Credits to Petr Tesarik from SUSE who provided this updated configuration, |
| 2 | # source: https://www.suse.com/c/debugging-raspberry-pi-3-with-jtag/ |
Philip Attfield | c14e952 | 2016-09-14 07:57:07 +0200 | [diff] [blame] | 3 | transport select jtag |
| 4 | |
Joakim Bech | 13dc81c | 2019-02-04 15:13:17 +0100 | [diff] [blame] | 5 | # we need to enable srst even though we don't connect it |
| 6 | reset_config trst_and_srst |
| 7 | |
Philip Attfield | c14e952 | 2016-09-14 07:57:07 +0200 | [diff] [blame] | 8 | adapter_khz 1000 |
Joakim Bech | 13dc81c | 2019-02-04 15:13:17 +0100 | [diff] [blame] | 9 | jtag_ntrst_delay 500 |
Philip Attfield | c14e952 | 2016-09-14 07:57:07 +0200 | [diff] [blame] | 10 | |
Joakim Bech | 13dc81c | 2019-02-04 15:13:17 +0100 | [diff] [blame] | 11 | if { [info exists CHIPNAME] } { |
| 12 | set _CHIPNAME $CHIPNAME |
| 13 | } else { |
| 14 | set _CHIPNAME rpi3 |
Philip Attfield | c14e952 | 2016-09-14 07:57:07 +0200 | [diff] [blame] | 15 | } |
| 16 | |
Joakim Bech | 13dc81c | 2019-02-04 15:13:17 +0100 | [diff] [blame] | 17 | # |
| 18 | # Main DAP |
| 19 | # |
| 20 | if { [info exists DAP_TAPID] } { |
| 21 | set _DAP_TAPID $DAP_TAPID |
| 22 | } else { |
| 23 | set _DAP_TAPID 0x4ba00477 |
| 24 | } |
| 25 | |
| 26 | jtag newtap $_CHIPNAME tap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -enable |
| 27 | dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.tap |
| 28 | |
| 29 | set _TARGETNAME $_CHIPNAME.a53 |
| 30 | set _CTINAME $_CHIPNAME.cti |
| 31 | |
| 32 | set DBGBASE {0x80010000 0x80012000 0x80014000 0x80016000} |
| 33 | set CTIBASE {0x80018000 0x80019000 0x8001a000 0x8001b000} |
| 34 | set _cores 4 |
| 35 | |
| 36 | for { set _core 0 } { $_core < $_cores } { incr _core } { |
| 37 | |
| 38 | cti create $_CTINAME.$_core -dap $_CHIPNAME.dap -ap-num 0 \ |
| 39 | -ctibase [lindex $CTIBASE $_core] |
| 40 | |
| 41 | target create $_TARGETNAME.$_core aarch64 \ |
| 42 | -dap $_CHIPNAME.dap -coreid $_core \ |
| 43 | -dbgbase [lindex $DBGBASE $_core] -cti $_CTINAME.$_core |
| 44 | |
| 45 | $_TARGETNAME.$_core configure -event reset-assert-post "aarch64 dbginit" |
| 46 | $_TARGETNAME.$_core configure -event gdb-attach { halt } |
Philip Attfield | c14e952 | 2016-09-14 07:57:07 +0200 | [diff] [blame] | 47 | } |