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.2 KiB

  1. ################################################################################
  2. # Author: Michael Trensch (MTrensch@googlemail.com)
  3. ################################################################################
  4. source [find target/hilscher_netx10.cfg]
  5. # Usually it is not needed to set srst_pulls_trst
  6. # but sometimes it does not work without it. If you encounter
  7. # problems try to line below
  8. # reset_config trst_and_srst srst_pulls_trst
  9. reset_config trst_and_srst
  10. adapter srst delay 500
  11. jtag_ntrst_delay 500
  12. $_TARGETNAME configure -work-area-virt 0x08000000 -work-area-phys 0x08000000 -work-area-size 0x4000 -work-area-backup 1
  13. # Par. Flash can only be accessed if DIP switch on the board is set in proper
  14. # position and init_sdrambus was called. Don't call these functions if the DIP
  15. # switch is in invalid position, as some outputs may collide. This is why this
  16. # function is not called automatically
  17. proc flash_init { } {
  18. puts "Configuring SRAM nCS0 for 90ns Par. Flash (x16)"
  19. mww 0x101C0100 0x01010008
  20. flash probe 0
  21. }
  22. proc mread32 {addr} {
  23. set value(0) 0
  24. mem2array value 32 $addr 1
  25. return $value(0)
  26. }
  27. proc init_clocks { } {
  28. puts "Enabling all clocks "
  29. set accesskey [mread32 0x101c0070]
  30. mww 0x101c0070 $accesskey
  31. mww 0x101c0028 0x00007511
  32. }
  33. proc init_sdrambus { } {
  34. puts "Initializing external SDRAM Bus 16 Bit "
  35. set accesskey [mread32 0x101c0070]
  36. mww 0x101c0070 $accesskey
  37. mww 0x101c0C40 0x00000050
  38. puts "Configuring SDRAM controller for K4S561632E (32MB) "
  39. mww 0x101C0140 0
  40. sleep 100
  41. #mww 0x101C0144 0x00a13262
  42. mww 0x101C0144 0x00a13251
  43. mww 0x101C0148 0x00000033
  44. mww 0x101C0140 0x030d0121
  45. }
  46. $_TARGETNAME configure -event reset-init {
  47. halt
  48. wait_halt 1000
  49. arm7_9 fast_memory_access enable
  50. arm7_9 dcc_downloads enable
  51. init_clocks
  52. # init_sdrambus
  53. puts ""
  54. puts "-------------------------------------------------"
  55. puts "Call 'init_clocks' to enable all clocks"
  56. puts "Call 'init_sdrambus' to enable external SDRAM bus"
  57. puts "-------------------------------------------------"
  58. }
  59. #####################
  60. # Flash configuration
  61. #####################
  62. #flash bank <name> <driver> <base> <size> <chip width> <bus width> <target#>
  63. #flash bank parflash cfi 0xC0000000 0x01000000 2 2 $_TARGETNAME
  64. init
  65. reset init