mcb1700.cfg 1.9 KB

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