nvr4102.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:14k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* nvr4102.h - NEC NVR4102 header file */
  2. /* Copyright 1984-1997 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01b,22dec97,jmc  revised VR4102_ISA_IO_BASE_ADRS for Unified Board rev 1.4.
  7. 01a,11jun97,sru  written.
  8. */
  9. /*
  10. This file contains constants for the NEC V4R4101.  Register address
  11. definitions for the various subsystems are provided, and some (but
  12. not all) register field definitions are provided.
  13. */
  14. #ifndef __INCnvr4102h
  15. #define __INCnvr4102h
  16. #include "vxWorks.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define VR4102_ICACHE_SIZE 4096
  21. #define VR4102_DCACHE_SIZE 1024
  22. /*
  23. The Unified Evaluation Board uses a different ISA IO base address.
  24. If not using a Unified Evaluation Board, rev 1.4 or later, replace the
  25. following define with the out-commented define that follows.
  26. */ 
  27. #define VR4102_ISA_IO_BASE_ADRS PHYS_TO_K1(0x16000000) /* unified board */
  28. /*#define VR4102_ISA_IO_BASE_ADRS PHYS_TO_K1(0x15000000) *//* pre rev 1.4 */
  29. /* interrupt bits in the status register */
  30. #define VR4102_SR_ICU_INTERVAL_TIMER  (1 << 11)
  31. #define VR4102_SR_ICU_OTHER       (1 << 10)
  32. /* VR4102 register definitions. */
  33. #define VR4102_REG_BASE   (0x0b000000 | K1BASE)
  34. #ifdef _ASMLANGUAGE
  35. #define VR4102_ADRS(reg)   (VR4102_REG_BASE + (reg))
  36. #else
  37. #define VR4102_ADRS(reg)   ((volatile UINT16 *)(VR4102_REG_BASE + (reg)))
  38. #endif /* _ASMLANGUAGE */
  39. /* BCU registers */
  40. #define VR4102_BCUCNTREG1 VR4102_ADRS(0x00)
  41. #define VR4102_BCUCNTREG2 VR4102_ADRS(0x02)
  42. #define VR4102_BCUSPEEDREG VR4102_ADRS(0x0a)
  43. #define VR4102_BCUERRSTREG VR4102_ADRS(0x0c)
  44. #define VR4102_BCURFCNTREG VR4102_ADRS(0x0e)
  45. #define VR4102_REVIDREG VR4102_ADRS(0x10)
  46. #define VR4102_BCURCOUNTRE VR4102_ADRS(0x12)
  47. #define VR4102_CLKSPEEDREG VR4102_ADRS(0x14)
  48. /* BCUCNTREG1 bit definitions */
  49. #define VR4102_ROM64 (1 << 15)
  50. #define VR4102_DRAM64 (1 << 14)
  51. #define VR4102_ISAM_LCD (1 << 13) /* XXX set this? */
  52. #define VR4102_PAGE128 (1 << 12)
  53. #define VR4102_PAGEROM2 (1 << 10)
  54. #define VR4102_PAGEROM0 (1 << 8)
  55. #define VR4102_ROMWEN2 (1 << 6)
  56. #define VR4102_ROMWEN0 (1 << 4)
  57. #define VR4102_BUSHERREN (1 << 2)
  58. #define VR4102_RSTOUT (1 << 0)
  59. /* BCUCNTREG2 bit definitions */
  60. #define VR4102_GMODE (1 << 0)
  61. /* DMAAU registers */
  62. #define VR4102_AIUBALREG VR4102_ADRS(0x20)
  63. #define VR4102_AIUBAHREG VR4102_ADRS(0x22)
  64. #define VR4102_AIUALREG VR4102_ADRS(0x24)
  65. #define VR4102_AIUAHREG VR4102_ADRS(0x26)
  66. #define VR4102_AIUOBALREG VR4102_ADRS(0x28)
  67. #define VR4102_AIUOBAHREG VR4102_ADRS(0x2a)
  68. #define VR4102_AIUOALREG VR4102_ADRS(0x2c)
  69. #define VR4102_AIUOAHREG VR4102_ADRS(0x2e)
  70. #define VR4102_FIRBALREG VR4102_ADRS(0x30)
  71. #define VR4102_FIRBAHREG VR4102_ADRS(0x32)
  72. #define VR4102_FIRALREG VR4102_ADRS(0x34)
  73. #define VR4102_FIRAHREG VR4102_ADRS(0x36)
  74. /* DCU registers */
  75. #define VR4102_DMARSTREG VR4102_ADRS(0x40)
  76. #define VR4102_DMAIDLEREG VR4102_ADRS(0x42)
  77. #define VR4102_DMASENREG VR4102_ADRS(0x44)
  78. #define VR4102_DMAMSKREG VR4102_ADRS(0x46)
  79. #define VR4102_DMAREQREG VR4102_ADRS(0x48)
  80. #define VR4102_TDREG VR4102_ADRS(0x4a)
  81. /* DMA mask bit definitions */
  82. #define  VR4102_DMAMSKAIN (1 << 3)
  83. #define  VR4102_DMAMSKAOUT (1 << 2)
  84. #define  VR4102_DMAMSKFOUT (1 << 0)
  85. /* CMU register */
  86. #define VR4102_CMUCLKMSK VR4102_ADRS(0x60)
  87. #define  VR4102_MSKFFIR (1 << 10)
  88. #define  VR4102_MSKSHSP (1 << 9)
  89. #define  VR4102_MSKSSIU (1 << 8)  /* XXX set this */
  90. #define  VR4102_MSKDSIU (1 << 5)  /* XXX set this */
  91. #define  VR4102_MSKFIR (1 << 4)
  92. #define  VR4102_MSKKIU (1 << 3)
  93. #define  VR4102_MSKADU (1 << 2)
  94. #define  VR4102_MSKSIU (1 << 1)  /* XXX set this */
  95. #define  VR4102_MSKPIU (1 << 0)
  96. /* ICU system and system mask registers */
  97. #define VR4102_ICU_SYSINT1REG   VR4102_ADRS(0x80)
  98. #define VR4102_ICU_MSYSINT1REG VR4102_ADRS(0x8c)
  99. #define  VR4102_DOZEPIUINTR (1 << 13)
  100. #define  VR4102_SOFTINTR (1 << 11)
  101. #define  VR4102_WRBERRINTR (1 << 10)
  102. #define  VR4102_SIUINTR (1 << 9)
  103. #define  VR4102_GIUINTR (1 << 8)
  104. #define  VR4102_KIUINTR (1 << 7)
  105. #define  VR4102_AIUINTR (1 << 6)
  106. #define  VR4102_PIUINTR (1 << 5)
  107. #define  VR4102_ETIMERINTR (1 << 3)
  108. #define  VR4102_RTCL1INTR (1 << 2)
  109. #define  VR4102_POWERINTR (1 << 1)
  110. #define  VR4102_BATINTR (1 << 0)
  111. #define VR4102_ICU_SYSINT2REG   VR4102_ADRS(0x200)
  112. #define VR4102_ICU_MSYSINT2REG VR4102_ADRS(0x206)
  113. #define  VR4102_DSIUINTR (1 << 5)
  114. #define  VR4102_FIRINTR (1 << 4)
  115. #define  VR4102_TCLKINTR (1 << 3)
  116. #define  VR4102_HSPINTR (1 << 2) 
  117. #define  VR4102_LEDINTR (1 << 1) 
  118. #define  VR4102_RTCL2INTR (1 << 0)
  119. /* ICU subsystem status and mask registers */
  120. #define VR4102_ICU_PIUINTREG VR4102_ADRS(0x82)
  121. #define VR4102_ICU_ADUINTREG VR4102_ADRS(0x84)
  122. #define VR4102_ICU_KIUINTREG VR4102_ADRS(0x86)
  123. #define VR4102_ICU_GIUINTLREG VR4102_ADRS(0x88)
  124. #define VR4102_ICU_DSIUINTREG VR4102_ADRS(0x8a)
  125. #define VR4102_ICU_MPIUINTREG VR4102_ADRS(0x8e)
  126. #define VR4102_ICU_MAIUINTREG VR4102_ADRS(0x90)
  127. #define VR4102_ICU_MKIUINTREG VR4102_ADRS(0x92)
  128. #define VR4102_ICU_MGIUINTLREG VR4102_ADRS(0x94)
  129. #define VR4102_ICU_MDSIUINTREG VR4102_ADRS(0x96)
  130. #define VR4102_ICU_NMIREG VR4102_ADRS(0x98)
  131. #define VR4102_ICU_SOFTINTREG VR4102_ADRS(0x9a)
  132. #define VR4102_ICU_GIUINTHREG   VR4102_ADRS(0x202)
  133. #define VR4102_ICU_FIRINTHREG   VR4102_ADRS(0x204)
  134. #define VR4102_ICU_MGIUINTHREG  VR4102_ADRS(0x208)
  135. #define VR4102_ICU_MFIRINTHREG  VR4102_ADRS(0x20a)
  136. /* ICU MDSIUINTREG bit definitions */
  137. #define  VR4102_ICU_DSIU_INTSR0    (1 << 9)
  138. #define  VR4102_ICU_DSIU_INTST0    (1 << 8)
  139. /* PMU registers */
  140. #define VR4102_PMUINTREG VR4102_ADRS(0xa0)  /* verify this adr XXX */
  141. #define VR4102_PMUCNTREG VR4102_ADRS(0xa2)  /* verify this adr XXX */
  142. #define   VR4102_HALTIMERRST (1 << 2)
  143. /* RTC registers */
  144. #define VR4102_ETIMELREG VR4102_ADRS(0xc0)
  145. #define VR4102_ETIMEMREG VR4102_ADRS(0xc2)
  146. #define VR4102_ETIMEHREG VR4102_ADRS(0xc4)
  147. #define VR4102_ECMPLREG VR4102_ADRS(0xc8)
  148. #define VR4102_ECMPMREG VR4102_ADRS(0xca)
  149. #define VR4102_ECMPHREG VR4102_ADRS(0xce)
  150. #define VR4102_RTCL1LREG VR4102_ADRS(0xd0)
  151. #define VR4102_RTCL1HREG VR4102_ADRS(0xd2)
  152. #define VR4102_RTCL1CNTLREG VR4102_ADRS(0xd4)
  153. #define VR4102_RTCL1CNTHREG VR4102_ADRS(0xd6)
  154. #define VR4102_RTCL2LREG VR4102_ADRS(0xd8)
  155. #define VR4102_RTCL2HREG VR4102_ADRS(0xda)
  156. #define VR4102_RTCL2CNTLREG VR4102_ADRS(0xdc)
  157. #define VR4102_RTCL2CNTHREG VR4102_ADRS(0xde)
  158. #define VR4102_TCLKLREG VR4102_ADRS(0x1c0)
  159. #define VR4102_TCLKHREG VR4102_ADRS(0x1c2)
  160. #define VR4102_TCLKCNTLREG VR4102_ADRS(0x1c4)
  161. #define VR4102_TCLKCNTHREG VR4102_ADRS(0x1c6)
  162. #define VR4102_RTCINTREG VR4102_ADRS(0x1de)
  163. #define  VR4102_RTC_RTCINTR0 (1 << 0)
  164. #define  VR4102_RTC_RTCINTR1 (1 << 1)
  165. #define  VR4102_RTC_RTCINTR2 (1 << 2)
  166. #define  VR4102_RTC_RTCINTR3 (1 << 3)
  167. /* DSU registers */
  168. #define VR4102_DSUCNTREG VR4102_ADRS(0xe0)
  169. #define VR4102_DSUSETREG VR4102_ADRS(0xe2)
  170. #define VR4102_DSUCLRREG VR4102_ADRS(0xe4)
  171. #define VR4102_DSUTIMREG VR4102_ADRS(0xe6)
  172. #define VR4102_DSULOADREG VR4102_ADRS(0xe8)
  173. /* GIU registers */
  174. #define VR4102_GIUIOSELL VR4102_ADRS(0x100)
  175. #define VR4102_GIUIOSELH VR4102_ADRS(0x102)
  176. #define VR4102_GIUPIODL VR4102_ADRS(0x104)
  177. #define VR4102_GIUPIODH VR4102_ADRS(0x106)
  178. #define VR4102_GIUINTSTATL VR4102_ADRS(0x108)
  179. #define VR4102_GIUINTSTATH VR4102_ADRS(0x10a)
  180. #define VR4102_GIUINTENL VR4102_ADRS(0x10c)
  181. #define VR4102_GIUINTENH VR4102_ADRS(0x10e)
  182. #define VR4102_GIUINTTYPL VR4102_ADRS(0x110)
  183. #define VR4102_GIUINTTYPH VR4102_ADRS(0x112)
  184. #define VR4102_GIUINTALSELL VR4102_ADRS(0x114)
  185. #define VR4102_GIUINTALSELH VR4102_ADRS(0x116)
  186. #define VR4102_GIUINTHTSELL VR4102_ADRS(0x118)
  187. #define VR4102_GIUINTHTSELH VR4102_ADRS(0x11a)
  188. #define VR4102_GIUPODATL VR4102_ADRS(0x11c)
  189. #define VR4102_GIUPODATH VR4102_ADRS(0x11e)
  190. /* The general-purpose I/O pins (GPIO) are enabled and controlled
  191.    via identically placed bits in the GIU registers and some of the 
  192.    ICU registers. This set of pin masks can be used with whichever 
  193.    registers contain GPIO pin configuration. */
  194. #define  VR4102_GPIO_PIN_31 (1 << 15)
  195. #define  VR4102_GPIO_PIN_30 (1 << 14)
  196. #define  VR4102_GPIO_PIN_29 (1 << 13)
  197. #define  VR4102_GPIO_PIN_28 (1 << 12)
  198. #define  VR4102_GPIO_PIN_27 (1 << 11)
  199. #define  VR4102_GPIO_PIN_26 (1 << 10)
  200. #define  VR4102_GPIO_PIN_25 (1 << 9)
  201. #define  VR4102_GPIO_PIN_24 (1 << 8)
  202. #define  VR4102_GPIO_PIN_23 (1 << 7)
  203. #define  VR4102_GPIO_PIN_22 (1 << 6)
  204. #define  VR4102_GPIO_PIN_21 (1 << 5)
  205. #define  VR4102_GPIO_PIN_20 (1 << 4)
  206. #define  VR4102_GPIO_PIN_19 (1 << 3)
  207. #define  VR4102_GPIO_PIN_18 (1 << 2)
  208. #define  VR4102_GPIO_PIN_17 (1 << 1)
  209. #define  VR4102_GPIO_PIN_16 (1 << 0)
  210. #define  VR4102_GPIO_PIN_15 (1 << 15)
  211. #define  VR4102_GPIO_PIN_14 (1 << 14)
  212. #define  VR4102_GPIO_PIN_13 (1 << 13)
  213. #define  VR4102_GPIO_PIN_12 (1 << 12)
  214. #define  VR4102_GPIO_PIN_11 (1 << 11)
  215. #define  VR4102_GPIO_PIN_10 (1 << 10)
  216. #define  VR4102_GPIO_PIN_9 (1 << 9)
  217. #define  VR4102_GPIO_PIN_8 (1 << 8)
  218. #define  VR4102_GPIO_PIN_7 (1 << 7)
  219. #define  VR4102_GPIO_PIN_6 (1 << 6)
  220. #define  VR4102_GPIO_PIN_5 (1 << 5)
  221. #define  VR4102_GPIO_PIN_4 (1 << 4)
  222. #define  VR4102_GPIO_PIN_3 (1 << 3)
  223. #define  VR4102_GPIO_PIN_2 (1 << 2)
  224. #define  VR4102_GPIO_PIN_1 (1 << 1)
  225. #define  VR4102_GPIO_PIN_0 (1 << 0)
  226. /* PIU registers */
  227. #define VR4102_PIUCNTREG VR4102_ADRS(0x122)
  228. #define VR4102_PIUINTREG VR4102_ADRS(0x124)
  229. #define VR4102_PIUSIVLREG VR4102_ADRS(0x126)
  230. #define VR4102_PIUSTBLREG VR4102_ADRS(0x128)
  231. #define VR4102_PIUCMDREG VR4102_ADRS(0x12a)
  232. #define VR4102_PIUASCNREG VR4102_ADRS(0x130)
  233. #define VR4102_PIUAMSKREG VR4102_ADRS(0x132)
  234. #define VR4102_PIUCIVLREG VR4102_ADRS(0x13e)
  235. #define VR4102_PIUPB00REG VR4102_ADRS(0x2a0)
  236. #define VR4102_PIUPB01REG VR4102_ADRS(0x2a2)
  237. #define VR4102_PIUPB02REG VR4102_ADRS(0x2a4)
  238. #define VR4102_PIUPB03REG VR4102_ADRS(0x2a6)
  239. #define VR4102_PIUPB10REG VR4102_ADRS(0x2a8)
  240. #define VR4102_PIUPB11REG VR4102_ADRS(0x2aa)
  241. #define VR4102_PIUPB12REG VR4102_ADRS(0x2ac)
  242. #define VR4102_PIUPB13REG VR4102_ADRS(0x2ae)
  243. #define VR4102_PIUAB0REG VR4102_ADRS(0x2b0)
  244. #define VR4102_PIUAB1REG VR4102_ADRS(0x2b2)
  245. #define VR4102_PIUAB2REG VR4102_ADRS(0x2b4)
  246. #define VR4102_PIUAB3REG VR4102_ADRS(0x2b6)
  247. #define VR4102_PIUPB04REG VR4102_ADRS(0x2bc)
  248. #define VR4102_PIUPB14REG VR4102_ADRS(0x2be)
  249. /* AIU registers */
  250. #define VR4102_MDMADATREG VR4102_ADRS(0x160)
  251. #define VR4102_SDMADATREG VR4102_ADRS(0x162)
  252. #define VR4102_SODATREG VR4102_ADRS(0x166)
  253. #define VR4102_SCNTREG VR4102_ADRS(0x168)
  254. #define VR4102_SCNVRREG VR4102_ADRS(0x16a)
  255. #define VR4102_SCNVCUNTREG VR4102_ADRS(0x16c)
  256. #define VR4102_MIDATREG VR4102_ADRS(0x170)
  257. #define VR4102_MCNTREG VR4102_ADRS(0x172)
  258. #define VR4102_MCNVRREG VR4102_ADRS(0x174)
  259. #define VR4102_MCNVCUNTREG VR4102_ADRS(0x176)
  260. #define VR4102_DVALIDREG VR4102_ADRS(0x178)
  261. #define VR4102_SEQREG VR4102_ADRS(0x17a)
  262. #define VR4102_INTREG VR4102_ADRS(0x17c)
  263. /* KIU registers */
  264. #define VR4102_KIUDAT0REG VR4102_ADRS(0x180)
  265. #define VR4102_KIUDAT1REG VR4102_ADRS(0x182)
  266. #define VR4102_KIUDAT2REG VR4102_ADRS(0x184)
  267. #define VR4102_KIUDAT3REG VR4102_ADRS(0x186)
  268. #define VR4102_KIUDAT4REG VR4102_ADRS(0x188)
  269. #define VR4102_KIUDAT5REG VR4102_ADRS(0x18a)
  270. #define VR4102_KIUSCANREP VR4102_ADRS(0x190)
  271. #define VR4102_DIUSCANS VR4102_ADRS(0x192)
  272. #define VR4102_KIUWKS VR4102_ADRS(0x194)
  273. #define VR4102_KIUWKI VR4102_ADRS(0x196)
  274. #define VR4102_KIUINT VR4102_ADRS(0x198)
  275. #define VR4102_KIURST VR4102_ADRS(0x19a)
  276. #define VR4102_KIUGPEN VR4102_ADRS(0x19c)
  277. #define VR4102_SCANLINE VR4102_ADRS(0x19e)
  278. /* Debug SIU registers */
  279. #define VR4102_PORTREG VR4102_ADRS(0x1a0)  /* new XXX */
  280. #define VR4102_MODEMREG VR4102_ADRS(0x1a2)  /* new XXX */
  281. #define VR4102_ASIM00REG VR4102_ADRS(0x1a4)
  282. #define VR4102_ASIM01REG VR4102_ADRS(0x1a6)
  283. #define VR4102_RXB0RREG VR4102_ADRS(0x1a8)
  284. #define VR4102_RXB0LREG VR4102_ADRS(0x1aa)
  285. #define VR4102_RXS0RREG VR4102_ADRS(0x1ac)
  286. #define VR4102_TXS0LREG VR4102_ADRS(0x1ae)
  287. #define VR4102_ASIS0REG VR4102_ADRS(0x1b0)
  288. #define VR4102_INTR0REG VR4102_ADRS(0x1b2)
  289. #define VR4102_BRG0REG VR4102_ADRS(0x1b4)  /* new XXX */
  290. #define VR4102_BPRM0REG VR4102_ADRS(0x1b6)
  291. #define VR4102_DSIURESETREG VR4102_ADRS(0x1b8)
  292. /* DSIU subsystem DSIURESETREG bit definitions */
  293. #define VR4102_DSIURST (1 << 0)
  294. /* DSIU subsystem ASIM00REG register bit definitions */
  295. #define VR4102_ASIM00REG_RESERVED  (1 << 7)
  296. #define VR4102_RXE0    (1 << 6)
  297. #define VR4102_DSIU_PAR_SHIFT    4
  298. #define VR4102_DSIU_PAR_EVEN    (3 << VR4102_DSIU_PAR_SHIFT)
  299. #define VR4102_DSIU_PAR_ODD    (2 << VR4102_DSIU_PAR_SHIFT)
  300. #define VR4102_DSIU_PAR_ZERO    (1 << VR4102_DSIU_PAR_SHIFT)
  301. #define VR4102_DSIU_PAR_EXTEND    (0 << VR4102_DSIU_PAR_SHIFT)
  302. #define VR4102_DSIU_CHARLEN_8    (1 << 3)
  303. #define VR4102_DSIU_CHARLEN_7    (0 << 3)
  304. #define VR4102_DSIU_STOPBITS_2    (1 << 2)
  305. #define VR4102_DSIU_STOPBITS_1    (1 << 2)
  306. #define VR4102_DSIU_SCLS0    (1 << 0)  /* new XXX */
  307. /* DSIU subsystem BPRM0REG register bit definitions */
  308. #define VR4102_BRCE0    (1 << 7)
  309. /* DSIU subsystem INTR0REG register bit definitions */
  310. #define VR4102_INTDCD    (1 << 3)
  311. #define VR4102_INTSER0    (1 << 2)
  312. #define VR4102_INTSR0    (1 << 1)
  313. #define VR4102_INTST0    (1 << 0)
  314. /* DSIU subsystem ASIS0REG register bit definitions */
  315. #define VR4102_SOT0    (1 << 7)
  316. #define VR4102_PE0    (1 << 2)
  317. #define VR4102_FE0    (1 << 1)
  318. #define VR4102_OVE0    (1 << 0)
  319. /* LED registers */
  320. #define VR4102_LEDHTSREG    VR4102_ADRS(0x240)
  321. #define VR4102_LEDTLSREG    VR4102_ADRS(0x242)
  322. #define VR4102_LEDHLTCLREG    VR4102_ADRS(0x244)
  323. #define VR4102_LEDHLTCHREG    VR4102_ADRS(0x246)
  324. #define VR4102_LEDCNTREG    VR4102_ADRS(0x248)
  325. #define VR4102_LEDASTCREG    VR4102_ADRS(0x24a)
  326. #define VR4102_LEDINTREG    VR4102_ADRS(0x24c)
  327. /* SIU registers -- (16550-compatible registers not included) */
  328. #define VR4102_SIURSEL    VR4102_ADRS(0x01000008)
  329. /* HSP registers */
  330. #define VR4102_HSPINIT    VR4102_ADRS(0x01000020)
  331. #define VR4102_HSPDATA    VR4102_ADRS(0x01000022)
  332. #define VR4102_HSPINDEX    VR4102_ADRS(0x01000024)
  333. #define VR4102_HSPID    VR4102_ADRS(0x01000028)
  334. #define VR4102_HSPPCS    VR4102_ADRS(0x01000029)
  335. #define VR4102_HSPPCTEL    VR4102_ADRS(0x01000029)
  336. #ifdef __cplusplus
  337. }
  338. #endif
  339. #endif /* __INCnvr4102h */