F2837xD_flash.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_flash.h
  4. //
  5. // TITLE: FLASH 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_FLASH_H__
  43. #define __F2837xD_FLASH_H__
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. //---------------------------------------------------------------------------
  48. // FLASH Individual Register Bit Definitions:
  49. struct FRDCNTL_BITS { // bits description
  50. Uint16 rsvd1:8; // 7:0 Reserved
  51. Uint16 RWAIT:4; // 11:8 Random Read Waitstate
  52. Uint16 rsvd2:4; // 15:12 Reserved
  53. Uint16 rsvd3:16; // 31:16 Reserved
  54. };
  55. union FRDCNTL_REG {
  56. Uint32 all;
  57. struct FRDCNTL_BITS bit;
  58. };
  59. struct FBAC_BITS { // bits description
  60. Uint16 VREADST:8; // 7:0 VREAD Setup Time Count
  61. Uint16 rsvd1:8; // 15:8 Reserved
  62. Uint16 rsvd2:16; // 31:16 Reserved
  63. };
  64. union FBAC_REG {
  65. Uint32 all;
  66. struct FBAC_BITS bit;
  67. };
  68. struct FBFALLBACK_BITS { // bits description
  69. Uint16 BNKPWR0:2; // 1:0 Bank Power Mode
  70. Uint16 rsvd1:14; // 15:2 Reserved
  71. Uint16 rsvd2:16; // 31:16 Reserved
  72. };
  73. union FBFALLBACK_REG {
  74. Uint32 all;
  75. struct FBFALLBACK_BITS bit;
  76. };
  77. struct FBPRDY_BITS { // bits description
  78. Uint16 BANKRDY:1; // 0 Flash Bank Active Power State
  79. Uint16 rsvd1:14; // 14:1 Reserved
  80. Uint16 PUMPRDY:1; // 15 Flash Pump Active Power Mode
  81. Uint16 rsvd2:16; // 31:16 Reserved
  82. };
  83. union FBPRDY_REG {
  84. Uint32 all;
  85. struct FBPRDY_BITS bit;
  86. };
  87. struct FPAC1_BITS { // bits description
  88. Uint16 PMPPWR:1; // 0 Charge Pump Fallback Power Mode
  89. Uint16 rsvd1:15; // 15:1 Reserved
  90. Uint16 PSLEEP:12; // 27:16 Pump Sleep Down Count
  91. Uint16 rsvd2:4; // 31:28 Reserved
  92. };
  93. union FPAC1_REG {
  94. Uint32 all;
  95. struct FPAC1_BITS bit;
  96. };
  97. struct FMSTAT_BITS { // bits description
  98. Uint16 rsvd1:1; // 0 Reserved
  99. Uint16 rsvd2:1; // 1 Reserved
  100. Uint16 rsvd3:1; // 2 Reserved
  101. Uint16 VOLTSTAT:1; // 3 Flash Pump Power Status
  102. Uint16 CSTAT:1; // 4 Command Fail Status
  103. Uint16 INVDAT:1; // 5 Invalid Data
  104. Uint16 PGM:1; // 6 Program Operation Status
  105. Uint16 ERS:1; // 7 Erase Operation Status
  106. Uint16 BUSY:1; // 8 Busy Bit
  107. Uint16 rsvd4:1; // 9 Reserved
  108. Uint16 EV:1; // 10 Erase Verify Status
  109. Uint16 rsvd5:1; // 11 Reserved
  110. Uint16 PGV:1; // 12 Programming Verify Status
  111. Uint16 rsvd6:1; // 13 Reserved
  112. Uint16 rsvd7:1; // 14 Reserved
  113. Uint16 rsvd8:1; // 15 Reserved
  114. Uint16 rsvd9:1; // 16 Reserved
  115. Uint16 rsvd10:1; // 17 Reserved
  116. Uint16 rsvd11:14; // 31:18 Reserved
  117. };
  118. union FMSTAT_REG {
  119. Uint32 all;
  120. struct FMSTAT_BITS bit;
  121. };
  122. struct FRD_INTF_CTRL_BITS { // bits description
  123. Uint16 PREFETCH_EN:1; // 0 Prefetch Enable
  124. Uint16 DATA_CACHE_EN:1; // 1 Data Cache Enable
  125. Uint16 rsvd1:14; // 15:2 Reserved
  126. Uint16 rsvd2:16; // 31:16 Reserved
  127. };
  128. union FRD_INTF_CTRL_REG {
  129. Uint32 all;
  130. struct FRD_INTF_CTRL_BITS bit;
  131. };
  132. struct FLASH_CTRL_REGS {
  133. union FRDCNTL_REG FRDCNTL; // Flash Read Control Register
  134. Uint16 rsvd1[28]; // Reserved
  135. union FBAC_REG FBAC; // Flash Bank Access Control Register
  136. union FBFALLBACK_REG FBFALLBACK; // Flash Bank Fallback Power Register
  137. union FBPRDY_REG FBPRDY; // Flash Bank Pump Ready Register
  138. union FPAC1_REG FPAC1; // Flash Pump Access Control Register 1
  139. Uint16 rsvd2[4]; // Reserved
  140. union FMSTAT_REG FMSTAT; // Flash Module Status Register
  141. Uint16 rsvd3[340]; // Reserved
  142. union FRD_INTF_CTRL_REG FRD_INTF_CTRL; // Flash Read Interface Control Register
  143. };
  144. struct ECC_ENABLE_BITS { // bits description
  145. Uint16 ENABLE:4; // 3:0 Enable ECC
  146. Uint16 rsvd1:12; // 15:4 Reserved
  147. Uint16 rsvd2:16; // 31:16 Reserved
  148. };
  149. union ECC_ENABLE_REG {
  150. Uint32 all;
  151. struct ECC_ENABLE_BITS bit;
  152. };
  153. struct ERR_STATUS_BITS { // bits description
  154. Uint16 FAIL_0_L:1; // 0 Lower 64bits Single Bit Error Corrected Value 0
  155. Uint16 FAIL_1_L:1; // 1 Lower 64bits Single Bit Error Corrected Value 1
  156. Uint16 UNC_ERR_L:1; // 2 Lower 64 bits Uncorrectable error occurred
  157. Uint16 rsvd1:13; // 15:3 Reserved
  158. Uint16 FAIL_0_H:1; // 16 Upper 64bits Single Bit Error Corrected Value 0
  159. Uint16 FAIL_1_H:1; // 17 Upper 64bits Single Bit Error Corrected Value 1
  160. Uint16 UNC_ERR_H:1; // 18 Upper 64 bits Uncorrectable error occurred
  161. Uint16 rsvd2:13; // 31:19 Reserved
  162. };
  163. union ERR_STATUS_REG {
  164. Uint32 all;
  165. struct ERR_STATUS_BITS bit;
  166. };
  167. struct ERR_POS_BITS { // bits description
  168. Uint16 ERR_POS_L:6; // 5:0 Bit Position of Single bit Error in lower 64 bits
  169. Uint16 rsvd1:2; // 7:6 Reserved
  170. Uint16 ERR_TYPE_L:1; // 8 Error Type in lower 64 bits
  171. Uint16 rsvd2:7; // 15:9 Reserved
  172. Uint16 ERR_POS_H:6; // 21:16 Bit Position of Single bit Error in upper 64 bits
  173. Uint16 rsvd3:2; // 23:22 Reserved
  174. Uint16 ERR_TYPE_H:1; // 24 Error Type in upper 64 bits
  175. Uint16 rsvd4:7; // 31:25 Reserved
  176. };
  177. union ERR_POS_REG {
  178. Uint32 all;
  179. struct ERR_POS_BITS bit;
  180. };
  181. struct ERR_STATUS_CLR_BITS { // bits description
  182. Uint16 FAIL_0_L_CLR:1; // 0 Lower 64bits Single Bit Error Corrected Value 0 Clear
  183. Uint16 FAIL_1_L_CLR:1; // 1 Lower 64bits Single Bit Error Corrected Value 1 Clear
  184. Uint16 UNC_ERR_L_CLR:1; // 2 Lower 64 bits Uncorrectable error occurred Clear
  185. Uint16 rsvd1:13; // 15:3 Reserved
  186. Uint16 FAIL_0_H_CLR:1; // 16 Upper 64bits Single Bit Error Corrected Value 0 Clear
  187. Uint16 FAIL_1_H_CLR:1; // 17 Upper 64bits Single Bit Error Corrected Value 1 Clear
  188. Uint16 UNC_ERR_H_CLR:1; // 18 Upper 64 bits Uncorrectable error occurred Clear
  189. Uint16 rsvd2:13; // 31:19 Reserved
  190. };
  191. union ERR_STATUS_CLR_REG {
  192. Uint32 all;
  193. struct ERR_STATUS_CLR_BITS bit;
  194. };
  195. struct ERR_CNT_BITS { // bits description
  196. Uint16 ERR_CNT:16; // 15:0 Error counter
  197. Uint16 rsvd1:16; // 31:16 Reserved
  198. };
  199. union ERR_CNT_REG {
  200. Uint32 all;
  201. struct ERR_CNT_BITS bit;
  202. };
  203. struct ERR_THRESHOLD_BITS { // bits description
  204. Uint16 ERR_THRESHOLD:16; // 15:0 Error Threshold
  205. Uint16 rsvd1:16; // 31:16 Reserved
  206. };
  207. union ERR_THRESHOLD_REG {
  208. Uint32 all;
  209. struct ERR_THRESHOLD_BITS bit;
  210. };
  211. struct ERR_INTFLG_BITS { // bits description
  212. Uint16 SINGLE_ERR_INTFLG:1; // 0 Single Error Interrupt Flag
  213. Uint16 UNC_ERR_INTFLG:1; // 1 Uncorrectable Interrupt Flag
  214. Uint16 rsvd1:14; // 15:2 Reserved
  215. Uint16 rsvd2:16; // 31:16 Reserved
  216. };
  217. union ERR_INTFLG_REG {
  218. Uint32 all;
  219. struct ERR_INTFLG_BITS bit;
  220. };
  221. struct ERR_INTCLR_BITS { // bits description
  222. Uint16 SINGLE_ERR_INTCLR:1; // 0 Single Error Interrupt Flag Clear
  223. Uint16 UNC_ERR_INTCLR:1; // 1 Uncorrectable Interrupt Flag Clear
  224. Uint16 rsvd1:14; // 15:2 Reserved
  225. Uint16 rsvd2:16; // 31:16 Reserved
  226. };
  227. union ERR_INTCLR_REG {
  228. Uint32 all;
  229. struct ERR_INTCLR_BITS bit;
  230. };
  231. struct FADDR_TEST_BITS { // bits description
  232. Uint16 rsvd1:3; // 2:0 Reserved
  233. Uint16 ADDRL:13; // 15:3 ECC Address Low
  234. Uint16 ADDRH:6; // 21:16 ECC Address High
  235. Uint16 rsvd2:10; // 31:22 Reserved
  236. };
  237. union FADDR_TEST_REG {
  238. Uint32 all;
  239. struct FADDR_TEST_BITS bit;
  240. };
  241. struct FECC_TEST_BITS { // bits description
  242. Uint16 ECC:8; // 7:0 ECC Control Bits
  243. Uint16 rsvd1:8; // 15:8 Reserved
  244. Uint16 rsvd2:16; // 31:16 Reserved
  245. };
  246. union FECC_TEST_REG {
  247. Uint32 all;
  248. struct FECC_TEST_BITS bit;
  249. };
  250. struct FECC_CTRL_BITS { // bits description
  251. Uint16 ECC_TEST_EN:1; // 0 Enable ECC Test Logic
  252. Uint16 ECC_SELECT:1; // 1 ECC Bit Select
  253. Uint16 DO_ECC_CALC:1; // 2 Enable ECC Calculation
  254. Uint16 rsvd1:13; // 15:3 Reserved
  255. Uint16 rsvd2:16; // 31:16 Reserved
  256. };
  257. union FECC_CTRL_REG {
  258. Uint32 all;
  259. struct FECC_CTRL_BITS bit;
  260. };
  261. struct FECC_STATUS_BITS { // bits description
  262. Uint16 SINGLE_ERR:1; // 0 Test Result is Single Bit Error
  263. Uint16 UNC_ERR:1; // 1 Test Result is Uncorrectable Error
  264. Uint16 DATA_ERR_POS:6; // 7:2 Holds Bit Position of Error
  265. Uint16 ERR_TYPE:1; // 8 Holds Bit Position of 8 Check Bits of Error
  266. Uint16 rsvd1:7; // 15:9 Reserved
  267. Uint16 rsvd2:16; // 31:16 Reserved
  268. };
  269. union FECC_STATUS_REG {
  270. Uint32 all;
  271. struct FECC_STATUS_BITS bit;
  272. };
  273. struct FLASH_ECC_REGS {
  274. union ECC_ENABLE_REG ECC_ENABLE; // ECC Enable
  275. Uint32 SINGLE_ERR_ADDR_LOW; // Single Error Address Low
  276. Uint32 SINGLE_ERR_ADDR_HIGH; // Single Error Address High
  277. Uint32 UNC_ERR_ADDR_LOW; // Uncorrectable Error Address Low
  278. Uint32 UNC_ERR_ADDR_HIGH; // Uncorrectable Error Address High
  279. union ERR_STATUS_REG ERR_STATUS; // Error Status
  280. union ERR_POS_REG ERR_POS; // Error Position
  281. union ERR_STATUS_CLR_REG ERR_STATUS_CLR; // Error Status Clear
  282. union ERR_CNT_REG ERR_CNT; // Error Control
  283. union ERR_THRESHOLD_REG ERR_THRESHOLD; // Error Threshold
  284. union ERR_INTFLG_REG ERR_INTFLG; // Error Interrupt Flag
  285. union ERR_INTCLR_REG ERR_INTCLR; // Error Interrupt Flag Clear
  286. Uint32 FDATAH_TEST; // Data High Test
  287. Uint32 FDATAL_TEST; // Data Low Test
  288. union FADDR_TEST_REG FADDR_TEST; // ECC Test Address
  289. union FECC_TEST_REG FECC_TEST; // ECC Test Address
  290. union FECC_CTRL_REG FECC_CTRL; // ECC Control
  291. Uint32 FOUTH_TEST; // Test Data Out High
  292. Uint32 FOUTL_TEST; // Test Data Out Low
  293. union FECC_STATUS_REG FECC_STATUS; // ECC Status
  294. };
  295. struct PUMPREQUEST_BITS { // bits description
  296. Uint16 PUMP_OWNERSHIP:2; // 1:0 Flash Pump Request Semaphore between CPU1 and CPU2
  297. Uint16 rsvd1:14; // 15:2 Reserved
  298. Uint16 KEY:16; // 31:16 Key Qualifier for writes to this register
  299. };
  300. union PUMPREQUEST_REG {
  301. Uint32 all;
  302. struct PUMPREQUEST_BITS bit;
  303. };
  304. struct FLASH_PUMP_SEMAPHORE_REGS {
  305. union PUMPREQUEST_REG PUMPREQUEST; // Flash programming semaphore PUMP request register
  306. };
  307. //---------------------------------------------------------------------------
  308. // FLASH External References & Function Declarations:
  309. //
  310. #ifdef CPU1
  311. extern volatile struct FLASH_PUMP_SEMAPHORE_REGS FlashPumpSemaphoreRegs;
  312. extern volatile struct FLASH_CTRL_REGS Flash0CtrlRegs;
  313. extern volatile struct FLASH_ECC_REGS Flash0EccRegs;
  314. #endif
  315. #ifdef CPU2
  316. extern volatile struct FLASH_PUMP_SEMAPHORE_REGS FlashPumpSemaphoreRegs;
  317. extern volatile struct FLASH_CTRL_REGS Flash0CtrlRegs;
  318. extern volatile struct FLASH_ECC_REGS Flash0EccRegs;
  319. #endif
  320. #ifdef __cplusplus
  321. }
  322. #endif /* extern "C" */
  323. #endif
  324. //===========================================================================
  325. // End of file.
  326. //===========================================================================