def_LPBlackfin.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. /*
  2. * Blackfin core register bit & address definitions
  3. *
  4. * Copyright 2005-2008 Analog Devices Inc.
  5. *
  6. * Licensed under the Clear BSD license or GPL-2 (or later).
  7. */
  8. #ifndef _DEF_LPBLACKFIN_H
  9. #define _DEF_LPBLACKFIN_H
  10. #include <mach/anomaly.h>
  11. #define MK_BMSK_(x) (1<<x)
  12. #define BFIN_DEPOSIT(mask, x) (((x) << __ffs(mask)) & (mask))
  13. #define BFIN_EXTRACT(mask, x) (((x) & (mask)) >> __ffs(mask))
  14. #ifndef __ASSEMBLY__
  15. #include <linux/types.h>
  16. #if ANOMALY_05000198
  17. # define NOP_PAD_ANOMALY_05000198 "nop;"
  18. #else
  19. # define NOP_PAD_ANOMALY_05000198
  20. #endif
  21. #define _bfin_readX(addr, size, asm_size, asm_ext) ({ \
  22. u32 __v; \
  23. __asm__ __volatile__( \
  24. NOP_PAD_ANOMALY_05000198 \
  25. "%0 = " #asm_size "[%1]" #asm_ext ";" \
  26. : "=d" (__v) \
  27. : "a" (addr) \
  28. ); \
  29. __v; })
  30. #define _bfin_writeX(addr, val, size, asm_size) \
  31. __asm__ __volatile__( \
  32. NOP_PAD_ANOMALY_05000198 \
  33. #asm_size "[%0] = %1;" \
  34. : \
  35. : "a" (addr), "d" ((u##size)(val)) \
  36. : "memory" \
  37. )
  38. #define bfin_read8(addr) _bfin_readX(addr, 8, b, (z))
  39. #define bfin_read16(addr) _bfin_readX(addr, 16, w, (z))
  40. #define bfin_read32(addr) _bfin_readX(addr, 32, , )
  41. #define bfin_write8(addr, val) _bfin_writeX(addr, val, 8, b)
  42. #define bfin_write16(addr, val) _bfin_writeX(addr, val, 16, w)
  43. #define bfin_write32(addr, val) _bfin_writeX(addr, val, 32, )
  44. #define bfin_read(addr) \
  45. ({ \
  46. sizeof(*(addr)) == 1 ? bfin_read8(addr) : \
  47. sizeof(*(addr)) == 2 ? bfin_read16(addr) : \
  48. sizeof(*(addr)) == 4 ? bfin_read32(addr) : \
  49. ({ BUG(); 0; }); \
  50. })
  51. #define bfin_write(addr, val) \
  52. do { \
  53. switch (sizeof(*(addr))) { \
  54. case 1: bfin_write8(addr, val); break; \
  55. case 2: bfin_write16(addr, val); break; \
  56. case 4: bfin_write32(addr, val); break; \
  57. default: BUG(); \
  58. } \
  59. } while (0)
  60. #define bfin_write_or(addr, bits) \
  61. do { \
  62. typeof(addr) __addr = (addr); \
  63. bfin_write(__addr, bfin_read(__addr) | (bits)); \
  64. } while (0)
  65. #define bfin_write_and(addr, bits) \
  66. do { \
  67. typeof(addr) __addr = (addr); \
  68. bfin_write(__addr, bfin_read(__addr) & (bits)); \
  69. } while (0)
  70. #endif /* __ASSEMBLY__ */
  71. /**************************************************
  72. * System Register Bits
  73. **************************************************/
  74. /**************************************************
  75. * ASTAT register
  76. **************************************************/
  77. /* definitions of ASTAT bit positions*/
  78. /*Result of last ALU0 or shifter operation is zero*/
  79. #define ASTAT_AZ_P 0x00000000
  80. /*Result of last ALU0 or shifter operation is negative*/
  81. #define ASTAT_AN_P 0x00000001
  82. /*Condition Code, used for holding comparison results*/
  83. #define ASTAT_CC_P 0x00000005
  84. /*Quotient Bit*/
  85. #define ASTAT_AQ_P 0x00000006
  86. /*Rounding mode, set for biased, clear for unbiased*/
  87. #define ASTAT_RND_MOD_P 0x00000008
  88. /*Result of last ALU0 operation generated a carry*/
  89. #define ASTAT_AC0_P 0x0000000C
  90. /*Result of last ALU0 operation generated a carry*/
  91. #define ASTAT_AC0_COPY_P 0x00000002
  92. /*Result of last ALU1 operation generated a carry*/
  93. #define ASTAT_AC1_P 0x0000000D
  94. /*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/
  95. #define ASTAT_AV0_P 0x00000010
  96. /*Sticky version of ASTAT_AV0 */
  97. #define ASTAT_AV0S_P 0x00000011
  98. /*Result of last MAC1 operation overflowed, sticky for MAC*/
  99. #define ASTAT_AV1_P 0x00000012
  100. /*Sticky version of ASTAT_AV1 */
  101. #define ASTAT_AV1S_P 0x00000013
  102. /*Result of last ALU0 or MAC0 operation overflowed*/
  103. #define ASTAT_V_P 0x00000018
  104. /*Result of last ALU0 or MAC0 operation overflowed*/
  105. #define ASTAT_V_COPY_P 0x00000003
  106. /*Sticky version of ASTAT_V*/
  107. #define ASTAT_VS_P 0x00000019
  108. /* Masks */
  109. /*Result of last ALU0 or shifter operation is zero*/
  110. #define ASTAT_AZ MK_BMSK_(ASTAT_AZ_P)
  111. /*Result of last ALU0 or shifter operation is negative*/
  112. #define ASTAT_AN MK_BMSK_(ASTAT_AN_P)
  113. /*Result of last ALU0 operation generated a carry*/
  114. #define ASTAT_AC0 MK_BMSK_(ASTAT_AC0_P)
  115. /*Result of last ALU0 operation generated a carry*/
  116. #define ASTAT_AC0_COPY MK_BMSK_(ASTAT_AC0_COPY_P)
  117. /*Result of last ALU0 operation generated a carry*/
  118. #define ASTAT_AC1 MK_BMSK_(ASTAT_AC1_P)
  119. /*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/
  120. #define ASTAT_AV0 MK_BMSK_(ASTAT_AV0_P)
  121. /*Result of last MAC1 operation overflowed, sticky for MAC*/
  122. #define ASTAT_AV1 MK_BMSK_(ASTAT_AV1_P)
  123. /*Condition Code, used for holding comparison results*/
  124. #define ASTAT_CC MK_BMSK_(ASTAT_CC_P)
  125. /*Quotient Bit*/
  126. #define ASTAT_AQ MK_BMSK_(ASTAT_AQ_P)
  127. /*Rounding mode, set for biased, clear for unbiased*/
  128. #define ASTAT_RND_MOD MK_BMSK_(ASTAT_RND_MOD_P)
  129. /*Overflow Bit*/
  130. #define ASTAT_V MK_BMSK_(ASTAT_V_P)
  131. /*Overflow Bit*/
  132. #define ASTAT_V_COPY MK_BMSK_(ASTAT_V_COPY_P)
  133. /**************************************************
  134. * SEQSTAT register
  135. **************************************************/
  136. /* Bit Positions */
  137. #define SEQSTAT_EXCAUSE0_P 0x00000000 /* Last exception cause bit 0 */
  138. #define SEQSTAT_EXCAUSE1_P 0x00000001 /* Last exception cause bit 1 */
  139. #define SEQSTAT_EXCAUSE2_P 0x00000002 /* Last exception cause bit 2 */
  140. #define SEQSTAT_EXCAUSE3_P 0x00000003 /* Last exception cause bit 3 */
  141. #define SEQSTAT_EXCAUSE4_P 0x00000004 /* Last exception cause bit 4 */
  142. #define SEQSTAT_EXCAUSE5_P 0x00000005 /* Last exception cause bit 5 */
  143. #define SEQSTAT_IDLE_REQ_P 0x0000000C /* Pending idle mode request,
  144. * set by IDLE instruction.
  145. */
  146. #define SEQSTAT_SFTRESET_P 0x0000000D /* Indicates whether the last
  147. * reset was a software reset
  148. * (=1)
  149. */
  150. #define SEQSTAT_HWERRCAUSE0_P 0x0000000E /* Last hw error cause bit 0 */
  151. #define SEQSTAT_HWERRCAUSE1_P 0x0000000F /* Last hw error cause bit 1 */
  152. #define SEQSTAT_HWERRCAUSE2_P 0x00000010 /* Last hw error cause bit 2 */
  153. #define SEQSTAT_HWERRCAUSE3_P 0x00000011 /* Last hw error cause bit 3 */
  154. #define SEQSTAT_HWERRCAUSE4_P 0x00000012 /* Last hw error cause bit 4 */
  155. /* Masks */
  156. /* Exception cause */
  157. #define SEQSTAT_EXCAUSE (MK_BMSK_(SEQSTAT_EXCAUSE0_P) | \
  158. MK_BMSK_(SEQSTAT_EXCAUSE1_P) | \
  159. MK_BMSK_(SEQSTAT_EXCAUSE2_P) | \
  160. MK_BMSK_(SEQSTAT_EXCAUSE3_P) | \
  161. MK_BMSK_(SEQSTAT_EXCAUSE4_P) | \
  162. MK_BMSK_(SEQSTAT_EXCAUSE5_P) | \
  163. 0)
  164. /* Indicates whether the last reset was a software reset (=1) */
  165. #define SEQSTAT_SFTRESET (MK_BMSK_(SEQSTAT_SFTRESET_P))
  166. /* Last hw error cause */
  167. #define SEQSTAT_HWERRCAUSE (MK_BMSK_(SEQSTAT_HWERRCAUSE0_P) | \
  168. MK_BMSK_(SEQSTAT_HWERRCAUSE1_P) | \
  169. MK_BMSK_(SEQSTAT_HWERRCAUSE2_P) | \
  170. MK_BMSK_(SEQSTAT_HWERRCAUSE3_P) | \
  171. MK_BMSK_(SEQSTAT_HWERRCAUSE4_P) | \
  172. 0)
  173. /* Translate bits to something useful */
  174. /* Last hw error cause */
  175. #define SEQSTAT_HWERRCAUSE_SHIFT (14)
  176. #define SEQSTAT_HWERRCAUSE_SYSTEM_MMR (0x02 << SEQSTAT_HWERRCAUSE_SHIFT)
  177. #define SEQSTAT_HWERRCAUSE_EXTERN_ADDR (0x03 << SEQSTAT_HWERRCAUSE_SHIFT)
  178. #define SEQSTAT_HWERRCAUSE_PERF_FLOW (0x12 << SEQSTAT_HWERRCAUSE_SHIFT)
  179. #define SEQSTAT_HWERRCAUSE_RAISE_5 (0x18 << SEQSTAT_HWERRCAUSE_SHIFT)
  180. /**************************************************
  181. * SYSCFG register
  182. **************************************************/
  183. /* Bit Positions */
  184. #define SYSCFG_SSSTEP_P 0x00000000 /* Supervisor single step, when
  185. * set it forces an exception
  186. * for each instruction executed
  187. */
  188. #define SYSCFG_CCEN_P 0x00000001 /* Enable cycle counter (=1) */
  189. #define SYSCFG_SNEN_P 0x00000002 /* Self nesting Interrupt Enable */
  190. /* Masks */
  191. /* Supervisor single step, when set it forces an exception for each
  192. *instruction executed
  193. */
  194. #define SYSCFG_SSSTEP MK_BMSK_(SYSCFG_SSSTEP_P )
  195. /* Enable cycle counter (=1) */
  196. #define SYSCFG_CCEN MK_BMSK_(SYSCFG_CCEN_P )
  197. /* Self Nesting Interrupt Enable */
  198. #define SYSCFG_SNEN MK_BMSK_(SYSCFG_SNEN_P)
  199. /* Backward-compatibility for typos in prior releases */
  200. #define SYSCFG_SSSSTEP SYSCFG_SSSTEP
  201. #define SYSCFG_CCCEN SYSCFG_CCEN
  202. /****************************************************
  203. * Core MMR Register Map
  204. ****************************************************/
  205. /* Data Cache & SRAM Memory (0xFFE00000 - 0xFFE00404) */
  206. #define SRAM_BASE_ADDRESS 0xFFE00000 /* SRAM Base Address Register */
  207. #define DMEM_CONTROL 0xFFE00004 /* Data memory control */
  208. #define DCPLB_STATUS 0xFFE00008 /* Data Cache Programmable Look-Aside
  209. * Buffer Status
  210. */
  211. #define DCPLB_FAULT_STATUS 0xFFE00008 /* "" (older define) */
  212. #define DCPLB_FAULT_ADDR 0xFFE0000C /* Data Cache Programmable Look-Aside
  213. * Buffer Fault Address
  214. */
  215. #define DCPLB_ADDR0 0xFFE00100 /* Data Cache Protection Lookaside
  216. * Buffer 0
  217. */
  218. #define DCPLB_ADDR1 0xFFE00104 /* Data Cache Protection Lookaside
  219. * Buffer 1
  220. */
  221. #define DCPLB_ADDR2 0xFFE00108 /* Data Cache Protection Lookaside
  222. * Buffer 2
  223. */
  224. #define DCPLB_ADDR3 0xFFE0010C /* Data Cacheability Protection
  225. * Lookaside Buffer 3
  226. */
  227. #define DCPLB_ADDR4 0xFFE00110 /* Data Cacheability Protection
  228. * Lookaside Buffer 4
  229. */
  230. #define DCPLB_ADDR5 0xFFE00114 /* Data Cacheability Protection
  231. * Lookaside Buffer 5
  232. */
  233. #define DCPLB_ADDR6 0xFFE00118 /* Data Cacheability Protection
  234. * Lookaside Buffer 6
  235. */
  236. #define DCPLB_ADDR7 0xFFE0011C /* Data Cacheability Protection
  237. * Lookaside Buffer 7
  238. */
  239. #define DCPLB_ADDR8 0xFFE00120 /* Data Cacheability Protection
  240. * Lookaside Buffer 8
  241. */
  242. #define DCPLB_ADDR9 0xFFE00124 /* Data Cacheability Protection
  243. * Lookaside Buffer 9
  244. */
  245. #define DCPLB_ADDR10 0xFFE00128 /* Data Cacheability Protection
  246. * Lookaside Buffer 10
  247. */
  248. #define DCPLB_ADDR11 0xFFE0012C /* Data Cacheability Protection
  249. * Lookaside Buffer 11
  250. */
  251. #define DCPLB_ADDR12 0xFFE00130 /* Data Cacheability Protection
  252. * Lookaside Buffer 12
  253. */
  254. #define DCPLB_ADDR13 0xFFE00134 /* Data Cacheability Protection
  255. * Lookaside Buffer 13
  256. */
  257. #define DCPLB_ADDR14 0xFFE00138 /* Data Cacheability Protection
  258. * Lookaside Buffer 14
  259. */
  260. #define DCPLB_ADDR15 0xFFE0013C /* Data Cacheability Protection
  261. * Lookaside Buffer 15
  262. */
  263. #define DCPLB_DATA0 0xFFE00200 /* Data Cache 0 Status */
  264. #define DCPLB_DATA1 0xFFE00204 /* Data Cache 1 Status */
  265. #define DCPLB_DATA2 0xFFE00208 /* Data Cache 2 Status */
  266. #define DCPLB_DATA3 0xFFE0020C /* Data Cache 3 Status */
  267. #define DCPLB_DATA4 0xFFE00210 /* Data Cache 4 Status */
  268. #define DCPLB_DATA5 0xFFE00214 /* Data Cache 5 Status */
  269. #define DCPLB_DATA6 0xFFE00218 /* Data Cache 6 Status */
  270. #define DCPLB_DATA7 0xFFE0021C /* Data Cache 7 Status */
  271. #define DCPLB_DATA8 0xFFE00220 /* Data Cache 8 Status */
  272. #define DCPLB_DATA9 0xFFE00224 /* Data Cache 9 Status */
  273. #define DCPLB_DATA10 0xFFE00228 /* Data Cache 10 Status */
  274. #define DCPLB_DATA11 0xFFE0022C /* Data Cache 11 Status */
  275. #define DCPLB_DATA12 0xFFE00230 /* Data Cache 12 Status */
  276. #define DCPLB_DATA13 0xFFE00234 /* Data Cache 13 Status */
  277. #define DCPLB_DATA14 0xFFE00238 /* Data Cache 14 Status */
  278. #define DCPLB_DATA15 0xFFE0023C /* Data Cache 15 Status */
  279. #define DCPLB_DATA16 0xFFE00240 /* Extra Dummy entry */
  280. #define DTEST_COMMAND 0xFFE00300 /* Data Test Command Register */
  281. #define DTEST_DATA0 0xFFE00400 /* Data Test Data Register */
  282. #define DTEST_DATA1 0xFFE00404 /* Data Test Data Register */
  283. /* Instruction Cache & SRAM Memory (0xFFE01004 - 0xFFE01404) */
  284. #define IMEM_CONTROL 0xFFE01004 /* Instruction Memory Control */
  285. #define ICPLB_STATUS 0xFFE01008 /* Instruction Cache miss status */
  286. #define CODE_FAULT_STATUS 0xFFE01008 /* "" (older define) */
  287. #define ICPLB_FAULT_ADDR 0xFFE0100C /* Instruction Cache miss address */
  288. #define CODE_FAULT_ADDR 0xFFE0100C /* "" (older define) */
  289. #define ICPLB_ADDR0 0xFFE01100 /* Instruction Cacheability
  290. * Protection Lookaside Buffer 0
  291. */
  292. #define ICPLB_ADDR1 0xFFE01104 /* Instruction Cacheability
  293. * Protection Lookaside Buffer 1
  294. */
  295. #define ICPLB_ADDR2 0xFFE01108 /* Instruction Cacheability
  296. * Protection Lookaside Buffer 2
  297. */
  298. #define ICPLB_ADDR3 0xFFE0110C /* Instruction Cacheability
  299. * Protection Lookaside Buffer 3
  300. */
  301. #define ICPLB_ADDR4 0xFFE01110 /* Instruction Cacheability
  302. * Protection Lookaside Buffer 4
  303. */
  304. #define ICPLB_ADDR5 0xFFE01114 /* Instruction Cacheability
  305. * Protection Lookaside Buffer 5
  306. */
  307. #define ICPLB_ADDR6 0xFFE01118 /* Instruction Cacheability
  308. * Protection Lookaside Buffer 6
  309. */
  310. #define ICPLB_ADDR7 0xFFE0111C /* Instruction Cacheability
  311. * Protection Lookaside Buffer 7
  312. */
  313. #define ICPLB_ADDR8 0xFFE01120 /* Instruction Cacheability
  314. * Protection Lookaside Buffer 8
  315. */
  316. #define ICPLB_ADDR9 0xFFE01124 /* Instruction Cacheability
  317. * Protection Lookaside Buffer 9
  318. */
  319. #define ICPLB_ADDR10 0xFFE01128 /* Instruction Cacheability
  320. * Protection Lookaside Buffer 10
  321. */
  322. #define ICPLB_ADDR11 0xFFE0112C /* Instruction Cacheability
  323. * Protection Lookaside Buffer 11
  324. */
  325. #define ICPLB_ADDR12 0xFFE01130 /* Instruction Cacheability
  326. * Protection Lookaside Buffer 12
  327. */
  328. #define ICPLB_ADDR13 0xFFE01134 /* Instruction Cacheability
  329. * Protection Lookaside Buffer 13
  330. */
  331. #define ICPLB_ADDR14 0xFFE01138 /* Instruction Cacheability
  332. * Protection Lookaside Buffer 14
  333. */
  334. #define ICPLB_ADDR15 0xFFE0113C /* Instruction Cacheability
  335. * Protection Lookaside Buffer 15
  336. */
  337. #define ICPLB_DATA0 0xFFE01200 /* Instruction Cache 0 Status */
  338. #define ICPLB_DATA1 0xFFE01204 /* Instruction Cache 1 Status */
  339. #define ICPLB_DATA2 0xFFE01208 /* Instruction Cache 2 Status */
  340. #define ICPLB_DATA3 0xFFE0120C /* Instruction Cache 3 Status */
  341. #define ICPLB_DATA4 0xFFE01210 /* Instruction Cache 4 Status */
  342. #define ICPLB_DATA5 0xFFE01214 /* Instruction Cache 5 Status */
  343. #define ICPLB_DATA6 0xFFE01218 /* Instruction Cache 6 Status */
  344. #define ICPLB_DATA7 0xFFE0121C /* Instruction Cache 7 Status */
  345. #define ICPLB_DATA8 0xFFE01220 /* Instruction Cache 8 Status */
  346. #define ICPLB_DATA9 0xFFE01224 /* Instruction Cache 9 Status */
  347. #define ICPLB_DATA10 0xFFE01228 /* Instruction Cache 10 Status */
  348. #define ICPLB_DATA11 0xFFE0122C /* Instruction Cache 11 Status */
  349. #define ICPLB_DATA12 0xFFE01230 /* Instruction Cache 12 Status */
  350. #define ICPLB_DATA13 0xFFE01234 /* Instruction Cache 13 Status */
  351. #define ICPLB_DATA14 0xFFE01238 /* Instruction Cache 14 Status */
  352. #define ICPLB_DATA15 0xFFE0123C /* Instruction Cache 15 Status */
  353. #define ITEST_COMMAND 0xFFE01300 /* Instruction Test Command Register */
  354. #define ITEST_DATA0 0xFFE01400 /* Instruction Test Data Register */
  355. #define ITEST_DATA1 0xFFE01404 /* Instruction Test Data Register */
  356. /* Event/Interrupt Controller Registers (0xFFE02000 - 0xFFE02110) */
  357. #define EVT0 0xFFE02000 /* Event Vector 0 ESR Address */
  358. #define EVT1 0xFFE02004 /* Event Vector 1 ESR Address */
  359. #define EVT2 0xFFE02008 /* Event Vector 2 ESR Address */
  360. #define EVT3 0xFFE0200C /* Event Vector 3 ESR Address */
  361. #define EVT4 0xFFE02010 /* Event Vector 4 ESR Address */
  362. #define EVT5 0xFFE02014 /* Event Vector 5 ESR Address */
  363. #define EVT6 0xFFE02018 /* Event Vector 6 ESR Address */
  364. #define EVT7 0xFFE0201C /* Event Vector 7 ESR Address */
  365. #define EVT8 0xFFE02020 /* Event Vector 8 ESR Address */
  366. #define EVT9 0xFFE02024 /* Event Vector 9 ESR Address */
  367. #define EVT10 0xFFE02028 /* Event Vector 10 ESR Address */
  368. #define EVT11 0xFFE0202C /* Event Vector 11 ESR Address */
  369. #define EVT12 0xFFE02030 /* Event Vector 12 ESR Address */
  370. #define EVT13 0xFFE02034 /* Event Vector 13 ESR Address */
  371. #define EVT14 0xFFE02038 /* Event Vector 14 ESR Address */
  372. #define EVT15 0xFFE0203C /* Event Vector 15 ESR Address */
  373. #define EVT_OVERRIDE 0xFFE02100 /* Event Vector Override Register */
  374. #define IMASK 0xFFE02104 /* Interrupt Mask Register */
  375. #define IPEND 0xFFE02108 /* Interrupt Pending Register */
  376. #define ILAT 0xFFE0210C /* Interrupt Latch Register */
  377. #define IPRIO 0xFFE02110 /* Core Interrupt Priority Register */
  378. /* Core Timer Registers (0xFFE03000 - 0xFFE0300C) */
  379. #define TCNTL 0xFFE03000 /* Core Timer Control Register */
  380. #define TPERIOD 0xFFE03004 /* Core Timer Period Register */
  381. #define TSCALE 0xFFE03008 /* Core Timer Scale Register */
  382. #define TCOUNT 0xFFE0300C /* Core Timer Count Register */
  383. /* Debug/MP/Emulation Registers (0xFFE05000 - 0xFFE05008) */
  384. #define DSPID 0xFFE05000 /* DSP Processor ID Register for
  385. * MP implementations
  386. */
  387. #define DBGSTAT 0xFFE05008 /* Debug Status Register */
  388. /* Trace Buffer Registers (0xFFE06000 - 0xFFE06100) */
  389. #define TBUFCTL 0xFFE06000 /* Trace Buffer Control Register */
  390. #define TBUFSTAT 0xFFE06004 /* Trace Buffer Status Register */
  391. #define TBUF 0xFFE06100 /* Trace Buffer */
  392. /* Watchpoint Control Registers (0xFFE07000 - 0xFFE07200) */
  393. /* Watchpoint Instruction Address Control Register */
  394. #define WPIACTL 0xFFE07000
  395. /* Watchpoint Instruction Address Register 0 */
  396. #define WPIA0 0xFFE07040
  397. /* Watchpoint Instruction Address Register 1 */
  398. #define WPIA1 0xFFE07044
  399. /* Watchpoint Instruction Address Register 2 */
  400. #define WPIA2 0xFFE07048
  401. /* Watchpoint Instruction Address Register 3 */
  402. #define WPIA3 0xFFE0704C
  403. /* Watchpoint Instruction Address Register 4 */
  404. #define WPIA4 0xFFE07050
  405. /* Watchpoint Instruction Address Register 5 */
  406. #define WPIA5 0xFFE07054
  407. /* Watchpoint Instruction Address Count Register 0 */
  408. #define WPIACNT0 0xFFE07080
  409. /* Watchpoint Instruction Address Count Register 1 */
  410. #define WPIACNT1 0xFFE07084
  411. /* Watchpoint Instruction Address Count Register 2 */
  412. #define WPIACNT2 0xFFE07088
  413. /* Watchpoint Instruction Address Count Register 3 */
  414. #define WPIACNT3 0xFFE0708C
  415. /* Watchpoint Instruction Address Count Register 4 */
  416. #define WPIACNT4 0xFFE07090
  417. /* Watchpoint Instruction Address Count Register 5 */
  418. #define WPIACNT5 0xFFE07094
  419. /* Watchpoint Data Address Control Register */
  420. #define WPDACTL 0xFFE07100
  421. /* Watchpoint Data Address Register 0 */
  422. #define WPDA0 0xFFE07140
  423. /* Watchpoint Data Address Register 1 */
  424. #define WPDA1 0xFFE07144
  425. /* Watchpoint Data Address Count Value Register 0 */
  426. #define WPDACNT0 0xFFE07180
  427. /* Watchpoint Data Address Count Value Register 1 */
  428. #define WPDACNT1 0xFFE07184
  429. /* Watchpoint Status Register */
  430. #define WPSTAT 0xFFE07200
  431. /* Performance Monitor Registers (0xFFE08000 - 0xFFE08104) */
  432. /* Performance Monitor Control Register */
  433. #define PFCTL 0xFFE08000
  434. /* Performance Monitor Counter Register 0 */
  435. #define PFCNTR0 0xFFE08100
  436. /* Performance Monitor Counter Register 1 */
  437. #define PFCNTR1 0xFFE08104
  438. /****************************************************
  439. * Core MMR Register Bits
  440. ****************************************************/
  441. /**************************************************
  442. * EVT registers (ILAT, IMASK, and IPEND).
  443. **************************************************/
  444. /* Bit Positions */
  445. #define EVT_EMU_P 0x00000000 /* Emulator interrupt bit position */
  446. #define EVT_RST_P 0x00000001 /* Reset interrupt bit position */
  447. #define EVT_NMI_P 0x00000002 /* Non Maskable interrupt bit position */
  448. #define EVT_EVX_P 0x00000003 /* Exception bit position */
  449. #define EVT_IRPTEN_P 0x00000004 /* Global interrupt enable bit position */
  450. #define EVT_IVHW_P 0x00000005 /* Hardware Error interrupt bit position */
  451. #define EVT_IVTMR_P 0x00000006 /* Timer interrupt bit position */
  452. #define EVT_IVG7_P 0x00000007 /* IVG7 interrupt bit position */
  453. #define EVT_IVG8_P 0x00000008 /* IVG8 interrupt bit position */
  454. #define EVT_IVG9_P 0x00000009 /* IVG9 interrupt bit position */
  455. #define EVT_IVG10_P 0x0000000a /* IVG10 interrupt bit position */
  456. #define EVT_IVG11_P 0x0000000b /* IVG11 interrupt bit position */
  457. #define EVT_IVG12_P 0x0000000c /* IVG12 interrupt bit position */
  458. #define EVT_IVG13_P 0x0000000d /* IVG13 interrupt bit position */
  459. #define EVT_IVG14_P 0x0000000e /* IVG14 interrupt bit position */
  460. #define EVT_IVG15_P 0x0000000f /* IVG15 interrupt bit position */
  461. /* Masks */
  462. #define EVT_EMU MK_BMSK_(EVT_EMU_P ) /* Emulator interrupt mask */
  463. #define EVT_RST MK_BMSK_(EVT_RST_P ) /* Reset interrupt mask */
  464. #define EVT_NMI MK_BMSK_(EVT_NMI_P ) /* Non Maskable interrupt mask */
  465. #define EVT_EVX MK_BMSK_(EVT_EVX_P ) /* Exception mask */
  466. #define EVT_IRPTEN MK_BMSK_(EVT_IRPTEN_P) /* Global interrupt enable mask */
  467. #define EVT_IVHW MK_BMSK_(EVT_IVHW_P ) /* Hardware Error interrupt mask */
  468. #define EVT_IVTMR MK_BMSK_(EVT_IVTMR_P ) /* Timer interrupt mask */
  469. #define EVT_IVG7 MK_BMSK_(EVT_IVG7_P ) /* IVG7 interrupt mask */
  470. #define EVT_IVG8 MK_BMSK_(EVT_IVG8_P ) /* IVG8 interrupt mask */
  471. #define EVT_IVG9 MK_BMSK_(EVT_IVG9_P ) /* IVG9 interrupt mask */
  472. #define EVT_IVG10 MK_BMSK_(EVT_IVG10_P ) /* IVG10 interrupt mask */
  473. #define EVT_IVG11 MK_BMSK_(EVT_IVG11_P ) /* IVG11 interrupt mask */
  474. #define EVT_IVG12 MK_BMSK_(EVT_IVG12_P ) /* IVG12 interrupt mask */
  475. #define EVT_IVG13 MK_BMSK_(EVT_IVG13_P ) /* IVG13 interrupt mask */
  476. #define EVT_IVG14 MK_BMSK_(EVT_IVG14_P ) /* IVG14 interrupt mask */
  477. #define EVT_IVG15 MK_BMSK_(EVT_IVG15_P ) /* IVG15 interrupt mask */
  478. /**************************************************
  479. * DMEM_CONTROL Register
  480. **************************************************/
  481. /* Bit Positions */
  482. #define ENDM_P 0x00 /* (doesn't really exist) Enable
  483. *Data Memory L1
  484. */
  485. #define DMCTL_ENDM_P ENDM_P /* "" (older define) */
  486. #define ENDCPLB_P 0x01 /* Enable DCPLBS */
  487. #define DMCTL_ENDCPLB_P ENDCPLB_P /* "" (older define) */
  488. #define DMC0_P 0x02 /* L1 Data Memory Configure bit 0 */
  489. #define DMCTL_DMC0_P DMC0_P /* "" (older define) */
  490. #define DMC1_P 0x03 /* L1 Data Memory Configure bit 1 */
  491. #define DMCTL_DMC1_P DMC1_P /* "" (older define) */
  492. #define DCBS_P 0x04 /* L1 Data Cache Bank Select */
  493. #define PORT_PREF0_P 0x12 /* DAG0 Port Preference */
  494. #define PORT_PREF1_P 0x13 /* DAG1 Port Preference */
  495. #define RDCHK 0x9 /* Enable L1 Parity Check */
  496. /* Masks */
  497. #define ENDM 0x00000001 /* (doesn't really exist) Enable
  498. * Data Memory L1
  499. */
  500. #define ENDCPLB 0x00000002 /* Enable DCPLB */
  501. #define ASRAM_BSRAM 0x00000000
  502. #define ACACHE_BSRAM 0x00000008
  503. #define ACACHE_BCACHE 0x0000000C
  504. #define DCBS 0x00000010 /* L1 Data Cache Bank Select */
  505. #define PORT_PREF0 0x00001000 /* DAG0 Port Preference */
  506. #define PORT_PREF1 0x00002000 /* DAG1 Port Preference */
  507. /* IMEM_CONTROL Register */
  508. /* Bit Positions */
  509. #define ENIM_P 0x00 /* Enable L1 Code Memory */
  510. #define IMCTL_ENIM_P 0x00 /* "" (older define) */
  511. #define ENICPLB_P 0x01 /* Enable ICPLB */
  512. #define IMCTL_ENICPLB_P 0x01 /* "" (older define) */
  513. #define IMC_P 0x02 /* Enable */
  514. #define IMCTL_IMC_P 0x02 /* Configure L1 code memory as
  515. * cache (0=SRAM)
  516. */
  517. #define ILOC0_P 0x03 /* Lock Way 0 */
  518. #define ILOC1_P 0x04 /* Lock Way 1 */
  519. #define ILOC2_P 0x05 /* Lock Way 2 */
  520. #define ILOC3_P 0x06 /* Lock Way 3 */
  521. #define LRUPRIORST_P 0x0D /* Least Recently Used Replacement
  522. * Priority
  523. */
  524. /* Masks */
  525. #define ENIM 0x00000001 /* Enable L1 Code Memory */
  526. #define ENICPLB 0x00000002 /* Enable ICPLB */
  527. #define IMC 0x00000004 /* Configure L1 code memory as
  528. * cache (0=SRAM)
  529. */
  530. #define ILOC0 0x00000008 /* Lock Way 0 */
  531. #define ILOC1 0x00000010 /* Lock Way 1 */
  532. #define ILOC2 0x00000020 /* Lock Way 2 */
  533. #define ILOC3 0x00000040 /* Lock Way 3 */
  534. #define LRUPRIORST 0x00002000 /* Least Recently Used Replacement
  535. * Priority
  536. */
  537. /* TCNTL Masks */
  538. #define TMPWR 0x00000001 /* Timer Low Power Control,
  539. * 0=low power mode, 1=active state
  540. */
  541. #define TMREN 0x00000002 /* Timer enable, 0=disable, 1=enable */
  542. #define TAUTORLD 0x00000004 /* Timer auto reload */
  543. #define TINT 0x00000008 /* Timer generated interrupt 0=no
  544. * interrupt has been generated,
  545. * 1=interrupt has been generated
  546. * (sticky)
  547. */
  548. /* DCPLB_DATA and ICPLB_DATA Registers */
  549. /* Bit Positions */
  550. #define CPLB_VALID_P 0x00000000 /* 0=invalid entry, 1=valid entry */
  551. #define CPLB_LOCK_P 0x00000001 /* 0=entry may be replaced, 1=entry
  552. * locked
  553. */
  554. #define CPLB_USER_RD_P 0x00000002 /* 0=no read access, 1=read access
  555. * allowed (user mode)
  556. */
  557. /* Masks */
  558. #define CPLB_VALID 0x00000001 /* 0=invalid entry, 1=valid entry */
  559. #define CPLB_LOCK 0x00000002 /* 0=entry may be replaced, 1=entry
  560. * locked
  561. */
  562. #define CPLB_USER_RD 0x00000004 /* 0=no read access, 1=read access
  563. * allowed (user mode)
  564. */
  565. #define PAGE_SIZE_1KB 0x00000000 /* 1 KB page size */
  566. #define PAGE_SIZE_4KB 0x00010000 /* 4 KB page size */
  567. #define PAGE_SIZE_1MB 0x00020000 /* 1 MB page size */
  568. #define PAGE_SIZE_4MB 0x00030000 /* 4 MB page size */
  569. #ifdef CONFIG_BF60x
  570. #define PAGE_SIZE_16KB 0x00040000 /* 16 KB page size */
  571. #define PAGE_SIZE_64KB 0x00050000 /* 64 KB page size */
  572. #define PAGE_SIZE_16MB 0x00060000 /* 16 MB page size */
  573. #define PAGE_SIZE_64MB 0x00070000 /* 64 MB page size */
  574. #endif
  575. #define CPLB_L1SRAM 0x00000020 /* 0=SRAM mapped in L1, 0=SRAM not
  576. * mapped to L1
  577. */
  578. #define CPLB_PORTPRIO 0x00000200 /* 0=low priority port, 1= high
  579. * priority port
  580. */
  581. #define CPLB_L1_CHBL 0x00001000 /* 0=non-cacheable in L1, 1=cacheable
  582. * in L1
  583. */
  584. /* ICPLB_DATA only */
  585. #define CPLB_LRUPRIO 0x00000100 /* 0=can be replaced by any line,
  586. * 1=priority for non-replacement
  587. */
  588. /* DCPLB_DATA only */
  589. #define CPLB_USER_WR 0x00000008 /* 0=no write access, 0=write
  590. * access allowed (user mode)
  591. */
  592. #define CPLB_SUPV_WR 0x00000010 /* 0=no write access, 0=write
  593. * access allowed (supervisor mode)
  594. */
  595. #define CPLB_DIRTY 0x00000080 /* 1=dirty, 0=clean */
  596. #define CPLB_L1_AOW 0x00008000 /* 0=do not allocate cache lines on
  597. * write-through writes,
  598. * 1= allocate cache lines on
  599. * write-through writes.
  600. */
  601. #define CPLB_WT 0x00004000 /* 0=write-back, 1=write-through */
  602. #define CPLB_ALL_ACCESS CPLB_SUPV_WR | CPLB_USER_RD | CPLB_USER_WR
  603. /* TBUFCTL Masks */
  604. #define TBUFPWR 0x0001
  605. #define TBUFEN 0x0002
  606. #define TBUFOVF 0x0004
  607. #define TBUFCMPLP_SINGLE 0x0008
  608. #define TBUFCMPLP_DOUBLE 0x0010
  609. #define TBUFCMPLP (TBUFCMPLP_SINGLE | TBUFCMPLP_DOUBLE)
  610. /* TBUFSTAT Masks */
  611. #define TBUFCNT 0x001F
  612. /* ITEST_COMMAND and DTEST_COMMAND Registers */
  613. /* Masks */
  614. #define TEST_READ 0x00000000 /* Read Access */
  615. #define TEST_WRITE 0x00000002 /* Write Access */
  616. #define TEST_TAG 0x00000000 /* Access TAG */
  617. #define TEST_DATA 0x00000004 /* Access DATA */
  618. #define TEST_DW0 0x00000000 /* Select Double Word 0 */
  619. #define TEST_DW1 0x00000008 /* Select Double Word 1 */
  620. #define TEST_DW2 0x00000010 /* Select Double Word 2 */
  621. #define TEST_DW3 0x00000018 /* Select Double Word 3 */
  622. #define TEST_MB0 0x00000000 /* Select Mini-Bank 0 */
  623. #define TEST_MB1 0x00010000 /* Select Mini-Bank 1 */
  624. #define TEST_MB2 0x00020000 /* Select Mini-Bank 2 */
  625. #define TEST_MB3 0x00030000 /* Select Mini-Bank 3 */
  626. #define TEST_SET(x) ((x << 5) & 0x03E0) /* Set Index 0->31 */
  627. #define TEST_WAY0 0x00000000 /* Access Way0 */
  628. #define TEST_WAY1 0x04000000 /* Access Way1 */
  629. /* ITEST_COMMAND only */
  630. #define TEST_WAY2 0x08000000 /* Access Way2 */
  631. #define TEST_WAY3 0x0C000000 /* Access Way3 */
  632. /* DTEST_COMMAND only */
  633. #define TEST_BNKSELA 0x00000000 /* Access SuperBank A */
  634. #define TEST_BNKSELB 0x00800000 /* Access SuperBank B */
  635. #endif /* _DEF_LPBLACKFIN_H */