F2837xD_emif.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_emif.h
  4. //
  5. // TITLE: EMIF Register Definitions.
  6. //
  7. //###########################################################################
  8. // $TI Release: F2837xD Support Library v3.05.00.00 $
  9. // $Release Date: Tue Jun 26 03:15:23 CDT 2018 $
  10. // $Copyright:
  11. // Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/
  12. //
  13. // Redistribution and use in source and binary forms, with or without
  14. // modification, are permitted provided that the following conditions
  15. // are met:
  16. //
  17. // Redistributions of source code must retain the above copyright
  18. // notice, this list of conditions and the following disclaimer.
  19. //
  20. // Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the
  23. // distribution.
  24. //
  25. // Neither the name of Texas Instruments Incorporated nor the names of
  26. // its contributors may be used to endorse or promote products derived
  27. // from this software without specific prior written permission.
  28. //
  29. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  30. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  31. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  32. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  33. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  34. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  35. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  36. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  37. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. // $
  41. //###########################################################################
  42. #ifndef __F2837xD_EMIF_H__
  43. #define __F2837xD_EMIF_H__
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. //---------------------------------------------------------------------------
  48. // EMIF Individual Register Bit Definitions:
  49. struct RCSR_BITS { // bits description
  50. Uint16 MINOR_REVISION:8; // 7:0 Minor Revision.
  51. Uint16 MAJOR_REVISION:8; // 15:8 Major Revision.
  52. Uint16 MODULE_ID:14; // 29:16 EMIF module ID.
  53. Uint16 FR:1; // 30 EMIF is running in full rate or half rate.
  54. Uint16 BE:1; // 31 EMIF endian mode.
  55. };
  56. union RCSR_REG {
  57. Uint32 all;
  58. struct RCSR_BITS bit;
  59. };
  60. struct ASYNC_WCCR_BITS { // bits description
  61. Uint16 MAX_EXT_WAIT:8; // 7:0 Maximum Extended Wait cycles.
  62. Uint16 rsvd1:8; // 15:8 Reserved
  63. Uint16 rsvd2:2; // 17:16 Reserved
  64. Uint16 rsvd3:2; // 19:18 Reserved
  65. Uint16 rsvd4:2; // 21:20 Reserved
  66. Uint16 rsvd5:2; // 23:22 Reserved
  67. Uint16 rsvd6:4; // 27:24 Reserved
  68. Uint16 WP0:1; // 28 Polarity for EMxWAIT.
  69. Uint16 rsvd7:1; // 29 Reserved
  70. Uint16 rsvd8:1; // 30 Reserved
  71. Uint16 rsvd9:1; // 31 Reserved
  72. };
  73. union ASYNC_WCCR_REG {
  74. Uint32 all;
  75. struct ASYNC_WCCR_BITS bit;
  76. };
  77. struct SDRAM_CR_BITS { // bits description
  78. Uint16 PAGESIGE:3; // 2:0 Page Size.
  79. Uint16 rsvd1:1; // 3 Reserved
  80. Uint16 IBANK:3; // 6:4 Internal Bank setup of SDRAM devices.
  81. Uint16 rsvd2:1; // 7 Reserved
  82. Uint16 BIT_11_9_LOCK:1; // 8 Bits 11 to 9 are writable only if this bit is set.
  83. Uint16 CL:3; // 11:9 CAS Latency.
  84. Uint16 rsvd3:1; // 12 Reserved
  85. Uint16 rsvd4:1; // 13 Reserved
  86. Uint16 NM:1; // 14 Narrow Mode.
  87. Uint16 rsvd5:1; // 15 Reserved
  88. Uint16 rsvd6:1; // 16 Reserved
  89. Uint16 rsvd7:2; // 18:17 Reserved
  90. Uint16 rsvd8:1; // 19 Reserved
  91. Uint16 rsvd9:3; // 22:20 Reserved
  92. Uint16 rsvd10:3; // 25:23 Reserved
  93. Uint16 rsvd11:3; // 28:26 Reserved
  94. Uint16 PDWR:1; // 29 Perform refreshes during Power Down.
  95. Uint16 PD:1; // 30 Power Down.
  96. Uint16 SR:1; // 31 Self Refresh.
  97. };
  98. union SDRAM_CR_REG {
  99. Uint32 all;
  100. struct SDRAM_CR_BITS bit;
  101. };
  102. struct SDRAM_RCR_BITS { // bits description
  103. Uint16 REFRESH_RATE:13; // 12:0 Refresh Rate.
  104. Uint16 rsvd1:3; // 15:13 Reserved
  105. Uint16 rsvd2:3; // 18:16 Reserved
  106. Uint16 rsvd3:13; // 31:19 Reserved
  107. };
  108. union SDRAM_RCR_REG {
  109. Uint32 all;
  110. struct SDRAM_RCR_BITS bit;
  111. };
  112. struct ASYNC_CS2_CR_BITS { // bits description
  113. Uint16 ASIZE:2; // 1:0 Asynchronous Memory Size.
  114. Uint16 TA:2; // 3:2 Turn Around cycles.
  115. Uint16 R_HOLD:3; // 6:4 Read Strobe Hold cycles.
  116. Uint16 R_STROBE:6; // 12:7 Read Strobe Duration cycles.
  117. Uint32 R_SETUP:4; // 16:13 Read Strobe Setup cycles.
  118. Uint16 W_HOLD:3; // 19:17 Write Strobe Hold cycles.
  119. Uint16 W_STROBE:6; // 25:20 Write Strobe Duration cycles.
  120. Uint16 W_SETUP:4; // 29:26 Write Strobe Setup cycles.
  121. Uint16 EW:1; // 30 Extend Wait mode.
  122. Uint16 SS:1; // 31 Select Strobe mode.
  123. };
  124. union ASYNC_CS2_CR_REG {
  125. Uint32 all;
  126. struct ASYNC_CS2_CR_BITS bit;
  127. };
  128. struct ASYNC_CS3_CR_BITS { // bits description
  129. Uint16 ASIZE:2; // 1:0 Asynchronous Memory Size.
  130. Uint16 TA:2; // 3:2 Turn Around cycles.
  131. Uint16 R_HOLD:3; // 6:4 Read Strobe Hold cycles.
  132. Uint16 R_STROBE:6; // 12:7 Read Strobe Duration cycles.
  133. Uint32 R_SETUP:4; // 16:13 Read Strobe Setup cycles.
  134. Uint16 W_HOLD:3; // 19:17 Write Strobe Hold cycles.
  135. Uint16 W_STROBE:6; // 25:20 Write Strobe Duration cycles.
  136. Uint16 W_SETUP:4; // 29:26 Write Strobe Setup cycles.
  137. Uint16 EW:1; // 30 Extend Wait mode.
  138. Uint16 SS:1; // 31 Select Strobe mode.
  139. };
  140. union ASYNC_CS3_CR_REG {
  141. Uint32 all;
  142. struct ASYNC_CS3_CR_BITS bit;
  143. };
  144. struct ASYNC_CS4_CR_BITS { // bits description
  145. Uint16 ASIZE:2; // 1:0 Asynchronous Memory Size.
  146. Uint16 TA:2; // 3:2 Turn Around cycles.
  147. Uint16 R_HOLD:3; // 6:4 Read Strobe Hold cycles.
  148. Uint16 R_STROBE:6; // 12:7 Read Strobe Duration cycles.
  149. Uint32 R_SETUP:4; // 16:13 Read Strobe Setup cycles.
  150. Uint16 W_HOLD:3; // 19:17 Write Strobe Hold cycles.
  151. Uint16 W_STROBE:6; // 25:20 Write Strobe Duration cycles.
  152. Uint16 W_SETUP:4; // 29:26 Write Strobe Setup cycles.
  153. Uint16 EW:1; // 30 Extend Wait mode.
  154. Uint16 SS:1; // 31 Select Strobe mode.
  155. };
  156. union ASYNC_CS4_CR_REG {
  157. Uint32 all;
  158. struct ASYNC_CS4_CR_BITS bit;
  159. };
  160. struct SDRAM_TR_BITS { // bits description
  161. Uint16 rsvd1:4; // 3:0 Reserved
  162. Uint16 T_RRD:3; // 6:4 Activate to Activate timing for different bank.
  163. Uint16 rsvd2:1; // 7 Reserved
  164. Uint16 T_RC:4; // 11:8 Activate to Activate timing .
  165. Uint16 T_RAS:4; // 15:12 Activate to Precharge timing.
  166. Uint16 T_WR:3; // 18:16 Last Write to Precharge timing.
  167. Uint16 rsvd3:1; // 19 Reserved
  168. Uint16 T_RCD:3; // 22:20 Activate to Read/Write timing.
  169. Uint16 rsvd4:1; // 23 Reserved
  170. Uint16 T_RP:3; // 26:24 Precharge to Activate/Refresh timing.
  171. Uint16 T_RFC:5; // 31:27 Refresh/Load Mode to Refresh/Activate timing
  172. };
  173. union SDRAM_TR_REG {
  174. Uint32 all;
  175. struct SDRAM_TR_BITS bit;
  176. };
  177. struct SDR_EXT_TMNG_BITS { // bits description
  178. Uint16 T_XS:5; // 4:0 Self Refresh exit to new command timing.
  179. Uint16 rsvd1:11; // 15:5 Reserved
  180. Uint16 rsvd2:16; // 31:16 Reserved
  181. };
  182. union SDR_EXT_TMNG_REG {
  183. Uint32 all;
  184. struct SDR_EXT_TMNG_BITS bit;
  185. };
  186. struct INT_RAW_BITS { // bits description
  187. Uint16 AT:1; // 0 Asynchronous Timeout.
  188. Uint16 LT:1; // 1 Line Trap.
  189. Uint16 WR:4; // 5:2 Wait Rise.
  190. Uint16 rsvd1:10; // 15:6 Reserved
  191. Uint16 rsvd2:16; // 31:16 Reserved
  192. };
  193. union INT_RAW_REG {
  194. Uint32 all;
  195. struct INT_RAW_BITS bit;
  196. };
  197. struct INT_MSK_BITS { // bits description
  198. Uint16 AT_MASKED:1; // 0 Asynchronous Timeout.
  199. Uint16 LT_MASKED:1; // 1 Line Trap.
  200. Uint16 WR_MASKED:4; // 5:2 Wait Rise.
  201. Uint16 rsvd1:10; // 15:6 Reserved
  202. Uint16 rsvd2:16; // 31:16 Reserved
  203. };
  204. union INT_MSK_REG {
  205. Uint32 all;
  206. struct INT_MSK_BITS bit;
  207. };
  208. struct INT_MSK_SET_BITS { // bits description
  209. Uint16 AT_MASK_SET:1; // 0 Asynchronous Timeout.
  210. Uint16 LT_MASK_SET:1; // 1 Line Trap.
  211. Uint16 WR_MASK_SET:4; // 5:2 Wait Rise.
  212. Uint16 rsvd1:10; // 15:6 Reserved
  213. Uint16 rsvd2:16; // 31:16 Reserved
  214. };
  215. union INT_MSK_SET_REG {
  216. Uint32 all;
  217. struct INT_MSK_SET_BITS bit;
  218. };
  219. struct INT_MSK_CLR_BITS { // bits description
  220. Uint16 AT_MASK_CLR:1; // 0 Asynchronous Timeout.
  221. Uint16 LT_MASK_CLR:1; // 1 Line Trap.
  222. Uint16 WR_MASK_CLR:4; // 5:2 Wait Rise.
  223. Uint16 rsvd1:10; // 15:6 Reserved
  224. Uint16 rsvd2:16; // 31:16 Reserved
  225. };
  226. union INT_MSK_CLR_REG {
  227. Uint32 all;
  228. struct INT_MSK_CLR_BITS bit;
  229. };
  230. struct EMIF_REGS {
  231. union RCSR_REG RCSR; // Revision Code and Status Register
  232. union ASYNC_WCCR_REG ASYNC_WCCR; // Async Wait Cycle Config Register
  233. union SDRAM_CR_REG SDRAM_CR; // SDRAM (EMxCS0n) Config Register
  234. union SDRAM_RCR_REG SDRAM_RCR; // SDRAM Refresh Control Register
  235. union ASYNC_CS2_CR_REG ASYNC_CS2_CR; // Async 1 (EMxCS2n) Config Register
  236. union ASYNC_CS3_CR_REG ASYNC_CS3_CR; // Async 2 (EMxCS3n) Config Register
  237. union ASYNC_CS4_CR_REG ASYNC_CS4_CR; // Async 3 (EMxCS4n) Config Register
  238. Uint16 rsvd1[2]; // Reserved
  239. union SDRAM_TR_REG SDRAM_TR; // SDRAM Timing Register
  240. Uint16 rsvd2[6]; // Reserved
  241. Uint32 TOTAL_SDRAM_AR; // Total SDRAM Accesses Register
  242. Uint32 TOTAL_SDRAM_ACTR; // Total SDRAM Activate Register
  243. Uint16 rsvd3[2]; // Reserved
  244. union SDR_EXT_TMNG_REG SDR_EXT_TMNG; // SDRAM SR/PD Exit Timing Register
  245. union INT_RAW_REG INT_RAW; // Interrupt Raw Register
  246. union INT_MSK_REG INT_MSK; // Interrupt Masked Register
  247. union INT_MSK_SET_REG INT_MSK_SET; // Interrupt Mask Set Register
  248. union INT_MSK_CLR_REG INT_MSK_CLR; // Interrupt Mask Clear Register
  249. Uint16 rsvd4[72]; // Reserved
  250. };
  251. //---------------------------------------------------------------------------
  252. // EMIF External References & Function Declarations:
  253. //
  254. #ifdef CPU1
  255. extern volatile struct EMIF_REGS Emif1Regs;
  256. extern volatile struct EMIF_REGS Emif2Regs;
  257. #endif
  258. #ifdef CPU2
  259. extern volatile struct EMIF_REGS Emif1Regs;
  260. extern volatile struct EMIF_REGS Emif2Regs;
  261. #endif
  262. #ifdef __cplusplus
  263. }
  264. #endif /* extern "C" */
  265. #endif
  266. //===========================================================================
  267. // End of file.
  268. //===========================================================================