phytec_lpc3250.cfg 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. source [find target/lpc3250.cfg]
  3. adapter srst delay 200
  4. jtag_ntrst_delay 1
  5. adapter speed 200
  6. reset_config trst_and_srst separate
  7. arm7_9 dcc_downloads enable
  8. $_TARGETNAME configure -event gdb-attach { reset init }
  9. $_TARGETNAME configure -event reset-start {
  10. arm7_9 fast_memory_access disable
  11. adapter speed 200
  12. }
  13. $_TARGETNAME configure -event reset-end {
  14. adapter speed 6000
  15. arm7_9 fast_memory_access enable
  16. }
  17. $_TARGETNAME configure -event reset-init { phytec_lpc3250_init }
  18. # Bare-bones initialization of core clocks and SDRAM
  19. proc phytec_lpc3250_init { } {
  20. # Set clock dividers
  21. # ARMCLK = 266.5 MHz
  22. # HCLK = 133.25 MHz
  23. # PERIPHCLK = 13.325 MHz
  24. mww 0x400040BC 0
  25. mww 0x40004050 0x140
  26. mww 0x40004040 0x4D
  27. mww 0x40004058 0x16250
  28. # Init PLLs
  29. mww 0x40004044 0x006
  30. sleep 1 busy
  31. mww 0x40004044 0x106
  32. sleep 1 busy
  33. mww 0x40004044 0x006
  34. sleep 1 busy
  35. mww 0x40004048 0x2
  36. # Init SDRAM with 133 MHz timings
  37. mww 0x40028134 0x00FFFFFF
  38. mww 0x4002802C 0x00000008
  39. mww 0x31080000 1
  40. mww 0x31080008 0
  41. mww 0x40004068 0x1C000
  42. mww 0x31080028 0x11
  43. mww 0x31080400 0
  44. mww 0x31080440 0
  45. mww 0x31080460 0
  46. mww 0x31080480 0
  47. # Delays
  48. mww 0x31080030 1
  49. mww 0x31080034 6
  50. mww 0x31080038 10
  51. mww 0x31080044 1
  52. mww 0x31080048 9
  53. mww 0x3108004C 12
  54. mww 0x31080050 10
  55. mww 0x31080054 1
  56. mww 0x31080058 1
  57. mww 0x3108005C 0
  58. mww 0x31080100 0x5680
  59. mww 0x31080104 0x302
  60. # Init sequence
  61. mww 0x31080020 0x193
  62. sleep 1 busy
  63. mww 0x31080024 1
  64. mww 0x31080020 0x113
  65. sleep 1 busy
  66. mww 0x31080020 0x013
  67. sleep 1 busy
  68. mww 0x31080024 65
  69. mww 0x31080020 0x093
  70. mdw 0x80020000
  71. mww 0x31080020 0x013
  72. # SYS_CTRL remapping
  73. mww 0x40004014 1
  74. }