timer-regs.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. /* AM33v2 on-board timer module registers
  2. *
  3. * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
  4. * Written by David Howells (dhowells@redhat.com)
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public Licence
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the Licence, or (at your option) any later version.
  10. */
  11. #ifndef _ASM_TIMER_REGS_H
  12. #define _ASM_TIMER_REGS_H
  13. #include <asm/cpu-regs.h>
  14. #include <asm/intctl-regs.h>
  15. #ifdef __KERNEL__
  16. /*
  17. * Timer prescalar control
  18. */
  19. #define TMPSCNT __SYSREG(0xd4003071, u8) /* timer prescaler control */
  20. #define TMPSCNT_ENABLE 0x80 /* timer prescaler enable */
  21. #define TMPSCNT_DISABLE 0x00 /* timer prescaler disable */
  22. /*
  23. * 8-bit timers
  24. */
  25. #define TM0MD __SYSREG(0xd4003000, u8) /* timer 0 mode register */
  26. #define TM0MD_SRC 0x07 /* timer source */
  27. #define TM0MD_SRC_IOCLK 0x00 /* - IOCLK */
  28. #define TM0MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  29. #define TM0MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  30. #define TM0MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  31. #define TM0MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  32. #if defined(CONFIG_AM33_2)
  33. #define TM0MD_SRC_TM2IO 0x03 /* - TM2IO pin input */
  34. #define TM0MD_SRC_TM0IO 0x07 /* - TM0IO pin input */
  35. #endif /* CONFIG_AM33_2 */
  36. #define TM0MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  37. #define TM0MD_COUNT_ENABLE 0x80 /* timer count enable */
  38. #define TM1MD __SYSREG(0xd4003001, u8) /* timer 1 mode register */
  39. #define TM1MD_SRC 0x07 /* timer source */
  40. #define TM1MD_SRC_IOCLK 0x00 /* - IOCLK */
  41. #define TM1MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  42. #define TM1MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  43. #define TM1MD_SRC_TM0CASCADE 0x03 /* - cascade with timer 0 */
  44. #define TM1MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  45. #define TM1MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  46. #if defined(CONFIG_AM33_2)
  47. #define TM1MD_SRC_TM1IO 0x07 /* - TM1IO pin input */
  48. #endif /* CONFIG_AM33_2 */
  49. #define TM1MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  50. #define TM1MD_COUNT_ENABLE 0x80 /* timer count enable */
  51. #define TM2MD __SYSREG(0xd4003002, u8) /* timer 2 mode register */
  52. #define TM2MD_SRC 0x07 /* timer source */
  53. #define TM2MD_SRC_IOCLK 0x00 /* - IOCLK */
  54. #define TM2MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  55. #define TM2MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  56. #define TM2MD_SRC_TM1CASCADE 0x03 /* - cascade with timer 1 */
  57. #define TM2MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  58. #define TM2MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  59. #if defined(CONFIG_AM33_2)
  60. #define TM2MD_SRC_TM2IO 0x07 /* - TM2IO pin input */
  61. #endif /* CONFIG_AM33_2 */
  62. #define TM2MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  63. #define TM2MD_COUNT_ENABLE 0x80 /* timer count enable */
  64. #define TM3MD __SYSREG(0xd4003003, u8) /* timer 3 mode register */
  65. #define TM3MD_SRC 0x07 /* timer source */
  66. #define TM3MD_SRC_IOCLK 0x00 /* - IOCLK */
  67. #define TM3MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  68. #define TM3MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  69. #define TM3MD_SRC_TM2CASCADE 0x03 /* - cascade with timer 2 */
  70. #define TM3MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  71. #define TM3MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  72. #define TM3MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  73. #if defined(CONFIG_AM33_2)
  74. #define TM3MD_SRC_TM3IO 0x07 /* - TM3IO pin input */
  75. #endif /* CONFIG_AM33_2 */
  76. #define TM3MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  77. #define TM3MD_COUNT_ENABLE 0x80 /* timer count enable */
  78. #define TM01MD __SYSREG(0xd4003000, u16) /* timer 0:1 mode register */
  79. #define TM0BR __SYSREG(0xd4003010, u8) /* timer 0 base register */
  80. #define TM1BR __SYSREG(0xd4003011, u8) /* timer 1 base register */
  81. #define TM2BR __SYSREG(0xd4003012, u8) /* timer 2 base register */
  82. #define TM3BR __SYSREG(0xd4003013, u8) /* timer 3 base register */
  83. #define TM01BR __SYSREG(0xd4003010, u16) /* timer 0:1 base register */
  84. #define TM0BC __SYSREGC(0xd4003020, u8) /* timer 0 binary counter */
  85. #define TM1BC __SYSREGC(0xd4003021, u8) /* timer 1 binary counter */
  86. #define TM2BC __SYSREGC(0xd4003022, u8) /* timer 2 binary counter */
  87. #define TM3BC __SYSREGC(0xd4003023, u8) /* timer 3 binary counter */
  88. #define TM01BC __SYSREGC(0xd4003020, u16) /* timer 0:1 binary counter */
  89. #define TM0IRQ 2 /* timer 0 IRQ */
  90. #define TM1IRQ 3 /* timer 1 IRQ */
  91. #define TM2IRQ 4 /* timer 2 IRQ */
  92. #define TM3IRQ 5 /* timer 3 IRQ */
  93. #define TM0ICR GxICR(TM0IRQ) /* timer 0 uflow intr ctrl reg */
  94. #define TM1ICR GxICR(TM1IRQ) /* timer 1 uflow intr ctrl reg */
  95. #define TM2ICR GxICR(TM2IRQ) /* timer 2 uflow intr ctrl reg */
  96. #define TM3ICR GxICR(TM3IRQ) /* timer 3 uflow intr ctrl reg */
  97. /*
  98. * 16-bit timers 4,5 & 7-15
  99. */
  100. #define TM4MD __SYSREG(0xd4003080, u8) /* timer 4 mode register */
  101. #define TM4MD_SRC 0x07 /* timer source */
  102. #define TM4MD_SRC_IOCLK 0x00 /* - IOCLK */
  103. #define TM4MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  104. #define TM4MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  105. #define TM4MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  106. #define TM4MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  107. #define TM4MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  108. #if defined(CONFIG_AM33_2)
  109. #define TM4MD_SRC_TM4IO 0x07 /* - TM4IO pin input */
  110. #endif /* CONFIG_AM33_2 */
  111. #define TM4MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  112. #define TM4MD_COUNT_ENABLE 0x80 /* timer count enable */
  113. #define TM5MD __SYSREG(0xd4003082, u8) /* timer 5 mode register */
  114. #define TM5MD_SRC 0x07 /* timer source */
  115. #define TM5MD_SRC_IOCLK 0x00 /* - IOCLK */
  116. #define TM5MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  117. #define TM5MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  118. #define TM5MD_SRC_TM4CASCADE 0x03 /* - cascade with timer 4 */
  119. #define TM5MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  120. #define TM5MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  121. #define TM5MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  122. #if defined(CONFIG_AM33_2)
  123. #define TM5MD_SRC_TM5IO 0x07 /* - TM5IO pin input */
  124. #else /* !CONFIG_AM33_2 */
  125. #define TM5MD_SRC_TM7UFLOW 0x07 /* - timer 7 underflow */
  126. #endif /* CONFIG_AM33_2 */
  127. #define TM5MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  128. #define TM5MD_COUNT_ENABLE 0x80 /* timer count enable */
  129. #define TM7MD __SYSREG(0xd4003086, u8) /* timer 7 mode register */
  130. #define TM7MD_SRC 0x07 /* timer source */
  131. #define TM7MD_SRC_IOCLK 0x00 /* - IOCLK */
  132. #define TM7MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  133. #define TM7MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  134. #define TM7MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  135. #define TM7MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  136. #define TM7MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  137. #if defined(CONFIG_AM33_2)
  138. #define TM7MD_SRC_TM7IO 0x07 /* - TM7IO pin input */
  139. #endif /* CONFIG_AM33_2 */
  140. #define TM7MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  141. #define TM7MD_COUNT_ENABLE 0x80 /* timer count enable */
  142. #define TM8MD __SYSREG(0xd4003088, u8) /* timer 8 mode register */
  143. #define TM8MD_SRC 0x07 /* timer source */
  144. #define TM8MD_SRC_IOCLK 0x00 /* - IOCLK */
  145. #define TM8MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  146. #define TM8MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  147. #define TM8MD_SRC_TM7CASCADE 0x03 /* - cascade with timer 7 */
  148. #define TM8MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  149. #define TM8MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  150. #define TM8MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  151. #if defined(CONFIG_AM33_2)
  152. #define TM8MD_SRC_TM8IO 0x07 /* - TM8IO pin input */
  153. #else /* !CONFIG_AM33_2 */
  154. #define TM8MD_SRC_TM7UFLOW 0x07 /* - timer 7 underflow */
  155. #endif /* CONFIG_AM33_2 */
  156. #define TM8MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  157. #define TM8MD_COUNT_ENABLE 0x80 /* timer count enable */
  158. #define TM9MD __SYSREG(0xd400308a, u8) /* timer 9 mode register */
  159. #define TM9MD_SRC 0x07 /* timer source */
  160. #define TM9MD_SRC_IOCLK 0x00 /* - IOCLK */
  161. #define TM9MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  162. #define TM9MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  163. #define TM9MD_SRC_TM8CASCADE 0x03 /* - cascade with timer 8 */
  164. #define TM9MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  165. #define TM9MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  166. #define TM9MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  167. #if defined(CONFIG_AM33_2)
  168. #define TM9MD_SRC_TM9IO 0x07 /* - TM9IO pin input */
  169. #else /* !CONFIG_AM33_2 */
  170. #define TM9MD_SRC_TM7UFLOW 0x07 /* - timer 7 underflow */
  171. #endif /* CONFIG_AM33_2 */
  172. #define TM9MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  173. #define TM9MD_COUNT_ENABLE 0x80 /* timer count enable */
  174. #define TM10MD __SYSREG(0xd400308c, u8) /* timer 10 mode register */
  175. #define TM10MD_SRC 0x07 /* timer source */
  176. #define TM10MD_SRC_IOCLK 0x00 /* - IOCLK */
  177. #define TM10MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  178. #define TM10MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  179. #define TM10MD_SRC_TM9CASCADE 0x03 /* - cascade with timer 9 */
  180. #define TM10MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  181. #define TM10MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  182. #define TM10MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  183. #if defined(CONFIG_AM33_2)
  184. #define TM10MD_SRC_TM10IO 0x07 /* - TM10IO pin input */
  185. #else /* !CONFIG_AM33_2 */
  186. #define TM10MD_SRC_TM7UFLOW 0x07 /* - timer 7 underflow */
  187. #endif /* CONFIG_AM33_2 */
  188. #define TM10MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  189. #define TM10MD_COUNT_ENABLE 0x80 /* timer count enable */
  190. #define TM11MD __SYSREG(0xd400308e, u8) /* timer 11 mode register */
  191. #define TM11MD_SRC 0x07 /* timer source */
  192. #define TM11MD_SRC_IOCLK 0x00 /* - IOCLK */
  193. #define TM11MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  194. #define TM11MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  195. #define TM11MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  196. #define TM11MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  197. #define TM11MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  198. #if defined(CONFIG_AM33_2)
  199. #define TM11MD_SRC_TM11IO 0x07 /* - TM11IO pin input */
  200. #else /* !CONFIG_AM33_2 */
  201. #define TM11MD_SRC_TM7UFLOW 0x07 /* - timer 7 underflow */
  202. #endif /* CONFIG_AM33_2 */
  203. #define TM11MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  204. #define TM11MD_COUNT_ENABLE 0x80 /* timer count enable */
  205. #if defined(CONFIG_AM34_2)
  206. #define TM12MD __SYSREG(0xd4003180, u8) /* timer 11 mode register */
  207. #define TM12MD_SRC 0x07 /* timer source */
  208. #define TM12MD_SRC_IOCLK 0x00 /* - IOCLK */
  209. #define TM12MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  210. #define TM12MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  211. #define TM12MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  212. #define TM12MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  213. #define TM12MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  214. #define TM12MD_SRC_TM7UFLOW 0x07 /* - timer 7 underflow */
  215. #define TM12MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  216. #define TM12MD_COUNT_ENABLE 0x80 /* timer count enable */
  217. #define TM13MD __SYSREG(0xd4003182, u8) /* timer 11 mode register */
  218. #define TM13MD_SRC 0x07 /* timer source */
  219. #define TM13MD_SRC_IOCLK 0x00 /* - IOCLK */
  220. #define TM13MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  221. #define TM13MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  222. #define TM13MD_SRC_TM12CASCADE 0x03 /* - cascade with timer 12 */
  223. #define TM13MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  224. #define TM13MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  225. #define TM13MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  226. #define TM13MD_SRC_TM7UFLOW 0x07 /* - timer 7 underflow */
  227. #define TM13MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  228. #define TM13MD_COUNT_ENABLE 0x80 /* timer count enable */
  229. #define TM14MD __SYSREG(0xd4003184, u8) /* timer 11 mode register */
  230. #define TM14MD_SRC 0x07 /* timer source */
  231. #define TM14MD_SRC_IOCLK 0x00 /* - IOCLK */
  232. #define TM14MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  233. #define TM14MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  234. #define TM14MD_SRC_TM13CASCADE 0x03 /* - cascade with timer 13 */
  235. #define TM14MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  236. #define TM14MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  237. #define TM14MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  238. #define TM14MD_SRC_TM7UFLOW 0x07 /* - timer 7 underflow */
  239. #define TM14MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  240. #define TM14MD_COUNT_ENABLE 0x80 /* timer count enable */
  241. #define TM15MD __SYSREG(0xd4003186, u8) /* timer 11 mode register */
  242. #define TM15MD_SRC 0x07 /* timer source */
  243. #define TM15MD_SRC_IOCLK 0x00 /* - IOCLK */
  244. #define TM15MD_SRC_IOCLK_8 0x01 /* - 1/8 IOCLK */
  245. #define TM15MD_SRC_IOCLK_32 0x02 /* - 1/32 IOCLK */
  246. #define TM15MD_SRC_TM0UFLOW 0x04 /* - timer 0 underflow */
  247. #define TM15MD_SRC_TM1UFLOW 0x05 /* - timer 1 underflow */
  248. #define TM15MD_SRC_TM2UFLOW 0x06 /* - timer 2 underflow */
  249. #define TM15MD_SRC_TM7UFLOW 0x07 /* - timer 7 underflow */
  250. #define TM15MD_INIT_COUNTER 0x40 /* initialize TMnBC = TMnBR */
  251. #define TM15MD_COUNT_ENABLE 0x80 /* timer count enable */
  252. #endif /* CONFIG_AM34_2 */
  253. #define TM4BR __SYSREG(0xd4003090, u16) /* timer 4 base register */
  254. #define TM5BR __SYSREG(0xd4003092, u16) /* timer 5 base register */
  255. #define TM45BR __SYSREG(0xd4003090, u32) /* timer 4:5 base register */
  256. #define TM7BR __SYSREG(0xd4003096, u16) /* timer 7 base register */
  257. #define TM8BR __SYSREG(0xd4003098, u16) /* timer 8 base register */
  258. #define TM9BR __SYSREG(0xd400309a, u16) /* timer 9 base register */
  259. #define TM89BR __SYSREG(0xd4003098, u32) /* timer 8:9 base register */
  260. #define TM10BR __SYSREG(0xd400309c, u16) /* timer 10 base register */
  261. #define TM11BR __SYSREG(0xd400309e, u16) /* timer 11 base register */
  262. #if defined(CONFIG_AM34_2)
  263. #define TM12BR __SYSREG(0xd4003190, u16) /* timer 12 base register */
  264. #define TM13BR __SYSREG(0xd4003192, u16) /* timer 13 base register */
  265. #define TM14BR __SYSREG(0xd4003194, u16) /* timer 14 base register */
  266. #define TM15BR __SYSREG(0xd4003196, u16) /* timer 15 base register */
  267. #endif /* CONFIG_AM34_2 */
  268. #define TM4BC __SYSREG(0xd40030a0, u16) /* timer 4 binary counter */
  269. #define TM5BC __SYSREG(0xd40030a2, u16) /* timer 5 binary counter */
  270. #define TM45BC __SYSREG(0xd40030a0, u32) /* timer 4:5 binary counter */
  271. #define TM7BC __SYSREG(0xd40030a6, u16) /* timer 7 binary counter */
  272. #define TM8BC __SYSREG(0xd40030a8, u16) /* timer 8 binary counter */
  273. #define TM9BC __SYSREG(0xd40030aa, u16) /* timer 9 binary counter */
  274. #define TM89BC __SYSREG(0xd40030a8, u32) /* timer 8:9 binary counter */
  275. #define TM10BC __SYSREG(0xd40030ac, u16) /* timer 10 binary counter */
  276. #define TM11BC __SYSREG(0xd40030ae, u16) /* timer 11 binary counter */
  277. #if defined(CONFIG_AM34_2)
  278. #define TM12BC __SYSREG(0xd40031a0, u16) /* timer 12 binary counter */
  279. #define TM13BC __SYSREG(0xd40031a2, u16) /* timer 13 binary counter */
  280. #define TM14BC __SYSREG(0xd40031a4, u16) /* timer 14 binary counter */
  281. #define TM15BC __SYSREG(0xd40031a6, u16) /* timer 15 binary counter */
  282. #endif /* CONFIG_AM34_2 */
  283. #define TM4IRQ 6 /* timer 4 IRQ */
  284. #define TM5IRQ 7 /* timer 5 IRQ */
  285. #define TM7IRQ 11 /* timer 7 IRQ */
  286. #define TM8IRQ 12 /* timer 8 IRQ */
  287. #define TM9IRQ 13 /* timer 9 IRQ */
  288. #define TM10IRQ 14 /* timer 10 IRQ */
  289. #define TM11IRQ 15 /* timer 11 IRQ */
  290. #if defined(CONFIG_AM34_2)
  291. #define TM12IRQ 64 /* timer 12 IRQ */
  292. #define TM13IRQ 65 /* timer 13 IRQ */
  293. #define TM14IRQ 66 /* timer 14 IRQ */
  294. #define TM15IRQ 67 /* timer 15 IRQ */
  295. #endif /* CONFIG_AM34_2 */
  296. #define TM4ICR GxICR(TM4IRQ) /* timer 4 uflow intr ctrl reg */
  297. #define TM5ICR GxICR(TM5IRQ) /* timer 5 uflow intr ctrl reg */
  298. #define TM7ICR GxICR(TM7IRQ) /* timer 7 uflow intr ctrl reg */
  299. #define TM8ICR GxICR(TM8IRQ) /* timer 8 uflow intr ctrl reg */
  300. #define TM9ICR GxICR(TM9IRQ) /* timer 9 uflow intr ctrl reg */
  301. #define TM10ICR GxICR(TM10IRQ) /* timer 10 uflow intr ctrl reg */
  302. #define TM11ICR GxICR(TM11IRQ) /* timer 11 uflow intr ctrl reg */
  303. #if defined(CONFIG_AM34_2)
  304. #define TM12ICR GxICR(TM12IRQ) /* timer 12 uflow intr ctrl reg */
  305. #define TM13ICR GxICR(TM13IRQ) /* timer 13 uflow intr ctrl reg */
  306. #define TM14ICR GxICR(TM14IRQ) /* timer 14 uflow intr ctrl reg */
  307. #define TM15ICR GxICR(TM15IRQ) /* timer 15 uflow intr ctrl reg */
  308. #endif /* CONFIG_AM34_2 */
  309. /*
  310. * 16-bit timer 6
  311. */
  312. #define TM6MD __SYSREG(0xd4003084, u16) /* timer6 mode register */
  313. #define TM6MD_SRC 0x0007 /* timer source */
  314. #define TM6MD_SRC_IOCLK 0x0000 /* - IOCLK */
  315. #define TM6MD_SRC_IOCLK_8 0x0001 /* - 1/8 IOCLK */
  316. #define TM6MD_SRC_IOCLK_32 0x0002 /* - 1/32 IOCLK */
  317. #define TM6MD_SRC_TM0UFLOW 0x0004 /* - timer 0 underflow */
  318. #define TM6MD_SRC_TM1UFLOW 0x0005 /* - timer 1 underflow */
  319. #define TM6MD_SRC_TM2UFLOW 0x0006 /* - timer 2 underflow */
  320. #if defined(CONFIG_AM33_2)
  321. /* #define TM6MD_SRC_TM6IOB_BOTH 0x0006 */ /* - TM6IOB pin input (both edges) */
  322. #define TM6MD_SRC_TM6IOB_SINGLE 0x0007 /* - TM6IOB pin input (single edge) */
  323. #endif /* CONFIG_AM33_2 */
  324. #define TM6MD_ONESHOT_ENABLE 0x0040 /* oneshot count */
  325. #define TM6MD_CLR_ENABLE 0x0010 /* clear count enable */
  326. #if defined(CONFIG_AM33_2)
  327. #define TM6MD_TRIG_ENABLE 0x0080 /* TM6IOB pin trigger enable */
  328. #define TM6MD_PWM 0x3800 /* PWM output mode */
  329. #define TM6MD_PWM_DIS 0x0000 /* - disabled */
  330. #define TM6MD_PWM_10BIT 0x1000 /* - 10 bits mode */
  331. #define TM6MD_PWM_11BIT 0x1800 /* - 11 bits mode */
  332. #define TM6MD_PWM_12BIT 0x3000 /* - 12 bits mode */
  333. #define TM6MD_PWM_14BIT 0x3800 /* - 14 bits mode */
  334. #endif /* CONFIG_AM33_2 */
  335. #define TM6MD_INIT_COUNTER 0x4000 /* initialize TMnBC to zero */
  336. #define TM6MD_COUNT_ENABLE 0x8000 /* timer count enable */
  337. #define TM6MDA __SYSREG(0xd40030b4, u8) /* timer6 cmp/cap A mode reg */
  338. #define TM6MDA_MODE_CMP_SINGLE 0x00 /* - compare, single buffer mode */
  339. #define TM6MDA_MODE_CMP_DOUBLE 0x40 /* - compare, double buffer mode */
  340. #if defined(CONFIG_AM33_2)
  341. #define TM6MDA_OUT 0x07 /* output select */
  342. #define TM6MDA_OUT_SETA_RESETB 0x00 /* - set at match A, reset at match B */
  343. #define TM6MDA_OUT_SETA_RESETOV 0x01 /* - set at match A, reset at overflow */
  344. #define TM6MDA_OUT_SETA 0x02 /* - set at match A */
  345. #define TM6MDA_OUT_RESETA 0x03 /* - reset at match A */
  346. #define TM6MDA_OUT_TOGGLE 0x04 /* - toggle on match A */
  347. #define TM6MDA_MODE 0xc0 /* compare A register mode */
  348. #define TM6MDA_MODE_CAP_S_EDGE 0x80 /* - capture, single edge mode */
  349. #define TM6MDA_MODE_CAP_D_EDGE 0xc0 /* - capture, double edge mode */
  350. #define TM6MDA_EDGE 0x20 /* compare A edge select */
  351. #define TM6MDA_EDGE_FALLING 0x00 /* capture on falling edge */
  352. #define TM6MDA_EDGE_RISING 0x20 /* capture on rising edge */
  353. #define TM6MDA_CAPTURE_ENABLE 0x10 /* capture enable */
  354. #else /* !CONFIG_AM33_2 */
  355. #define TM6MDA_MODE 0x40 /* compare A register mode */
  356. #endif /* CONFIG_AM33_2 */
  357. #define TM6MDB __SYSREG(0xd40030b5, u8) /* timer6 cmp/cap B mode reg */
  358. #define TM6MDB_MODE_CMP_SINGLE 0x00 /* - compare, single buffer mode */
  359. #define TM6MDB_MODE_CMP_DOUBLE 0x40 /* - compare, double buffer mode */
  360. #if defined(CONFIG_AM33_2)
  361. #define TM6MDB_OUT 0x07 /* output select */
  362. #define TM6MDB_OUT_SETB_RESETA 0x00 /* - set at match B, reset at match A */
  363. #define TM6MDB_OUT_SETB_RESETOV 0x01 /* - set at match B */
  364. #define TM6MDB_OUT_RESETB 0x03 /* - reset at match B */
  365. #define TM6MDB_OUT_TOGGLE 0x04 /* - toggle on match B */
  366. #define TM6MDB_MODE 0xc0 /* compare B register mode */
  367. #define TM6MDB_MODE_CAP_S_EDGE 0x80 /* - capture, single edge mode */
  368. #define TM6MDB_MODE_CAP_D_EDGE 0xc0 /* - capture, double edge mode */
  369. #define TM6MDB_EDGE 0x20 /* compare B edge select */
  370. #define TM6MDB_EDGE_FALLING 0x00 /* capture on falling edge */
  371. #define TM6MDB_EDGE_RISING 0x20 /* capture on rising edge */
  372. #define TM6MDB_CAPTURE_ENABLE 0x10 /* capture enable */
  373. #else /* !CONFIG_AM33_2 */
  374. #define TM6MDB_MODE 0x40 /* compare B register mode */
  375. #endif /* CONFIG_AM33_2 */
  376. #define TM6CA __SYSREG(0xd40030c4, u16) /* timer6 cmp/capture reg A */
  377. #define TM6CB __SYSREG(0xd40030d4, u16) /* timer6 cmp/capture reg B */
  378. #define TM6BC __SYSREG(0xd40030a4, u16) /* timer6 binary counter */
  379. #define TM6IRQ 6 /* timer 6 IRQ */
  380. #define TM6AIRQ 9 /* timer 6A IRQ */
  381. #define TM6BIRQ 10 /* timer 6B IRQ */
  382. #define TM6ICR GxICR(TM6IRQ) /* timer 6 uflow intr ctrl reg */
  383. #define TM6AICR GxICR(TM6AIRQ) /* timer 6A intr control reg */
  384. #define TM6BICR GxICR(TM6BIRQ) /* timer 6B intr control reg */
  385. #if defined(CONFIG_AM34_2)
  386. /*
  387. * MTM: OS Tick-Timer
  388. */
  389. #define TMTMD __SYSREG(0xd4004100, u8) /* Tick Timer mode register */
  390. #define TMTMD_TMTLDE 0x40 /* initialize TMTBC = TMTBR */
  391. #define TMTMD_TMTCNE 0x80 /* timer count enable */
  392. #define TMTBR __SYSREG(0xd4004110, u32) /* Tick Timer mode reg */
  393. #define TMTBC __SYSREG(0xd4004120, u32) /* Tick Timer mode reg */
  394. /*
  395. * MTM: OS Timestamp-Timer
  396. */
  397. #define TMSMD __SYSREG(0xd4004140, u8) /* Tick Timer mode register */
  398. #define TMSMD_TMSLDE 0x40 /* initialize TMSBC = TMSBR */
  399. #define TMSMD_TMSCNE 0x80 /* timer count enable */
  400. #define TMSBR __SYSREG(0xd4004150, u32) /* Tick Timer mode register */
  401. #define TMSBC __SYSREG(0xd4004160, u32) /* Tick Timer mode register */
  402. #define TMTIRQ 119 /* OS Tick timer IRQ */
  403. #define TMSIRQ 120 /* Timestamp timer IRQ */
  404. #define TMTICR GxICR(TMTIRQ) /* OS Tick timer uflow intr ctrl reg */
  405. #define TMSICR GxICR(TMSIRQ) /* Timestamp timer uflow intr ctrl reg */
  406. #endif /* CONFIG_AM34_2 */
  407. #endif /* __KERNEL__ */
  408. #endif /* _ASM_TIMER_REGS_H */