lpc4350.cfg 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. source [find target/swj-dp.tcl]
  3. adapter speed 500
  4. if { [info exists CHIPNAME] } {
  5. set _CHIPNAME $CHIPNAME
  6. } else {
  7. set _CHIPNAME lpc4350
  8. }
  9. #
  10. # M4 JTAG mode TAP
  11. #
  12. if { [info exists M4_JTAG_TAPID] } {
  13. set _M4_JTAG_TAPID $M4_JTAG_TAPID
  14. } else {
  15. set _M4_JTAG_TAPID 0x4ba00477
  16. }
  17. #
  18. # M4 SWD mode TAP
  19. #
  20. if { [info exists M4_SWD_TAPID] } {
  21. set _M4_SWD_TAPID $M4_SWD_TAPID
  22. } else {
  23. set _M4_SWD_TAPID 0x2ba01477
  24. }
  25. if { [using_jtag] } {
  26. set _M4_TAPID $_M4_JTAG_TAPID
  27. } {
  28. set _M4_TAPID $_M4_SWD_TAPID
  29. }
  30. #
  31. # M0 TAP
  32. #
  33. if { [info exists M0_JTAG_TAPID] } {
  34. set _M0_JTAG_TAPID $M0_JTAG_TAPID
  35. } else {
  36. set _M0_JTAG_TAPID 0x0ba01477
  37. }
  38. swj_newdap $_CHIPNAME m4 -irlen 4 -ircapture 0x1 -irmask 0xf \
  39. -expected-id $_M4_TAPID
  40. dap create $_CHIPNAME.m4.dap -chain-position $_CHIPNAME.m4
  41. target create $_CHIPNAME.m4 cortex_m -dap $_CHIPNAME.m4.dap
  42. if { [using_jtag] } {
  43. swj_newdap $_CHIPNAME m0 -irlen 4 -ircapture 0x1 -irmask 0xf \
  44. -expected-id $_M0_JTAG_TAPID
  45. dap create $_CHIPNAME.m0.dap -chain-position $_CHIPNAME.m0
  46. target create $_CHIPNAME.m0 cortex_m -dap $_CHIPNAME.m0.dap
  47. }
  48. # LPC4350 has 96+32 KB SRAM
  49. if { [info exists WORKAREASIZE] } {
  50. set _WORKAREASIZE $WORKAREASIZE
  51. } else {
  52. set _WORKAREASIZE 0x20000
  53. }
  54. $_CHIPNAME.m4 configure -work-area-phys 0x10000000 \
  55. -work-area-size $_WORKAREASIZE -work-area-backup 0
  56. if {![using_hla]} {
  57. # on this CPU we should use VECTRESET to perform a soft reset and
  58. # manually reset the periphery
  59. # SRST or SYSRESETREQ disable the debug interface for the time of
  60. # the reset and will not fit our requirements for a consistent debug
  61. # session
  62. cortex_m reset_config vectreset
  63. }