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
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 # V3U: Cortex-A76 x 8, Cortex-R52 x2 (Lock-Step)
11 # V3H: Cortex-A53 x 4, Cortex-R7 x 2 (Lock-Step)
12 # V3M: Cortex-A53 x 2, Cortex-R7 x 2 (Lock-Step)
13 # E3: Cortex-A53 x 1, Cortex-R7 x 2 (Lock-Step)
17 # There are 2 configuration options:
18 # SOC: Selects the supported SOC. (Default 'H3')
19 # BOOT_CORE: Selects the booting core. 'CA57', 'CA53', or 'CR7'
20 # Defaults to 'CA57' if the SOC has one, else defaults to 'CA53'
22 if { [info exists SOC] } {
34 # Set configuration for each SOC and the default 'BOOT_CORE'
37 set _CHIPNAME r8a77950
44 set _CHIPNAME r8a77960
51 set _CHIPNAME r8a77965
58 set _CHIPNAME r8a77970
65 set _CHIPNAME r8a77980
72 set _CHIPNAME r8a77990
79 set _CHIPNAME r8a77995
86 set _CHIPNAME r8a779a0
92 error "'$_soc' is invalid!"
96 # If configured, override the default 'CHIPNAME'
97 if { [info exists CHIPNAME] } {
98 set _CHIPNAME $CHIPNAME
101 # If configured, override the default 'BOOT_CORE'
102 if { [info exists BOOT_CORE] } {
103 set _boot_core $BOOT_CORE
106 if { [info exists DAP_TAPID] } {
107 set _DAP_TAPID $DAP_TAPID
109 set _DAP_TAPID 0x5ba00477
112 echo "\t$_soc - $_num_ca76 CA76(s), $_num_ca57 CA57(s), $_num_ca53 CA53(s), $_num_cr52 CR52(s), $_num_cr7 CR7(s)"
113 echo "\tBoot Core - $_boot_core\n"
115 set _DAPNAME $_CHIPNAME.dap
118 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x01 -irmask 0x0f -expected-id $_DAP_TAPID
119 dap create $_DAPNAME -chain-position $_CHIPNAME.cpu
121 set CA76_DBGBASE {0x81410000 0x81510000 0x81610000 0x81710000 0x81c10000 0x81d10000 0x81e10000 0x81f10000}
122 set CA76_CTIBASE {0x81420000 0x81520000 0x81620000 0x81720000 0x81c20000 0x81d20000 0x81e20000 0x81f20000}
123 set CA57_DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000}
124 set CA57_CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000}
125 set CA53_DBGBASE {0x80C10000 0x80D10000 0x80E10000 0x80F10000}
126 set CA53_CTIBASE {0x80C20000 0x80D20000 0x80E20000 0x80F20000}
127 set CR52_DBGBASE 0x80c10000
128 set CR52_CTIBASE 0x80c20000
129 set CR7_DBGBASE 0x80910000
130 set CR7_CTIBASE 0x80918000
135 proc setup_a5x {core_name dbgbase ctibase num boot} {
140 for { set _core 0 } { $_core < $num } { incr _core } {
141 set _TARGETNAME $_CHIPNAME.$core_name.$_core
142 set _CTINAME $_TARGETNAME.cti
143 cti create $_CTINAME -dap $_DAPNAME -ap-num 1 \
144 -baseaddr [lindex $ctibase $_core]
145 set _command "target create $_TARGETNAME aarch64 -dap $_DAPNAME \
146 -ap-num 1 -dbgbase [lindex $dbgbase $_core] -cti $_CTINAME"
147 if { $_core == 0 && $boot == 1 } {
148 set _targets "$_TARGETNAME"
150 set _command "$_command -defer-examine"
152 set smp_targets "$smp_targets $_TARGETNAME"
157 proc setup_cr7 {core_name dbgbase ctibase num boot} {
160 for { set _core 0 } { $_core < $num } { incr _core } {
161 set _TARGETNAME $_CHIPNAME.$core_name
162 set _CTINAME $_TARGETNAME.cti
163 cti create $_CTINAME -dap $_DAPNAME -ap-num 1 -baseaddr $ctibase
164 set _command "target create $_TARGETNAME cortex_r4 -dap $_DAPNAME \
165 -ap-num 1 -dbgbase $dbgbase"
167 set _targets "$_TARGETNAME"
169 set _command "$_command -defer-examine"
175 # Organize target list based on the boot core
176 if { [string equal $_boot_core CA76] } {
177 setup_a5x a76 $CA76_DBGBASE $CA76_CTIBASE $_num_ca76 1
178 setup_cr7 r52 $CR52_DBGBASE $CR52_CTIBASE $_num_cr52 0
179 } elseif { [string equal $_boot_core CA57] } {
180 setup_a5x a57 $CA57_DBGBASE $CA57_CTIBASE $_num_ca57 1
181 setup_a5x a53 $CA53_DBGBASE $CA53_CTIBASE $_num_ca53 0
182 setup_cr7 r7 $CR7_DBGBASE $CR7_CTIBASE $_num_cr7 0
183 } elseif { [string equal $_boot_core CA53] } {
184 setup_a5x a53 $CA53_DBGBASE $CA53_CTIBASE $_num_ca53 1
185 setup_a5x a57 $CA57_DBGBASE $CA57_CTIBASE $_num_ca57 0
186 setup_cr7 r7 $CR7_DBGBASE $CR7_CTIBASE $_num_cr7 0
187 } elseif { [string equal $_boot_core CR52] } {
188 setup_cr7 r52 $CR52_DBGBASE $CR52_CTIBASE $_num_cr52 1
189 setup_a5x a76 $CA76_DBGBASE $CA76_CTIBASE $_num_ca76 0
191 setup_cr7 r7 $CR7_DBGBASE $CR7_CTIBASE $_num_cr7 1
192 setup_a5x a57 $CA57_DBGBASE $CA57_CTIBASE $_num_ca57 0
193 setup_a5x a53 $CA53_DBGBASE $CA53_CTIBASE $_num_ca53 0
196 source [find target/renesas_rcar_reset_common.cfg]
198 eval "target smp $smp_targets"