1 # Renesas R-Car Generation 2 SOCs
2 # - There are a combination of Cortex-A15s and Cortex-A7s for each Gen2 SOC
3 # - Each SOC can boot through any of the, up to 2, core types that it has
4 # e.g. H2 can boot through Cortex-A15 or Cortex-A7
6 # Supported Gen2 SOCs and their cores:
7 # H2: Cortex-A15 x 4, Cortex-A7 x 4
14 # There are 2 configuration options:
15 # SOC: Selects the supported SOC. (Default 'H2')
16 # BOOT_CORE: Selects the booting core. 'CA15', or 'CA7'
17 # Defaults to 'CA15' if the SOC has one, else defaults to 'CA7'
19 if { [info exists SOC] } {
25 # Set configuration for each SOC and the default 'BOOT_CORE'
58 error "'$_soc' is invalid!"
62 # If configured, override the default 'CHIPNAME'
63 if { [info exists CHIPNAME] } {
64 set _CHIPNAME $CHIPNAME
67 # If configured, override the default 'BOOT_CORE'
68 if { [info exists BOOT_CORE] } {
69 set _boot_core $BOOT_CORE
72 if { [info exists DAP_TAPID] } {
73 set _DAP_TAPID $DAP_TAPID
75 set _DAP_TAPID 0x4ba00477
78 echo "\t$_soc - $_num_ca15 CA15(s), $_num_ca7 CA7(s)"
79 echo "\tBoot Core - $_boot_core\n"
81 set _DAPNAME $_CHIPNAME.dap
84 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x01 -irmask 0x0f -expected-id $_DAP_TAPID
85 dap create $_DAPNAME -chain-position $_CHIPNAME.cpu
87 set CA15_DBGBASE {0x800B0000 0x800B2000 0x800B4000 0x800B6000}
88 set CA7_DBGBASE {0x800F0000 0x800F2000 0x800F4000 0x800F6000}
93 proc setup_ca {core_name dbgbase num boot} {
98 for { set _core 0 } { $_core < $num } { incr _core } {
99 set _TARGETNAME $_CHIPNAME.$core_name.$_core
100 set _CTINAME $_TARGETNAME.cti
101 set _command "target create $_TARGETNAME cortex_a -dap $_DAPNAME \
102 -coreid $_core -dbgbase [lindex $dbgbase $_core]"
103 if { $_core == 0 && $boot == 1 } {
104 set _targets "$_TARGETNAME"
106 set _command "$_command -defer-examine"
108 set smp_targets "$smp_targets $_TARGETNAME"
113 # Organize target list based on the boot core
114 if { [string equal $_boot_core CA15] } {
115 setup_ca a15 $CA15_DBGBASE $_num_ca15 1
116 setup_ca a7 $CA7_DBGBASE $_num_ca7 0
117 } elseif { [string equal $_boot_core CA7] } {
118 setup_ca a7 $CA7_DBGBASE $_num_ca7 1
119 setup_ca a15 $CA15_DBGBASE $_num_ca15 0
121 setup_ca a15 $CA15_DBGBASE $_num_ca15 0
122 setup_ca a7 $CA7_DBGBASE $_num_ca7 0
125 source [find target/renesas_rcar_reset_common.cfg]
127 eval "target smp $smp_targets"