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.
 
 
 
 
 
 

77 lines
2.0 KiB

  1. source [find target/at91sam7a2.cfg]
  2. # delays needed to get stable reads of cpu state
  3. jtag_ntrst_delay 10
  4. adapter srst delay 200
  5. # board uses pullup and connects only srst
  6. reset_config srst_open_drain
  7. # srst is connected to NRESET of CPU and fully resets everything...
  8. reset_config srst_only srst_pulls_trst
  9. adapter speed 1
  10. $_TARGETNAME configure -event reset-start {
  11. adapter speed 1
  12. }
  13. $_TARGETNAME configure -event reset-init {
  14. # init script from http://www.mikrocontroller.net/topic/107462
  15. # AT91SAM7A2
  16. # AMC (advanced memory controller)
  17. echo "setting up AMC"
  18. # AMC_CS0 - FLASH 1MB (0x40000000-0x400FFFFF) + DM9000E (0x40100000)
  19. mww 0xFFE00000 0x40003EBD
  20. # AMC_CS1 - RAM low 2MB (0x40400000-0x405FFFFF)
  21. mww 0xFFE00004 0x404030A9
  22. # AMC_CS2 - RAM high 2MB (0x40800000-0x405FFFFF)
  23. #mww 0xFFE00008 0x404030A9
  24. # changed to 0x40_8_
  25. mww 0xFFE00008 0x408030A9
  26. # AMC_MCR
  27. mww 0xFFE00024 0x00000004
  28. # AMC_RCR force remap
  29. mww 0xFFE00020 0x00000001
  30. echo "set up AMC"
  31. sleep 100
  32. # the following base addresses from the original script did not correspond to those from datasheet
  33. # changed bases from 0xFF000000 to 0xFFF00000
  34. # disable watchdog, to prevent unwanted resets
  35. mww 0xFFFA0068 0x00000000
  36. echo "disabled watchdog"
  37. sleep 50
  38. # disable PLL
  39. mww 0xFFFEC004 0x18070004
  40. # PLL = 10 ==> Coreclock = 6Mhz*10/2 = 30 Mhz
  41. mww 0xFFFEC010 0x762D800A
  42. # enable PLL
  43. mww 0xFFFEC000 0x23050004
  44. echo "set up pll"
  45. sleep 100
  46. adapter speed 5000
  47. }
  48. $_TARGETNAME arm7_9 dcc_downloads enable
  49. $_TARGETNAME arm7_9 fast_memory_access enable
  50. # remap: ram at 0, flash at 0x40000000, like reset-init above does
  51. $_TARGETNAME configure -work-area-phys 0x00000000 -work-area-size 0x4000 -work-area-backup 1
  52. flash bank onboard.flash cfi 0x40000000 0x00100000 2 2 at91sam7a2.cpu
  53. # boot: ram at 0x300000, flash at 0x0, useful if board is in funny configuration
  54. #$_TARGETNAME configure -work-area-phys 0x00300000 -work-area-size 0x4000 -work-area-backup 1
  55. #flash bank onboard1.flash cfi 0x00000000 0x00100000 2 2 at91sam7a2.cpu