You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

200 lines
5.6 KiB

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