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.
 
 
 
 
 
 

113 lines
4.1 KiB

  1. # Target configuration for the Samsung s3c6410 system on chip
  2. # Tested on a tiny6410
  3. # Processor : ARM1176
  4. # Info : JTAG tap: s3c6410.etb tap/device found: 0x2b900f0f (mfg: 0x787, part: 0xb900, ver: 0x2)
  5. # Info : JTAG tap: s3c6410.cpu tap/device found: 0x07b76f0f (mfg: 0x787, part: 0x7b76, ver: 0x0)
  6. source [find target/samsung_s3c6410.cfg]
  7. proc init_6410 {} {
  8. halt
  9. reg cpsr 0x1D3
  10. arm mcr 15 0 15 2 4 0x70000013
  11. #-----------------------------------------------
  12. # Clock and Timer Setting
  13. #-----------------------------------------------
  14. mww 0x7e004000 0 ;# WATCHDOG - Disable
  15. mww 0x7E00F120 0x0003 ;# MEM_SYS_CFG - CS0:8 bit, Mem1:32bit, CS2=NAND
  16. #mww 0x7E00F120 0x1000 ;# MEM_SYS_CFG - CS0:16bit, Mem1:32bit, CS2=SROMC
  17. #mww 0x7E00F120 0x1002 ;# MEM_SYS_CFG - CS0:16bit, Mem1:32bit, CS2=OND
  18. mww 0x7E00F900 0x805e ;# OTHERS - Change SYNCMUX[6] to “1”
  19. sleep 1000
  20. mww 0x7E00F900 0x80de ;# OTHERS - Assert SYNCREQ&VICSYNCEN to “1”(rb1004modify)
  21. sleep 1000 ;# - Others[11:8] to 0xF
  22. mww 0x7E00F000 0xffff ;# APLL_LOCK - APLL LockTime
  23. mww 0x7E00F004 0xffff ;# MPLL_LOCK - MPLL LockTime
  24. mww 0x7E00F020 0x1047310 ;# CLK_DIV0 - ARMCLK:HCLK:PCLK = 1:4:16
  25. mww 0x7E00F00c 0x81900302 ;# APLL_CON - A:400, P:3, S:2 => 400MHz
  26. mww 0x7E00F010 0x81900303 ;# MPLL_CON - M:400, P:3, S:3 => 200MHz
  27. mww 0x7E00F01c 0x3 ;# CLK_SRC - APLL,MPLL Clock Select
  28. #-----------------------------------------------
  29. # DRAM initialization
  30. #-----------------------------------------------
  31. mww 0x7e001004 0x4 ;# P1MEMCCMD - Enter the config state
  32. mww 0x7e001010 0x30C ;# P1REFRESH - Refresh Period register (7800ns), 100MHz
  33. # mww 0x7e001010 0x40e ;# P1REFRESH - Refresh Period register (7800ns), 133MHz
  34. mww 0x7e001014 0x6 ;# P1CASLAT - CAS Latency = 3
  35. mww 0x7e001018 0x1 ;# P1T_DQSS
  36. mww 0x7e00101c 0x2 ;# P1T_MRD
  37. mww 0x7e001020 0x7 ;# P1T_RAS - 45 ns
  38. mww 0x7e001024 0xA ;# P1T_RC - 67.5 ns
  39. mww 0x7e001028 0xC ;# P1T_RCD - 22.5 ns
  40. mww 0x7e00102C 0x10B ;# P1T_RFC - 80 ns
  41. mww 0x7e001030 0xC ;# P1T_RP - 22.5 ns
  42. mww 0x7e001034 0x3 ;# P1T_RRD - 15 ns
  43. mww 0x7e001038 0x3 ;# P1T_WR - 15 ns
  44. mww 0x7e00103C 0x2 ;# P1T_WTR
  45. mww 0x7e001040 0x2 ;# P1T_XP
  46. mww 0x7e001044 0x11 ;# P1T_XSR - 120 ns
  47. mww 0x7e001048 0x11 ;# P1T_ESR
  48. #-----------------------------------------------
  49. # Memory Configuration Registers
  50. #-----------------------------------------------
  51. mww 0x7e00100C 0x00010012 ;# P1MEMCFG - 1 CKE, 1Chip, 4burst, Alw, AP[10],ROW/Column bit
  52. mww 0x7e00104C 0x0B41 ;# P1MEMCFG2 - Read delay 1 Cycle, mDDR, 32bit, Sync.
  53. mww 0x7e001200 0x150F0 ;# CHIP_N_CFG - 0x150F0 for 256M, 0x150F8 for 128M
  54. #-----------------------------------------------
  55. # Memory Direct Commands
  56. #-----------------------------------------------
  57. mww 0x7e001008 0xc0000 ;# Chip0 Direct Command :NOP5
  58. mww 0x7e001008 0x0 ;# Chip0 Direct Command :PreCharge al
  59. mww 0x7e001008 0x40000 ;# Chip0 Direct Command :AutoRefresh
  60. mww 0x7e001008 0x40000 ;# Chip0 Direct Command :AutoRefresh
  61. mww 0x7e001008 0xA0000 ;# EMRS, DS:Full, PASR:Full
  62. mww 0x7e001008 0x80032 ;# MRS, CAS3, BL4
  63. mww 0x7e001004 0x0 ;# Enable DMC1
  64. }
  65. proc install_6410_uboot {} {
  66. # write U-boot magic number
  67. mww 0x50000000 0x24564236
  68. mww 0x50000004 0x20764316
  69. load_image u-boot_nand-ram256.bin 0x50008000 bin
  70. load_image u-boot_nand-ram256.bin 0x57E00000 bin
  71. #Kick in
  72. reg pc 0x57E00000
  73. resume
  74. }
  75. proc init_6410_flash {} {
  76. halt
  77. nand probe 0
  78. nand list
  79. }
  80. adapter_khz 1000
  81. adapter_nsrst_delay 100
  82. jtag_ntrst_delay 100
  83. reset_config trst_and_srst
  84. gdb_breakpoint_override hard
  85. targets
  86. nand device $_CHIPNAME.flash s3c6400 $_CHIPNAME.cpu
  87. init
  88. echo " "
  89. echo " "
  90. echo "-------------------------------------------------------------------"
  91. echo "---- The following mini6410/tiny6410 functions are available: ----"
  92. echo "---- init_6410 - initialize clock, timer, DRAM ----"
  93. echo "---- init_6410_flash - initializes NAND flash support ----"
  94. echo "---- install_6410_uboot - copies u-boot image into RAM and ----"
  95. echo "---- runs it ----"
  96. echo "-------------------------------------------------------------------"
  97. echo " "
  98. echo " "