at91rm9200-dk.cfg 2.1 KB

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