LPC24xx.h 75 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201
  1. /*
  2. * File : LPC2478.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Develop Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://openlab.rt-thread.com/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2008-12-11 xuxinming first version
  13. */
  14. #ifndef __LPC24xx_H
  15. #define __LPC24xx_H
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #define USERMODE 0x10
  20. #define FIQMODE 0x11
  21. #define IRQMODE 0x12
  22. #define SVCMODE 0x13
  23. #define ABORTMODE 0x17
  24. #define UNDEFMODE 0x1b
  25. #define MODEMASK 0x1f
  26. #define NOINT 0xc0
  27. #define MCLK (72000000)
  28. /* Vectored Interrupt Controller (VIC) */
  29. #define VIC_BASE_ADDR 0xFFFFF000
  30. #define VICIRQStatus (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x000))
  31. #define VICFIQStatus (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x004))
  32. #define VICRawIntr (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x008))
  33. #define VICIntSelect (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x00C))
  34. #define VICIntEnable (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x010))
  35. #define VICIntEnClr (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x014))
  36. #define VICSoftInt (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x018))
  37. #define VICSoftIntClr (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x01C))
  38. #define VICProtection (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x020))
  39. #define VICSWPrioMask (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x024))
  40. #define VICVectAddr0 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x100))
  41. #define VICVectAddr1 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x104))
  42. #define VICVectAddr2 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x108))
  43. #define VICVectAddr3 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x10C))
  44. #define VICVectAddr4 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x110))
  45. #define VICVectAddr5 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x114))
  46. #define VICVectAddr6 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x118))
  47. #define VICVectAddr7 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x11C))
  48. #define VICVectAddr8 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x120))
  49. #define VICVectAddr9 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x124))
  50. #define VICVectAddr10 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x128))
  51. #define VICVectAddr11 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x12C))
  52. #define VICVectAddr12 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x130))
  53. #define VICVectAddr13 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x134))
  54. #define VICVectAddr14 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x138))
  55. #define VICVectAddr15 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x13C))
  56. #define VICVectAddr16 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x140))
  57. #define VICVectAddr17 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x144))
  58. #define VICVectAddr18 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x148))
  59. #define VICVectAddr19 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x14C))
  60. #define VICVectAddr20 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x150))
  61. #define VICVectAddr21 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x154))
  62. #define VICVectAddr22 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x158))
  63. #define VICVectAddr23 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x15C))
  64. #define VICVectAddr24 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x160))
  65. #define VICVectAddr25 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x164))
  66. #define VICVectAddr26 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x168))
  67. #define VICVectAddr27 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x16C))
  68. #define VICVectAddr28 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x170))
  69. #define VICVectAddr29 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x174))
  70. #define VICVectAddr30 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x178))
  71. #define VICVectAddr31 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x17C))
  72. /* The name convention below is from previous LPC2000 family MCUs, in LPC23xx/24xx,
  73. these registers are known as "VICVectPriority(x)". */
  74. #define VICVectCntl0 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x200))
  75. #define VICVectCntl1 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x204))
  76. #define VICVectCntl2 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x208))
  77. #define VICVectCntl3 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x20C))
  78. #define VICVectCntl4 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x210))
  79. #define VICVectCntl5 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x214))
  80. #define VICVectCntl6 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x218))
  81. #define VICVectCntl7 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x21C))
  82. #define VICVectCntl8 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x220))
  83. #define VICVectCntl9 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x224))
  84. #define VICVectCntl10 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x228))
  85. #define VICVectCntl11 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x22C))
  86. #define VICVectCntl12 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x230))
  87. #define VICVectCntl13 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x234))
  88. #define VICVectCntl14 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x238))
  89. #define VICVectCntl15 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x23C))
  90. #define VICVectCntl16 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x240))
  91. #define VICVectCntl17 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x244))
  92. #define VICVectCntl18 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x248))
  93. #define VICVectCntl19 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x24C))
  94. #define VICVectCntl20 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x250))
  95. #define VICVectCntl21 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x254))
  96. #define VICVectCntl22 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x258))
  97. #define VICVectCntl23 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x25C))
  98. #define VICVectCntl24 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x260))
  99. #define VICVectCntl25 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x264))
  100. #define VICVectCntl26 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x268))
  101. #define VICVectCntl27 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x26C))
  102. #define VICVectCntl28 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x270))
  103. #define VICVectCntl29 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x274))
  104. #define VICVectCntl30 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x278))
  105. #define VICVectCntl31 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x27C))
  106. #define VICVectAddr (*(volatile unsigned long *)(VIC_BASE_ADDR + 0xF00))
  107. /* Pin Connect Block */
  108. #define PINSEL_BASE_ADDR 0xE002C000
  109. #define PINSEL0 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x00))
  110. #define PINSEL1 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x04))
  111. #define PINSEL2 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x08))
  112. #define PINSEL3 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x0C))
  113. #define PINSEL4 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x10))
  114. #define PINSEL5 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x14))
  115. #define PINSEL6 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x18))
  116. #define PINSEL7 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x1C))
  117. #define PINSEL8 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x20))
  118. #define PINSEL9 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x24))
  119. #define PINSEL10 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x28))
  120. #define PINSEL11 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x2C))
  121. #define PINMODE0 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x40))
  122. #define PINMODE1 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x44))
  123. #define PINMODE2 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x48))
  124. #define PINMODE3 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x4C))
  125. #define PINMODE4 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x50))
  126. #define PINMODE5 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x54))
  127. #define PINMODE6 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x58))
  128. #define PINMODE7 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x5C))
  129. #define PINMODE8 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x60))
  130. #define PINMODE9 (*(volatile unsigned long *)(PINSEL_BASE_ADDR + 0x64))
  131. /* General Purpose Input/Output (GPIO) */
  132. #define GPIO_BASE_ADDR 0xE0028000
  133. #define IOPIN0 (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x00))
  134. #define IOSET0 (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x04))
  135. #define IODIR0 (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x08))
  136. #define IOCLR0 (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x0C))
  137. #define IOPIN1 (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x10))
  138. #define IOSET1 (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x14))
  139. #define IODIR1 (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x18))
  140. #define IOCLR1 (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x1C))
  141. /* GPIO Interrupt Registers */
  142. #define IO0_INT_EN_R (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x90))
  143. #define IO0_INT_EN_F (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x94))
  144. #define IO0_INT_STAT_R (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x84))
  145. #define IO0_INT_STAT_F (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x88))
  146. #define IO0_INT_CLR (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x8C))
  147. #define IO2_INT_EN_R (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0xB0))
  148. #define IO2_INT_EN_F (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0xB4))
  149. #define IO2_INT_STAT_R (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0xA4))
  150. #define IO2_INT_STAT_F (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0xA8))
  151. #define IO2_INT_CLR (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0xAC))
  152. #define IO_INT_STAT (*(volatile unsigned long *)(GPIO_BASE_ADDR + 0x80))
  153. #define PARTCFG_BASE_ADDR 0x3FFF8000
  154. #define PARTCFG (*(volatile unsigned long *)(PARTCFG_BASE_ADDR + 0x00))
  155. /* Fast I/O setup */
  156. #define FIO_BASE_ADDR 0x3FFFC000
  157. #define FIO0DIR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x00))
  158. #define FIO0MASK (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x10))
  159. #define FIO0PIN (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x14))
  160. #define FIO0SET (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x18))
  161. #define FIO0CLR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x1C))
  162. #define FIO1DIR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x20))
  163. #define FIO1MASK (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x30))
  164. #define FIO1PIN (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x34))
  165. #define FIO1SET (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x38))
  166. #define FIO1CLR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x3C))
  167. #define FIO2DIR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x40))
  168. #define FIO2MASK (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x50))
  169. #define FIO2PIN (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x54))
  170. #define FIO2SET (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x58))
  171. #define FIO2CLR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x5C))
  172. #define FIO3DIR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x60))
  173. #define FIO3MASK (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x70))
  174. #define FIO3PIN (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x74))
  175. #define FIO3SET (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x78))
  176. #define FIO3CLR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x7C))
  177. #define FIO4DIR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x80))
  178. #define FIO4MASK (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x90))
  179. #define FIO4PIN (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x94))
  180. #define FIO4SET (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x98))
  181. #define FIO4CLR (*(volatile unsigned long *)(FIO_BASE_ADDR + 0x9C))
  182. /* FIOs can be accessed through WORD, HALF-WORD or BYTE. */
  183. #define FIO0DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x00))
  184. #define FIO1DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x20))
  185. #define FIO2DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x40))
  186. #define FIO3DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x60))
  187. #define FIO4DIR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x80))
  188. #define FIO0DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x01))
  189. #define FIO1DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x21))
  190. #define FIO2DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x41))
  191. #define FIO3DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x61))
  192. #define FIO4DIR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x81))
  193. #define FIO0DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x02))
  194. #define FIO1DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x22))
  195. #define FIO2DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x42))
  196. #define FIO3DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x62))
  197. #define FIO4DIR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x82))
  198. #define FIO0DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x03))
  199. #define FIO1DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x23))
  200. #define FIO2DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x43))
  201. #define FIO3DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x63))
  202. #define FIO4DIR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x83))
  203. #define FIO0DIRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x00))
  204. #define FIO1DIRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x20))
  205. #define FIO2DIRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x40))
  206. #define FIO3DIRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x60))
  207. #define FIO4DIRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x80))
  208. #define FIO0DIRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x02))
  209. #define FIO1DIRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x22))
  210. #define FIO2DIRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x42))
  211. #define FIO3DIRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x62))
  212. #define FIO4DIRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x82))
  213. #define FIO0MASK0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x10))
  214. #define FIO1MASK0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x30))
  215. #define FIO2MASK0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x50))
  216. #define FIO3MASK0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x70))
  217. #define FIO4MASK0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x90))
  218. #define FIO0MASK1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x11))
  219. #define FIO1MASK1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x21))
  220. #define FIO2MASK1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x51))
  221. #define FIO3MASK1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x71))
  222. #define FIO4MASK1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x91))
  223. #define FIO0MASK2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x12))
  224. #define FIO1MASK2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x32))
  225. #define FIO2MASK2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x52))
  226. #define FIO3MASK2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x72))
  227. #define FIO4MASK2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x92))
  228. #define FIO0MASK3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x13))
  229. #define FIO1MASK3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x33))
  230. #define FIO2MASK3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x53))
  231. #define FIO3MASK3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x73))
  232. #define FIO4MASK3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x93))
  233. #define FIO0MASKL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x10))
  234. #define FIO1MASKL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x30))
  235. #define FIO2MASKL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x50))
  236. #define FIO3MASKL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x70))
  237. #define FIO4MASKL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x90))
  238. #define FIO0MASKU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x12))
  239. #define FIO1MASKU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x32))
  240. #define FIO2MASKU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x52))
  241. #define FIO3MASKU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x72))
  242. #define FIO4MASKU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x92))
  243. #define FIO0PIN0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x14))
  244. #define FIO1PIN0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x34))
  245. #define FIO2PIN0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x54))
  246. #define FIO3PIN0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x74))
  247. #define FIO4PIN0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x94))
  248. #define FIO0PIN1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x15))
  249. #define FIO1PIN1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x35))
  250. #define FIO2PIN1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x55))
  251. #define FIO3PIN1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x75))
  252. #define FIO4PIN1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x95))
  253. #define FIO0PIN2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x16))
  254. #define FIO1PIN2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x36))
  255. #define FIO2PIN2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x56))
  256. #define FIO3PIN2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x76))
  257. #define FIO4PIN2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x96))
  258. #define FIO0PIN3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x17))
  259. #define FIO1PIN3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x37))
  260. #define FIO2PIN3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x57))
  261. #define FIO3PIN3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x77))
  262. #define FIO4PIN3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x97))
  263. #define FIO0PINL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x14))
  264. #define FIO1PINL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x34))
  265. #define FIO2PINL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x54))
  266. #define FIO3PINL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x74))
  267. #define FIO4PINL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x94))
  268. #define FIO0PINU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x16))
  269. #define FIO1PINU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x36))
  270. #define FIO2PINU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x56))
  271. #define FIO3PINU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x76))
  272. #define FIO4PINU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x96))
  273. #define FIO0SET0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x18))
  274. #define FIO1SET0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x38))
  275. #define FIO2SET0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x58))
  276. #define FIO3SET0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x78))
  277. #define FIO4SET0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x98))
  278. #define FIO0SET1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x19))
  279. #define FIO1SET1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x29))
  280. #define FIO2SET1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x59))
  281. #define FIO3SET1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x79))
  282. #define FIO4SET1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x99))
  283. #define FIO0SET2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x1A))
  284. #define FIO1SET2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x3A))
  285. #define FIO2SET2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x5A))
  286. #define FIO3SET2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x7A))
  287. #define FIO4SET2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x9A))
  288. #define FIO0SET3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x1B))
  289. #define FIO1SET3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x3B))
  290. #define FIO2SET3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x5B))
  291. #define FIO3SET3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x7B))
  292. #define FIO4SET3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x9B))
  293. #define FIO0SETL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x18))
  294. #define FIO1SETL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x38))
  295. #define FIO2SETL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x58))
  296. #define FIO3SETL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x78))
  297. #define FIO4SETL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x98))
  298. #define FIO0SETU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x1A))
  299. #define FIO1SETU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x3A))
  300. #define FIO2SETU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x5A))
  301. #define FIO3SETU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x7A))
  302. #define FIO4SETU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x9A))
  303. #define FIO0CLR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x1C))
  304. #define FIO1CLR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x3C))
  305. #define FIO2CLR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x5C))
  306. #define FIO3CLR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x7C))
  307. #define FIO4CLR0 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x9C))
  308. #define FIO0CLR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x1D))
  309. #define FIO1CLR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x2D))
  310. #define FIO2CLR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x5D))
  311. #define FIO3CLR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x7D))
  312. #define FIO4CLR1 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x9D))
  313. #define FIO0CLR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x1E))
  314. #define FIO1CLR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x3E))
  315. #define FIO2CLR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x5E))
  316. #define FIO3CLR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x7E))
  317. #define FIO4CLR2 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x9E))
  318. #define FIO0CLR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x1F))
  319. #define FIO1CLR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x3F))
  320. #define FIO2CLR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x5F))
  321. #define FIO3CLR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x7F))
  322. #define FIO4CLR3 (*(volatile unsigned char *)(FIO_BASE_ADDR + 0x9F))
  323. #define FIO0CLRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x1C))
  324. #define FIO1CLRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x3C))
  325. #define FIO2CLRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x5C))
  326. #define FIO3CLRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x7C))
  327. #define FIO4CLRL (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x9C))
  328. #define FIO0CLRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x1E))
  329. #define FIO1CLRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x3E))
  330. #define FIO2CLRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x5E))
  331. #define FIO3CLRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x7E))
  332. #define FIO4CLRU (*(volatile unsigned short *)(FIO_BASE_ADDR + 0x9E))
  333. /* System Control Block(SCB) modules include Memory Accelerator Module,
  334. Phase Locked Loop, VPB divider, Power Control, External Interrupt,
  335. Reset, and Code Security/Debugging */
  336. #define SCB_BASE_ADDR 0xE01FC000
  337. /* Memory Accelerator Module (MAM) */
  338. #define MAMCR (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x000))
  339. #define MAMTIM (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x004))
  340. #define MEMMAP (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x040))
  341. /* Phase Locked Loop (PLL) */
  342. #define PLLCON (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x080))
  343. #define PLLCFG (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x084))
  344. #define PLLSTAT (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x088))
  345. #define PLLFEED (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x08C))
  346. /* Power Control */
  347. #define PCON (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x0C0))
  348. #define PCONP (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x0C4))
  349. /* Clock Divider */
  350. #define CCLKCFG (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x104))
  351. #define USBCLKCFG (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x108))
  352. #define CLKSRCSEL (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x10C))
  353. #define PCLKSEL0 (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x1A8))
  354. #define PCLKSEL1 (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x1AC))
  355. /* External Interrupts */
  356. #define EXTINT (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x140))
  357. #define INTWAKE (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x144))
  358. #define EXTMODE (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x148))
  359. #define EXTPOLAR (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x14C))
  360. /* Reset, reset source identification */
  361. #define RSIR (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x180))
  362. /* RSID, code security protection */
  363. #define CSPR (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x184))
  364. /* AHB configuration */
  365. #define AHBCFG1 (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x188))
  366. #define AHBCFG2 (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x18C))
  367. /* System Controls and Status */
  368. #define SCS (*(volatile unsigned long *)(SCB_BASE_ADDR + 0x1A0))
  369. /* MPMC(EMC) registers, note: all the external memory controller(EMC) registers
  370. are for LPC24xx only. */
  371. #define STATIC_MEM0_BASE 0x80000000
  372. #define STATIC_MEM1_BASE 0x81000000
  373. #define STATIC_MEM2_BASE 0x82000000
  374. #define STATIC_MEM3_BASE 0x83000000
  375. #define DYNAMIC_MEM0_BASE 0xA0000000
  376. #define DYNAMIC_MEM1_BASE 0xB0000000
  377. #define DYNAMIC_MEM2_BASE 0xC0000000
  378. #define DYNAMIC_MEM3_BASE 0xD0000000
  379. /* External Memory Controller (EMC) */
  380. #define EMC_BASE_ADDR 0xFFE08000
  381. #define EMC_CTRL (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x000))
  382. #define EMC_STAT (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x004))
  383. #define EMC_CONFIG (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x008))
  384. /* Dynamic RAM access registers */
  385. #define EMC_DYN_CTRL (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x020))
  386. #define EMC_DYN_RFSH (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x024))
  387. #define EMC_DYN_RD_CFG (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x028))
  388. #define EMC_DYN_RP (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x030))
  389. #define EMC_DYN_RAS (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x034))
  390. #define EMC_DYN_SREX (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x038))
  391. #define EMC_DYN_APR (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x03C))
  392. #define EMC_DYN_DAL (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x040))
  393. #define EMC_DYN_WR (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x044))
  394. #define EMC_DYN_RC (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x048))
  395. #define EMC_DYN_RFC (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x04C))
  396. #define EMC_DYN_XSR (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x050))
  397. #define EMC_DYN_RRD (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x054))
  398. #define EMC_DYN_MRD (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x058))
  399. #define EMC_DYN_CFG0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x100))
  400. #define EMC_DYN_RASCAS0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x104))
  401. #define EMC_DYN_CFG1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x140))
  402. #define EMC_DYN_RASCAS1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x144))
  403. #define EMC_DYN_CFG2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x160))
  404. #define EMC_DYN_RASCAS2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x164))
  405. #define EMC_DYN_CFG3 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x180))
  406. #define EMC_DYN_RASCAS3 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x184))
  407. /* static RAM access registers */
  408. #define EMC_STA_CFG0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x200))
  409. #define EMC_STA_WAITWEN0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x204))
  410. #define EMC_STA_WAITOEN0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x208))
  411. #define EMC_STA_WAITRD0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x20C))
  412. #define EMC_STA_WAITPAGE0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x210))
  413. #define EMC_STA_WAITWR0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x214))
  414. #define EMC_STA_WAITTURN0 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x218))
  415. #define EMC_STA_CFG1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x220))
  416. #define EMC_STA_WAITWEN1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x224))
  417. #define EMC_STA_WAITOEN1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x228))
  418. #define EMC_STA_WAITRD1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x22C))
  419. #define EMC_STA_WAITPAGE1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x230))
  420. #define EMC_STA_WAITWR1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x234))
  421. #define EMC_STA_WAITTURN1 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x238))
  422. #define EMC_STA_CFG2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x240))
  423. #define EMC_STA_WAITWEN2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x244))
  424. #define EMC_STA_WAITOEN2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x248))
  425. #define EMC_STA_WAITRD2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x24C))
  426. #define EMC_STA_WAITPAGE2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x250))
  427. #define EMC_STA_WAITWR2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x254))
  428. #define EMC_STA_WAITTURN2 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x258))
  429. #define EMC_STA_CFG3 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x260))
  430. #define EMC_STA_WAITWEN3 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x264))
  431. #define EMC_STA_WAITOEN3 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x268))
  432. #define EMC_STA_WAITRD3 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x26C))
  433. #define EMC_STA_WAITPAGE3 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x270))
  434. #define EMC_STA_WAITWR3 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x274))
  435. #define EMC_STA_WAITTURN3 (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x278))
  436. #define EMC_STA_EXT_WAIT (*(volatile unsigned long *)(EMC_BASE_ADDR + 0x880))
  437. /* Timer 0 */
  438. #define TMR0_BASE_ADDR 0xE0004000
  439. #define T0IR (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x00))
  440. #define T0TCR (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x04))
  441. #define T0TC (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x08))
  442. #define T0PR (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x0C))
  443. #define T0PC (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x10))
  444. #define T0MCR (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x14))
  445. #define T0MR0 (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x18))
  446. #define T0MR1 (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x1C))
  447. #define T0MR2 (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x20))
  448. #define T0MR3 (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x24))
  449. #define T0CCR (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x28))
  450. #define T0CR0 (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x2C))
  451. #define T0CR1 (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x30))
  452. #define T0CR2 (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x34))
  453. #define T0CR3 (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x38))
  454. #define T0EMR (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x3C))
  455. #define T0CTCR (*(volatile unsigned long *)(TMR0_BASE_ADDR + 0x70))
  456. /* Timer 1 */
  457. #define TMR1_BASE_ADDR 0xE0008000
  458. #define T1IR (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x00))
  459. #define T1TCR (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x04))
  460. #define T1TC (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x08))
  461. #define T1PR (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x0C))
  462. #define T1PC (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x10))
  463. #define T1MCR (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x14))
  464. #define T1MR0 (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x18))
  465. #define T1MR1 (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x1C))
  466. #define T1MR2 (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x20))
  467. #define T1MR3 (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x24))
  468. #define T1CCR (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x28))
  469. #define T1CR0 (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x2C))
  470. #define T1CR1 (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x30))
  471. #define T1CR2 (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x34))
  472. #define T1CR3 (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x38))
  473. #define T1EMR (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x3C))
  474. #define T1CTCR (*(volatile unsigned long *)(TMR1_BASE_ADDR + 0x70))
  475. /* Timer 2 */
  476. #define TMR2_BASE_ADDR 0xE0070000
  477. #define T2IR (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x00))
  478. #define T2TCR (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x04))
  479. #define T2TC (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x08))
  480. #define T2PR (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x0C))
  481. #define T2PC (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x10))
  482. #define T2MCR (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x14))
  483. #define T2MR0 (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x18))
  484. #define T2MR1 (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x1C))
  485. #define T2MR2 (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x20))
  486. #define T2MR3 (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x24))
  487. #define T2CCR (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x28))
  488. #define T2CR0 (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x2C))
  489. #define T2CR1 (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x30))
  490. #define T2CR2 (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x34))
  491. #define T2CR3 (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x38))
  492. #define T2EMR (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x3C))
  493. #define T2CTCR (*(volatile unsigned long *)(TMR2_BASE_ADDR + 0x70))
  494. /* Timer 3 */
  495. #define TMR3_BASE_ADDR 0xE0074000
  496. #define T3IR (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x00))
  497. #define T3TCR (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x04))
  498. #define T3TC (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x08))
  499. #define T3PR (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x0C))
  500. #define T3PC (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x10))
  501. #define T3MCR (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x14))
  502. #define T3MR0 (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x18))
  503. #define T3MR1 (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x1C))
  504. #define T3MR2 (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x20))
  505. #define T3MR3 (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x24))
  506. #define T3CCR (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x28))
  507. #define T3CR0 (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x2C))
  508. #define T3CR1 (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x30))
  509. #define T3CR2 (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x34))
  510. #define T3CR3 (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x38))
  511. #define T3EMR (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x3C))
  512. #define T3CTCR (*(volatile unsigned long *)(TMR3_BASE_ADDR + 0x70))
  513. /* Pulse Width Modulator (PWM) */
  514. #define PWM0_BASE_ADDR 0xE0014000
  515. #define PWM0IR (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x00))
  516. #define PWM0TCR (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x04))
  517. #define PWM0TC (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x08))
  518. #define PWM0PR (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x0C))
  519. #define PWM0PC (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x10))
  520. #define PWM0MCR (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x14))
  521. #define PWM0MR0 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x18))
  522. #define PWM0MR1 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x1C))
  523. #define PWM0MR2 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x20))
  524. #define PWM0MR3 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x24))
  525. #define PWM0CCR (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x28))
  526. #define PWM0CR0 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x2C))
  527. #define PWM0CR1 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x30))
  528. #define PWM0CR2 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x34))
  529. #define PWM0CR3 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x38))
  530. #define PWM0EMR (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x3C))
  531. #define PWM0MR4 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x40))
  532. #define PWM0MR5 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x44))
  533. #define PWM0MR6 (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x48))
  534. #define PWM0PCR (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x4C))
  535. #define PWM0LER (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x50))
  536. #define PWM0CTCR (*(volatile unsigned long *)(PWM0_BASE_ADDR + 0x70))
  537. #define PWM1_BASE_ADDR 0xE0018000
  538. #define PWM1IR (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x00))
  539. #define PWM1TCR (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x04))
  540. #define PWM1TC (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x08))
  541. #define PWM1PR (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x0C))
  542. #define PWM1PC (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x10))
  543. #define PWM1MCR (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x14))
  544. #define PWM1MR0 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x18))
  545. #define PWM1MR1 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x1C))
  546. #define PWM1MR2 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x20))
  547. #define PWM1MR3 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x24))
  548. #define PWM1CCR (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x28))
  549. #define PWM1CR0 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x2C))
  550. #define PWM1CR1 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x30))
  551. #define PWM1CR2 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x34))
  552. #define PWM1CR3 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x38))
  553. #define PWM1EMR (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x3C))
  554. #define PWM1MR4 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x40))
  555. #define PWM1MR5 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x44))
  556. #define PWM1MR6 (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x48))
  557. #define PWM1PCR (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x4C))
  558. #define PWM1LER (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x50))
  559. #define PWM1CTCR (*(volatile unsigned long *)(PWM1_BASE_ADDR + 0x70))
  560. /* Universal Asynchronous Receiver Transmitter 0 (UART0) */
  561. #define UART0_BASE_ADDR 0xE000C000
  562. #define U0RBR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x00))
  563. #define U0THR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x00))
  564. #define U0DLL (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x00))
  565. #define U0DLM (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x04))
  566. #define U0IER (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x04))
  567. #define U0IIR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x08))
  568. #define U0FCR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x08))
  569. #define U0LCR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x0C))
  570. #define U0LSR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x14))
  571. #define U0SCR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x1C))
  572. #define U0ACR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x20))
  573. #define U0ICR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x24))
  574. #define U0FDR (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x28))
  575. #define U0TER (*(volatile unsigned long *)(UART0_BASE_ADDR + 0x30))
  576. /* Universal Asynchronous Receiver Transmitter 1 (UART1) */
  577. #define UART1_BASE_ADDR 0xE0010000
  578. #define U1RBR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x00))
  579. #define U1THR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x00))
  580. #define U1DLL (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x00))
  581. #define U1DLM (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x04))
  582. #define U1IER (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x04))
  583. #define U1IIR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x08))
  584. #define U1FCR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x08))
  585. #define U1LCR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x0C))
  586. #define U1MCR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x10))
  587. #define U1LSR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x14))
  588. #define U1MSR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x18))
  589. #define U1SCR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x1C))
  590. #define U1ACR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x20))
  591. #define U1FDR (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x28))
  592. #define U1TER (*(volatile unsigned long *)(UART1_BASE_ADDR + 0x30))
  593. /* Universal Asynchronous Receiver Transmitter 2 (UART2) */
  594. #define UART2_BASE_ADDR 0xE0078000
  595. #define U2RBR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x00))
  596. #define U2THR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x00))
  597. #define U2DLL (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x00))
  598. #define U2DLM (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x04))
  599. #define U2IER (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x04))
  600. #define U2IIR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x08))
  601. #define U2FCR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x08))
  602. #define U2LCR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x0C))
  603. #define U2LSR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x14))
  604. #define U2SCR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x1C))
  605. #define U2ACR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x20))
  606. #define U2ICR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x24))
  607. #define U2FDR (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x28))
  608. #define U2TER (*(volatile unsigned long *)(UART2_BASE_ADDR + 0x30))
  609. /* Universal Asynchronous Receiver Transmitter 3 (UART3) */
  610. #define UART3_BASE_ADDR 0xE007C000
  611. #define U3RBR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x00))
  612. #define U3THR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x00))
  613. #define U3DLL (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x00))
  614. #define U3DLM (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x04))
  615. #define U3IER (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x04))
  616. #define U3IIR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x08))
  617. #define U3FCR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x08))
  618. #define U3LCR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x0C))
  619. #define U3LSR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x14))
  620. #define U3SCR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x1C))
  621. #define U3ACR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x20))
  622. #define U3ICR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x24))
  623. #define U3FDR (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x28))
  624. #define U3TER (*(volatile unsigned long *)(UART3_BASE_ADDR + 0x30))
  625. /* I2C Interface 0 */
  626. #define I2C0_BASE_ADDR 0xE001C000
  627. #define I20CONSET (*(volatile unsigned long *)(I2C0_BASE_ADDR + 0x00))
  628. #define I20STAT (*(volatile unsigned long *)(I2C0_BASE_ADDR + 0x04))
  629. #define I20DAT (*(volatile unsigned long *)(I2C0_BASE_ADDR + 0x08))
  630. #define I20ADR (*(volatile unsigned long *)(I2C0_BASE_ADDR + 0x0C))
  631. #define I20SCLH (*(volatile unsigned long *)(I2C0_BASE_ADDR + 0x10))
  632. #define I20SCLL (*(volatile unsigned long *)(I2C0_BASE_ADDR + 0x14))
  633. #define I20CONCLR (*(volatile unsigned long *)(I2C0_BASE_ADDR + 0x18))
  634. /* I2C Interface 1 */
  635. #define I2C1_BASE_ADDR 0xE005C000
  636. #define I21CONSET (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x00))
  637. #define I21STAT (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x04))
  638. #define I21DAT (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x08))
  639. #define I21ADR (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x0C))
  640. #define I21SCLH (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x10))
  641. #define I21SCLL (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x14))
  642. #define I21CONCLR (*(volatile unsigned long *)(I2C1_BASE_ADDR + 0x18))
  643. /* I2C Interface 2 */
  644. #define I2C2_BASE_ADDR 0xE0080000
  645. #define I22CONSET (*(volatile unsigned long *)(I2C2_BASE_ADDR + 0x00))
  646. #define I22STAT (*(volatile unsigned long *)(I2C2_BASE_ADDR + 0x04))
  647. #define I22DAT (*(volatile unsigned long *)(I2C2_BASE_ADDR + 0x08))
  648. #define I22ADR (*(volatile unsigned long *)(I2C2_BASE_ADDR + 0x0C))
  649. #define I22SCLH (*(volatile unsigned long *)(I2C2_BASE_ADDR + 0x10))
  650. #define I22SCLL (*(volatile unsigned long *)(I2C2_BASE_ADDR + 0x14))
  651. #define I22CONCLR (*(volatile unsigned long *)(I2C2_BASE_ADDR + 0x18))
  652. /* SPI0 (Serial Peripheral Interface 0) */
  653. #define SPI0_BASE_ADDR 0xE0020000
  654. #define S0SPCR (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x00))
  655. #define S0SPSR (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x04))
  656. #define S0SPDR (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x08))
  657. #define S0SPCCR (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x0C))
  658. #define S0SPINT (*(volatile unsigned long *)(SPI0_BASE_ADDR + 0x1C))
  659. /* SSP0 Controller */
  660. #define SSP0_BASE_ADDR 0xE0068000
  661. #define SSP0CR0 (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x00))
  662. #define SSP0CR1 (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x04))
  663. #define SSP0DR (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x08))
  664. #define SSP0SR (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x0C))
  665. #define SSP0CPSR (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x10))
  666. #define SSP0IMSC (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x14))
  667. #define SSP0RIS (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x18))
  668. #define SSP0MIS (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x1C))
  669. #define SSP0ICR (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x20))
  670. #define SSP0DMACR (*(volatile unsigned long *)(SSP0_BASE_ADDR + 0x24))
  671. /* SSP1 Controller */
  672. #define SSP1_BASE_ADDR 0xE0030000
  673. #define SSP1CR0 (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x00))
  674. #define SSP1CR1 (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x04))
  675. #define SSP1DR (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x08))
  676. #define SSP1SR (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x0C))
  677. #define SSP1CPSR (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x10))
  678. #define SSP1IMSC (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x14))
  679. #define SSP1RIS (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x18))
  680. #define SSP1MIS (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x1C))
  681. #define SSP1ICR (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x20))
  682. #define SSP1DMACR (*(volatile unsigned long *)(SSP1_BASE_ADDR + 0x24))
  683. /* Real Time Clock */
  684. #define RTC_BASE_ADDR 0xE0024000
  685. #define RTC_ILR (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x00))
  686. #define RTC_CTC (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x04))
  687. #define RTC_CCR (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x08))
  688. #define RTC_CIIR (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x0C))
  689. #define RTC_AMR (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x10))
  690. #define RTC_CTIME0 (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x14))
  691. #define RTC_CTIME1 (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x18))
  692. #define RTC_CTIME2 (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x1C))
  693. #define RTC_SEC (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x20))
  694. #define RTC_MIN (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x24))
  695. #define RTC_HOUR (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x28))
  696. #define RTC_DOM (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x2C))
  697. #define RTC_DOW (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x30))
  698. #define RTC_DOY (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x34))
  699. #define RTC_MONTH (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x38))
  700. #define RTC_YEAR (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x3C))
  701. #define RTC_CISS (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x40))
  702. #define RTC_ALSEC (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x60))
  703. #define RTC_ALMIN (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x64))
  704. #define RTC_ALHOUR (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x68))
  705. #define RTC_ALDOM (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x6C))
  706. #define RTC_ALDOW (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x70))
  707. #define RTC_ALDOY (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x74))
  708. #define RTC_ALMON (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x78))
  709. #define RTC_ALYEAR (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x7C))
  710. #define RTC_PREINT (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x80))
  711. #define RTC_PREFRAC (*(volatile unsigned long *)(RTC_BASE_ADDR + 0x84))
  712. /* A/D Converter 0 (AD0) */
  713. #define AD0_BASE_ADDR 0xE0034000
  714. #define AD0CR (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x00))
  715. #define AD0GDR (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x04))
  716. #define AD0INTEN (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x0C))
  717. #define AD0DR0 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x10))
  718. #define AD0DR1 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x14))
  719. #define AD0DR2 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x18))
  720. #define AD0DR3 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x1C))
  721. #define AD0DR4 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x20))
  722. #define AD0DR5 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x24))
  723. #define AD0DR6 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x28))
  724. #define AD0DR7 (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x2C))
  725. #define AD0STAT (*(volatile unsigned long *)(AD0_BASE_ADDR + 0x30))
  726. /* D/A Converter */
  727. #define DAC_BASE_ADDR 0xE006C000
  728. #define DACR (*(volatile unsigned long *)(DAC_BASE_ADDR + 0x00))
  729. /* Watchdog */
  730. #define WDG_BASE_ADDR 0xE0000000
  731. #define WDMOD (*(volatile unsigned long *)(WDG_BASE_ADDR + 0x00))
  732. #define WDTC (*(volatile unsigned long *)(WDG_BASE_ADDR + 0x04))
  733. #define WDFEED (*(volatile unsigned long *)(WDG_BASE_ADDR + 0x08))
  734. #define WDTV (*(volatile unsigned long *)(WDG_BASE_ADDR + 0x0C))
  735. #define WDCLKSEL (*(volatile unsigned long *)(WDG_BASE_ADDR + 0x10))
  736. /* CAN CONTROLLERS AND ACCEPTANCE FILTER */
  737. #define CAN_ACCEPT_BASE_ADDR 0xE003C000
  738. #define CAN_AFMR (*(volatile unsigned long *)(CAN_ACCEPT_BASE_ADDR + 0x00))
  739. #define CAN_SFF_SA (*(volatile unsigned long *)(CAN_ACCEPT_BASE_ADDR + 0x04))
  740. #define CAN_SFF_GRP_SA (*(volatile unsigned long *)(CAN_ACCEPT_BASE_ADDR + 0x08))
  741. #define CAN_EFF_SA (*(volatile unsigned long *)(CAN_ACCEPT_BASE_ADDR + 0x0C))
  742. #define CAN_EFF_GRP_SA (*(volatile unsigned long *)(CAN_ACCEPT_BASE_ADDR + 0x10))
  743. #define CAN_EOT (*(volatile unsigned long *)(CAN_ACCEPT_BASE_ADDR + 0x14))
  744. #define CAN_LUT_ERR_ADR (*(volatile unsigned long *)(CAN_ACCEPT_BASE_ADDR + 0x18))
  745. #define CAN_LUT_ERR (*(volatile unsigned long *)(CAN_ACCEPT_BASE_ADDR + 0x1C))
  746. #define CAN_CENTRAL_BASE_ADDR 0xE0040000
  747. #define CAN_TX_SR (*(volatile unsigned long *)(CAN_CENTRAL_BASE_ADDR + 0x00))
  748. #define CAN_RX_SR (*(volatile unsigned long *)(CAN_CENTRAL_BASE_ADDR + 0x04))
  749. #define CAN_MSR (*(volatile unsigned long *)(CAN_CENTRAL_BASE_ADDR + 0x08))
  750. #define CAN1_BASE_ADDR 0xE0044000
  751. #define CAN1MOD (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x00))
  752. #define CAN1CMR (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x04))
  753. #define CAN1GSR (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x08))
  754. #define CAN1ICR (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x0C))
  755. #define CAN1IER (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x10))
  756. #define CAN1BTR (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x14))
  757. #define CAN1EWL (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x18))
  758. #define CAN1SR (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x1C))
  759. #define CAN1RFS (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x20))
  760. #define CAN1RID (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x24))
  761. #define CAN1RDA (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x28))
  762. #define CAN1RDB (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x2C))
  763. #define CAN1TFI1 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x30))
  764. #define CAN1TID1 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x34))
  765. #define CAN1TDA1 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x38))
  766. #define CAN1TDB1 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x3C))
  767. #define CAN1TFI2 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x40))
  768. #define CAN1TID2 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x44))
  769. #define CAN1TDA2 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x48))
  770. #define CAN1TDB2 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x4C))
  771. #define CAN1TFI3 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x50))
  772. #define CAN1TID3 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x54))
  773. #define CAN1TDA3 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x58))
  774. #define CAN1TDB3 (*(volatile unsigned long *)(CAN1_BASE_ADDR + 0x5C))
  775. #define CAN2_BASE_ADDR 0xE0048000
  776. #define CAN2MOD (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x00))
  777. #define CAN2CMR (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x04))
  778. #define CAN2GSR (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x08))
  779. #define CAN2ICR (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x0C))
  780. #define CAN2IER (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x10))
  781. #define CAN2BTR (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x14))
  782. #define CAN2EWL (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x18))
  783. #define CAN2SR (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x1C))
  784. #define CAN2RFS (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x20))
  785. #define CAN2RID (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x24))
  786. #define CAN2RDA (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x28))
  787. #define CAN2RDB (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x2C))
  788. #define CAN2TFI1 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x30))
  789. #define CAN2TID1 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x34))
  790. #define CAN2TDA1 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x38))
  791. #define CAN2TDB1 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x3C))
  792. #define CAN2TFI2 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x40))
  793. #define CAN2TID2 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x44))
  794. #define CAN2TDA2 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x48))
  795. #define CAN2TDB2 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x4C))
  796. #define CAN2TFI3 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x50))
  797. #define CAN2TID3 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x54))
  798. #define CAN2TDA3 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x58))
  799. #define CAN2TDB3 (*(volatile unsigned long *)(CAN2_BASE_ADDR + 0x5C))
  800. /* MultiMedia Card Interface(MCI) Controller */
  801. #define MCI_BASE_ADDR 0xE008C000
  802. #define MCI_POWER (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x00))
  803. #define MCI_CLOCK (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x04))
  804. #define MCI_ARGUMENT (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x08))
  805. #define MCI_COMMAND (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x0C))
  806. #define MCI_RESP_CMD (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x10))
  807. #define MCI_RESP0 (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x14))
  808. #define MCI_RESP1 (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x18))
  809. #define MCI_RESP2 (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x1C))
  810. #define MCI_RESP3 (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x20))
  811. #define MCI_DATA_TMR (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x24))
  812. #define MCI_DATA_LEN (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x28))
  813. #define MCI_DATA_CTRL (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x2C))
  814. #define MCI_DATA_CNT (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x30))
  815. #define MCI_STATUS (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x34))
  816. #define MCI_CLEAR (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x38))
  817. #define MCI_MASK0 (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x3C))
  818. #define MCI_MASK1 (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x40))
  819. #define MCI_FIFO_CNT (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x48))
  820. #define MCI_FIFO (*(volatile unsigned long *)(MCI_BASE_ADDR + 0x80))
  821. /* I2S Interface Controller (I2S) */
  822. #define I2S_BASE_ADDR 0xE0088000
  823. #define I2S_DAO (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x00))
  824. #define I2S_DAI (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x04))
  825. #define I2S_TX_FIFO (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x08))
  826. #define I2S_RX_FIFO (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x0C))
  827. #define I2S_STATE (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x10))
  828. #define I2S_DMA1 (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x14))
  829. #define I2S_DMA2 (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x18))
  830. #define I2S_IRQ (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x1C))
  831. #define I2S_TXRATE (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x20))
  832. #define I2S_RXRATE (*(volatile unsigned long *)(I2S_BASE_ADDR + 0x24))
  833. /* General-purpose DMA Controller */
  834. #define DMA_BASE_ADDR 0xFFE04000
  835. #define GPDMA_INT_STAT (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x000))
  836. #define GPDMA_INT_TCSTAT (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x004))
  837. #define GPDMA_INT_TCCLR (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x008))
  838. #define GPDMA_INT_ERR_STAT (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x00C))
  839. #define GPDMA_INT_ERR_CLR (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x010))
  840. #define GPDMA_RAW_INT_TCSTAT (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x014))
  841. #define GPDMA_RAW_INT_ERR_STAT (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x018))
  842. #define GPDMA_ENABLED_CHNS (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x01C))
  843. #define GPDMA_SOFT_BREQ (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x020))
  844. #define GPDMA_SOFT_SREQ (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x024))
  845. #define GPDMA_SOFT_LBREQ (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x028))
  846. #define GPDMA_SOFT_LSREQ (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x02C))
  847. #define GPDMA_CONFIG (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x030))
  848. #define GPDMA_SYNC (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x034))
  849. /* DMA channel 0 registers */
  850. #define GPDMA_CH0_SRC (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x100))
  851. #define GPDMA_CH0_DEST (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x104))
  852. #define GPDMA_CH0_LLI (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x108))
  853. #define GPDMA_CH0_CTRL (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x10C))
  854. #define GPDMA_CH0_CFG (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x110))
  855. /* DMA channel 1 registers */
  856. #define GPDMA_CH1_SRC (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x120))
  857. #define GPDMA_CH1_DEST (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x124))
  858. #define GPDMA_CH1_LLI (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x128))
  859. #define GPDMA_CH1_CTRL (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x12C))
  860. #define GPDMA_CH1_CFG (*(volatile unsigned long *)(DMA_BASE_ADDR + 0x130))
  861. /* USB Controller */
  862. #define USB_INT_BASE_ADDR 0xE01FC1C0
  863. #define USB_BASE_ADDR 0xFFE0C200 /* USB Base Address */
  864. #define USB_INT_STAT (*(volatile unsigned long *)(USB_INT_BASE_ADDR + 0x00))
  865. /* USB Device Interrupt Registers */
  866. #define DEV_INT_STAT (*(volatile unsigned long *)(USB_BASE_ADDR + 0x00))
  867. #define DEV_INT_EN (*(volatile unsigned long *)(USB_BASE_ADDR + 0x04))
  868. #define DEV_INT_CLR (*(volatile unsigned long *)(USB_BASE_ADDR + 0x08))
  869. #define DEV_INT_SET (*(volatile unsigned long *)(USB_BASE_ADDR + 0x0C))
  870. #define DEV_INT_PRIO (*(volatile unsigned long *)(USB_BASE_ADDR + 0x2C))
  871. /* USB Device Endpoint Interrupt Registers */
  872. #define EP_INT_STAT (*(volatile unsigned long *)(USB_BASE_ADDR + 0x30))
  873. #define EP_INT_EN (*(volatile unsigned long *)(USB_BASE_ADDR + 0x34))
  874. #define EP_INT_CLR (*(volatile unsigned long *)(USB_BASE_ADDR + 0x38))
  875. #define EP_INT_SET (*(volatile unsigned long *)(USB_BASE_ADDR + 0x3C))
  876. #define EP_INT_PRIO (*(volatile unsigned long *)(USB_BASE_ADDR + 0x40))
  877. /* USB Device Endpoint Realization Registers */
  878. #define REALIZE_EP (*(volatile unsigned long *)(USB_BASE_ADDR + 0x44))
  879. #define EP_INDEX (*(volatile unsigned long *)(USB_BASE_ADDR + 0x48))
  880. #define MAXPACKET_SIZE (*(volatile unsigned long *)(USB_BASE_ADDR + 0x4C))
  881. /* USB Device Command Reagisters */
  882. #define CMD_CODE (*(volatile unsigned long *)(USB_BASE_ADDR + 0x10))
  883. #define CMD_DATA (*(volatile unsigned long *)(USB_BASE_ADDR + 0x14))
  884. /* USB Device Data Transfer Registers */
  885. #define RX_DATA (*(volatile unsigned long *)(USB_BASE_ADDR + 0x18))
  886. #define TX_DATA (*(volatile unsigned long *)(USB_BASE_ADDR + 0x1C))
  887. #define RX_PLENGTH (*(volatile unsigned long *)(USB_BASE_ADDR + 0x20))
  888. #define TX_PLENGTH (*(volatile unsigned long *)(USB_BASE_ADDR + 0x24))
  889. #define USB_CTRL (*(volatile unsigned long *)(USB_BASE_ADDR + 0x28))
  890. /* USB Device DMA Registers */
  891. #define DMA_REQ_STAT (*(volatile unsigned long *)(USB_BASE_ADDR + 0x50))
  892. #define DMA_REQ_CLR (*(volatile unsigned long *)(USB_BASE_ADDR + 0x54))
  893. #define DMA_REQ_SET (*(volatile unsigned long *)(USB_BASE_ADDR + 0x58))
  894. #define UDCA_HEAD (*(volatile unsigned long *)(USB_BASE_ADDR + 0x80))
  895. #define EP_DMA_STAT (*(volatile unsigned long *)(USB_BASE_ADDR + 0x84))
  896. #define EP_DMA_EN (*(volatile unsigned long *)(USB_BASE_ADDR + 0x88))
  897. #define EP_DMA_DIS (*(volatile unsigned long *)(USB_BASE_ADDR + 0x8C))
  898. #define DMA_INT_STAT (*(volatile unsigned long *)(USB_BASE_ADDR + 0x90))
  899. #define DMA_INT_EN (*(volatile unsigned long *)(USB_BASE_ADDR + 0x94))
  900. #define EOT_INT_STAT (*(volatile unsigned long *)(USB_BASE_ADDR + 0xA0))
  901. #define EOT_INT_CLR (*(volatile unsigned long *)(USB_BASE_ADDR + 0xA4))
  902. #define EOT_INT_SET (*(volatile unsigned long *)(USB_BASE_ADDR + 0xA8))
  903. #define NDD_REQ_INT_STAT (*(volatile unsigned long *)(USB_BASE_ADDR + 0xAC))
  904. #define NDD_REQ_INT_CLR (*(volatile unsigned long *)(USB_BASE_ADDR + 0xB0))
  905. #define NDD_REQ_INT_SET (*(volatile unsigned long *)(USB_BASE_ADDR + 0xB4))
  906. #define SYS_ERR_INT_STAT (*(volatile unsigned long *)(USB_BASE_ADDR + 0xB8))
  907. #define SYS_ERR_INT_CLR (*(volatile unsigned long *)(USB_BASE_ADDR + 0xBC))
  908. #define SYS_ERR_INT_SET (*(volatile unsigned long *)(USB_BASE_ADDR + 0xC0))
  909. /* USB Host and OTG registers are for LPC24xx only */
  910. /* USB Host Controller */
  911. #define USBHC_BASE_ADDR 0xFFE0C000
  912. #define HC_REVISION (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x00))
  913. #define HC_CONTROL (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x04))
  914. #define HC_CMD_STAT (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x08))
  915. #define HC_INT_STAT (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x0C))
  916. #define HC_INT_EN (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x10))
  917. #define HC_INT_DIS (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x14))
  918. #define HC_HCCA (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x18))
  919. #define HC_PERIOD_CUR_ED (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x1C))
  920. #define HC_CTRL_HEAD_ED (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x20))
  921. #define HC_CTRL_CUR_ED (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x24))
  922. #define HC_BULK_HEAD_ED (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x28))
  923. #define HC_BULK_CUR_ED (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x2C))
  924. #define HC_DONE_HEAD (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x30))
  925. #define HC_FM_INTERVAL (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x34))
  926. #define HC_FM_REMAINING (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x38))
  927. #define HC_FM_NUMBER (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x3C))
  928. #define HC_PERIOD_START (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x40))
  929. #define HC_LS_THRHLD (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x44))
  930. #define HC_RH_DESCA (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x48))
  931. #define HC_RH_DESCB (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x4C))
  932. #define HC_RH_STAT (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x50))
  933. #define HC_RH_PORT_STAT1 (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x54))
  934. #define HC_RH_PORT_STAT2 (*(volatile unsigned long *)(USBHC_BASE_ADDR + 0x58))
  935. /* USB OTG Controller */
  936. #define USBOTG_BASE_ADDR 0xFFE0C100
  937. #define OTG_INT_STAT (*(volatile unsigned long *)(USBOTG_BASE_ADDR + 0x00))
  938. #define OTG_INT_EN (*(volatile unsigned long *)(USBOTG_BASE_ADDR + 0x04))
  939. #define OTG_INT_SET (*(volatile unsigned long *)(USBOTG_BASE_ADDR + 0x08))
  940. #define OTG_INT_CLR (*(volatile unsigned long *)(USBOTG_BASE_ADDR + 0x0C))
  941. /* On LPC23xx, the name is USBPortSel, on LPC24xx, the name is OTG_STAT_CTRL */
  942. #define OTG_STAT_CTRL (*(volatile unsigned long *)(USBOTG_BASE_ADDR + 0x10))
  943. #define OTG_TIMER (*(volatile unsigned long *)(USBOTG_BASE_ADDR + 0x14))
  944. #define USBOTG_I2C_BASE_ADDR 0xFFE0C300
  945. #define OTG_I2C_RX (*(volatile unsigned long *)(USBOTG_I2C_BASE_ADDR + 0x00))
  946. #define OTG_I2C_TX (*(volatile unsigned long *)(USBOTG_I2C_BASE_ADDR + 0x00))
  947. #define OTG_I2C_STS (*(volatile unsigned long *)(USBOTG_I2C_BASE_ADDR + 0x04))
  948. #define OTG_I2C_CTL (*(volatile unsigned long *)(USBOTG_I2C_BASE_ADDR + 0x08))
  949. #define OTG_I2C_CLKHI (*(volatile unsigned long *)(USBOTG_I2C_BASE_ADDR + 0x0C))
  950. #define OTG_I2C_CLKLO (*(volatile unsigned long *)(USBOTG_I2C_BASE_ADDR + 0x10))
  951. /* On LPC23xx, the names are USBClkCtrl and USBClkSt; on LPC24xx, the names are
  952. OTG_CLK_CTRL and OTG_CLK_STAT respectively. */
  953. #define USBOTG_CLK_BASE_ADDR 0xFFE0CFF0
  954. #define OTG_CLK_CTRL (*(volatile unsigned long *)(USBOTG_CLK_BASE_ADDR + 0x04))
  955. #define OTG_CLK_STAT (*(volatile unsigned long *)(USBOTG_CLK_BASE_ADDR + 0x08))
  956. /* Note: below three register name convention is for LPC23xx USB device only, match
  957. with the spec. update in USB Device Section. */
  958. #define USBPortSel (*(volatile unsigned long *)(USBOTG_BASE_ADDR + 0x10))
  959. #define USBClkCtrl (*(volatile unsigned long *)(USBOTG_CLK_BASE_ADDR + 0x04))
  960. #define USBClkSt (*(volatile unsigned long *)(USBOTG_CLK_BASE_ADDR + 0x08))
  961. /* Ethernet MAC (32 bit data bus) -- all registers are RW unless indicated in parentheses */
  962. #define MAC_BASE_ADDR 0xFFE00000 /* AHB Peripheral # 0 */
  963. #define MAC_MAC1 (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x000)) /* MAC config reg 1 */
  964. #define MAC_MAC2 (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x004)) /* MAC config reg 2 */
  965. #define MAC_IPGT (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x008)) /* b2b InterPacketGap reg */
  966. #define MAC_IPGR (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x00C)) /* non b2b InterPacketGap reg */
  967. #define MAC_CLRT (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x010)) /* CoLlision window/ReTry reg */
  968. #define MAC_MAXF (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x014)) /* MAXimum Frame reg */
  969. #define MAC_SUPP (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x018)) /* PHY SUPPort reg */
  970. #define MAC_TEST (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x01C)) /* TEST reg */
  971. #define MAC_MCFG (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x020)) /* MII Mgmt ConFiG reg */
  972. #define MAC_MCMD (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x024)) /* MII Mgmt CoMmanD reg */
  973. #define MAC_MADR (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x028)) /* MII Mgmt ADdRess reg */
  974. #define MAC_MWTD (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x02C)) /* MII Mgmt WriTe Data reg (WO) */
  975. #define MAC_MRDD (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x030)) /* MII Mgmt ReaD Data reg (RO) */
  976. #define MAC_MIND (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x034)) /* MII Mgmt INDicators reg (RO) */
  977. #define MAC_SA0 (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x040)) /* Station Address 0 reg */
  978. #define MAC_SA1 (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x044)) /* Station Address 1 reg */
  979. #define MAC_SA2 (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x048)) /* Station Address 2 reg */
  980. #define MAC_COMMAND (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x100)) /* Command reg */
  981. #define MAC_STATUS (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x104)) /* Status reg (RO) */
  982. #define MAC_RXDESCRIPTOR (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x108)) /* Rx descriptor base address reg */
  983. #define MAC_RXSTATUS (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x10C)) /* Rx status base address reg */
  984. #define MAC_RXDESCRIPTORNUM (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x110)) /* Rx number of descriptors reg */
  985. #define MAC_RXPRODUCEINDEX (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x114)) /* Rx produce index reg (RO) */
  986. #define MAC_RXCONSUMEINDEX (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x118)) /* Rx consume index reg */
  987. #define MAC_TXDESCRIPTOR (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x11C)) /* Tx descriptor base address reg */
  988. #define MAC_TXSTATUS (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x120)) /* Tx status base address reg */
  989. #define MAC_TXDESCRIPTORNUM (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x124)) /* Tx number of descriptors reg */
  990. #define MAC_TXPRODUCEINDEX (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x128)) /* Tx produce index reg */
  991. #define MAC_TXCONSUMEINDEX (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x12C)) /* Tx consume index reg (RO) */
  992. #define MAC_TSV0 (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x158)) /* Tx status vector 0 reg (RO) */
  993. #define MAC_TSV1 (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x15C)) /* Tx status vector 1 reg (RO) */
  994. #define MAC_RSV (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x160)) /* Rx status vector reg (RO) */
  995. #define MAC_FLOWCONTROLCNT (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x170)) /* Flow control counter reg */
  996. #define MAC_FLOWCONTROLSTS (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x174)) /* Flow control status reg */
  997. #define MAC_RXFILTERCTRL (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x200)) /* Rx filter ctrl reg */
  998. #define MAC_RXFILTERWOLSTS (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x204)) /* Rx filter WoL status reg (RO) */
  999. #define MAC_RXFILTERWOLCLR (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x208)) /* Rx filter WoL clear reg (WO) */
  1000. #define MAC_HASHFILTERL (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x210)) /* Hash filter LSBs reg */
  1001. #define MAC_HASHFILTERH (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x214)) /* Hash filter MSBs reg */
  1002. #define MAC_INTSTATUS (*(volatile unsigned long *)(MAC_BASE_ADDR + 0xFE0)) /* Interrupt status reg (RO) */
  1003. #define MAC_INTENABLE (*(volatile unsigned long *)(MAC_BASE_ADDR + 0xFE4)) /* Interrupt enable reg */
  1004. #define MAC_INTCLEAR (*(volatile unsigned long *)(MAC_BASE_ADDR + 0xFE8)) /* Interrupt clear reg (WO) */
  1005. #define MAC_INTSET (*(volatile unsigned long *)(MAC_BASE_ADDR + 0xFEC)) /* Interrupt set reg (WO) */
  1006. #define MAC_POWERDOWN (*(volatile unsigned long *)(MAC_BASE_ADDR + 0xFF4)) /* Power-down reg */
  1007. #define MAC_MODULEID (*(volatile unsigned long *)(MAC_BASE_ADDR + 0xFFC)) /* Module ID reg (RO) */
  1008. /* LCD Controller registers */
  1009. #define LCD_BASE_ADDR 0xFFE10000 /* AHB Peripheral # 4 */
  1010. #define LCD_CFG (*(volatile unsigned long *)(0xE01FC1B8))
  1011. #define LCD_TIMH (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x000))
  1012. #define LCD_TIMV (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x004))
  1013. #define LCD_POL (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x008))
  1014. #define LCD_LE (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x00C))
  1015. #define LCD_UPBASE (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x010))
  1016. #define LCD_LPBASE (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x014))
  1017. #define LCD_CTRL (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x018))
  1018. #define LCD_INTMSK (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x01C))
  1019. #define LCD_INTRAW (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x020))
  1020. #define LCD_INTSTAT (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x024))
  1021. #define LCD_INTCLR (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x028))
  1022. #define LCD_UPCURR (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x02C))
  1023. #define LCD_LPCURR (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x030))
  1024. #define LCD_PAL (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x200))
  1025. #define CRSR_IMG (*(volatile unsigned long *)(LCD_BASE_ADDR + 0x800))
  1026. #define CRSR_CTRL (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC00))
  1027. #define CRSR_CFG (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC04))
  1028. #define CRSR_PAL0 (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC08))
  1029. #define CRSR_PAL1 (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC0C))
  1030. #define CRSR_XY (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC10))
  1031. #define CRSR_CLIP (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC14))
  1032. #define CRSR_INTMSK (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC20))
  1033. #define CRSR_INTCLR (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC24))
  1034. #define CRSR_INTRAW (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC28))
  1035. #define CRSR_INTSTAT (*(volatile unsigned long *)(LCD_BASE_ADDR + 0xC2C))
  1036. struct rt_hw_register
  1037. {
  1038. unsigned long r0;
  1039. unsigned long r1;
  1040. unsigned long r2;
  1041. unsigned long r3;
  1042. unsigned long r4;
  1043. unsigned long r5;
  1044. unsigned long r6;
  1045. unsigned long r7;
  1046. unsigned long r8;
  1047. unsigned long r9;
  1048. unsigned long r10;
  1049. unsigned long fp;
  1050. unsigned long ip;
  1051. unsigned long sp;
  1052. unsigned long lr;
  1053. unsigned long pc;
  1054. unsigned long cpsr;
  1055. unsigned long ORIG_r0;
  1056. };
  1057. #ifdef __cplusplus
  1058. }
  1059. #endif
  1060. #endif // __LPC24xx_H