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.
 
 
 
 
 
 

67 lines
2.0 KiB

  1. if { [info exists CHIPNAME] } {
  2. set _CHIPNAME $CHIPNAME
  3. } else {
  4. set _CHIPNAME lpc2900
  5. }
  6. if { [info exists CPUTAPID ] } {
  7. set _CPUTAPID $CPUTAPID
  8. } else {
  9. set _CPUTAPID 0x0596802B
  10. }
  11. if { [info exists HAS_ETB ] } {
  12. } else {
  13. # Set default (no ETB).
  14. # Show a warning, because this should have been configured explicitely.
  15. set HAS_ETB 0
  16. # TODO warning?
  17. }
  18. if { [info exists ETBTAPID ] } {
  19. set _ETBTAPID $ETBTAPID
  20. } else {
  21. set _ETBTAPID 0x1B900F0F
  22. }
  23. # TRST and SRST both exist, and can be controlled independently
  24. reset_config trst_and_srst separate
  25. # Define the _TARGETNAME
  26. set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
  27. # Include the ETB tap controller if asked for.
  28. # Has to be done manually for newer devices (not an "old" LPC2917/2919).
  29. if { $HAS_ETB == 1 } {
  30. # Clear the HAS_ETB flag. Must be set again for a new tap in the chain.
  31. set HAS_ETB 0
  32. # Add the ETB tap controller and the ARM9 core debug tap
  33. jtag newtap $_CHIPNAME etb -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_ETBTAPID
  34. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  35. # Create the ".cpu" target
  36. target create $_TARGETNAME arm966e -endian little -chain-position $_TARGETNAME -variant arm966e
  37. # Configure ETM and ETB
  38. etm config $_TARGETNAME 8 normal full etb
  39. etb config $_TARGETNAME $_CHIPNAME.etb
  40. } else {
  41. # Add the ARM9 core debug tap
  42. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  43. # Create the ".cpu" target
  44. target create $_TARGETNAME arm966e -endian little -chain-position $_TARGETNAME -variant arm966e
  45. }
  46. arm7_9 dbgrq enable
  47. arm7_9 dcc_downloads enable
  48. # Flash bank configuration:
  49. # Flash: flash bank lpc2900 0 0 0 0 <target#> <flash clock (CLK_SYS_FMC) in kHz>
  50. # Flash base address, total flash size, and number of sectors are all configured automatically.
  51. set _FLASHNAME $_CHIPNAME.flash
  52. flash bank $_FLASHNAME lpc2900 0 0 0 0 $_TARGETNAME $FLASH_CLOCK