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}
92 proc setup_ca {core_name dbgbase num boot} {
96 for { set _core 0 } { $_core < $num } { incr _core } {
97 set _TARGETNAME $_CHIPNAME.$core_name.$_core
98 set _CTINAME $_TARGETNAME.cti
99 set _command "target create $_TARGETNAME cortex_a -dap $_DAPNAME \
100 -coreid $_core -dbgbase [lindex $dbgbase $_core]"
101 if { $_core == 0 && $boot == 1 } {
102 set _targets "$_TARGETNAME"
104 set _command "$_command -defer-examine"
106 set smp_targets "$smp_targets $_TARGETNAME"
111 # Organize target list based on the boot core
112 if { [string equal $_boot_core CA15] } {
113 setup_ca a15 $CA15_DBGBASE $_num_ca15 1
114 setup_ca a7 $CA7_DBGBASE $_num_ca7 0
115 } elseif { [string equal $_boot_core CA7] } {
116 setup_ca a7 $CA7_DBGBASE $_num_ca7 1
117 setup_ca a15 $CA15_DBGBASE $_num_ca15 0
119 setup_ca a15 $CA15_DBGBASE $_num_ca15 0
120 setup_ca a7 $CA7_DBGBASE $_num_ca7 0
123 source [find target/renesas_rcar_reset_common.cfg]
125 eval "target smp $smp_targets"