tcl/target: Select default boot core on Renesas R-Car Gen2/Gen3
[openocd.git] / tcl / target / renesas_rcar_gen3.cfg
1 # Renesas R-Car Generation 3 SOCs
2 # - There are a combination of Cortex-A57s, Cortex-A53s, and Cortex-R7 for each Gen3 SOC
3 # - Each SOC can boot through any of the, up to 3, core types that it has
4 # e.g. H3 can boot through Cortex-A57, Cortex-A53, or Cortex-R7
5
6 # Supported Gen3 SOCs and their cores:
7 # H3: Cortex-A57 x 4, Cortex-A53 x 4, Cortex-R7 x 2 (Lock-Step)
8 # M3W: Cortex-A57 x 2, Cortex-A53 x 4, Cortex-R7 x 2 (Lock-Step)
9 # M3N: Cortex-A57 x 2, Cortex-R7 x 2 (Lock-Step)
10 # V3H: Cortex-A53 x 4, Cortex-R7 x 2 (Lock-Step)
11 # V3M: Cortex-A53 x 2, Cortex-R7 x 2 (Lock-Step)
12 # E3: Cortex-A53 x 1, Cortex-R7 x 2 (Lock-Step)
13 # D3: Cortex-A53 x 1
14
15 # Usage:
16 # There are 2 configuration options:
17 # SOC: Selects the supported SOC. (Default 'H3')
18 # BOOT_CORE: Selects the booting core. 'CA57', 'CA53', or 'CR7'
19 # Defaults to 'CA57' if the SOC has one, else defaults to 'CA53'
20
21 if { [info exists SOC] } {
22 set _soc $SOC
23 } else {
24 set _soc H3
25 }
26
27 # Set configuration for each SOC and the default 'BOOT_CORE'
28 switch $_soc {
29 H3 {
30 set _CHIPNAME r8a77950
31 set _num_ca57 4
32 set _num_ca53 4
33 set _num_cr7 1
34 set _boot_core CA57
35 }
36 M3W {
37 set _CHIPNAME r8a77960
38 set _num_ca57 2
39 set _num_ca53 4
40 set _num_cr7 1
41 set _boot_core CA57
42 }
43 M3N {
44 set _CHIPNAME r8a77965
45 set _num_ca57 2
46 set _num_ca53 4
47 set _num_cr7 1
48 set _boot_core CA57
49 }
50 V3M {
51 set _CHIPNAME r8a77970
52 set _num_ca57 0
53 set _num_ca53 2
54 set _num_cr7 1
55 set _boot_core CA53
56 }
57 V3H {
58 set _CHIPNAME r8a77980
59 set _num_ca57 0
60 set _num_ca53 4
61 set _num_cr7 1
62 set _boot_core CA53
63 }
64 E3 {
65 set _CHIPNAME r8a77990
66 set _num_ca57 0
67 set _num_ca53 1
68 set _num_cr7 1
69 set _boot_core CA53
70 }
71 D3 {
72 set _CHIPNAME r8a77995
73 set _num_ca57 0
74 set _num_ca53 1
75 set _num_cr7 0
76 set _boot_core CA53
77 }
78 default {
79 error "'$_soc' is invalid!"
80 }
81 }
82
83 # If configured, override the default 'CHIPNAME'
84 if { [info exists CHIPNAME] } {
85 set _CHIPNAME $CHIPNAME
86 }
87
88 # If configured, override the default 'BOOT_CORE'
89 if { [info exists BOOT_CORE] } {
90 set _boot_core $BOOT_CORE
91 }
92
93 if { [info exists DAP_TAPID] } {
94 set _DAP_TAPID $DAP_TAPID
95 } else {
96 set _DAP_TAPID 0x5ba00477
97 }
98
99 echo "\t$_soc - $_num_ca57 CA57(s), $_num_ca53 CA53(s), $_num_cr7 CR7(s)"
100 echo "\tBoot Core - $_boot_core\n"
101
102 set _DAPNAME $_CHIPNAME.dap
103
104 # TAP and DAP
105 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x01 -irmask 0x0f -expected-id $_DAP_TAPID
106 dap create $_DAPNAME -chain-position $_CHIPNAME.cpu
107
108 set CA57_DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
109 set CA57_CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
110 set CA53_DBGBASE {0x80C10000 0x80D10000 0x80E10000 0x80F10000}
111 set CA53_CTIBASE {0x80C20000 0x80D20000 0x80E20000 0x80F20000}
112 set CR7_DBGBASE 0x80910000
113 set CR7_CTIBASE 0x80918000
114
115 set _targets ""
116 set smp_targets ""
117
118 proc setup_a5x {core_name dbgbase ctibase num boot} {
119 global _CHIPNAME
120 global _DAPNAME
121 global smp_targets
122 global _targets
123 for { set _core 0 } { $_core < $num } { incr _core } {
124 set _TARGETNAME $_CHIPNAME.$core_name.$_core
125 set _CTINAME $_TARGETNAME.cti
126 cti create $_CTINAME -dap $_DAPNAME -ap-num 1 \
127 -baseaddr [lindex $ctibase $_core]
128 set _command "target create $_TARGETNAME aarch64 -dap $_DAPNAME \
129 -ap-num 1 -dbgbase [lindex $dbgbase $_core] -cti $_CTINAME"
130 if { $_core == 0 && $boot == 1 } {
131 set _targets "$_TARGETNAME"
132 } else {
133 set _command "$_command -defer-examine"
134 }
135 set smp_targets "$smp_targets $_TARGETNAME"
136 eval $_command
137 }
138 }
139
140 proc setup_cr7 {dbgbase ctibase boot} {
141 global _CHIPNAME
142 global _DAPNAME
143 set _TARGETNAME $_CHIPNAME.r7
144 set _CTINAME $_TARGETNAME.cti
145 cti create $_CTINAME -dap $_DAPNAME -ap-num 1 -baseaddr $ctibase
146 set _command "target create $_TARGETNAME cortex_r4 -dap $_DAPNAME \
147 -ap-num 1 -dbgbase $dbgbase"
148 if { $boot == 1 } {
149 set _targets "$_TARGETNAME"
150 } else {
151 set _command "$_command -defer-examine"
152 }
153 eval $_command
154 }
155
156 # Organize target list based on the boot core
157 if { [string equal $_boot_core CA57] } {
158 setup_a5x a57 $CA57_DBGBASE $CA57_CTIBASE $_num_ca57 1
159 setup_a5x a53 $CA53_DBGBASE $CA53_CTIBASE $_num_ca53 0
160 setup_cr7 $CR7_DBGBASE $CR7_CTIBASE 0
161 } elseif { [string equal $_boot_core CA53] } {
162 setup_a5x a53 $CA53_DBGBASE $CA53_CTIBASE $_num_ca53 1
163 setup_a5x a57 $CA57_DBGBASE $CA57_CTIBASE $_num_ca57 0
164 setup_cr7 $CR7_DBGBASE $CR7_CTIBASE 0
165 } else {
166 setup_cr7 $CR7_DBGBASE $CR7_CTIBASE 1
167 setup_a5x a57 $CA57_DBGBASE $CA57_CTIBASE $_num_ca57 0
168 setup_a5x a53 $CA53_DBGBASE $CA53_CTIBASE $_num_ca53 0
169 }
170
171 source [find target/renesas_rcar_reset_common.cfg]
172
173 eval "target smp $smp_targets"
174 targets $_targets

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)