pio-regs.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /* MN10300 On-board I/O port 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_PIO_REGS_H
  12. #define _ASM_PIO_REGS_H
  13. #include <asm/cpu-regs.h>
  14. #include <asm/intctl-regs.h>
  15. #ifdef __KERNEL__
  16. /* I/O port 0 */
  17. #define P0MD __SYSREG(0xdb000000, u16) /* mode reg */
  18. #define P0MD_0 0x0003 /* mask */
  19. #define P0MD_0_IN 0x0000 /* input mode */
  20. #define P0MD_0_OUT 0x0001 /* output mode */
  21. #define P0MD_0_TM0IO 0x0002 /* timer 0 I/O mode */
  22. #define P0MD_0_EYECLK 0x0003 /* test signal output (clock) */
  23. #define P0MD_1 0x000c
  24. #define P0MD_1_IN 0x0000
  25. #define P0MD_1_OUT 0x0004
  26. #define P0MD_1_TM1IO 0x0008 /* timer 1 I/O mode */
  27. #define P0MD_1_EYED 0x000c /* test signal output (data) */
  28. #define P0MD_2 0x0030
  29. #define P0MD_2_IN 0x0000
  30. #define P0MD_2_OUT 0x0010
  31. #define P0MD_2_TM2IO 0x0020 /* timer 2 I/O mode */
  32. #define P0MD_3 0x00c0
  33. #define P0MD_3_IN 0x0000
  34. #define P0MD_3_OUT 0x0040
  35. #define P0MD_3_TM3IO 0x0080 /* timer 3 I/O mode */
  36. #define P0MD_4 0x0300
  37. #define P0MD_4_IN 0x0000
  38. #define P0MD_4_OUT 0x0100
  39. #define P0MD_4_TM4IO 0x0200 /* timer 4 I/O mode */
  40. #define P0MD_4_XCTS 0x0300 /* XCTS input for serial port 2 */
  41. #define P0MD_5 0x0c00
  42. #define P0MD_5_IN 0x0000
  43. #define P0MD_5_OUT 0x0400
  44. #define P0MD_5_TM5IO 0x0800 /* timer 5 I/O mode */
  45. #define P0MD_6 0x3000
  46. #define P0MD_6_IN 0x0000
  47. #define P0MD_6_OUT 0x1000
  48. #define P0MD_6_TM6IOA 0x2000 /* timer 6 I/O mode A */
  49. #define P0MD_7 0xc000
  50. #define P0MD_7_IN 0x0000
  51. #define P0MD_7_OUT 0x4000
  52. #define P0MD_7_TM6IOB 0x8000 /* timer 6 I/O mode B */
  53. #define P0IN __SYSREG(0xdb000004, u8) /* in reg */
  54. #define P0OUT __SYSREG(0xdb000008, u8) /* out reg */
  55. #define P0TMIO __SYSREG(0xdb00000c, u8) /* TM pin I/O control reg */
  56. #define P0TMIO_TM0_IN 0x00
  57. #define P0TMIO_TM0_OUT 0x01
  58. #define P0TMIO_TM1_IN 0x00
  59. #define P0TMIO_TM1_OUT 0x02
  60. #define P0TMIO_TM2_IN 0x00
  61. #define P0TMIO_TM2_OUT 0x04
  62. #define P0TMIO_TM3_IN 0x00
  63. #define P0TMIO_TM3_OUT 0x08
  64. #define P0TMIO_TM4_IN 0x00
  65. #define P0TMIO_TM4_OUT 0x10
  66. #define P0TMIO_TM5_IN 0x00
  67. #define P0TMIO_TM5_OUT 0x20
  68. #define P0TMIO_TM6A_IN 0x00
  69. #define P0TMIO_TM6A_OUT 0x40
  70. #define P0TMIO_TM6B_IN 0x00
  71. #define P0TMIO_TM6B_OUT 0x80
  72. /* I/O port 1 */
  73. #define P1MD __SYSREG(0xdb000100, u16) /* mode reg */
  74. #define P1MD_0 0x0003 /* mask */
  75. #define P1MD_0_IN 0x0000 /* input mode */
  76. #define P1MD_0_OUT 0x0001 /* output mode */
  77. #define P1MD_0_TM7IO 0x0002 /* timer 7 I/O mode */
  78. #define P1MD_0_ADTRG 0x0003 /* A/D converter trigger mode */
  79. #define P1MD_1 0x000c
  80. #define P1MD_1_IN 0x0000
  81. #define P1MD_1_OUT 0x0004
  82. #define P1MD_1_TM8IO 0x0008 /* timer 8 I/O mode */
  83. #define P1MD_1_XDMR0 0x000c /* DMA request input 0 mode */
  84. #define P1MD_2 0x0030
  85. #define P1MD_2_IN 0x0000
  86. #define P1MD_2_OUT 0x0010
  87. #define P1MD_2_TM9IO 0x0020 /* timer 9 I/O mode */
  88. #define P1MD_2_XDMR1 0x0030 /* DMA request input 1 mode */
  89. #define P1MD_3 0x00c0
  90. #define P1MD_3_IN 0x0000
  91. #define P1MD_3_OUT 0x0040
  92. #define P1MD_3_TM10IO 0x0080 /* timer 10 I/O mode */
  93. #define P1MD_3_FRQS0 0x00c0 /* CPU clock multiplier setting input 0 mode */
  94. #define P1MD_4 0x0300
  95. #define P1MD_4_IN 0x0000
  96. #define P1MD_4_OUT 0x0100
  97. #define P1MD_4_TM11IO 0x0200 /* timer 11 I/O mode */
  98. #define P1MD_4_FRQS1 0x0300 /* CPU clock multiplier setting input 1 mode */
  99. #define P1IN __SYSREG(0xdb000104, u8) /* in reg */
  100. #define P1OUT __SYSREG(0xdb000108, u8) /* out reg */
  101. #define P1TMIO __SYSREG(0xdb00010c, u8) /* TM pin I/O control reg */
  102. #define P1TMIO_TM11_IN 0x00
  103. #define P1TMIO_TM11_OUT 0x01
  104. #define P1TMIO_TM10_IN 0x00
  105. #define P1TMIO_TM10_OUT 0x02
  106. #define P1TMIO_TM9_IN 0x00
  107. #define P1TMIO_TM9_OUT 0x04
  108. #define P1TMIO_TM8_IN 0x00
  109. #define P1TMIO_TM8_OUT 0x08
  110. #define P1TMIO_TM7_IN 0x00
  111. #define P1TMIO_TM7_OUT 0x10
  112. /* I/O port 2 */
  113. #define P2MD __SYSREG(0xdb000200, u16) /* mode reg */
  114. #define P2MD_0 0x0003 /* mask */
  115. #define P2MD_0_IN 0x0000 /* input mode */
  116. #define P2MD_0_OUT 0x0001 /* output mode */
  117. #define P2MD_0_BOOTBW 0x0003 /* boot bus width selector mode */
  118. #define P2MD_1 0x000c
  119. #define P2MD_1_IN 0x0000
  120. #define P2MD_1_OUT 0x0004
  121. #define P2MD_1_BOOTSEL 0x000c /* boot device selector mode */
  122. #define P2MD_2 0x0030
  123. #define P2MD_2_IN 0x0000
  124. #define P2MD_2_OUT 0x0010
  125. #define P2MD_3 0x00c0
  126. #define P2MD_3_IN 0x0000
  127. #define P2MD_3_OUT 0x0040
  128. #define P2MD_3_CKIO 0x00c0 /* mode */
  129. #define P2MD_4 0x0300
  130. #define P2MD_4_IN 0x0000
  131. #define P2MD_4_OUT 0x0100
  132. #define P2MD_4_CMOD 0x0300 /* mode */
  133. #define P2IN __SYSREG(0xdb000204, u8) /* in reg */
  134. #define P2OUT __SYSREG(0xdb000208, u8) /* out reg */
  135. #define P2TMIO __SYSREG(0xdb00020c, u8) /* TM pin I/O control reg */
  136. /* I/O port 3 */
  137. #define P3MD __SYSREG(0xdb000300, u16) /* mode reg */
  138. #define P3MD_0 0x0003 /* mask */
  139. #define P3MD_0_IN 0x0000 /* input mode */
  140. #define P3MD_0_OUT 0x0001 /* output mode */
  141. #define P3MD_0_AFRXD 0x0002 /* AFR interface mode */
  142. #define P3MD_1 0x000c
  143. #define P3MD_1_IN 0x0000
  144. #define P3MD_1_OUT 0x0004
  145. #define P3MD_1_AFTXD 0x0008 /* AFR interface mode */
  146. #define P3MD_2 0x0030
  147. #define P3MD_2_IN 0x0000
  148. #define P3MD_2_OUT 0x0010
  149. #define P3MD_2_AFSCLK 0x0020 /* AFR interface mode */
  150. #define P3MD_3 0x00c0
  151. #define P3MD_3_IN 0x0000
  152. #define P3MD_3_OUT 0x0040
  153. #define P3MD_3_AFFS 0x0080 /* AFR interface mode */
  154. #define P3MD_4 0x0300
  155. #define P3MD_4_IN 0x0000
  156. #define P3MD_4_OUT 0x0100
  157. #define P3MD_4_AFEHC 0x0200 /* AFR interface mode */
  158. #define P3IN __SYSREG(0xdb000304, u8) /* in reg */
  159. #define P3OUT __SYSREG(0xdb000308, u8) /* out reg */
  160. /* I/O port 4 */
  161. #define P4MD __SYSREG(0xdb000400, u16) /* mode reg */
  162. #define P4MD_0 0x0003 /* mask */
  163. #define P4MD_0_IN 0x0000 /* input mode */
  164. #define P4MD_0_OUT 0x0001 /* output mode */
  165. #define P4MD_0_SCL0 0x0002 /* I2C/serial mode */
  166. #define P4MD_1 0x000c
  167. #define P4MD_1_IN 0x0000
  168. #define P4MD_1_OUT 0x0004
  169. #define P4MD_1_SDA0 0x0008
  170. #define P4MD_2 0x0030
  171. #define P4MD_2_IN 0x0000
  172. #define P4MD_2_OUT 0x0010
  173. #define P4MD_2_SCL1 0x0020
  174. #define P4MD_3 0x00c0
  175. #define P4MD_3_IN 0x0000
  176. #define P4MD_3_OUT 0x0040
  177. #define P4MD_3_SDA1 0x0080
  178. #define P4MD_4 0x0300
  179. #define P4MD_4_IN 0x0000
  180. #define P4MD_4_OUT 0x0100
  181. #define P4MD_4_SBO0 0x0200
  182. #define P4MD_5 0x0c00
  183. #define P4MD_5_IN 0x0000
  184. #define P4MD_5_OUT 0x0400
  185. #define P4MD_5_SBO1 0x0800
  186. #define P4MD_6 0x3000
  187. #define P4MD_6_IN 0x0000
  188. #define P4MD_6_OUT 0x1000
  189. #define P4MD_6_SBT0 0x2000
  190. #define P4MD_7 0xc000
  191. #define P4MD_7_IN 0x0000
  192. #define P4MD_7_OUT 0x4000
  193. #define P4MD_7_SBT1 0x8000
  194. #define P4IN __SYSREG(0xdb000404, u8) /* in reg */
  195. #define P4OUT __SYSREG(0xdb000408, u8) /* out reg */
  196. /* I/O port 5 */
  197. #define P5MD __SYSREG(0xdb000500, u16) /* mode reg */
  198. #define P5MD_0 0x0003 /* mask */
  199. #define P5MD_0_IN 0x0000 /* input mode */
  200. #define P5MD_0_OUT 0x0001 /* output mode */
  201. #define P5MD_0_IRTXD 0x0002 /* IrDA mode */
  202. #define P5MD_0_SOUT 0x0004 /* serial mode */
  203. #define P5MD_1 0x000c
  204. #define P5MD_1_IN 0x0000
  205. #define P5MD_1_OUT 0x0004
  206. #define P5MD_1_IRRXDS 0x0008 /* IrDA mode */
  207. #define P5MD_1_SIN 0x000c /* serial mode */
  208. #define P5MD_2 0x0030
  209. #define P5MD_2_IN 0x0000
  210. #define P5MD_2_OUT 0x0010
  211. #define P5MD_2_IRRXDF 0x0020 /* IrDA mode */
  212. #define P5IN __SYSREG(0xdb000504, u8) /* in reg */
  213. #define P5OUT __SYSREG(0xdb000508, u8) /* out reg */
  214. #endif /* __KERNEL__ */
  215. #endif /* _ASM_PIO_REGS_H */