start.txt 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*------------------------------------------------------*/
  2. /* TERON Articia / SDRAM Init */
  3. /*------------------------------------------------------*/
  4. * XD_CTL = 0x81000000 (0x74)
  5. * HBUS_ACC_CTL_0 &= 0xFFFFFDFF (0x5c)
  6. /* host bus access ctl reg 2(5e) */
  7. /* set - CPU read from memory data one clock after data is latched */
  8. * GLOBL_INFO_0 |= 0x00004000 (0x50)
  9. /* global info register 2 (52), AGP/PCI bus 1 arbiter is addressed in Articia S */
  10. PCI_1_SB_CONFIG_0 |= 0x00000400 (0x80d0)
  11. /* PCI1 side band config reg 2 (d2), enable read acces while write buffer not empty */
  12. MEM_RAS_CTL_0 |= 0x3f000000 (0xcc)
  13. &= 0x3fffffff
  14. /* RAS park control reg 0(cc), park access enable is set */
  15. HOST_RDBUF_CTL |= 0x10000000 (0x70)
  16. &= 0x10ffffff
  17. /* host read buffer control reg, enable prefetch for CPU read from DRAM control */
  18. HBUS_ACC_CTL_0 |= 0x0100001f (0x5c)
  19. &= 0xf1ffffff
  20. /* host bus access control register, enable CPU address bus pipe control */
  21. /* two outstanding requests, *** changed to 2 from 3 */
  22. /* enable line merge write control for CPU write to system memory, PCI 1 */
  23. /* and PCI 0 bus memory; enable page merge write control for write to */
  24. /* PCI bus 0 & bus 1 memory */
  25. SRAM_CTL |= 0x00004000 (0xc8)
  26. &= 0xffbff7ff
  27. /* DRAM detail timing control register 1 (ca), bit 3 set to 0 */
  28. /* DRAM start access latency control - wait for one clock */
  29. /* ff9f changed to ffbf */
  30. DIM0_TIM_CTL_0 = 0x737d737d (0xc9)
  31. /* DRAM timing control for dimm0 & dimm1; set wait one clock */
  32. /* cycle for next data access */
  33. DIM2_TIM_CTL_0 = 0x737d737d (0xca)
  34. /* DRAM timing control for dimm2 & dimm3; set wait one clock */
  35. /* cycle for next data access */
  36. DIM0_BNK0_CTL_0 = BNK0_RAM_SIZ_128MB (0x90)
  37. /* set dimm0 bank0 for 128 MB */
  38. DIM0_BNK1_CTL_0 = BNK1_RAM_SIZ_128MB (0x94)
  39. /* set dimm0 for bank1 */
  40. DIM0_TIM_CTL_0 = 0xf3bf0000 (0xc9)
  41. /* dimm0 timing control register; RAS - CAS latency - 4 clock */
  42. /* CAS access latency - 3 wait; pre-charge latency - 3 wait */
  43. /* pre-charge command period control - 5 clock; wait one clock */
  44. /* cycle for next data access; read to write access latency control */
  45. /* - 2 clock cycles */
  46. DRAM_GBL_CTL_0 |= 0x00000100 (0xc0)
  47. &= 0xffff01ff
  48. /* memory global control register - support buffer sdram on bank 0 */
  49. DRAM_ECC_CTL_0 |= 0x00260000 (0xc4)
  50. &= 0xff26ffff
  51. /* enable ECC; enable read, modify, write control */
  52. DRAM_REF_CTL_0 = DRAM_REF_DATA (0xb8)
  53. /* set DRAM refresh parameters *** changed to 00940100 */
  54. nop
  55. nop
  56. nop
  57. nop
  58. nop
  59. DRAM_ECC_CTL_0 |= 0x20243280 (0xc4)
  60. /* turn off ecc */
  61. /* for SDRAM bank 0 */
  62. DRAM_ECC_CTL_0 |= 0x20243290 (0xc4) ?
  63. /* for SDRAM bank 1 */
  64. /* Additional Stuff...*/
  65. GLOBL_CTRL |= 0x20000b00 (0x54)
  66. PCI_0_SB_CONFIG |= 0x04100007 (0xd0)
  67. /* PCI 0 Side band config reg*/
  68. 0x8000083c |= 0x00080000
  69. /* Disable VGA decode on PCI Bus 1 */
  70. /*End Additional Stuff..*/
  71. /*--------------------------------------------------------------*/
  72. /* TERON serial port initialization code */
  73. /*--------------------------------------------------------------*/
  74. 0x84380080 |= 0x00030000
  75. /* enable super IO configuration VIA chip Register 85 */
  76. /* Enable super I/O config mode */
  77. 0xfe0003f0 = 0xe2
  78. bl delay1
  79. 0xfe0003f1 = 0x0f
  80. bl delay1
  81. /* enable com1 & com2, parallel port disabled */
  82. 0xfe0003f0 = 0xe7
  83. bl delay1
  84. /* let's make com1 base as 0x3f8 */
  85. 0xfe0003f1 = 0xfe
  86. bl delay1
  87. 0xfe0003f0 = 0xe8
  88. bl delay1
  89. /* let's make com2 base as 0x2f8 */
  90. 0xfe0003f1 = 0xbe
  91. 0x84380080 &= 0xfffdffff
  92. /* closing super IO configuration VIA chip Register 85 */
  93. /* -------------------------------*/
  94. 0xfe0003fb = 0x83
  95. bl delay1
  96. /*latch enable word length -8 bit */ /* set mslab bit */
  97. 0xfe0003f8 = 0x0c
  98. bl delay1
  99. /* set baud rate lsb for 9600 baud */
  100. 0xfe0003f9 = 0x0
  101. bl delay1
  102. /* set baud rate msb for 9600 baud */
  103. 0xfe0003fb = 0x03
  104. bl delay1
  105. /* reset mslab */
  106. /*--------------------------------------------------------------*/
  107. /* END TERON Serial Port Initialization Code */
  108. /*--------------------------------------------------------------*/
  109. /*--------------------------------------------------------------*/
  110. /* END TERON Articia / SDRAM Initialization code */
  111. /*--------------------------------------------------------------*/
  112. Proposed from Documentation:
  113. write dmem 0xfec00cf8 0x50000080
  114. write dmem 0xfee00cfc 0xc0305411
  115. Writes to index 0x50-0x53.
  116. 0x50: Global Information Register 0
  117. 0xC0 = Little Endian CPU, Sequential order Burst
  118. 0x51: Global Information Register 1
  119. Read only, 0x30 = Provides PowerPC and X86 support
  120. 0x52: Global Information Register 2
  121. 0x05 = 64/128 bit CPU bus support
  122. 0x53: Global Information Register 3
  123. 0x80 = PCI Bus 0 grant active time is 1 clock after REQ# deasserted
  124. write dmem 0xfec00cf8 0x5c000080
  125. write dmem 0xfee00cfc 0xb300011F
  126. write dmem 0xfec00cf8 0xc8000080
  127. write dmem 0xfee00cfc 0x0020f100
  128. write dmem 0xfec00cf8 0x90000080
  129. write dmem 0xfee00cfc 0x007fe700
  130. write dmem 0xfec00cf8 0x9400080
  131. write dmem 0xfee00cfc 0x007fe700
  132. write dmem 0xfec00cf8 0xb0000080
  133. write dmem 0xfee00cfc 0x737d737d
  134. write dmem 0xfec00cf8 0xb4000080
  135. write dmem 0xfee00cfc 0x737d737d
  136. write dmem 0xfec00cf8 0xc0000080
  137. write dmem 0xfee00cfc 0x40005500
  138. write dmem 0xfec00cf8 0xb8000080
  139. write dmem 0xfee00cfc 0x00940100
  140. write dmem 0xfec00cf8 0xc4000080
  141. write dmem 0xfee00cfc 0x00003280
  142. write dmem 0xfec00cf8 0xc4000080
  143. write dmem 0xfee00cfc 0x00003290