1 source [find target/icepick.cfg]
3 if { [info exists CHIPNAME] } {
4 set _CHIPNAME $CHIPNAME
9 # set the taps to be enabled by default. this can be overridden
10 # by setting DEFAULT_TAPS in a separate configuration file
11 # or directly on the command line.
12 if { [info exists DEFAULT_TAPS] } {
13 set _DEFAULT_TAPS "$DEFAULT_TAPS"
15 set _DEFAULT_TAPS "$_CHIPNAME.tap"
21 if { [info exists DAP_TAPID] } {
22 set _DAP_TAPID $DAP_TAPID
24 set _DAP_TAPID 0x4b6b902f
26 jtag newtap $_CHIPNAME tap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -disable
27 jtag configure $_CHIPNAME.tap -event tap-enable "icepick_d_tapenable $_CHIPNAME.jrc 12 0"
28 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.tap
33 if { [info exists M3_DAP_TAPID] } {
34 set _M3_DAP_TAPID $M3_DAP_TAPID
36 set _M3_DAP_TAPID 0x4b6b902f
38 jtag newtap $_CHIPNAME m3_tap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_M3_DAP_TAPID -disable
39 jtag configure $_CHIPNAME.m3_tap -event tap-enable "icepick_d_tapenable $_CHIPNAME.jrc 11 0"
40 dap create $_CHIPNAME.m3_dap -chain-position $_CHIPNAME.m3_tap
43 # ICEpick-D (JTAG route controller)
45 if { [info exists JRC_TAPID] } {
46 set _JRC_TAPID $JRC_TAPID
48 set _JRC_TAPID 0x0b94402f
50 jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f -expected-id $_JRC_TAPID -ignore-version
51 jtag configure $_CHIPNAME.jrc -event setup {
53 enable_default_taps $_DEFAULT_TAPS
55 # some TCK tycles are required to activate the DEBUG power domain
56 jtag configure $_CHIPNAME.jrc -event post-reset "runtest 100"
59 # helper function that enables all taps passed as argument
61 proc enable_default_taps { taps } {
70 set _TARGETNAME_2 $_CHIPNAME.m3
71 target create $_TARGETNAME_2 cortex_m -dap $_CHIPNAME.m3_dap
76 set _TARGETNAME $_CHIPNAME.cpu
77 target create $_TARGETNAME cortex_a -dap $_CHIPNAME.dap -dbgbase 0x80001000
79 # SRAM: 64K at 0x4030.0000; use the first 16K
80 $_TARGETNAME configure -work-area-phys 0x40300000 -work-area-size 0x4000
83 # when putting the target into 'reset halt', we need to disable the watchdog as
84 # it would otherwise trigger while we're in JTAG
85 # FIXME: unify with target/am437x.cfg
86 source [find mem_helper.tcl]
87 set WDT1_BASE_ADDR 0x44e35000
88 set WDT1_W_PEND_WSPR [expr $WDT1_BASE_ADDR + 0x0034]
89 set WDT1_WSPR [expr $WDT1_BASE_ADDR + 0x0048]
90 proc disable_watchdog { } {
92 global WDT1_W_PEND_WSPR
95 set curstate [$_TARGETNAME curstate]
97 if { [string compare $curstate halted] == 0 } {
98 set WDT_DISABLE_SEQ1 0xaaaa
99 set WDT_DISABLE_SEQ2 0x5555
101 mww phys $WDT1_WSPR $WDT_DISABLE_SEQ1
103 # Empty body to make sure this executes as fast as possible.
104 # We don't want any delays here otherwise romcode might start
105 # executing and end up changing state of certain IPs.
106 while { [expr [mrw $WDT1_W_PEND_WSPR] & 0x10] } { }
108 mww phys $WDT1_WSPR $WDT_DISABLE_SEQ2
109 while { [expr [mrw $WDT1_W_PEND_WSPR] & 0x10] } { }
112 $_TARGETNAME configure -event reset-end { disable_watchdog }