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.
 
 
 
 
 
 

76 lines
1.8 KiB

  1. # Keil MCB1700 PCB with 1768
  2. #
  3. # Reset init script sets it to 100MHz
  4. set CCLK 100000
  5. source [find target/lpc1768.cfg]
  6. global MCB1700_CCLK
  7. set MCB1700_CCLK $CCLK
  8. $_TARGETNAME configure -event reset-start {
  9. # Start *real slow* as we do not know the
  10. # state the boot rom left the clock in
  11. adapter_khz 10
  12. }
  13. # Set up 100MHz clock to CPU
  14. $_TARGETNAME configure -event reset-init {
  15. # PLL0CON: Disable PLL
  16. mww 0x400FC080 0x00000000
  17. # PLLFEED
  18. mww 0x400FC08C 0x000000AA
  19. # PLLFEED
  20. mww 0x400FC08C 0x00000055
  21. # CCLK=PLL/4 (=100 MHz)
  22. mww 0x400FC104 0x00000003
  23. # CLKSRCSEL: Clock source = internal RC oscillator
  24. mww 0x400FC10C 0x00000000
  25. # PLL0CFG: M=50,N=1 -> PLL=400 MHz
  26. mww 0x400FC084 0x00000031
  27. # PLLFEED
  28. mww 0x400FC08C 0x000000AA
  29. # PLLFEED
  30. mww 0x400FC08C 0x00000055
  31. # PLL0CON: Enable PLL
  32. mww 0x400FC080 0x00000001
  33. # PLLFEED
  34. mww 0x400FC08C 0x000000AA
  35. # PLLFEED
  36. mww 0x400FC08C 0x00000055
  37. sleep 50
  38. # PLL0CON: Connect PLL
  39. mww 0x400FC080 0x00000003
  40. # PLLFEED
  41. mww 0x400FC08C 0x000000AA
  42. # PLLFEED
  43. mww 0x400FC08C 0x00000055
  44. # Dividing CPU clock by 8 should be pretty conservative
  45. #
  46. #
  47. global MCB1700_CCLK
  48. adapter_khz [expr $MCB1700_CCLK / 8]
  49. # Do not remap 0x0000-0x0020 to anything but the flash (i.e. select
  50. # "User Flash Mode" where interrupt vectors are _not_ remapped,
  51. # and reside in flash instead).
  52. #
  53. # See Table 612. Memory Mapping Control register (MEMMAP - 0x400F C040) bit description
  54. # Bit Symbol Value Description Reset
  55. # value
  56. # 0 MAP Memory map control. 0
  57. # 0 Boot mode. A portion of the Boot ROM is mapped to address 0.
  58. # 1 User mode. The on-chip Flash memory is mapped to address 0.
  59. # 31:1 - Reserved. The value read from a reserved bit is not defined. NA
  60. #
  61. # http://ics.nxp.com/support/documents/microcontrollers/?scope=LPC1768&type=user
  62. mww 0x400FC040 0x01
  63. }