imx6.cfg 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. #
  3. # Freescale i.MX6 series
  4. #
  5. # Supports 6Q 6D 6QP 6DP 6DL 6S 6SL 6SLL
  6. #
  7. # Some imx6 chips have Cortex-A7 or an Cortex-M and need special handling
  8. #
  9. if { [info exists CHIPNAME] } {
  10. set _CHIPNAME $CHIPNAME
  11. } else {
  12. set _CHIPNAME imx6
  13. }
  14. # CoreSight Debug Access Port
  15. if { [info exists DAP_TAPID] } {
  16. set _DAP_TAPID $DAP_TAPID
  17. } else {
  18. set _DAP_TAPID 0x4ba00477
  19. }
  20. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x01 -irmask 0x0f \
  21. -expected-id $_DAP_TAPID
  22. # SDMA / no IDCODE
  23. jtag newtap $_CHIPNAME sdma -irlen 4 -ircapture 0x00 -irmask 0x0f
  24. # System JTAG Controller
  25. # List supported SJC TAPIDs from imx reference manuals:
  26. set _SJC_TAPID_6Q 0x0191c01d
  27. set _SJC_TAPID_6D 0x0191e01d
  28. set _SJC_TAPID_6QP 0x3191c01d
  29. set _SJC_TAPID_6DP 0x3191d01d
  30. set _SJC_TAPID_6DL 0x0891a01d
  31. set _SJC_TAPID_6S 0x0891b01d
  32. set _SJC_TAPID_6SL 0x0891f01d
  33. set _SJC_TAPID_6SLL 0x088c201d
  34. # Allow external override of the first SJC TAPID
  35. if { [info exists SJC_TAPID] } {
  36. set _SJC_TAPID $SJC_TAPID
  37. } else {
  38. set _SJC_TAPID $_SJC_TAPID_6Q
  39. }
  40. jtag newtap $_CHIPNAME sjc -irlen 5 -ircapture 0x01 -irmask 0x1f \
  41. -ignore-version \
  42. -expected-id $_SJC_TAPID \
  43. -expected-id $_SJC_TAPID_6QP \
  44. -expected-id $_SJC_TAPID_6DP \
  45. -expected-id $_SJC_TAPID_6D \
  46. -expected-id $_SJC_TAPID_6DL \
  47. -expected-id $_SJC_TAPID_6S \
  48. -expected-id $_SJC_TAPID_6SL \
  49. -expected-id $_SJC_TAPID_6SLL
  50. # GDB target: Cortex-A9, using DAP, configuring only one core
  51. # Base addresses of cores:
  52. # core 0 - 0x82150000
  53. # core 1 - 0x82152000
  54. # core 2 - 0x82154000
  55. # core 3 - 0x82156000
  56. set _TARGETNAME $_CHIPNAME.cpu.0
  57. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
  58. target create $_TARGETNAME cortex_a -dap $_CHIPNAME.dap \
  59. -coreid 0 -dbgbase 0x82150000
  60. # some TCK cycles are required to activate the DEBUG power domain
  61. jtag configure $_CHIPNAME.sjc -event post-reset "runtest 100"
  62. proc imx6_dbginit {target} {
  63. # General Cortex-A8/A9 debug initialisation
  64. cortex_a dbginit
  65. }
  66. # Slow speed to be sure it will work
  67. adapter speed 1000
  68. $_TARGETNAME configure -event reset-start { adapter speed 1000 }
  69. $_TARGETNAME configure -event reset-assert-post "imx6_dbginit $_TARGETNAME"