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.
 
 
 
 
 
 

83 lines
2.1 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. reset_config trst_and_srst
  9. $_TARGETNAME configure -event gdb-attach { reset init }
  10. $_TARGETNAME configure -event reset-init { at91rm9200_dk_init }
  11. #flash bank <name> <driver> <base> <size> <chip_width> <bus_width> <target>
  12. set _FLASHNAME $_CHIPNAME.flash
  13. flash bank $_FLASHNAME cfi 0x10000000 0x00200000 2 2 $_TARGETNAME
  14. proc at91rm9200_dk_init { } {
  15. # Try to run at 1khz... Yea, that slow!
  16. # Chip is really running @ 32khz
  17. adapter_khz 8
  18. mww 0xfffffc64 0xffffffff
  19. ## disable all clocks but system clock
  20. mww 0xfffffc04 0xfffffffe
  21. ## disable all clocks to pioa and piob
  22. mww 0xfffffc14 0xffffffc3
  23. ## master clock = slow cpu = slow
  24. ## (means the CPU is running at 32khz!)
  25. mww 0xfffffc30 0
  26. ## main osc enable
  27. mww 0xfffffc20 0x0000ff01
  28. ## program pllA
  29. mww 0xfffffc28 0x20263e04
  30. ## program pllB
  31. mww 0xfffffc2c 0x10483e0e
  32. ## let pll settle... sleep 100msec
  33. sleep 100
  34. ## switch to fast clock
  35. mww 0xfffffc30 0x202
  36. ## Sleep some - (go read)
  37. sleep 100
  38. #========================================
  39. # CPU now runs at 180mhz
  40. # SYS runs at 60mhz.
  41. adapter_khz 40000
  42. #========================================
  43. ## set memc for all memories
  44. mww 0xffffff60 0x02
  45. ## program smc controller
  46. mww 0xffffff70 0x3284
  47. ## init sdram
  48. mww 0xffffff98 0x7fffffd0
  49. ## all banks precharge
  50. mww 0xffffff80 0x02
  51. ## touch sdram chip to make it work
  52. mww 0x20000000 0
  53. ## sdram controller mode register
  54. mww 0xffffff90 0x04
  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. mww 0x20000000 0
  62. mww 0x20000000 0
  63. ## sdram controller mode register
  64. ## Refresh, etc....
  65. mww 0xffffff90 0x03
  66. mww 0x20000080 0
  67. mww 0xffffff94 0x1f4
  68. mww 0x20000080 0
  69. mww 0xffffff90 0x10
  70. mww 0x20000000 0
  71. mww 0xffffff00 0x01
  72. }