hi3798.cfg 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # Hisilicon Hi3798 Target
  3. if { [info exists CHIPNAME] } {
  4. set _CHIPNAME $CHIPNAME
  5. } else {
  6. set _CHIPNAME hi3798
  7. }
  8. #
  9. # Main DAP
  10. #
  11. if { [info exists DAP_TAPID] } {
  12. set _DAP_TAPID $DAP_TAPID
  13. } else {
  14. set _DAP_TAPID 0x5ba00477
  15. }
  16. # declare the one JTAG tap to access the DAP
  17. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -ignore-version -enable
  18. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
  19. # declare the 4 main application cores
  20. set _TARGETNAME $_CHIPNAME.cpu
  21. set _smp_command ""
  22. set $_TARGETNAME.cti(0) 0x80020000
  23. set $_TARGETNAME.cti(1) 0x80120000
  24. set $_TARGETNAME.cti(2) 0x80220000
  25. set $_TARGETNAME.cti(3) 0x80320000
  26. set _cores 4
  27. for { set _core 0 } { $_core < $_cores } { incr _core 1 } {
  28. cti create cti$_core -dap $_CHIPNAME.dap -baseaddr [set $_TARGETNAME.cti($_core)] -ap-num 0
  29. set _command "target create ${_TARGETNAME}$_core aarch64 \
  30. -dap $_CHIPNAME.dap -coreid $_core -cti cti$_core"
  31. if { $_core != 0 } {
  32. # non-boot core examination may fail
  33. #set _command "$_command -defer-examine"
  34. set _smp_command "$_smp_command ${_TARGETNAME}$_core"
  35. } else {
  36. set _command "$_command -rtos hwthread"
  37. set _smp_command "target smp ${_TARGETNAME}$_core"
  38. }
  39. eval $_command
  40. }
  41. eval $_smp_command