renesas_rcar_gen2.cfg 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # Renesas R-Car Generation 2 SOCs
  3. # - There are a combination of Cortex-A15s and Cortex-A7s for each Gen2 SOC
  4. # - Each SOC can boot through any of the, up to 2, core types that it has
  5. # 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
  8. # M2: Cortex-A15 x 2
  9. # V2H: Cortex-A15 x 2
  10. # M2N: Cortex-A15 x 2
  11. # E2: Cortex-A7 x 2
  12. # Usage:
  13. # There are 2 configuration options:
  14. # SOC: Selects the supported SOC. (Default 'H2')
  15. # BOOT_CORE: Selects the booting core. 'CA15', or 'CA7'
  16. # Defaults to 'CA15' if the SOC has one, else defaults to 'CA7'
  17. if { [info exists SOC] } {
  18. set _soc $SOC
  19. } else {
  20. set _soc H2
  21. }
  22. # Set configuration for each SOC and the default 'BOOT_CORE'
  23. switch $_soc {
  24. H2 {
  25. set _CHIPNAME r8a7790
  26. set _num_ca15 4
  27. set _num_ca7 4
  28. set _boot_core CA15
  29. }
  30. M2 {
  31. set _CHIPNAME r8a7791
  32. set _num_ca15 2
  33. set _num_ca7 0
  34. set _boot_core CA15
  35. }
  36. V2H {
  37. set _CHIPNAME r8a7792
  38. set _num_ca15 2
  39. set _num_ca7 0
  40. set _boot_core CA15
  41. }
  42. M2N {
  43. set _CHIPNAME r8a7793
  44. set _num_ca15 2
  45. set _num_ca7 0
  46. set _boot_core CA15
  47. }
  48. E2 {
  49. set _CHIPNAME r8a7794
  50. set _num_ca15 0
  51. set _num_ca7 2
  52. set _boot_core CA7
  53. }
  54. default {
  55. error "'$_soc' is invalid!"
  56. }
  57. }
  58. # If configured, override the default 'CHIPNAME'
  59. if { [info exists CHIPNAME] } {
  60. set _CHIPNAME $CHIPNAME
  61. }
  62. # If configured, override the default 'BOOT_CORE'
  63. if { [info exists BOOT_CORE] } {
  64. set _boot_core $BOOT_CORE
  65. }
  66. if { [info exists DAP_TAPID] } {
  67. set _DAP_TAPID $DAP_TAPID
  68. } else {
  69. set _DAP_TAPID 0x4ba00477
  70. }
  71. echo "\t$_soc - $_num_ca15 CA15(s), $_num_ca7 CA7(s)"
  72. echo "\tBoot Core - $_boot_core\n"
  73. set _DAPNAME $_CHIPNAME.dap
  74. # TAP and DAP
  75. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x01 -irmask 0x0f -expected-id $_DAP_TAPID
  76. dap create $_DAPNAME -chain-position $_CHIPNAME.cpu
  77. set CA15_DBGBASE {0x800B0000 0x800B2000 0x800B4000 0x800B6000}
  78. set CA7_DBGBASE {0x800F0000 0x800F2000 0x800F4000 0x800F6000}
  79. set _targets ""
  80. set smp_targets ""
  81. proc setup_ca {core_name dbgbase num boot} {
  82. global _CHIPNAME
  83. global _DAPNAME
  84. global smp_targets
  85. global _targets
  86. for { set _core 0 } { $_core < $num } { incr _core } {
  87. set _TARGETNAME $_CHIPNAME.$core_name.$_core
  88. set _CTINAME $_TARGETNAME.cti
  89. set _command "target create $_TARGETNAME cortex_a -dap $_DAPNAME \
  90. -coreid $_core -dbgbase [lindex $dbgbase $_core]"
  91. if { $_core == 0 && $boot == 1 } {
  92. set _targets "$_TARGETNAME"
  93. } else {
  94. set _command "$_command -defer-examine"
  95. }
  96. set smp_targets "$smp_targets $_TARGETNAME"
  97. eval $_command
  98. }
  99. }
  100. # Organize target list based on the boot core
  101. if { [string equal $_boot_core CA15] } {
  102. setup_ca a15 $CA15_DBGBASE $_num_ca15 1
  103. setup_ca a7 $CA7_DBGBASE $_num_ca7 0
  104. } elseif { [string equal $_boot_core CA7] } {
  105. setup_ca a7 $CA7_DBGBASE $_num_ca7 1
  106. setup_ca a15 $CA15_DBGBASE $_num_ca15 0
  107. } else {
  108. setup_ca a15 $CA15_DBGBASE $_num_ca15 0
  109. setup_ca a7 $CA7_DBGBASE $_num_ca7 0
  110. }
  111. source [find target/renesas_rcar_reset_common.cfg]
  112. eval "target smp $smp_targets"
  113. targets $_targets