nds32_defs.h 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362
  1. /*
  2. * Copyright (C) 2008 Andes Technology, Inc.
  3. */
  4. #ifndef __NDS32_DEFS_H__
  5. #define __NDS32_DEFS_H__
  6. /******************************************************************************
  7. * cr0: CPU_VER (CPU Version Register)
  8. *****************************************************************************/
  9. #define CPU_VER_offCFGID 0 /* Minor configuration */
  10. #define CPU_VER_offREV 16 /* Revision of the CPU version */
  11. #define CPU_VER_offCPUID 24 /* Major CPU versions */
  12. #define CPU_VER_mskCFGID ( 0xFFFF << CPU_VER_offCFGID )
  13. #define CPU_VER_mskREV ( 0xFF << CPU_VER_offREV )
  14. #define CPU_VER_mskCPUID ( 0xFF << CPU_VER_offCPUID )
  15. /******************************************************************************
  16. * cr1: ICM_CFG (Instruction Cache/Memory Configuration Register)
  17. *****************************************************************************/
  18. #define ICM_CFG_offISET 0 /* I-cache sets (# of cache lines) per way */
  19. #define ICM_CFG_offIWAY 3 /* I-cache ways */
  20. #define ICM_CFG_offISZ 6 /* I-cache line size */
  21. #define ICM_CFG_offILCK 9 /* I-cache locking support */
  22. #define ICM_CFG_offILMB 10 /* On-chip ILM banks */
  23. #define ICM_CFG_offBSAV 13 /* ILM base register alignment version */
  24. #define ICM_CFG_offEXT 15 /* External ILM or not */
  25. #define ICM_CFG_offULM_2BANK 16 /* In ULM configuration, ILM has two banks */
  26. /* bit 17:31 reserved */
  27. #define ICM_CFG_mskISET ( 0x7 << ICM_CFG_offISET )
  28. #define ICM_CFG_mskIWAY ( 0x7 << ICM_CFG_offIWAY )
  29. #define ICM_CFG_mskISZ ( 0x7 << ICM_CFG_offISZ )
  30. #define ICM_CFG_mskILCK ( 0x1 << ICM_CFG_offILCK )
  31. #define ICM_CFG_mskILMB ( 0x7 << ICM_CFG_offILMB )
  32. #define ICM_CFG_mskBSAV ( 0x3 << ICM_CFG_offBSAV )
  33. #define ICM_CFG_mskEXT ( 0x1 << ICM_CFG_offEXT )
  34. #define ICM_CFG_mskULM_2BANK ( 0x1 << ICM_CFG_offULM_2BANK )
  35. /******************************************************************************
  36. * cr2: DCM_CFG (Data Cache/Memory Configuration Register)
  37. *****************************************************************************/
  38. #define DCM_CFG_offDSET 0 /* D-cache sets (# of cache lines) per way */
  39. #define DCM_CFG_offDWAY 3 /* D-cache ways */
  40. #define DCM_CFG_offDSZ 6 /* D-cache line size */
  41. #define DCM_CFG_offDLCK 9 /* D-cache locking support */
  42. #define DCM_CFG_offDLMB 10 /* On-chip DLM banks */
  43. #define DCM_CFG_offBSAV 13 /* DLM base register alignment version */
  44. #define DCM_CFG_offEXT 15 /* External DLM or not */
  45. #define DCM_CFG_offULM_2BANK 16 /* In ULM configuration, DLM has two banks */
  46. /* bit 17:31 reserved */
  47. #define DCM_CFG_mskDSET ( 0x7 << DCM_CFG_offDSET )
  48. #define DCM_CFG_mskDWAY ( 0x7 << DCM_CFG_offDWAY )
  49. #define DCM_CFG_mskDSZ ( 0x7 << DCM_CFG_offDSZ )
  50. #define DCM_CFG_mskDLCK ( 0x1 << DCM_CFG_offDLCK )
  51. #define DCM_CFG_mskDLMB ( 0x7 << DCM_CFG_offDLMB )
  52. #define DCM_CFG_mskBSAV ( 0x3 << DCM_CFG_offBSAV )
  53. #define DCM_CFG_mskEXT ( 0x1 << DCM_CFG_offEXT )
  54. #define DCM_CFG_mskULM_2BANK ( 0x1 << DCM_CFG_offULM_2BANK )
  55. /******************************************************************************
  56. * cr3: MMU_CFG (MMU Configuration Register)
  57. *****************************************************************************/
  58. #define MMU_CFG_offMMPS 0 /* Memory management protection scheme */
  59. #define MMU_CFG_offMMPV 2 /* Memory management protection version number */
  60. #define MMU_CFG_offFATB 7 /* Fully-associative or non-fully-associative TLB */
  61. #ifdef CONFIG_FULL_ASSOC
  62. #define MMU_CFG_offFATBSZ 8 /* TLB entries while using full-associative TLB */
  63. #else
  64. #define MMU_CFG_offTBW 8 /* TLB ways(non-associative) TBS */
  65. #define MMU_CFG_offTBS 11 /* TLB sets per way(non-associative) TBS */
  66. /* bit 14:14 reserved */
  67. #endif
  68. #define MMU_CFG_offEP8MIN4 15 /* 8KB page supported while minimum page is 4KB */
  69. #define MMU_CFG_offfEPSZ 16 /* Extra page size supported */
  70. #define MMU_CFG_offTLBLCK 24 /* TLB locking support */
  71. #define MMU_CFG_offHPTWK 25 /* Hardware Page Table Walker implemented */
  72. #define MMU_CFG_offDE 26 /* Default endian */
  73. #define MMU_CFG_offNTPT 27 /* Partitions for non-translated attributes */
  74. #define MMU_CFG_offIVTB 28 /* Invisible TLB */
  75. #define MMU_CFG_offVLPT 29 /* VLPT for fast TLB fill handling implemented */
  76. #define MMU_CFG_offNTME 30 /* Non-translated VA to PA mapping */
  77. #define MMU_CFG_offDRDE 31 /* Device register default endian */
  78. #define MMU_CFG_mskMMPS ( 0x3 << MMU_CFG_offMMPS )
  79. #define MMU_CFG_mskMMPV ( 0x1F << MMU_CFG_offMMPV )
  80. #define MMU_CFG_mskFATB ( 0x1 << MMU_CFG_offFATB )
  81. #ifdef CONFIG_FULL_ASSOC
  82. #define MMU_CFG_mskFATBSZ ( 0x7f << MMU_CFG_offFATBSZ )
  83. #else
  84. #define MMU_CFG_mskTBW ( 0x7 << MMU_CFG_offTBW )
  85. #define MMU_CFG_mskTBS ( 0x7 << MMU_CFG_offTBS )
  86. #endif
  87. #define MMU_CFG_mskEP8MIN4 ( 0x1 << MMU_CFG_offEP8MIN4 )
  88. #define MMU_CFG_mskfEPSZ ( 0xFF << MMU_CFG_offfEPSZ )
  89. #define MMU_CFG_mskTLBLCK ( 0x1 << MMU_CFG_offTLBLCK )
  90. #define MMU_CFG_mskHPTWK ( 0x1 << MMU_CFG_offHPTWK )
  91. #define MMU_CFG_mskDE ( 0x1 << MMU_CFG_offDE )
  92. #define MMU_CFG_mskNTPT ( 0x1 << MMU_CFG_offNTPT )
  93. #define MMU_CFG_mskIVTB ( 0x1 << MMU_CFG_offIVTB )
  94. #define MMU_CFG_mskVLPT ( 0x1 << MMU_CFG_offVLPT )
  95. #define MMU_CFG_mskNTME ( 0x1 << MMU_CFG_offNTME )
  96. #define MMU_CFG_mskDRDE ( 0x1 << MMU_CFG_offDRDE )
  97. /******************************************************************************
  98. * cr4: MSC_CFG (Misc Configuration Register)
  99. *****************************************************************************/
  100. #define MSC_CFG_offEDM 0 /* EDM */
  101. #define MSC_CFG_offLMDMA 1 /* Local memory DMA engine */
  102. #define MSC_CFG_offPFM 2 /* Performance monitoring feature */
  103. #define MSC_CFG_offHSMP 3 /* HSMP_SADDR (V1 and V2 of HSMP) register */
  104. #define MSC_CFG_offTRACE 4 /* Debug Tracer Unit */
  105. #define MSC_CFG_offDIV 5 /* Divide instructions support */
  106. #define MSC_CFG_offMAC 6 /* Multiply instructions support */
  107. #define MSC_CFG_offAUDIO 7 /* AUDIO ISA extension support */
  108. #define MSC_CFG_offL2C 9 /* L2 unified cache */
  109. #define MSC_CFG_offRDREG 10 /* Reduced Register configuration */
  110. #define MSC_CFG_offADR24 11 /* Reduced Address Space to 24-bit configuration */
  111. #define MSC_CFG_offINTLC 12 /* interruption level configuration */
  112. #define MSC_CFG_offBASEV 13 /* Baseline instructions version */
  113. #define MSC_CFG_offNOD 16 /* Dx registers */
  114. #define MSC_CFG_offIMV 17 /* Implementation-dependent register detection scheme version */
  115. #define MSC_CFG_offIMR 18 /* First implementation-dependent register of SR encoding {2, 15, 0} */
  116. #define MSC_CFG_offIFC 19 /* IFC support */
  117. #define MSC_CFG_offMCU 20 /* MCU family */
  118. #define MSC_CFG_offSHADOW 21 /* shadow registers support */
  119. #define MSC_CFG_offEIT 24 /* EX9 support */
  120. #define MSC_CFG_offULM 25 /* ULM configuration */
  121. #define MSC_CFG_offPFT 26 /* Performance Throttling feature support */
  122. #define MSC_CFG_offHSP 27 /* HW Stack protection/recording feature support */
  123. /* bit 28:29 reserved */
  124. #define MSC_CFG_offMSC_EXT 30 /* Miscellaneous Configuration Extension */
  125. #define MSC_CFG_mskEDM ( 0x1 << MSC_CFG_offEDM )
  126. #define MSC_CFG_mskLMDMA ( 0x1 << MSC_CFG_offLMDMA )
  127. #define MSC_CFG_mskPFM ( 0x1 << MSC_CFG_offPFM )
  128. #define MSC_CFG_mskHSMP ( 0x1 << MSC_CFG_offHSMP )
  129. #define MSC_CFG_mskTRACE ( 0x1 << MSC_CFG_offTRACE )
  130. #define MSC_CFG_mskDIV ( 0x1 << MSC_CFG_offDIV )
  131. #define MSC_CFG_mskMAC ( 0x1 << MSC_CFG_offMAC )
  132. #define MSC_CFG_mskAUDIO ( 0x3 << MSC_CFG_offAUDIO )
  133. #define MSC_CFG_mskL2C ( 0x1 << MSC_CFG_offL2C )
  134. #define MSC_CFG_mskRDREG ( 0x1 << MSC_CFG_offRDREG )
  135. #define MSC_CFG_mskADR24 ( 0x1 << MSC_CFG_offADR24 )
  136. #define MSC_CFG_mskINTLC ( 0x1 << MSC_CFG_offINTLC )
  137. #define MSC_CFG_mskBASEV ( 0x7 << MSC_CFG_offBASEV )
  138. #define MSC_CFG_mskNOD ( 0x1 << MSC_CFG_offNOD )
  139. #define MSC_CFG_mskIMV ( 0x1 << MSC_CFG_offIMV )
  140. #define MSC_CFG_mskIMR ( 0x1 << MSC_CFG_offIMR )
  141. #define MSC_CFG_mskIFC ( 0x1 << MSC_CFG_offIFC )
  142. #define MSC_CFG_mskMCU ( 0x1 << MSC_CFG_offMCU )
  143. #define MSC_CFG_mskSHADOW ( 0x7 << MSC_CFG_offSHADOW )
  144. #define MSC_CFG_mskEIT ( 0x1 << MSC_CFG_offEIT )
  145. #define MSC_CFG_mskULM ( 0x1 << MSC_CFG_offULM )
  146. #define MSC_CFG_mskPFT ( 0x1 << MSC_CFG_offPFT )
  147. #define MSC_CFG_mskHSP ( 0x1 << MSC_CFG_offHSP )
  148. #define MSC_CFG_mskMSC_EXT ( 0x3 << MSC_CFG_offMSC_EXT )
  149. /******************************************************************************
  150. * cr5: CORE_CFG (Core Identification Register)
  151. *****************************************************************************/
  152. #define CORE_ID_offCOREID 0
  153. /* bit 4:31 reserved */
  154. #define CORE_ID_mskCOREID ( 0xF << CORE_ID_offCOREID )
  155. /******************************************************************************
  156. * cr6: FUCOP_EXIST (FPU and Coprocessor Existence Configuration Register)
  157. *****************************************************************************/
  158. #define FUCOP_EXIST_offCP0EX 0 /* Coprocessor #0 existence */
  159. #define FUCOP_EXIST_offCP1EX 1 /* Coprocessor #1 existence */
  160. #define FUCOP_EXIST_offCP2EX 2 /* Coprocessor #2 existence */
  161. #define FUCOP_EXIST_offCP3EX 3 /* Coprocessor #3 existence */
  162. /* bit 4:15 reserved */
  163. #define FUCOP_EXIST_offCPV 16 /* Coprocessor ISA extension version */
  164. /* bit 18:30 reserved */
  165. #define FUCOP_EXIST_offCP0ISFPU 31 /* Coprocessor #0 is FPU when CP0EX is 1 */
  166. #define FUCOP_EXIST_mskCP0EX ( 0x1 << FUCOP_EXIST_offCP0EX )
  167. #define FUCOP_EXIST_mskCP1EX ( 0x1 << FUCOP_EXIST_offCP1EX )
  168. #define FUCOP_EXIST_mskCP2EX ( 0x1 << FUCOP_EXIST_offCP2EX )
  169. #define FUCOP_EXIST_mskCP3EX ( 0x1 << FUCOP_EXIST_offCP3EX )
  170. #define FUCOP_EXIST_mskCPV ( 0x3 << FUCOP_EXIST_offCPV )
  171. #define FUCOP_EXIST_mskCP0ISFPU ( 0x1 << FUCOP_EXIST_offCP0ISFPU )
  172. /******************************************************************************
  173. * ir0: PSW (Processor Status Word Register)
  174. * ir1: IPSW (Interruption PSW Register)
  175. * ir2: P_IPSW (Previous IPSW Register)
  176. *****************************************************************************/
  177. #define PSW_offGIE 0 /* Global Interrupt Enable */
  178. #define PSW_offINTL 1 /* Interruption Stack Level */
  179. #define PSW_offPOM 3 /* Processor Operation Mode, User/Superuser */
  180. #define PSW_offBE 5 /* Endianness for data memory access, 1:MSB, 0:LSB */
  181. #define PSW_offIT 6 /* Enable instruction address translation */
  182. #define PSW_offDT 7 /* Enable data address translation */
  183. #define PSW_offIME 8 /* Instruction Machine Error flag */
  184. #define PSW_offDME 9 /* Data Machine Error flag */
  185. #define PSW_offDEX 10 /* Debug Exception */
  186. #define PSW_offHSS 11 /* Hardware Single Stepping */
  187. #define PSW_offDRBE 12 /* Device Register Endian mode for device register */
  188. #define PSW_offAEN 13 /* Audio ISA special features enable control */
  189. #define PSW_offWBNA 14 /* write-back, write-allocation to write-back, no-write-allocation */
  190. #define PSW_offIFCON 15 /* Hardware Single Stepping */
  191. #define PSW_offCPL 16 /* Current Priority Level */
  192. /* bit 19 reserved */
  193. #define PSW_offOV 20 /* Overflow flag for saturation arithmetic instructions */
  194. #define PSW_offPFT_EN 21 /* Enable performance throttling */
  195. /* bit 22:31 reserved */
  196. #define PSW_mskGIE ( 0x1 << PSW_offGIE )
  197. #define PSW_mskINTL ( 0x3 << PSW_offINTL )
  198. #define PSW_mskPOM ( 0x3 << PSW_offPOM )
  199. #define PSW_mskBE ( 0x1 << PSW_offBE )
  200. #define PSW_mskIT ( 0x1 << PSW_offIT )
  201. #define PSW_mskDT ( 0x1 << PSW_offDT )
  202. #define PSW_mskIME ( 0x1 << PSW_offIME )
  203. #define PSW_mskDME ( 0x1 << PSW_offDME )
  204. #define PSW_mskDEX ( 0x1 << PSW_offDEX )
  205. #define PSW_mskHSS ( 0x1 << PSW_offHSS )
  206. #define PSW_mskDRBE ( 0x1 << PSW_offDRBE )
  207. #define PSW_mskAEN ( 0x1 << PSW_offAEN )
  208. #define PSW_mskWBNA ( 0x1 << PSW_offWBNA )
  209. #define PSW_mskIFCON ( 0x1 << PSW_offIFCON )
  210. #define PSW_mskCPL ( 0x7 << PSW_offCPL )
  211. #define PSW_mskOV ( 0x1 << PSW_offOV )
  212. #define PSW_mskPFT_EN ( 0x1 << PSW_offPFT_EN )
  213. /******************************************************************************
  214. * ir3: IVB (Interruption Vector Base Register)
  215. *****************************************************************************/
  216. #define IVB_offPROG_PRI_LVL 0 /* Programmable Priority Level */////
  217. #define IVB_offNIVIC 1 /* Number of input for Internal Vector Interrupt Controller*/
  218. /* bit 4:10 reserved */
  219. #define IVB_offIVIC_VER 11 /* Internal Vectored Interrupt Controller (IVIC) Version */
  220. #define IVB_offEVIC 13 /* External Vector Interrupt Controller mode */
  221. #define IVB_offESZ 14 /* Size of each vector entry */
  222. #define IVB_offIVBASE 16 /* BasePA of interrupt vector table */
  223. #define IVB_mskPROG_PRI_LVL ( 0x1 << IVB_offPROG_PRI_LVL)
  224. #define IVB_mskNIVIC ( 0x7 << IVB_offNIVIC)
  225. #define IVB_mskIVIC_VER ( 0x3 << IVB_offIVIC_VER )
  226. #define IVB_mskEVIC ( 0x1 << IVB_offEVIC )
  227. #define IVB_mskESZ ( 0x3 << IVB_offESZ )
  228. #define IVB_mskIVBASE ( 0xFFFF << IVB_offIVBASE )
  229. /******************************************************************************
  230. * ir4: EVA (Exception Virtual Address Register)
  231. * ir5: P_EVA (Previous EVA Register)
  232. *****************************************************************************/
  233. /* This register contains the VA that causes the exception */
  234. /******************************************************************************
  235. * ir6: ITYPE (Interruption Type Register)
  236. * ir7: P_ITYPE (Previous ITYPE Register)
  237. *****************************************************************************/
  238. #define ITYPE_offETYPE 0 /* Exception Type */
  239. #define ITYPE_offINST 4 /* Exception caused by insn fetch or data access */
  240. /* bit 5:15 reserved */
  241. #define ITYPE_offSWID 16 /* SWID of debugging exception */
  242. /* bit 31:31 reserved */
  243. #define ITYPE_mskETYPE ( 0xF << ITYPE_offETYPE )
  244. #define ITYPE_mskINST ( 0x1 << ITYPE_offINST )
  245. #define ITYPE_mskSWID ( 0x7FFF << ITYPE_offSWID )
  246. /******************************************************************************
  247. * ir8: MERR (Machine Error Log Register)
  248. *****************************************************************************/
  249. /* bit 0:30 reserved */
  250. #define MERR_offBUSERR 31 /* Bus error caused by a load insn */
  251. #define MERR_mskBUSERR ( 0x1 << MERR_offBUSERR )
  252. /******************************************************************************
  253. * ir9: IPC (Interruption Program Counter Register)
  254. * ir10: P_IPC (Previous IPC Register)
  255. * ir11: OIPC (Overflow Interruption Program Counter Register)
  256. *****************************************************************************/
  257. /* This is the shadow stack register of the Program Counter */
  258. /******************************************************************************
  259. * ir12: P_P0 (Previous P0 Register)
  260. * ir13: P_P1 (Previous P1 Register)
  261. *****************************************************************************/
  262. /* These are shadow registers of $p0 and $p1 */
  263. /******************************************************************************
  264. * ir14: INT_MASK (Interruption Masking Register)
  265. *****************************************************************************/
  266. #define INT_MASK_offH0IM 0 /* Hardware Interrupt 0 Mask bit */
  267. #define INT_MASK_offH1IM 1 /* Hardware Interrupt 1 Mask bit */
  268. #define INT_MASK_offH2IM 2 /* Hardware Interrupt 2 Mask bit */
  269. #define INT_MASK_offH3IM 3 /* Hardware Interrupt 3 Mask bit */
  270. #define INT_MASK_offH4IM 4 /* Hardware Interrupt 4 Mask bit */
  271. #define INT_MASK_offH5IM 5 /* Hardware Interrupt 5 Mask bit */
  272. #define INT_MASK_offH6IM 6 /* Hardware Interrupt 6 Mask bit */
  273. #define INT_MASK_offH7IM 7 /* Hardware Interrupt 7 Mask bit */
  274. #define INT_MASK_offH8IM 8 /* Hardware Interrupt 8 Mask bit */
  275. #define INT_MASK_offH9IM 9 /* Hardware Interrupt 9 Mask bit */
  276. #define INT_MASK_offH10IM 10 /* Hardware Interrupt 10 Mask bit */
  277. #define INT_MASK_offH11IM 11 /* Hardware Interrupt 11 Mask bit */
  278. #define INT_MASK_offH12IM 12 /* Hardware Interrupt 12 Mask bit */
  279. #define INT_MASK_offH13IM 13 /* Hardware Interrupt 13 Mask bit */
  280. #define INT_MASK_offH14IM 14 /* Hardware Interrupt 14 Mask bit */
  281. #define INT_MASK_offH15IM 15 /* Hardware Interrupt 15 Mask bit */
  282. #define INT_MASK_offSIM 16 /* Software Interrupt Mask bit */
  283. /* bit 17:28 reserved */
  284. #define INT_MASK_offALZ 29 /* All zero opcode reserved instruction exception mask */
  285. #define INT_MASK_offIDIVZE 30 /* Enable detection for Divide-By-Zero */
  286. #define INT_MASK_offDSSIM 31 /* Default Single Stepping Interruption Mask */
  287. #define INT_MASK_mskH0IM ( 0x1 << INT_MASK_offH0IM )
  288. #define INT_MASK_mskH1IM ( 0x1 << INT_MASK_offH1IM )
  289. #define INT_MASK_mskH2IM ( 0x1 << INT_MASK_offH2IM )
  290. #define INT_MASK_mskH3IM ( 0x1 << INT_MASK_offH3IM )
  291. #define INT_MASK_mskH4IM ( 0x1 << INT_MASK_offH4IM )
  292. #define INT_MASK_mskH5IM ( 0x1 << INT_MASK_offH5IM )
  293. #define INT_MASK_mskH6IM ( 0x1 << INT_MASK_offH6IM )
  294. #define INT_MASK_mskH7IM ( 0x1 << INT_MASK_offH7IM )
  295. #define INT_MASK_mskH8IM ( 0x1 << INT_MASK_offH8IM )
  296. #define INT_MASK_mskH9IM ( 0x1 << INT_MASK_offH9IM )
  297. #define INT_MASK_mskH10IM ( 0x1 << INT_MASK_offH10IM )
  298. #define INT_MASK_mskH11IM ( 0x1 << INT_MASK_offH11IM )
  299. #define INT_MASK_mskH12IM ( 0x1 << INT_MASK_offH12IM )
  300. #define INT_MASK_mskH13IM ( 0x1 << INT_MASK_offH13IM )
  301. #define INT_MASK_mskH14IM ( 0x1 << INT_MASK_offH14IM )
  302. #define INT_MASK_mskH15IM ( 0x1 << INT_MASK_offH15IM )
  303. #define INT_MASK_mskSIM ( 0x1 << INT_MASK_offSIM )
  304. #define INT_MASK_mskALZ ( 0x1 << INT_MASK_offALZ )
  305. #define INT_MASK_mskIDIVZE ( 0x1 << INT_MASK_offIDIVZE )
  306. #define INT_MASK_mskDSSIM ( 0x1 << INT_MASK_offDSSIM )
  307. /******************************************************************************
  308. * ir15: INT_PEND (Interruption Pending Register)
  309. *****************************************************************************/
  310. #define INT_PEND_offH0I 0 /* Hardware Interrupt 0 pending bit */
  311. #define INT_PEND_offH1I 1 /* Hardware Interrupt 1 pending bit */
  312. #define INT_PEND_offH2I 2 /* Hardware Interrupt 2 pending bit */
  313. #define INT_PEND_offH3I 3 /* Hardware Interrupt 3 pending bit */
  314. #define INT_PEND_offH4I 4 /* Hardware Interrupt 4 pending bit */
  315. #define INT_PEND_offH5I 5 /* Hardware Interrupt 5 pending bit */
  316. #define INT_PEND_offH6I 6 /* Hardware Interrupt 6 pending bit */
  317. #define INT_PEND_offH7I 7 /* Hardware Interrupt 7 pending bit */
  318. #define INT_PEND_offH8I 8 /* Hardware Interrupt 8 pending bit */
  319. #define INT_PEND_offH9I 9 /* Hardware Interrupt 9 pending bit */
  320. #define INT_PEND_offH10I 10 /* Hardware Interrupt 10 pending bit */
  321. #define INT_PEND_offH11I 11 /* Hardware Interrupt 11 pending bit */
  322. #define INT_PEND_offH12I 12 /* Hardware Interrupt 12 pending bit */
  323. #define INT_PEND_offH13I 13 /* Hardware Interrupt 13 pending bit */
  324. #define INT_PEND_offH14I 14 /* Hardware Interrupt 14 pending bit */
  325. #define INT_PEND_offH15I 15 /* Hardware Interrupt 15 pending bit */
  326. #define INT_PEND_offCIPL 0 /* Current Interrupt Priority Level */
  327. #define INT_PEND_offSWI 16 /* Software Interrupt pending bit */
  328. /* bit 17:31 reserved */
  329. #define INT_PEND_mskH0I ( 0x1 << INT_PEND_offH0I )
  330. #define INT_PEND_mskH1I ( 0x1 << INT_PEND_offH1I )
  331. #define INT_PEND_mskH2I ( 0x1 << INT_PEND_offH2I )
  332. #define INT_PEND_mskH3I ( 0x1 << INT_PEND_offH3I )
  333. #define INT_PEND_mskH4I ( 0x1 << INT_PEND_offH4I )
  334. #define INT_PEND_mskH5I ( 0x1 << INT_PEND_offH5I )
  335. #define INT_PEND_mskH6I ( 0x1 << INT_PEND_offH6I )
  336. #define INT_PEND_mskH7I ( 0x1 << INT_PEND_offH7I )
  337. #define INT_PEND_mskH8I ( 0x1 << INT_PEND_offH8I )
  338. #define INT_PEND_mskH9I ( 0x1 << INT_PEND_offH9I )
  339. #define INT_PEND_mskH10I ( 0x1 << INT_PEND_offH10I )
  340. #define INT_PEND_mskH11I ( 0x1 << INT_PEND_offH11I )
  341. #define INT_PEND_mskH12I ( 0x1 << INT_PEND_offH12I )
  342. #define INT_PEND_mskH13I ( 0x1 << INT_PEND_offH13I )
  343. #define INT_PEND_mskH14I ( 0x1 << INT_PEND_offH14I )
  344. #define INT_PEND_mskH15I ( 0x1 << INT_PEND_offH15I )
  345. #define INT_PEND_mskCIPL ( 0x1 << INT_PEND_offCIPL )
  346. #define INT_PEND_mskSWI ( 0x1 << INT_PEND_offSWI )
  347. /******************************************************************************
  348. * ir16: SP_USR (Shadowed User Stack Pointer Register)
  349. * ir17: SP_PRIV (Shadowed Privileged Stack Pointer Register)
  350. *****************************************************************************/
  351. /* These are shadow registers of $sp */
  352. /******************************************************************************
  353. * ir18: INT_PRI (Interrupt Priority Register)
  354. *****************************************************************************/
  355. #define INT_PRI_offH0PRI 0 /* Hardware Interrupt 0 Priority Level */
  356. #define INT_PRI_offH1PRI 2 /* Hardware Interrupt 1 Priority Level */
  357. #define INT_PRI_offH2PRI 4 /* Hardware Interrupt 2 Priority Level */
  358. #define INT_PRI_offH3PRI 6 /* Hardware Interrupt 3 Priority Level */
  359. #define INT_PRI_offH4PRI 8 /* Hardware Interrupt 4 Priority Level */
  360. #define INT_PRI_offH5PRI 10 /* Hardware Interrupt 5 Priority Level */
  361. #define INT_PRI_offH6PRI 12 /* Hardware Interrupt 6 Priority Level */
  362. #define INT_PRI_offH7PRI 14 /* Hardware Interrupt 7 Priority Level */
  363. #define INT_PRI_offH8PRI 16 /* Hardware Interrupt 8 Priority Level */
  364. #define INT_PRI_offH9PRI 18 /* Hardware Interrupt 9 Priority Level */
  365. #define INT_PRI_offH10PRI 20 /* Hardware Interrupt 10 Priority Level */
  366. #define INT_PRI_offH11PRI 22 /* Hardware Interrupt 11 Priority Level */
  367. #define INT_PRI_offH12PRI 24 /* Hardware Interrupt 12 Priority Level */
  368. #define INT_PRI_offH13PRI 26 /* Hardware Interrupt 13 Priority Level */
  369. #define INT_PRI_offH14PRI 28 /* Hardware Interrupt 14 Priority Level */
  370. #define INT_PRI_offH15PRI 30 /* Hardware Interrupt 15 Priority Level */
  371. #define INT_PRI_mskH0PRI ( 0x3 << INT_PRI_offH0PRI )
  372. #define INT_PRI_mskH1PRI ( 0x3 << INT_PRI_offH1PRI )
  373. #define INT_PRI_mskH2PRI ( 0x3 << INT_PRI_offH2PRI )
  374. #define INT_PRI_mskH3PRI ( 0x3 << INT_PRI_offH3PRI )
  375. #define INT_PRI_mskH4PRI ( 0x3 << INT_PRI_offH4PRI )
  376. #define INT_PRI_mskH5PRI ( 0x3 << INT_PRI_offH5PRI )
  377. #define INT_PRI_mskH6PRI ( 0x3 << INT_PRI_offH6PRI )
  378. #define INT_PRI_mskH7PRI ( 0x3 << INT_PRI_offH7PRI )
  379. #define INT_PRI_mskH8PRI ( 0x3 << INT_PRI_offH8PRI )
  380. #define INT_PRI_mskH9PRI ( 0x3 << INT_PRI_offH9PRI )
  381. #define INT_PRI_mskH10PRI ( 0x3 << INT_PRI_offH10PRI )
  382. #define INT_PRI_mskH11PRI ( 0x3 << INT_PRI_offH11PRI )
  383. #define INT_PRI_mskH12PRI ( 0x3 << INT_PRI_offH12PRI )
  384. #define INT_PRI_mskH13PRI ( 0x3 << INT_PRI_offH13PRI )
  385. #define INT_PRI_mskH14PRI ( 0x3 << INT_PRI_offH14PRI )
  386. #define INT_PRI_mskH15PRI ( 0x3 << INT_PRI_offH15PRI )
  387. /******************************************************************************
  388. * ir19: INT_CTRL (Interrupt Control Register)
  389. *****************************************************************************/
  390. #define INT_CTRL_offPPL2FIX_EN 0
  391. /* bit 1:31 reserved */
  392. #define INT_CTRL_mskPPL2FIX_EN ( 0x1 << INT_CTRL_offPPL2FIX_EN )
  393. /******************************************************************************
  394. * ir26: INT_MASK2 (Interruption Masking Register 2)
  395. *****************************************************************************/
  396. #define INT_MASK2_offH0IM 0 /* Hardware Interrupt 0 Mask bit */
  397. #define INT_MASK2_offH1IM 1 /* Hardware Interrupt 1 Mask bit */
  398. #define INT_MASK2_offH2IM 2 /* Hardware Interrupt 2 Mask bit */
  399. #define INT_MASK2_offH3IM 3 /* Hardware Interrupt 3 Mask bit */
  400. #define INT_MASK2_offH4IM 4 /* Hardware Interrupt 4 Mask bit */
  401. #define INT_MASK2_offH5IM 5 /* Hardware Interrupt 5 Mask bit */
  402. #define INT_MASK2_offH6IM 6 /* Hardware Interrupt 6 Mask bit */
  403. #define INT_MASK2_offH7IM 7 /* Hardware Interrupt 7 Mask bit */
  404. #define INT_MASK2_offH8IM 8 /* Hardware Interrupt 8 Mask bit */
  405. #define INT_MASK2_offH9IM 9 /* Hardware Interrupt 9 Mask bit */
  406. #define INT_MASK2_offH10IM 10 /* Hardware Interrupt 10 Mask bit */
  407. #define INT_MASK2_offH11IM 11 /* Hardware Interrupt 11 Mask bit */
  408. #define INT_MASK2_offH12IM 12 /* Hardware Interrupt 12 Mask bit */
  409. #define INT_MASK2_offH13IM 13 /* Hardware Interrupt 13 Mask bit */
  410. #define INT_MASK2_offH14IM 14 /* Hardware Interrupt 14 Mask bit */
  411. #define INT_MASK2_offH15IM 15 /* Hardware Interrupt 15 Mask bit */
  412. #define INT_MASK2_offH16IM 16 /* Hardware Interrupt 16 Mask bit */
  413. #define INT_MASK2_offH17IM 17 /* Hardware Interrupt 17 Mask bit */
  414. #define INT_MASK2_offH18IM 18 /* Hardware Interrupt 18 Mask bit */
  415. #define INT_MASK2_offH19IM 19 /* Hardware Interrupt 19 Mask bit */
  416. #define INT_MASK2_offH20IM 20 /* Hardware Interrupt 20 Mask bit */
  417. #define INT_MASK2_offH21IM 21 /* Hardware Interrupt 21 Mask bit */
  418. #define INT_MASK2_offH22IM 22 /* Hardware Interrupt 22 Mask bit */
  419. #define INT_MASK2_offH23IM 23 /* Hardware Interrupt 23 Mask bit */
  420. #define INT_MASK2_offH24IM 24 /* Hardware Interrupt 24 Mask bit */
  421. #define INT_MASK2_offH25IM 25 /* Hardware Interrupt 25 Mask bit */
  422. #define INT_MASK2_offH26IM 26 /* Hardware Interrupt 26 Mask bit */
  423. #define INT_MASK2_offH27IM 27 /* Hardware Interrupt 27 Mask bit */
  424. #define INT_MASK2_offH28IM 28 /* Hardware Interrupt 28 Mask bit */
  425. #define INT_MASK2_offH29IM 29 /* Hardware Interrupt 29 Mask bit */
  426. #define INT_MASK2_offH30IM 30 /* Hardware Interrupt 30 Mask bit */
  427. #define INT_MASK2_offH31IM 31 /* Hardware Interrupt 31 Mask bit */
  428. #define INT_MASK2_mskH0IM ( 0x1 << INT_MASK2_offH0IM )
  429. #define INT_MASK2_mskH1IM ( 0x1 << INT_MASK2_offH1IM )
  430. #define INT_MASK2_mskH2IM ( 0x1 << INT_MASK2_offH2IM )
  431. #define INT_MASK2_mskH3IM ( 0x1 << INT_MASK2_offH3IM )
  432. #define INT_MASK2_mskH4IM ( 0x1 << INT_MASK2_offH4IM )
  433. #define INT_MASK2_mskH5IM ( 0x1 << INT_MASK2_offH5IM )
  434. #define INT_MASK2_mskH6IM ( 0x1 << INT_MASK2_offH6IM )
  435. #define INT_MASK2_mskH7IM ( 0x1 << INT_MASK2_offH7IM )
  436. #define INT_MASK2_mskH8IM ( 0x1 << INT_MASK2_offH8IM )
  437. #define INT_MASK2_mskH9IM ( 0x1 << INT_MASK2_offH9IM )
  438. #define INT_MASK2_mskH10IM ( 0x1 << INT_MASK2_offH10IM )
  439. #define INT_MASK2_mskH11IM ( 0x1 << INT_MASK2_offH11IM )
  440. #define INT_MASK2_mskH12IM ( 0x1 << INT_MASK2_offH12IM )
  441. #define INT_MASK2_mskH13IM ( 0x1 << INT_MASK2_offH13IM )
  442. #define INT_MASK2_mskH14IM ( 0x1 << INT_MASK2_offH14IM )
  443. #define INT_MASK2_mskH15IM ( 0x1 << INT_MASK2_offH15IM )
  444. #define INT_MASK2_mskH16IM ( 0x1 << INT_MASK2_offH16IM )
  445. #define INT_MASK2_mskH17IM ( 0x1 << INT_MASK2_offH17IM )
  446. #define INT_MASK2_mskH18IM ( 0x1 << INT_MASK2_offH18IM )
  447. #define INT_MASK2_mskH19IM ( 0x1 << INT_MASK2_offH19IM )
  448. #define INT_MASK2_mskH20IM ( 0x1 << INT_MASK2_offH20IM )
  449. #define INT_MASK2_mskH21IM ( 0x1 << INT_MASK2_offH21IM )
  450. #define INT_MASK2_mskH22IM ( 0x1 << INT_MASK2_offH22IM )
  451. #define INT_MASK2_mskH23IM ( 0x1 << INT_MASK2_offH23IM )
  452. #define INT_MASK2_mskH24IM ( 0x1 << INT_MASK2_offH24IM )
  453. #define INT_MASK2_mskH25IM ( 0x1 << INT_MASK2_offH25IM )
  454. #define INT_MASK2_mskH26IM ( 0x1 << INT_MASK2_offH26IM )
  455. #define INT_MASK2_mskH27IM ( 0x1 << INT_MASK2_offH27IM )
  456. #define INT_MASK2_mskH28IM ( 0x1 << INT_MASK2_offH28IM )
  457. #define INT_MASK2_mskH29IM ( 0x1 << INT_MASK2_offH29IM )
  458. #define INT_MASK2_mskH30IM ( 0x1 << INT_MASK2_offH30IM )
  459. #define INT_MASK2_mskH31IM ( 0x1 << INT_MASK2_offH31IM )
  460. /******************************************************************************
  461. * ir27: INT_PEND2 (Interruption Pending Register 2)
  462. *****************************************************************************/
  463. #define INT_PEND2_offH0I 0 /* Hardware Interrupt 0 Pending bit */
  464. #define INT_PEND2_offH1I 1 /* Hardware Interrupt 1 Pending bit */
  465. #define INT_PEND2_offH2I 2 /* Hardware Interrupt 2 Pending bit */
  466. #define INT_PEND2_offH3I 3 /* Hardware Interrupt 3 Pending bit */
  467. #define INT_PEND2_offH4I 4 /* Hardware Interrupt 4 Pending bit */
  468. #define INT_PEND2_offH5I 5 /* Hardware Interrupt 5 Pending bit */
  469. #define INT_PEND2_offH6I 6 /* Hardware Interrupt 6 Pending bit */
  470. #define INT_PEND2_offH7I 7 /* Hardware Interrupt 7 Pending bit */
  471. #define INT_PEND2_offH8I 8 /* Hardware Interrupt 8 Pending bit */
  472. #define INT_PEND2_offH9I 9 /* Hardware Interrupt 9 Pending bit */
  473. #define INT_PEND2_offH10I 10 /* Hardware Interrupt 10 Pending bit */
  474. #define INT_PEND2_offH11I 11 /* Hardware Interrupt 11 Pending bit */
  475. #define INT_PEND2_offH12I 12 /* Hardware Interrupt 12 Pending bit */
  476. #define INT_PEND2_offH13I 13 /* Hardware Interrupt 13 Pending bit */
  477. #define INT_PEND2_offH14I 14 /* Hardware Interrupt 14 Pending bit */
  478. #define INT_PEND2_offH15I 15 /* Hardware Interrupt 15 Pending bit */
  479. #define INT_PEND2_offH16I 16 /* Hardware Interrupt 16 Pending bit */
  480. #define INT_PEND2_offH17I 17 /* Hardware Interrupt 17 Pending bit */
  481. #define INT_PEND2_offH18I 18 /* Hardware Interrupt 18 Pending bit */
  482. #define INT_PEND2_offH19I 19 /* Hardware Interrupt 19 Pending bit */
  483. #define INT_PEND2_offH20I 20 /* Hardware Interrupt 20 Pending bit */
  484. #define INT_PEND2_offH21I 21 /* Hardware Interrupt 21 Pending bit */
  485. #define INT_PEND2_offH22I 22 /* Hardware Interrupt 22 Pending bit */
  486. #define INT_PEND2_offH23I 23 /* Hardware Interrupt 23 Pending bit */
  487. #define INT_PEND2_offH24I 24 /* Hardware Interrupt 24 Pending bit */
  488. #define INT_PEND2_offH25I 25 /* Hardware Interrupt 25 Pending bit */
  489. #define INT_PEND2_offH26I 26 /* Hardware Interrupt 26 Pending bit */
  490. #define INT_PEND2_offH27I 27 /* Hardware Interrupt 27 Pending bit */
  491. #define INT_PEND2_offH28I 28 /* Hardware Interrupt 28 Pending bit */
  492. #define INT_PEND2_offH29I 29 /* Hardware Interrupt 29 Pending bit */
  493. #define INT_PEND2_offH30I 30 /* Hardware Interrupt 30 Pending bit */
  494. #define INT_PEND2_offH31I 31 /* Hardware Interrupt 31 Pending bit */
  495. #define INT_PEND2_mskH0I ( 0x1 << INT_PEND2_offH0I )
  496. #define INT_PEND2_mskH1I ( 0x1 << INT_PEND2_offH1I )
  497. #define INT_PEND2_mskH2I ( 0x1 << INT_PEND2_offH2I )
  498. #define INT_PEND2_mskH3I ( 0x1 << INT_PEND2_offH3I )
  499. #define INT_PEND2_mskH4I ( 0x1 << INT_PEND2_offH4I )
  500. #define INT_PEND2_mskH5I ( 0x1 << INT_PEND2_offH5I )
  501. #define INT_PEND2_mskH6I ( 0x1 << INT_PEND2_offH6I )
  502. #define INT_PEND2_mskH7I ( 0x1 << INT_PEND2_offH7I )
  503. #define INT_PEND2_mskH8I ( 0x1 << INT_PEND2_offH8I )
  504. #define INT_PEND2_mskH9I ( 0x1 << INT_PEND2_offH9I )
  505. #define INT_PEND2_mskH10I ( 0x1 << INT_PEND2_offH10I )
  506. #define INT_PEND2_mskH11I ( 0x1 << INT_PEND2_offH11I )
  507. #define INT_PEND2_mskH12I ( 0x1 << INT_PEND2_offH12I )
  508. #define INT_PEND2_mskH13I ( 0x1 << INT_PEND2_offH13I )
  509. #define INT_PEND2_mskH14I ( 0x1 << INT_PEND2_offH14I )
  510. #define INT_PEND2_mskH15I ( 0x1 << INT_PEND2_offH15I )
  511. #define INT_PEND2_mskH16I ( 0x1 << INT_PEND2_offH16I )
  512. #define INT_PEND2_mskH17I ( 0x1 << INT_PEND2_offH17I )
  513. #define INT_PEND2_mskH18I ( 0x1 << INT_PEND2_offH18I )
  514. #define INT_PEND2_mskH19I ( 0x1 << INT_PEND2_offH19I )
  515. #define INT_PEND2_mskH20I ( 0x1 << INT_PEND2_offH20I )
  516. #define INT_PEND2_mskH21I ( 0x1 << INT_PEND2_offH21I )
  517. #define INT_PEND2_mskH22I ( 0x1 << INT_PEND2_offH22I )
  518. #define INT_PEND2_mskH23I ( 0x1 << INT_PEND2_offH23I )
  519. #define INT_PEND2_mskH24I ( 0x1 << INT_PEND2_offH24I )
  520. #define INT_PEND2_mskH25I ( 0x1 << INT_PEND2_offH25I )
  521. #define INT_PEND2_mskH26I ( 0x1 << INT_PEND2_offH26I )
  522. #define INT_PEND2_mskH27I ( 0x1 << INT_PEND2_offH27I )
  523. #define INT_PEND2_mskH28I ( 0x1 << INT_PEND2_offH28I )
  524. #define INT_PEND2_mskH29I ( 0x1 << INT_PEND2_offH29I )
  525. #define INT_PEND2_mskH30I ( 0x1 << INT_PEND2_offH30I )
  526. #define INT_PEND2_mskH31I ( 0x1 << INT_PEND2_offH31I )
  527. /******************************************************************************
  528. * ir28: INT_PRI2 (Interrupt Priority Register)
  529. *****************************************************************************/
  530. #define INT_PRI_offH16PRI 0 /* Hardware Interrupt 16 Priority Level */
  531. #define INT_PRI_offH17PRI 2 /* Hardware Interrupt 17 Priority Level */
  532. #define INT_PRI_offH18PRI 4 /* Hardware Interrupt 18 Priority Level */
  533. #define INT_PRI_offH19PRI 6 /* Hardware Interrupt 19 Priority Level */
  534. #define INT_PRI_offH20PRI 8 /* Hardware Interrupt 20 Priority Level */
  535. #define INT_PRI_offH21PRI 10 /* Hardware Interrupt 21 Priority Level */
  536. #define INT_PRI_offH22PRI 12 /* Hardware Interrupt 22 Priority Level */
  537. #define INT_PRI_offH23PRI 14 /* Hardware Interrupt 23 Priority Level */
  538. #define INT_PRI_offH24PRI 16 /* Hardware Interrupt 24 Priority Level */
  539. #define INT_PRI_offH25PRI 18 /* Hardware Interrupt 25 Priority Level */
  540. #define INT_PRI_offH26PRI 20 /* Hardware Interrupt 26 Priority Level */
  541. #define INT_PRI_offH27PRI 22 /* Hardware Interrupt 27 Priority Level */
  542. #define INT_PRI_offH28PRI 24 /* Hardware Interrupt 28 Priority Level */
  543. #define INT_PRI_offH29PRI 26 /* Hardware Interrupt 29 Priority Level */
  544. #define INT_PRI_offH30PRI 28 /* Hardware Interrupt 30 Priority Level */
  545. #define INT_PRI_offH31PRI 30 /* Hardware Interrupt 31 Priority Level */
  546. #define INT_PRI_mskH16PRI ( 0x3 << INT_PRI_offH16PRI )
  547. #define INT_PRI_mskH17PRI ( 0x3 << INT_PRI_offH17PRI )
  548. #define INT_PRI_mskH18PRI ( 0x3 << INT_PRI_offH18PRI )
  549. #define INT_PRI_mskH19PRI ( 0x3 << INT_PRI_offH19PRI )
  550. #define INT_PRI_mskH20PRI ( 0x3 << INT_PRI_offH20PRI )
  551. #define INT_PRI_mskH21PRI ( 0x3 << INT_PRI_offH21PRI )
  552. #define INT_PRI_mskH22PRI ( 0x3 << INT_PRI_offH22PRI )
  553. #define INT_PRI_mskH23PRI ( 0x3 << INT_PRI_offH23PRI )
  554. #define INT_PRI_mskH24PRI ( 0x3 << INT_PRI_offH24PRI )
  555. #define INT_PRI_mskH25PRI ( 0x3 << INT_PRI_offH25PRI )
  556. #define INT_PRI_mskH26PRI ( 0x3 << INT_PRI_offH26PRI )
  557. #define INT_PRI_mskH27PRI ( 0x3 << INT_PRI_offH27PRI )
  558. #define INT_PRI_mskH28PRI ( 0x3 << INT_PRI_offH28PRI )
  559. #define INT_PRI_mskH29PRI ( 0x3 << INT_PRI_offH29PRI )
  560. #define INT_PRI_mskH30PRI ( 0x3 << INT_PRI_offH30PRI )
  561. #define INT_PRI_mskH31PRI ( 0x3 << INT_PRI_offH31PRI )
  562. /******************************************************************************
  563. * ir29: INT_TRIGGER (Interrupt Trigger Type Register)
  564. *****************************************************************************/
  565. #define INT_TRIGGER_offH0TRIG 0 /* Hardware Interrupt 0 Trigger Type bit */
  566. #define INT_TRIGGER_offH1TRIG 1 /* Hardware Interrupt 1 Trigger Type bit */
  567. #define INT_TRIGGER_offH2TRIG 2 /* Hardware Interrupt 2 Trigger Type bit */
  568. #define INT_TRIGGER_offH3TRIG 3 /* Hardware Interrupt 3 Trigger Type bit */
  569. #define INT_TRIGGER_offH4TRIG 4 /* Hardware Interrupt 4 Trigger Type bit */
  570. #define INT_TRIGGER_offH5TRIG 5 /* Hardware Interrupt 5 Trigger Type bit */
  571. #define INT_TRIGGER_offH6TRIG 6 /* Hardware Interrupt 6 Trigger Type bit */
  572. #define INT_TRIGGER_offH7TRIG 7 /* Hardware Interrupt 7 Trigger Type bit */
  573. #define INT_TRIGGER_offH8TRIG 8 /* Hardware Interrupt 8 Trigger Type bit */
  574. #define INT_TRIGGER_offH9TRIG 9 /* Hardware Interrupt 9 Trigger Type bit */
  575. #define INT_TRIGGER_offH10TRIG 10 /* Hardware Interrupt 10 Trigger Type bit */
  576. #define INT_TRIGGER_offH11TRIG 11 /* Hardware Interrupt 11 Trigger Type bit */
  577. #define INT_TRIGGER_offH12TRIG 12 /* Hardware Interrupt 12 Trigger Type bit */
  578. #define INT_TRIGGER_offH13TRIG 13 /* Hardware Interrupt 13 Trigger Type bit */
  579. #define INT_TRIGGER_offH14TRIG 14 /* Hardware Interrupt 14 Trigger Type bit */
  580. #define INT_TRIGGER_offH15TRIG 15 /* Hardware Interrupt 15 Trigger Type bit */
  581. #define INT_TRIGGER_offH16TRIG 16 /* Hardware Interrupt 16 Trigger Type bit */
  582. #define INT_TRIGGER_offH17TRIG 17 /* Hardware Interrupt 17 Trigger Type bit */
  583. #define INT_TRIGGER_offH18TRIG 18 /* Hardware Interrupt 18 Trigger Type bit */
  584. #define INT_TRIGGER_offH19TRIG 19 /* Hardware Interrupt 19 Trigger Type bit */
  585. #define INT_TRIGGER_offH20TRIG 20 /* Hardware Interrupt 20 Trigger Type bit */
  586. #define INT_TRIGGER_offH21TRIG 21 /* Hardware Interrupt 21 Trigger Type bit */
  587. #define INT_TRIGGER_offH22TRIG 22 /* Hardware Interrupt 22 Trigger Type bit */
  588. #define INT_TRIGGER_offH23TRIG 23 /* Hardware Interrupt 23 Trigger Type bit */
  589. #define INT_TRIGGER_offH24TRIG 24 /* Hardware Interrupt 24 Trigger Type bit */
  590. #define INT_TRIGGER_offH25TRIG 25 /* Hardware Interrupt 25 Trigger Type bit */
  591. #define INT_TRIGGER_offH26TRIG 26 /* Hardware Interrupt 26 Trigger Type bit */
  592. #define INT_TRIGGER_offH27TRIG 27 /* Hardware Interrupt 27 Trigger Type bit */
  593. #define INT_TRIGGER_offH28TRIG 28 /* Hardware Interrupt 28 Trigger Type bit */
  594. #define INT_TRIGGER_offH29TRIG 29 /* Hardware Interrupt 29 Trigger Type bit */
  595. #define INT_TRIGGER_offH30TRIG 30 /* Hardware Interrupt 30 Trigger Type bit */
  596. #define INT_TRIGGER_offH31TRIG 31 /* Hardware Interrupt 31 Trigger Type bit */
  597. #define INT_TRIGGER_mskH0TRIG ( 0x1 << INT_TRIGGER_offH0TRIG )
  598. #define INT_TRIGGER_mskH1TRIG ( 0x1 << INT_TRIGGER_offH1TRIG )
  599. #define INT_TRIGGER_mskH2TRIG ( 0x1 << INT_TRIGGER_offH2TRIG )
  600. #define INT_TRIGGER_mskH3TRIG ( 0x1 << INT_TRIGGER_offH3TRIG )
  601. #define INT_TRIGGER_mskH4TRIG ( 0x1 << INT_TRIGGER_offH4TRIG )
  602. #define INT_TRIGGER_mskH5TRIG ( 0x1 << INT_TRIGGER_offH5TRIG )
  603. #define INT_TRIGGER_mskH6TRIG ( 0x1 << INT_TRIGGER_offH6TRIG )
  604. #define INT_TRIGGER_mskH7TRIG ( 0x1 << INT_TRIGGER_offH7TRIG )
  605. #define INT_TRIGGER_mskH8TRIG ( 0x1 << INT_TRIGGER_offH8TRIG )
  606. #define INT_TRIGGER_mskH9TRIG ( 0x1 << INT_TRIGGER_offH9TRIG )
  607. #define INT_TRIGGER_mskH10TRIG ( 0x1 << INT_TRIGGER_offH10TRIG )
  608. #define INT_TRIGGER_mskH11TRIG ( 0x1 << INT_TRIGGER_offH11TRIG )
  609. #define INT_TRIGGER_mskH12TRIG ( 0x1 << INT_TRIGGER_offH12TRIG )
  610. #define INT_TRIGGER_mskH13TRIG ( 0x1 << INT_TRIGGER_offH13TRIG )
  611. #define INT_TRIGGER_mskH14TRIG ( 0x1 << INT_TRIGGER_offH14TRIG )
  612. #define INT_TRIGGER_mskH15TRIG ( 0x1 << INT_TRIGGER_offH15TRIG )
  613. #define INT_TRIGGER_mskH16TRIG ( 0x1 << INT_TRIGGER_offH16TRIG )
  614. #define INT_TRIGGER_mskH17TRIG ( 0x1 << INT_TRIGGER_offH17TRIG )
  615. #define INT_TRIGGER_mskH18TRIG ( 0x1 << INT_TRIGGER_offH18TRIG )
  616. #define INT_TRIGGER_mskH19TRIG ( 0x1 << INT_TRIGGER_offH19TRIG )
  617. #define INT_TRIGGER_mskH20TRIG ( 0x1 << INT_TRIGGER_offH20TRIG )
  618. #define INT_TRIGGER_mskH21TRIG ( 0x1 << INT_TRIGGER_offH21TRIG )
  619. #define INT_TRIGGER_mskH22TRIG ( 0x1 << INT_TRIGGER_offH22TRIG )
  620. #define INT_TRIGGER_mskH23TRIG ( 0x1 << INT_TRIGGER_offH23TRIG )
  621. #define INT_TRIGGER_mskH24TRIG ( 0x1 << INT_TRIGGER_offH24TRIG )
  622. #define INT_TRIGGER_mskH25TRIG ( 0x1 << INT_TRIGGER_offH25TRIG )
  623. #define INT_TRIGGER_mskH26TRIG ( 0x1 << INT_TRIGGER_offH26TRIG )
  624. #define INT_TRIGGER_mskH27TRIG ( 0x1 << INT_TRIGGER_offH27TRIG )
  625. #define INT_TRIGGER_mskH28TRIG ( 0x1 << INT_TRIGGER_offH28TRIG )
  626. #define INT_TRIGGER_mskH29TRIG ( 0x1 << INT_TRIGGER_offH29TRIG )
  627. #define INT_TRIGGER_mskH30TRIG ( 0x1 << INT_TRIGGER_offH30TRIG )
  628. #define INT_TRIGGER_mskH31TRIG ( 0x1 << INT_TRIGGER_offH31TRIG )
  629. /******************************************************************************
  630. * mr0: MMU_CTL (MMU Control Register)
  631. *****************************************************************************/
  632. #define MMU_CTL_offD 0 /* Default minimum page size */
  633. #define MMU_CTL_offNTC0 1 /* Non-Translated Cachebility of partition 0 */
  634. #define MMU_CTL_offNTC1 3 /* Non-Translated Cachebility of partition 1 */
  635. #define MMU_CTL_offNTC2 5 /* Non-Translated Cachebility of partition 2 */
  636. #define MMU_CTL_offNTC3 7 /* Non-Translated Cachebility of partition 3 */
  637. #define MMU_CTL_offTBALCK 9 /* TLB all-lock resolution scheme */
  638. #define MMU_CTL_offMPZIU 10 /* Multiple Page Size In Use bit */
  639. #define MMU_CTL_offNTM0 11 /* Non-Translated VA to PA of partition 0 */
  640. #define MMU_CTL_offNTM1 13 /* Non-Translated VA to PA of partition 1 */
  641. #define MMU_CTL_offNTM2 15 /* Non-Translated VA to PA of partition 2 */
  642. #define MMU_CTL_offNTM3 17 /* Non-Translated VA to PA of partition 3 */
  643. #define MMU_CTL_offDREE 19 /* Device register endian control enable */
  644. /* bit 20:31 reserved */
  645. #define MMU_CTL_mskD ( 0x1 << MMU_CTL_offD )
  646. #define MMU_CTL_mskNTC0 ( 0x3 << MMU_CTL_offNTC0 )
  647. #define MMU_CTL_mskNTC1 ( 0x3 << MMU_CTL_offNTC1 )
  648. #define MMU_CTL_mskNTC2 ( 0x3 << MMU_CTL_offNTC2 )
  649. #define MMU_CTL_mskNTC3 ( 0x3 << MMU_CTL_offNTC3 )
  650. #define MMU_CTL_mskTBALCK ( 0x1 << MMU_CTL_offTBALCK )
  651. #define MMU_CTL_mskMPZIU ( 0x1 << MMU_CTL_offMPZIU )
  652. #define MMU_CTL_mskNTM0 ( 0x3 << MMU_CTL_offNTM0 )
  653. #define MMU_CTL_mskNTM1 ( 0x3 << MMU_CTL_offNTM1 )
  654. #define MMU_CTL_mskNTM2 ( 0x3 << MMU_CTL_offNTM2 )
  655. #define MMU_CTL_mskNTM3 ( 0x3 << MMU_CTL_offNTM3 )
  656. #define MMU_CTL_mskDREE ( 0x1 << MMU_CTL_offDREE )
  657. /******************************************************************************
  658. * mr1: L1_PPTB (L1 Physical Page Table Base Register)
  659. *****************************************************************************/
  660. #define L1_PPTB_offNV 0 /* Enable Hardware Page Table Walker (HPTWK) */
  661. /* bit 1:11 reserved */
  662. #define L1_PPTB_offBASE 12 /* First level physical page table base address */
  663. #define L1_PPTB_mskNV ( 0x1 << L1_PPTB_offNV )
  664. #define L1_PPTB_mskBASE ( 0xFFFFF << L1_PPTB_offBASE )
  665. /******************************************************************************
  666. * mr2: TLB_VPN (TLB Access VPN Register)
  667. *****************************************************************************/
  668. /* bit 0:11 reserved */
  669. #define TLB_VPN_offVPN 12 /* Virtual Page Number */
  670. #define TLB_VPN_mskVPN ( 0xFFFFF << TLB_VPN_offVPN )
  671. /******************************************************************************
  672. * mr3: TLB_DATA (TLB Access Data Register)
  673. *****************************************************************************/
  674. #define TLB_DATA_offV 0 /* PTE is valid and present */
  675. #define TLB_DATA_offM 1 /* Page read/write access privilege */
  676. #define TLB_DATA_offD 4 /* Dirty bit */
  677. #define TLB_DATA_offX 5 /* Executable bit */
  678. #define TLB_DATA_offA 6 /* Access bit */
  679. #define TLB_DATA_offG 7 /* Global page (shared across contexts) */
  680. #define TLB_DATA_offC 8 /* Cacheability atribute */
  681. /* bit 11:11 reserved */
  682. #define TLB_DATA_offPPN 12 /* Phisical Page Number */
  683. #define TLB_DATA_mskV ( 0x1 << TLB_DATA_offV )
  684. #define TLB_DATA_mskM ( 0x7 << TLB_DATA_offM )
  685. #define TLB_DATA_mskD ( 0x1 << TLB_DATA_offD )
  686. #define TLB_DATA_mskX ( 0x1 << TLB_DATA_offX )
  687. #define TLB_DATA_mskA ( 0x1 << TLB_DATA_offA )
  688. #define TLB_DATA_mskG ( 0x1 << TLB_DATA_offG )
  689. #define TLB_DATA_mskC ( 0x7 << TLB_DATA_offC )
  690. #define TLB_DATA_mskPPN ( 0xFFFFF << TLB_DATA_offPPN )
  691. /******************************************************************************
  692. * mr4: TLB_MISC (TLB Access Misc Register)
  693. *****************************************************************************/
  694. #define TLB_MISC_offACC_PSZ 0 /* Page size of a PTE entry */
  695. #define TLB_MISC_offCID 4 /* Context id */
  696. /* bit 13:31 reserved */
  697. #define TLB_MISC_mskACC_PSZ ( 0xF << TLB_MISC_offACC_PSZ )
  698. #define TLB_MISC_mskCID ( 0x1FF << TLB_MISC_offCID )
  699. /******************************************************************************
  700. * mr5: VLPT_IDX (Virtual Linear Page Table Index Register)
  701. *****************************************************************************/
  702. #define VLPT_IDX_offZERO 0 /* Always 0 */
  703. #define VLPT_IDX_offEVPN 2 /* Exception Virtual Page Number */
  704. #define VLPT_IDX_offVLPTB 22 /* Base VA of VLPT */
  705. #define VLPT_IDX_mskZERO ( 0x3 << VLPT_IDX_offZERO )
  706. #define VLPT_IDX_mskEVPN ( 0xFFFFF << VLPT_IDX_offEVPN )
  707. #define VLPT_IDX_mskVLPTB ( 0x3FF << VLPT_IDX_offVLPTB )
  708. /******************************************************************************
  709. * mr6: ILMB (Instruction Local Memory Base Register)
  710. *****************************************************************************/
  711. #define ILMB_offIEN 0 /* Enable ILM */
  712. #define ILMB_offILMSZ 1 /* Size of ILM */
  713. /* bit 5:19 reserved */
  714. #define ILMB_offIBPA 10 /* Base PA of ILM */
  715. #define ILMB_mskIEN ( 0x1 << ILMB_offIEN )
  716. #define ILMB_mskILMSZ ( 0xF << ILMB_offILMSZ )
  717. #define ILMB_mskIBPA ( 0xFFF << ILMB_offIBPA )
  718. /******************************************************************************
  719. * mr7: DLMB (Data Local Memory Base Register)
  720. *****************************************************************************/
  721. #define DLMB_offDEN 0 /* Enable DLM */
  722. #define DLMB_offDLMSZ 1 /* Size of DLM */
  723. #define DLMB_offDBM 5 /* Enable Double-Buffer Mode for DLM */
  724. #define DLMB_offDBB 6 /* Double-buffer bank which can be accessed by the processor */
  725. /* bit 7:19 reserved */
  726. #define DLMB_offDBPA 10 /* Base PA of DLM */
  727. #define DLMB_mskDEN ( 0x1 << DLMB_offDEN )
  728. #define DLMB_mskDLMSZ ( 0xF << DLMB_offDLMSZ )
  729. #define DLMB_mskDBM ( 0x1 << DLMB_offDBM )
  730. #define DLMB_mskDBB ( 0x1 << DLMB_offDBB )
  731. #define DLMB_mskDBPA ( 0xFFF << DLMB_offDBPA )
  732. /******************************************************************************
  733. * mr8: CACHE_CTL (Cache Control Register)
  734. *****************************************************************************/
  735. #define CACHE_CTL_offIC_EN 0 /* Enable I-cache */
  736. #define CACHE_CTL_offDC_EN 1 /* Enable D-cache */
  737. #define CACHE_CTL_offICALCK 2 /* I-cache all-lock resolution scheme */
  738. #define CACHE_CTL_offDCALCK 3 /* D-cache all-lock resolution scheme */
  739. #define CACHE_CTL_offDCCWF 4 /* Enable D-cache Critical Word Forwarding */
  740. #define CACHE_CTL_offDCPMW 5 /* Enable D-cache concurrent miss and write-back processing */
  741. /* bit 6:31 reserved */
  742. #define CACHE_CTL_mskIC_EN ( 0x1 << CACHE_CTL_offIC_EN )
  743. #define CACHE_CTL_mskDC_EN ( 0x1 << CACHE_CTL_offDC_EN )
  744. #define CACHE_CTL_mskICALCK ( 0x1 << CACHE_CTL_offICALCK )
  745. #define CACHE_CTL_mskDCALCK ( 0x1 << CACHE_CTL_offDCALCK )
  746. #define CACHE_CTL_mskDCCWF ( 0x1 << CACHE_CTL_offDCCWF )
  747. #define CACHE_CTL_mskDCPMW ( 0x1 << CACHE_CTL_offDCPMW )
  748. /******************************************************************************
  749. * mr9: HSMP_SADDR (High Speed Memory Port Starting Address)
  750. *****************************************************************************/
  751. #define HSMP_SADDR_offEN 0 /* Enable control bit for the High Speed Memory port */
  752. #define HSMP_SADDR_offRANGE 1 /* Denote the address range (only defined in HSMP v2 ) */
  753. /* bit 13:19 reserved */
  754. #define HSMP_SADDR_offSADJ1DR 20 /* Starting base PA of the High Speed Memory Port region */
  755. #define HSMP_SADDR_mskEN ( 0x1 << HSMP_SADDR_offEN )
  756. #define HSMP_SADDR_mskRANGE ( 0xFFF << HSMP_SADDR_offRANGE )
  757. #define HSMP_SADDR_mskSADDR ( 0xFFF << HSMP_SADDR_offSADDR )
  758. /******************************************************************************
  759. * mr10: HSMP_EADDR (High Speed Memory Port Ending Address)
  760. *****************************************************************************/
  761. /* bit 0:19 reserved */
  762. #define HSMP_EADDR_offEADDR 20
  763. #define HSMP_EADDR_mskEADDR ( 0xFFF << HSMP_EADDR_offEADDR )
  764. /******************************************************************************
  765. * dr0+(n*5): BPCn (n=0-7) (Breakpoint Control Register)
  766. *****************************************************************************/
  767. #define BPC_offWP 0 /* Configuration of BPAn */
  768. #define BPC_offEL 1 /* Enable BPAn */
  769. #define BPC_offS 2 /* Data address comparison for a store instruction */
  770. #define BPC_offP 3 /* Compared data address is PA */
  771. #define BPC_offC 4 /* CID value is compared with the BPCIDn register */
  772. #define BPC_offBE0 5 /* Enable byte mask for the comparison with register */
  773. #define BPC_offBE1 6 /* Enable byte mask for the comparison with register */
  774. #define BPC_offBE2 7 /* Enable byte mask for the comparison with register */
  775. #define BPC_offBE3 8 /* Enable byte mask for the comparison with register */
  776. #define BPC_offT 9 /* Enable breakpoint Embedded Tracer triggering operation */
  777. #define BPC_mskWP ( 0x1 << BPC_offWP )
  778. #define BPC_mskEL ( 0x1 << BPC_offEL )
  779. #define BPC_mskS ( 0x1 << BPC_offS )
  780. #define BPC_mskP ( 0x1 << BPC_offP )
  781. #define BPC_mskC ( 0x1 << BPC_offC )
  782. #define BPC_mskBE0 ( 0x1 << BPC_offBE0 )
  783. #define BPC_mskBE1 ( 0x1 << BPC_offBE1 )
  784. #define BPC_mskBE2 ( 0x1 << BPC_offBE2 )
  785. #define BPC_mskBE3 ( 0x1 << BPC_offBE3 )
  786. #define BPC_mskT ( 0x1 << BPC_offT )
  787. /******************************************************************************
  788. * dr1+(n*5): BPAn (n=0-7) (Breakpoint Address Register)
  789. *****************************************************************************/
  790. /* These registers contain break point address */
  791. /******************************************************************************
  792. * dr2+(n*5): BPAMn (n=0-7) (Breakpoint Address Mask Register)
  793. *****************************************************************************/
  794. /* These registerd contain the address comparison mask for the BPAn register */
  795. /******************************************************************************
  796. * dr3+(n*5): BPVn (n=0-7) Breakpoint Data Value Register
  797. *****************************************************************************/
  798. /* The BPVn register contains the data value that will be compared with the
  799. * incoming load/store data value */
  800. /******************************************************************************
  801. * dr4+(n*5): BPCIDn (n=0-7) (Breakpoint Context ID Register)
  802. *****************************************************************************/
  803. #define BPCID_offCID 0 /* CID that will be compared with a process's CID */
  804. /* bit 9:31 reserved */
  805. #define BPCID_mskCID ( 0x1FF << BPCID_offCID )
  806. /******************************************************************************
  807. * dr40: EDM_CFG (EDM Configuration Register)
  808. *****************************************************************************/
  809. #define EDM_CFG_offBC 0 /* Number of hardware breakpoint sets implemented */
  810. #define EDM_CFG_offDIMU 3 /* Debug Instruction Memory Unit exists */
  811. /* bit 4:15 reserved */
  812. #define EDM_CFG_offVER 16 /* EDM version */
  813. #define EDM_CFG_mskBC ( 0x7 << EDM_CFG_offBC )
  814. #define EDM_CFG_mskDIMU ( 0x1 << EDM_CFG_offDIMU )
  815. #define EDM_CFG_mskVER ( 0xFFFF << EDM_CFG_offVER )
  816. /******************************************************************************
  817. * dr41: EDMSW (EDM Status Word)
  818. *****************************************************************************/
  819. #define EDMSW_offWV 0 /* Write Valid */
  820. #define EDMSW_offRV 1 /* Read Valid */
  821. #define EDMSW_offDE 2 /* Debug exception has occurred for this core */
  822. /* bit 3:31 reserved */
  823. #define EDMSW_mskWV ( 0x1 << EDMSW_offWV )
  824. #define EDMSW_mskRV ( 0x1 << EDMSW_offRV )
  825. #define EDMSW_mskDE ( 0x1 << EDMSW_offDE )
  826. /******************************************************************************
  827. * dr42: EDM_CTL (EDM Control Register)
  828. *****************************************************************************/
  829. /* bit 0:30 reserved */
  830. #define EDM_CTL_offDEH_SEL 31 /* Controls where debug exception is directed to */
  831. #define EDM_CTL_mskDEH_SEL ( 0x1 << EDM_CTL_offDEH_SEL )
  832. /******************************************************************************
  833. * dr43: EDM_DTR (EDM Data Transfer Register)
  834. *****************************************************************************/
  835. /* This is used to exchange data between the embedded EDM logic
  836. * and the processor core */
  837. /******************************************************************************
  838. * dr44: BPMTC (Breakpoint Match Trigger Counter Register)
  839. *****************************************************************************/
  840. #define BPMTC_offBPMTC 0 /* Breakpoint match trigger counter value */
  841. /* bit 16:31 reserved */
  842. #define BPMTC_mskBPMTC ( 0xFFFF << BPMTC_offBPMTC )
  843. /******************************************************************************
  844. * dr45: DIMBR (Debug Instruction Memory Base Register)
  845. *****************************************************************************/
  846. /* bit 0:11 reserved */
  847. #define DIMBR_offDIMB 12 /* Base address of the Debug Instruction Memory (DIM)*/
  848. #define DIMBR_mskDIMB ( 0xFFFFF << DIMBR_offDIMB )
  849. /******************************************************************************
  850. * dr46: TECR0(Trigger Event Control register 0)
  851. * dr47: TECR1 (Trigger Event Control register 1)
  852. *****************************************************************************/
  853. #define TECR_offBP 0 /* Controld which BP is used as a trigger source */
  854. #define TECR_offNMI 8 /* Use NMI as a trigger source */
  855. #define TECR_offHWINT 9 /* Corresponding interrupt is used as a trigger source */
  856. #define TECR_offEVIC 15 /* Enable HWINT as a trigger source in EVIC mode */
  857. #define TECR_offSYS 16 /* Enable SYSCALL instruction as a trigger source */
  858. #define TECR_offDBG 17 /* Enable debug exception as a trigger source */
  859. #define TECR_offMRE 18 /* Enable MMU related exception as a trigger source */
  860. #define TECR_offE 19 /* An exception is used as a trigger source */
  861. /* bit 20:30 reserved */
  862. #define TECR_offL 31 /* Link/Cascade TECR0 trigger event to TECR1 trigger event */
  863. #define TECR_mskBP ( 0xFF << TECR_offBP )
  864. #define TECR_mskNMI ( 0x1 << TECR_offBNMI )
  865. #define TECR_mskHWINT ( 0x3F << TECR_offBHWINT )
  866. #define TECR_mskEVIC ( 0x1 << TECR_offBEVIC )
  867. #define TECR_mskSYS ( 0x1 << TECR_offBSYS )
  868. #define TECR_mskDBG ( 0x1 << TECR_offBDBG )
  869. #define TECR_mskMRE ( 0x1 << TECR_offBMRE )
  870. #define TECR_mskE ( 0x1 << TECR_offE )
  871. #define TECR_mskL ( 0x1 << TECR_offL )
  872. /******************************************************************************
  873. * hspr0: HSP_CTL (HW Stack Protection Control Register)
  874. *****************************************************************************/
  875. #define HSP_CTL_offHSP_EN 0 /* Enable bit for the stack protection and recording mechanism */
  876. #define HSP_CTL_offSCHM 1 /* Operating scheme of the stack protection and recording */
  877. #define HSP_CTL_offSU 2 /* Enable the SP protection and recording in the super-user mode */
  878. #define HSP_CTL_offU 3 /* Enable the SP protection and recording in the user mode */
  879. #define HSP_CTL_offSPL 4 /* (Secure Core Only) the enabled Security Privilege Level */
  880. /* bit 7:31 reserved */
  881. #define HSP_CTL_mskHSP_EN ( 0x1 << HSP_CTL_offHSP_EN )
  882. #define HSP_CTL_mskSCHM ( 0x1 << HSP_CTL_offSCHM )
  883. #define HSP_CTL_mskSU ( 0x1 << HSP_CTL_offSU )
  884. #define HSP_CTL_mskU ( 0x1 << HSP_CTL_offU )
  885. #define HSP_CTL_mskSPL ( 0x7 << HSP_CTL_offSPL )
  886. /******************************************************************************
  887. * hspr1: SP_BOUND (SP Bound Register)
  888. * hspr2: SP_BOUND_PRIV (Shadowed Privileged SP Bound Register)
  889. *****************************************************************************/
  890. /* These registers contains the stack overflow bound */
  891. /******************************************************************************
  892. * pfr0-2: PFMC0-2 (Performance Counter Register 0-2)
  893. *****************************************************************************/
  894. /* These registers contains performance event count */
  895. /******************************************************************************
  896. * pfr3: PFM_CTL (Performance Counter Control Register)
  897. *****************************************************************************/
  898. #define PFM_CTL_offEN0 0 /* Enable PFMC0 */
  899. #define PFM_CTL_offEN1 1 /* Enable PFMC1 */
  900. #define PFM_CTL_offEN2 2 /* Enable PFMC2 */
  901. #define PFM_CTL_offIE0 3 /* Enable interrupt for PFMC0 */
  902. #define PFM_CTL_offIE1 4 /* Enable interrupt for PFMC1 */
  903. #define PFM_CTL_offIE2 5 /* Enable interrupt for PFMC2 */
  904. #define PFM_CTL_offOVF0 6 /* Overflow bit of PFMC0 */
  905. #define PFM_CTL_offOVF1 7 /* Overflow bit of PFMC1 */
  906. #define PFM_CTL_offOVF2 8 /* Overflow bit of PFMC2 */
  907. #define PFM_CTL_offKS0 9 /* Enable superuser mode event counting for PFMC0 */
  908. #define PFM_CTL_offKS1 10 /* Enable superuser mode event counting for PFMC1 */
  909. #define PFM_CTL_offKS2 11 /* Enable superuser mode event counting for PFMC2 */
  910. #define PFM_CTL_offKU0 12 /* Enable user mode event counting for PFMC0 */
  911. #define PFM_CTL_offKU1 13 /* Enable user mode event counting for PFMC1 */
  912. #define PFM_CTL_offKU2 14 /* Enable user mode event counting for PFMC2 */
  913. #define PFM_CTL_offSEL0 15 /* The event selection for PFMC0 */
  914. #define PFM_CTL_offSEL1 16 /* The event selection for PFMC1 */
  915. #define PFM_CTL_offSEL2 22 /* The event selection for PFMC2 */
  916. /* bit 28:30 reserved */
  917. #define PFM_CTL_offMIN_CFG 31 /* Minimum Configuration */
  918. #define PFM_CTL_mskEN0 ( 0x01 << PFM_CTL_offEN0 )
  919. #define PFM_CTL_mskEN1 ( 0x01 << PFM_CTL_offEN1 )
  920. #define PFM_CTL_mskEN2 ( 0x01 << PFM_CTL_offEN2 )
  921. #define PFM_CTL_mskIE0 ( 0x01 << PFM_CTL_offIE0 )
  922. #define PFM_CTL_mskIE1 ( 0x01 << PFM_CTL_offIE1 )
  923. #define PFM_CTL_mskIE2 ( 0x01 << PFM_CTL_offIE2 )
  924. #define PFM_CTL_mskOVF0 ( 0x01 << PFM_CTL_offOVF0 )
  925. #define PFM_CTL_mskOVF1 ( 0x01 << PFM_CTL_offOVF1 )
  926. #define PFM_CTL_mskOVF2 ( 0x01 << PFM_CTL_offOVF2 )
  927. #define PFM_CTL_mskKS0 ( 0x01 << PFM_CTL_offKS0 )
  928. #define PFM_CTL_mskKS1 ( 0x01 << PFM_CTL_offKS1 )
  929. #define PFM_CTL_mskKS2 ( 0x01 << PFM_CTL_offKS2 )
  930. #define PFM_CTL_mskKU0 ( 0x01 << PFM_CTL_offKU0 )
  931. #define PFM_CTL_mskKU1 ( 0x01 << PFM_CTL_offKU1 )
  932. #define PFM_CTL_mskKU2 ( 0x01 << PFM_CTL_offKU2 )
  933. #define PFM_CTL_mskSEL0 ( 0x01 << PFM_CTL_offSEL0 )
  934. #define PFM_CTL_mskSEL1 ( 0x3F << PFM_CTL_offSEL1 )
  935. #define PFM_CTL_mskSEL2 ( 0x3F << PFM_CTL_offSEL2 )
  936. #define PFM_CTL_mskMIN_CFG ( 0x01 << PFM_CTL_offMIN_CFG )
  937. /******************************************************************************
  938. * pfr4: PFT_CTL (Performance Throttling Control Register)
  939. *****************************************************************************/
  940. /* bit 0:3 reserved */
  941. #define PFT_CTL_offT_LEVEL 4 /* Throttling Level */
  942. #define PFT_CTL_offFAST_INT 8 /* Fast interrupt response */
  943. /* bit 9:31 reserved */
  944. #define PFT_CTL_mskT_LEVEL ( 0x0F << PFT_CTL_offT_LEVEL )
  945. #define PFT_CTL_mskFAST_INT ( 0x01 << PFT_CTL_offFAST_INT )
  946. /******************************************************************************
  947. * idr0: SDZ_CTL (Structure Downsizing Control Register)
  948. *****************************************************************************/
  949. #define SDZ_CTL_offICDZ 0 /* I-cache downsizing control */
  950. #define SDZ_CTL_offDCDZ 3 /* D-cache downsizing control */
  951. #define SDZ_CTL_offMTBDZ 6 /* MTLB downsizing control */
  952. #define SDZ_CTL_offBTBDZ 9 /* Branch Target Table downsizing control */
  953. /* bit 12:31 reserved */
  954. #define SDZ_CTL_mskICDZ ( 0x07 << SDZ_CTL_offICDZ )
  955. #define SDZ_CTL_mskDCDZ ( 0x07 << SDZ_CTL_offDCDZ )
  956. #define SDZ_CTL_mskMTBDZ ( 0x07 << SDZ_CTL_offMTBDZ )
  957. #define SDZ_CTL_mskBTBDZ ( 0x07 << SDZ_CTL_offBTBDZ )
  958. /******************************************************************************
  959. * idr1: MISC_CTL (Miscellaneous Control Register)
  960. *****************************************************************************/
  961. #define MISC_CTL_offBTB 0 /* Disable Branch Target Buffer */
  962. #define MISC_CTL_offRTP 1 /* Disable Return Target Predictor */
  963. #define MISC_CTL_offPTEEPF 2 /* Disable HPTWK L2 PTE pefetch */
  964. #define MISC_CTL_offTCM 3 /* Disable Two Cycle Multiplication */
  965. #define MISC_CTL_offSP_SHADOW_EN 4 /* Enable control for shadow stack pointers */
  966. #define MISC_CTL_offLP_CACHE 5 /* Disable the Loop Cache */
  967. /* bit 6:6 reserved */
  968. #define MISC_CTL_offILMC_EN 7 /* Enable Instruction Local Memory Cache */
  969. #define MISC_CTL_offACE 8 /* Disable Andes Custom Extension */
  970. /* bit 9:31 reserved */
  971. #define MISC_CTL_makBTB ( 0x1 << MISC_CTL_makBTB )
  972. #define MISC_CTL_makRTP ( 0x1 << MISC_CTL_makRTP )
  973. #define MISC_CTL_makPTEEPF ( 0x1 << MISC_CTL_makPTEEPF )
  974. #define MISC_CTL_mskTCM ( 0x1 << MISC_CTL_offTCM )
  975. #define MISC_CTL_mskSP_SHADOW_EN ( 0x1 << MISC_CTL_offSP_SHADOW_EN )
  976. #define MISC_CTL_mskLP_CACHE ( 0x1 << MISC_CTL_offLP_CACHE )
  977. #define MISC_CTL_mskILMC_EN ( 0x1 << MISC_CTL_offILMC_EN )
  978. #define MISC_CTL_mskACE ( 0x1 << MISC_CTL_offACE )
  979. /******************************************************************************
  980. * racr0: PRUSR_ACC_CTL (Privileged Resource User Access Control Registers)
  981. *****************************************************************************/
  982. #define PRUSR_ACC_CTL_offDMA_EN 0 /* Allow user mode access of DMA registers */
  983. #define PRUSR_ACC_CTL_offPFM_EN 1 /* Allow user mode access of PFM registers */
  984. #define PRUSR_ACC_CTL_mskDMA_EN ( 0x1 << PRUSR_ACC_CTL_offDMA_EN )
  985. #define PRUSR_ACC_CTL_mskPFM_EN ( 0x1 << PRUSR_ACC_CTL_offPFM_EN )
  986. /******************************************************************************
  987. * dmar0: DMA_CFG (DMA Configuration Register)
  988. *****************************************************************************/
  989. #define DMA_CFG_offNCHN 0 /* The number of DMA channels implemented */
  990. #define DMA_CFG_offUNEA 2 /* Un-aligned External Address transfer feature */
  991. #define DMA_CFG_off2DET 3 /* 2-D Element Transfer feature */
  992. /* bit 4:15 reserved */
  993. #define DMA_CFG_offVER 16 /* DMA architecture and implementation version */
  994. #define DMA_CFG_mskNCHN ( 0x3 << DMA_CFG_offNCHN )
  995. #define DMA_CFG_mskUNEA ( 0x1 << DMA_CFG_offUNEA )
  996. #define DMA_CFG_msk2DET ( 0x1 << DMA_CFG_off2DET )
  997. #define DMA_CFG_mskVER ( 0xFFFF << DMA_CFG_offVER )
  998. /******************************************************************************
  999. * dmar1: DMA_GCSW (DMA Global Control and Status Word Register)
  1000. *****************************************************************************/
  1001. #define DMA_GCSW_offC0STAT 0 /* DMA channel 0 state */
  1002. #define DMA_GCSW_offC1STAT 3 /* DMA channel 1 state */
  1003. /* bit 6:11 reserved */
  1004. #define DMA_GCSW_offC0INT 12 /* DMA channel 0 generate interrupt */
  1005. #define DMA_GCSW_offC1INT 13 /* DMA channel 1 generate interrupt */
  1006. #define DMA_GCSW_offHCHAN 16 /* Head channel number */
  1007. #define DMA_GCSW_offFSM 18 /* Fast-start mode field */
  1008. #define DMA_GCSW_offSCMD 20 /* DMA Sub-Action Command used in the fast-start mode */
  1009. /* bit 22:27 reserved */
  1010. #define DMA_GCSW_offSDBE 28 /* Shadow DBM and DBB bits Enable control */
  1011. #define DMA_GCSW_offDBM 29 /* Double-Buffer Mode enable control for the data local memory */
  1012. #define DMA_GCSW_offDBB 30 /* Double-Buffer Bank */
  1013. #define DMA_GCSW_offEN 31 /* Enable DMA engine */
  1014. #define DMA_GCSW_mskC0STAT ( 0x7 << DMA_GCSW_offC0STAT )
  1015. #define DMA_GCSW_mskC1STAT ( 0x7 << DMA_GCSW_offC1STAT )
  1016. #define DMA_GCSW_mskC0INT ( 0x1 << DMA_GCSW_offC0INT )
  1017. #define DMA_GCSW_mskC1INT ( 0x1 << DMA_GCSW_offC1INT )
  1018. #define DMA_GCSW_mskHCHAN ( 0x3 << DMA_GCSW_offHCHAN )
  1019. #define DMA_GCSW_mskFSM ( 0x3 << DMA_GCSW_offFSM )
  1020. #define DMA_GCSW_mskSCMD ( 0x3 << DMA_GCSW_offSCMD )
  1021. #define DMA_GCSW_mskSDBE ( 0x1 << DMA_GCSW_offSDBE )
  1022. #define DMA_GCSW_mskDBM ( 0x1 << DMA_GCSW_offDBM )
  1023. #define DMA_GCSW_mskDBB ( 0x1 << DMA_GCSW_offDBB )
  1024. #define DMA_GCSW_mskEN ( 0x1 << DMA_GCSW_offEN )
  1025. /******************************************************************************
  1026. * dmar2: DMA_CHNSEL (DMA Channel Selection Register)
  1027. *****************************************************************************/
  1028. #define DMA_CHNSEL_offCHAN 0 /* Selected channel number */
  1029. /* bit 2:31 reserved */
  1030. #define DMA_CHNSEL_mskCHAN ( 0x3 << DMA_CHNSEL_offCHAN )
  1031. /******************************************************************************
  1032. * dmar3: DMA_ACT (DMA Action Register)
  1033. *****************************************************************************/
  1034. #define DMA_ACT_offACMD 0 /* DMA Action Command */
  1035. #define DMA_ACT_offSCMD 2 /* DMA Sub-action Command */
  1036. /* bit 4:31 reserved */
  1037. #define DMA_ACT_mskACMD ( 0x3 << DMA_ACT_offACMD )
  1038. #define DMA_ACT_mskSCMD ( 0x3 << DMA_ACT_offSCMD )
  1039. /******************************************************************************
  1040. * dmar4: DMA_SETUP (DMA Setup Register)
  1041. *****************************************************************************/
  1042. #define DMA_SETUP_offLM 0 /* Local Memory Selection */
  1043. #define DMA_SETUP_offTDIR 1 /* Transfer Direction */
  1044. #define DMA_SETUP_offTES 2 /* Transfer Element Size */
  1045. #define DMA_SETUP_offESTR 4 /* External memory transfer Stride */
  1046. #define DMA_SETUP_offCIE 16 /* Interrupt Enable on Completion */
  1047. #define DMA_SETUP_offSIE 17 /* Interrupt Enable on explicit Stop */
  1048. #define DMA_SETUP_offEIE 18 /* Interrupt Enable on Error */
  1049. #define DMA_SETUP_offUE 19 /* Enable the Un-aligned External Address */
  1050. #define DMA_SETUP_off2DE 20 /* Enable the 2-D External Transfer */
  1051. #define DMA_SETUP_offCOA 21 /* Transfer Coalescable */
  1052. /* bit 24:31 reserved */
  1053. #define DMA_SETUP_mskLM ( 0x1 << DMA_SETUP_offLM )
  1054. #define DMA_SETUP_mskTDIR ( 0x1 << DMA_SETUP_offTDIR )
  1055. #define DMA_SETUP_mskTES ( 0x3 << DMA_SETUP_offTES )
  1056. #define DMA_SETUP_mskESTR ( 0xFFF << DMA_SETUP_offESTR )
  1057. #define DMA_SETUP_mskCIE ( 0x1 << DMA_SETUP_offCIE )
  1058. #define DMA_SETUP_mskSIE ( 0x1 << DMA_SETUP_offSIE )
  1059. #define DMA_SETUP_mskEIE ( 0x1 << DMA_SETUP_offEIE )
  1060. #define DMA_SETUP_mskUE ( 0x1 << DMA_SETUP_offUE )
  1061. #define DMA_SETUP_msk2DE ( 0x1 << DMA_SETUP_off2DE )
  1062. #define DMA_SETUP_mskCOA ( 0x7 << DMA_SETUP_offCOA )
  1063. /******************************************************************************
  1064. * dmar5: DMA_ISADDR (DMA Internal Start Address Register)
  1065. *****************************************************************************/
  1066. #define DMA_ISADDR_offISADDR 0 /* Internal Start Address */
  1067. /* bit 20:31 reserved */
  1068. #define DMA_ISADDR_mskISADDR ( 0xFFFFF << DMA_ISADDR_offISADDR )
  1069. /******************************************************************************
  1070. * dmar6: DMA_ESADDR (DMA External Start Address Register)
  1071. *****************************************************************************/
  1072. /* This register holds External Start Address */
  1073. /******************************************************************************
  1074. * dmar7: DMA_TCNT (DMA Transfer Element Count Register)
  1075. *****************************************************************************/
  1076. #define DMA_TCNT_offTCNT 0 /* DMA transfer element count */
  1077. /* bit 18:31 reserved */
  1078. #define DMA_TCNT_mskTCNT ( 0x7FFFFF << DMA_TCNT_offTCNT )
  1079. /******************************************************************************
  1080. * dmar8: DMA_STATUS (DMA Status Register)
  1081. *****************************************************************************/
  1082. #define DMA_STATUS_offSTAT 0 /* DMA channel state */
  1083. #define DMA_STATUS_offSTUNA 3 /* Un-aligned error on External Stride value */
  1084. #define DMA_STATUS_offDERR 4 /* DMA Transfer Disruption Error */
  1085. #define DMA_STATUS_offEUNA 5 /* Un-aligned error on the External address */
  1086. #define DMA_STATUS_offIUNA 6 /* Un-aligned error on the Internal address */
  1087. #define DMA_STATUS_offIOOR 7 /* Out-Of-Range error on the Internal address */
  1088. #define DMA_STATUS_offEBUS 8 /* Bus Error on an External DMA transfer */
  1089. #define DMA_STATUS_offESUP 9 /* DMA setup error */
  1090. /* bit 10:30 reserved */
  1091. #define DMA_STATUS_offWE 31 /* Wait event */
  1092. #define DMA_STATUS_mskSTAT ( 0x7 << DMA_STATUS_offSTAT )
  1093. #define DMA_STATUS_mskSTUNA ( 0x1 << DMDMA_STATUS_offSTUNA )
  1094. #define DMA_STATUS_mskDERR ( 0x1 << DMDMA_STATUS_offDERR )
  1095. #define DMA_STATUS_mskEUNA ( 0x1 << DMDMA_STATUS_offEUNA )
  1096. #define DMA_STATUS_mskIUNA ( 0x1 << DMDMA_STATUS_offIUNA )
  1097. #define DMA_STATUS_mskIOOR ( 0x1 << DMDMA_STATUS_offIOOR )
  1098. #define DMA_STATUS_mskEBUS ( 0x1 << DMDMA_STATUS_offEBUS )
  1099. #define DMA_STATUS_mskESUP ( 0x1 << DMDMA_STATUS_offESUP )
  1100. #define DMA_STATUS_mskWE ( 0x1 << DMA_STATUS_offWE )
  1101. /******************************************************************************
  1102. * dmar9: DMA_2DSET (DMA 2D Setup Register)
  1103. *****************************************************************************/
  1104. #define DMA_2DSET_offWECNT 0 /* The Width Element Count for a 2-D region */
  1105. #define DMA_2DSET_offHTSTR 16 /* The Height Stride for a 2-D region */
  1106. #define DMA_2DSET_mskHTSTR ( 0xFFFF << DMA_2DSET_offHTSTR )
  1107. #define DMA_2DSET_mskWECNT ( 0xFFFF << DMA_2DSET_offWECNT )
  1108. /******************************************************************************
  1109. * dmar10: DMA_2DSCTL (DMA 2D Startup Control Register)
  1110. *****************************************************************************/
  1111. #define DMA_2DSCTL_offSTWECNT 0 /* Startup Width Element Count for a 2-D region */
  1112. /* bit 16:31 reserved */
  1113. #define DMA_2DSCTL_mskSTWECNT ( 0xFFFF << DMA_2DSCTL_offSTWECNT )
  1114. /******************************************************************************
  1115. * fpcsr: FPCSR (Floating-Point Control Status Register)
  1116. *****************************************************************************/
  1117. #define FPCSR_offRM 0
  1118. #define FPCSR_offIVO 2
  1119. #define FPCSR_offDBZ 3
  1120. #define FPCSR_offOVF 4
  1121. #define FPCSR_offUDF 5
  1122. #define FPCSR_offIEX 6
  1123. #define FPCSR_offIVOE 7
  1124. #define FPCSR_offDBZE 8
  1125. #define FPCSR_offOVFE 9
  1126. #define FPCSR_offUDFE 10
  1127. #define FPCSR_offIEXE 11
  1128. #define FPCSR_offDNZ 12
  1129. #define FPCSR_offIVOT 13
  1130. #define FPCSR_offDBZT 14
  1131. #define FPCSR_offOVFT 15
  1132. #define FPCSR_offUDFT 16
  1133. #define FPCSR_offIEXT 17
  1134. #define FPCSR_offDNIT 18
  1135. #define FPCSR_offRIT 19
  1136. #define FPCSR_mskRM ( 0x3 << FPCSR_offRM )
  1137. #define FPCSR_mskIVO ( 0x1 << FPCSR_offIVO )
  1138. #define FPCSR_mskDBZ ( 0x1 << FPCSR_offDBZ )
  1139. #define FPCSR_mskOVF ( 0x1 << FPCSR_offOVF )
  1140. #define FPCSR_mskUDF ( 0x1 << FPCSR_offUDF )
  1141. #define FPCSR_mskIEX ( 0x1 << FPCSR_offIEX )
  1142. #define FPCSR_mskIVOE ( 0x1 << FPCSR_offIVOE )
  1143. #define FPCSR_mskDBZE ( 0x1 << FPCSR_offDBZE )
  1144. #define FPCSR_mskOVFE ( 0x1 << FPCSR_offOVFE )
  1145. #define FPCSR_mskUDFE ( 0x1 << FPCSR_offUDFE )
  1146. #define FPCSR_mskIEXE ( 0x1 << FPCSR_offIEXE )
  1147. #define FPCSR_mskDNZ ( 0x1 << FPCSR_offDNZ )
  1148. #define FPCSR_mskIVOT ( 0x1 << FPCSR_offIVOT )
  1149. #define FPCSR_mskDBZT ( 0x1 << FPCSR_offDBZT )
  1150. #define FPCSR_mskOVFT ( 0x1 << FPCSR_offOVFT )
  1151. #define FPCSR_mskUDFT ( 0x1 << FPCSR_offUDFT )
  1152. #define FPCSR_mskIEXT ( 0x1 << FPCSR_offIEXT )
  1153. #define FPCSR_mskDNIT ( 0x1 << FPCSR_offDNIT )
  1154. #define FPCSR_mskRIT ( 0x1 << FPCSR_offRIT )
  1155. /******************************************************************************
  1156. * fpcfg: FPCFG (Floating-Point Configuration Register)
  1157. *****************************************************************************/
  1158. #define FPCFG_offSP 0
  1159. #define FPCFG_offDP 1
  1160. #define FPCFG_offFREG 2
  1161. #define FPCFG_offFMA 4
  1162. /* bit 5:21 reserved */
  1163. #define FPCFG_offIMVER 22
  1164. #define FPCFG_offAVER 27
  1165. #define FPCFG_mskSP ( 0x1 << FPCFG_offSP )
  1166. #define FPCFG_mskDP ( 0x1 << FPCFG_offDP )
  1167. #define FPCFG_mskFREG ( 0x3 << FPCFG_offFREG )
  1168. #define FPCFG_mskFMA ( 0x1 << FPCFG_offFMA )
  1169. #define FPCFG_mskIMVER ( 0x1F << FPCFG_offIMVER )
  1170. #define FPCFG_mskAVER ( 0x1F << FPCFG_offAVER )
  1171. /******************************************************************************
  1172. * fucpr: FUCOP_CTL (FPU and Coprocessor Enable Control Register)
  1173. *****************************************************************************/
  1174. #define FUCOP_CTL_offFPUEN 0
  1175. #define FUCOP_CTL_offCP1EN 1
  1176. #define FUCOP_CTL_offCP2EN 2
  1177. #define FUCOP_CTL_offCP3EN 3
  1178. /* bit 4:30 reserved */
  1179. #define FUCOP_CTL_offAUEN 31
  1180. #define FUCOP_CTL_mskFPUEN ( 0x1 << FUCOP_CTL_offFPUEN )
  1181. #define FUCOP_CTL_mskCP1EN ( 0x1 << FUCOP_CTL_offCP1EN )
  1182. #define FUCOP_CTL_mskCP2EN ( 0x1 << FUCOP_CTL_offCP2EN )
  1183. #define FUCOP_CTL_mskCP3EN ( 0x1 << FUCOP_CTL_offCP3EN )
  1184. #define FUCOP_CTL_mskAUEN ( 0x1 << FUCOP_CTL_offAUEN )
  1185. #ifdef CONFIG_CACHE_L2
  1186. /******************************************************************************
  1187. * L2_CA_CONF (Cache architecture configuration)
  1188. *****************************************************************************/
  1189. #define L2_CA_CONF_offL2CLSZ 8
  1190. #define L2_CA_CONF_mskL2CLSZ (0x7 << L2_CA_CONF_offL2CLSZ)
  1191. //TODO finish this table
  1192. /******************************************************************************
  1193. * L2CC_SETUP (L2CC Setup register)
  1194. *****************************************************************************/
  1195. #define L2CC_SETUP_offPART 0
  1196. #define L2CC_SETUP_mskPART (0x3 << L2_CA_CONF_offPART)
  1197. #define L2CC_SETUP_offDDLATC 4
  1198. #define L2CC_SETUP_mskDDLATC (0x3 << L2_CA_CONF_offDDLATC)
  1199. #define L2CC_SETUP_offTDLATC 8
  1200. #define L2CC_SETUP_mskTDLATC (0x3 << L2_CA_CONF_offTDLATC)
  1201. /******************************************************************************
  1202. * L2CC_PROT (L2CC Protect register)
  1203. *****************************************************************************/
  1204. #define L2CC_PROT_offMRWEN 31
  1205. #define L2CC_PROT_mskMRWEN (0x1 << L2CC_PROT_offMRWEN)
  1206. //TODO finish this table
  1207. //
  1208. /******************************************************************************
  1209. * L2_CCTL_STATUS_Mn (The L2CCTL command working status for Master n)
  1210. *****************************************************************************/
  1211. #define L2CC_CTRL_offEN 31
  1212. #define L2CC_CTRL_mskEN (0x1 << L2CC_CTRL_offEN)
  1213. /******************************************************************************
  1214. * L2_CCTL_STATUS_Mn (The L2CCTL command working status for Master n)
  1215. *****************************************************************************/
  1216. #define L2_CCTL_STATUS_offCMD_COMP 31
  1217. #define L2_CCTL_STATUS_mskCMD_COMP (0x1 << L2_CCTL_STATUS_offCMD_COMP)
  1218. //TODO finish this table
  1219. #endif
  1220. #endif /* __NDS32_DEFS_H__ */