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.
 
 
 
 
 
 

79 lines
2.0 KiB

  1. #
  2. # This is for the "at91rm9200-DK" (not the EK) eval board.
  3. #
  4. # The two are probably very simular.... I have DK...
  5. #
  6. # It has atmel at91rm9200 chip.
  7. source [find target/at91rm9200.cfg]
  8. $_TARGETNAME configure -event gdb-attach { reset init }
  9. $_TARGETNAME configure -event reset-init { at91rm9200_dk_init }
  10. #flash bank <driver> <base> <size> <chip_width> <bus_width>
  11. flash_bank cfi 0x10000000 0x00200000 2 2 0
  12. proc at91rm9200_dk_init { } {
  13. # Try to run at 1khz... Yea, that slow!
  14. # Chip is really running @ 32khz
  15. jtag_khz 8
  16. mww 0xfffffc64 0xffffffff
  17. ## disable all clocks but system clock
  18. mww 0xfffffc04 0xfffffffe
  19. ## disable all clocks to pioa and piob
  20. mww 0xfffffc14 0xffffffc3
  21. ## master clock = slow cpu = slow
  22. ## (means the CPU is running at 32khz!)
  23. mww 0xfffffc30 0
  24. ## main osc enable
  25. mww 0xfffffc20 0x0000ff01
  26. ## program pllA
  27. mww 0xfffffc28 0x20263e04
  28. ## program pllB
  29. mww 0xfffffc2c 0x10483e0e
  30. ## let pll settle... sleep 100msec
  31. sleep 100
  32. ## switch to fast clock
  33. mww 0xfffffc30 0x202
  34. ## Sleep some - (go read)
  35. sleep 100
  36. #========================================
  37. # CPU now runs at 180mhz
  38. # SYS runs at 60mhz.
  39. jtag_khz 40000
  40. #========================================
  41. ## set memc for all memories
  42. mww 0xffffff60 0x02
  43. ## program smc controller
  44. mww 0xffffff70 0x3284
  45. ## init sdram
  46. mww 0xffffff98 0x7fffffd0
  47. ## all banks precharge
  48. mww 0xffffff80 0x02
  49. ## touch sdram chip to make it work
  50. mww 0x20000000 0
  51. ## sdram controller mode register
  52. mww 0xffffff90 0x04
  53. mww 0x20000000 0
  54. mww 0x20000000 0
  55. mww 0x20000000 0
  56. mww 0x20000000 0
  57. mww 0x20000000 0
  58. mww 0x20000000 0
  59. mww 0x20000000 0
  60. mww 0x20000000 0
  61. ## sdram controller mode register
  62. ## Refresh, etc....
  63. mww 0xffffff90 0x03
  64. mww 0x20000080 0
  65. mww 0xffffff94 0x1f4
  66. mww 0x20000080 0
  67. mww 0xffffff90 0x10
  68. mww 0x20000000 0
  69. mww 0xffffff00 0x01
  70. }