pcm990_baseboard.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. /*
  2. * arch/arm/mach-pxa/include/mach/pcm990_baseboard.h
  3. *
  4. * (c) 2003 Phytec Messtechnik GmbH <armlinux@phytec.de>
  5. * (c) 2007 Juergen Beisert <j.beisert@pengutronix.de>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <mach/pcm027.h>
  22. /*
  23. * definitions relevant only when the PCM-990
  24. * development base board is in use
  25. */
  26. /* CPLD's interrupt controller is connected to PCM-027 GPIO 9 */
  27. #define PCM990_CTRL_INT_IRQ_GPIO 9
  28. #define PCM990_CTRL_INT_IRQ PXA_GPIO_TO_IRQ(PCM990_CTRL_INT_IRQ_GPIO)
  29. #define PCM990_CTRL_INT_IRQ_EDGE IRQ_TYPE_EDGE_RISING
  30. #define PCM990_CTRL_PHYS PXA_CS1_PHYS /* 16-Bit */
  31. #define PCM990_CTRL_BASE 0xea000000
  32. #define PCM990_CTRL_SIZE (1*1024*1024)
  33. #define PCM990_CTRL_PWR_IRQ_GPIO 14
  34. #define PCM990_CTRL_PWR_IRQ PXA_GPIO_TO_IRQ(PCM990_CTRL_PWR_IRQ_GPIO)
  35. #define PCM990_CTRL_PWR_IRQ_EDGE IRQ_TYPE_EDGE_RISING
  36. /* visible CPLD (U7) registers */
  37. #define PCM990_CTRL_REG0 0x0000 /* RESET REGISTER */
  38. #define PCM990_CTRL_SYSRES 0x0001 /* System RESET REGISTER */
  39. #define PCM990_CTRL_RESOUT 0x0002 /* RESETOUT Enable REGISTER */
  40. #define PCM990_CTRL_RESGPIO 0x0004 /* RESETGPIO Enable REGISTER */
  41. #define PCM990_CTRL_REG1 0x0002 /* Power REGISTER */
  42. #define PCM990_CTRL_5VOFF 0x0001 /* Disable 5V Regulators */
  43. #define PCM990_CTRL_CANPWR 0x0004 /* Enable CANPWR ADUM */
  44. #define PCM990_CTRL_PM_5V 0x0008 /* Read 5V OK */
  45. #define PCM990_CTRL_REG2 0x0004 /* LED REGISTER */
  46. #define PCM990_CTRL_LEDPWR 0x0001 /* POWER LED enable */
  47. #define PCM990_CTRL_LEDBAS 0x0002 /* BASIS LED enable */
  48. #define PCM990_CTRL_LEDUSR 0x0004 /* USER LED enable */
  49. #define PCM990_CTRL_REG3 0x0006 /* LCD CTRL REGISTER 3 */
  50. #define PCM990_CTRL_LCDPWR 0x0001 /* RW LCD Power on */
  51. #define PCM990_CTRL_LCDON 0x0002 /* RW LCD Latch on */
  52. #define PCM990_CTRL_LCDPOS1 0x0004 /* RW POS 1 */
  53. #define PCM990_CTRL_LCDPOS2 0x0008 /* RW POS 2 */
  54. #define PCM990_CTRL_REG4 0x0008 /* MMC1 CTRL REGISTER 4 */
  55. #define PCM990_CTRL_MMC1PWR 0x0001 /* RW MMC1 Power on */
  56. #define PCM990_CTRL_REG5 0x000A /* MMC2 CTRL REGISTER 5 */
  57. #define PCM990_CTRL_MMC2PWR 0x0001 /* RW MMC2 Power on */
  58. #define PCM990_CTRL_MMC2LED 0x0002 /* RW MMC2 LED */
  59. #define PCM990_CTRL_MMC2DE 0x0004 /* R MMC2 Card detect */
  60. #define PCM990_CTRL_MMC2WP 0x0008 /* R MMC2 Card write protect */
  61. #define PCM990_CTRL_REG6 0x000C /* Interrupt Clear REGISTER */
  62. #define PCM990_CTRL_INTC0 0x0001 /* Clear Reg BT Detect */
  63. #define PCM990_CTRL_INTC1 0x0002 /* Clear Reg FR RI */
  64. #define PCM990_CTRL_INTC2 0x0004 /* Clear Reg MMC1 Detect */
  65. #define PCM990_CTRL_INTC3 0x0008 /* Clear Reg PM_5V off */
  66. #define PCM990_CTRL_REG7 0x000E /* Interrupt Enable REGISTER */
  67. #define PCM990_CTRL_ENAINT0 0x0001 /* Enable Int BT Detect */
  68. #define PCM990_CTRL_ENAINT1 0x0002 /* Enable Int FR RI */
  69. #define PCM990_CTRL_ENAINT2 0x0004 /* Enable Int MMC1 Detect */
  70. #define PCM990_CTRL_ENAINT3 0x0008 /* Enable Int PM_5V off */
  71. #define PCM990_CTRL_REG8 0x0014 /* Uart REGISTER */
  72. #define PCM990_CTRL_FFSD 0x0001 /* BT Uart Enable */
  73. #define PCM990_CTRL_BTSD 0x0002 /* FF Uart Enable */
  74. #define PCM990_CTRL_FFRI 0x0004 /* FF Uart RI detect */
  75. #define PCM990_CTRL_BTRX 0x0008 /* BT Uart Rx detect */
  76. #define PCM990_CTRL_REG9 0x0010 /* AC97 Flash REGISTER */
  77. #define PCM990_CTRL_FLWP 0x0001 /* pC Flash Write Protect */
  78. #define PCM990_CTRL_FLDIS 0x0002 /* pC Flash Disable */
  79. #define PCM990_CTRL_AC97ENA 0x0004 /* Enable AC97 Expansion */
  80. #define PCM990_CTRL_REG10 0x0012 /* GPS-REGISTER */
  81. #define PCM990_CTRL_GPSPWR 0x0004 /* GPS-Modul Power on */
  82. #define PCM990_CTRL_GPSENA 0x0008 /* GPS-Modul Enable */
  83. #define PCM990_CTRL_REG11 0x0014 /* Accu REGISTER */
  84. #define PCM990_CTRL_ACENA 0x0001 /* Charge Enable */
  85. #define PCM990_CTRL_ACSEL 0x0002 /* Charge Akku -> DC Enable */
  86. #define PCM990_CTRL_ACPRES 0x0004 /* DC Present */
  87. #define PCM990_CTRL_ACALARM 0x0008 /* Error Akku */
  88. #define PCM990_CTRL_P2V(x) ((x) - PCM990_CTRL_PHYS + PCM990_CTRL_BASE)
  89. #define PCM990_CTRL_V2P(x) ((x) - PCM990_CTRL_BASE + PCM990_CTRL_PHYS)
  90. #ifndef __ASSEMBLY__
  91. # define __PCM990_CTRL_REG(x) \
  92. (*((volatile unsigned char *)PCM990_CTRL_P2V(x)))
  93. #else
  94. # define __PCM990_CTRL_REG(x) PCM990_CTRL_P2V(x)
  95. #endif
  96. #define PCM990_INTMSKENA __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG7)
  97. #define PCM990_INTSETCLR __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG6)
  98. #define PCM990_CTRL0 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG0)
  99. #define PCM990_CTRL1 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG1)
  100. #define PCM990_CTRL2 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG2)
  101. #define PCM990_CTRL3 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3)
  102. #define PCM990_CTRL4 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG4)
  103. #define PCM990_CTRL5 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5)
  104. #define PCM990_CTRL6 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG6)
  105. #define PCM990_CTRL7 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG7)
  106. #define PCM990_CTRL8 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG8)
  107. #define PCM990_CTRL9 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG9)
  108. #define PCM990_CTRL10 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG10)
  109. #define PCM990_CTRL11 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG11)
  110. /*
  111. * IDE
  112. */
  113. #define PCM990_IDE_IRQ_GPIO 13
  114. #define PCM990_IDE_IRQ PXA_GPIO_TO_IRQ(PCM990_IDE_IRQ_GPIO)
  115. #define PCM990_IDE_IRQ_EDGE IRQ_TYPE_EDGE_RISING
  116. #define PCM990_IDE_PLD_PHYS 0x20000000 /* 16 bit wide */
  117. #define PCM990_IDE_PLD_BASE 0xee000000
  118. #define PCM990_IDE_PLD_SIZE (1*1024*1024)
  119. /* visible CPLD (U6) registers */
  120. #define PCM990_IDE_PLD_REG0 0x1000 /* OFFSET IDE REGISTER 0 */
  121. #define PCM990_IDE_PM5V 0x0004 /* R System VCC_5V */
  122. #define PCM990_IDE_STBY 0x0008 /* R System StandBy */
  123. #define PCM990_IDE_PLD_REG1 0x1002 /* OFFSET IDE REGISTER 1 */
  124. #define PCM990_IDE_IDEMODE 0x0001 /* R TrueIDE Mode */
  125. #define PCM990_IDE_DMAENA 0x0004 /* RW DMA Enable */
  126. #define PCM990_IDE_DMA1_0 0x0008 /* RW 1=DREQ1 0=DREQ0 */
  127. #define PCM990_IDE_PLD_REG2 0x1004 /* OFFSET IDE REGISTER 2 */
  128. #define PCM990_IDE_RESENA 0x0001 /* RW IDE Reset Bit enable */
  129. #define PCM990_IDE_RES 0x0002 /* RW IDE Reset Bit */
  130. #define PCM990_IDE_RDY 0x0008 /* RDY */
  131. #define PCM990_IDE_PLD_REG3 0x1006 /* OFFSET IDE REGISTER 3 */
  132. #define PCM990_IDE_IDEOE 0x0001 /* RW Latch on Databus */
  133. #define PCM990_IDE_IDEON 0x0002 /* RW Latch on Control Address */
  134. #define PCM990_IDE_IDEIN 0x0004 /* RW Latch on Interrupt usw. */
  135. #define PCM990_IDE_PLD_REG4 0x1008 /* OFFSET IDE REGISTER 4 */
  136. #define PCM990_IDE_PWRENA 0x0001 /* RW IDE Power enable */
  137. #define PCM990_IDE_5V 0x0002 /* R IDE Power 5V */
  138. #define PCM990_IDE_PWG 0x0008 /* R IDE Power is on */
  139. #define PCM990_IDE_PLD_P2V(x) ((x) - PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_BASE)
  140. #define PCM990_IDE_PLD_V2P(x) ((x) - PCM990_IDE_PLD_BASE + PCM990_IDE_PLD_PHYS)
  141. #ifndef __ASSEMBLY__
  142. # define __PCM990_IDE_PLD_REG(x) \
  143. (*((volatile unsigned char *)PCM990_IDE_PLD_P2V(x)))
  144. #else
  145. # define __PCM990_IDE_PLD_REG(x) PCM990_IDE_PLD_P2V(x)
  146. #endif
  147. #define PCM990_IDE0 \
  148. __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG0)
  149. #define PCM990_IDE1 \
  150. __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG1)
  151. #define PCM990_IDE2 \
  152. __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG2)
  153. #define PCM990_IDE3 \
  154. __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG3)
  155. #define PCM990_IDE4 \
  156. __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG4)
  157. /*
  158. * Compact Flash
  159. */
  160. #define PCM990_CF_IRQ_GPIO 11
  161. #define PCM990_CF_IRQ PXA_GPIO_TO_IRQ(PCM990_CF_IRQ_GPIO)
  162. #define PCM990_CF_IRQ_EDGE IRQ_TYPE_EDGE_RISING
  163. #define PCM990_CF_CD_GPIO 12
  164. #define PCM990_CF_CD PXA_GPIO_TO_IRQ(PCM990_CF_CD_GPIO)
  165. #define PCM990_CF_CD_EDGE IRQ_TYPE_EDGE_RISING
  166. #define PCM990_CF_PLD_PHYS 0x30000000 /* 16 bit wide */
  167. #define PCM990_CF_PLD_BASE 0xef000000
  168. #define PCM990_CF_PLD_SIZE (1*1024*1024)
  169. #define PCM990_CF_PLD_P2V(x) ((x) - PCM990_CF_PLD_PHYS + PCM990_CF_PLD_BASE)
  170. #define PCM990_CF_PLD_V2P(x) ((x) - PCM990_CF_PLD_BASE + PCM990_CF_PLD_PHYS)
  171. /* visible CPLD (U6) registers */
  172. #define PCM990_CF_PLD_REG0 0x1000 /* OFFSET CF REGISTER 0 */
  173. #define PCM990_CF_REG0_LED 0x0001 /* RW LED on */
  174. #define PCM990_CF_REG0_BLK 0x0002 /* RW LED flash when access */
  175. #define PCM990_CF_REG0_PM5V 0x0004 /* R System VCC_5V enable */
  176. #define PCM990_CF_REG0_STBY 0x0008 /* R System StandBy */
  177. #define PCM990_CF_PLD_REG1 0x1002 /* OFFSET CF REGISTER 1 */
  178. #define PCM990_CF_REG1_IDEMODE 0x0001 /* RW CF card run as TrueIDE */
  179. #define PCM990_CF_REG1_CF0 0x0002 /* RW CF card at ADDR 0x28000000 */
  180. #define PCM990_CF_PLD_REG2 0x1004 /* OFFSET CF REGISTER 2 */
  181. #define PCM990_CF_REG2_RES 0x0002 /* RW CF RESET BIT */
  182. #define PCM990_CF_REG2_RDYENA 0x0004 /* RW Enable CF_RDY */
  183. #define PCM990_CF_REG2_RDY 0x0008 /* R CF_RDY auf PWAIT */
  184. #define PCM990_CF_PLD_REG3 0x1006 /* OFFSET CF REGISTER 3 */
  185. #define PCM990_CF_REG3_CFOE 0x0001 /* RW Latch on Databus */
  186. #define PCM990_CF_REG3_CFON 0x0002 /* RW Latch on Control Address */
  187. #define PCM990_CF_REG3_CFIN 0x0004 /* RW Latch on Interrupt usw. */
  188. #define PCM990_CF_REG3_CFCD 0x0008 /* RW Latch on CD1/2 VS1/2 usw */
  189. #define PCM990_CF_PLD_REG4 0x1008 /* OFFSET CF REGISTER 4 */
  190. #define PCM990_CF_REG4_PWRENA 0x0001 /* RW CF Power on (CD1/2 = "00") */
  191. #define PCM990_CF_REG4_5_3V 0x0002 /* RW 1 = 5V CF_VCC 0 = 3 V CF_VCC */
  192. #define PCM990_CF_REG4_3B 0x0004 /* RW 3.0V Backup from VCC (5_3V=0) */
  193. #define PCM990_CF_REG4_PWG 0x0008 /* R CF-Power is on */
  194. #define PCM990_CF_PLD_REG5 0x100A /* OFFSET CF REGISTER 5 */
  195. #define PCM990_CF_REG5_BVD1 0x0001 /* R CF /BVD1 */
  196. #define PCM990_CF_REG5_BVD2 0x0002 /* R CF /BVD2 */
  197. #define PCM990_CF_REG5_VS1 0x0004 /* R CF /VS1 */
  198. #define PCM990_CF_REG5_VS2 0x0008 /* R CF /VS2 */
  199. #define PCM990_CF_PLD_REG6 0x100C /* OFFSET CF REGISTER 6 */
  200. #define PCM990_CF_REG6_CD1 0x0001 /* R CF Card_Detect1 */
  201. #define PCM990_CF_REG6_CD2 0x0002 /* R CF Card_Detect2 */
  202. #ifndef __ASSEMBLY__
  203. # define __PCM990_CF_PLD_REG(x) \
  204. (*((volatile unsigned char *)PCM990_CF_PLD_P2V(x)))
  205. #else
  206. # define __PCM990_CF_PLD_REG(x) PCM990_CF_PLD_P2V(x)
  207. #endif
  208. #define PCM990_CF0 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG0)
  209. #define PCM990_CF1 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG1)
  210. #define PCM990_CF2 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG2)
  211. #define PCM990_CF3 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG3)
  212. #define PCM990_CF4 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG4)
  213. #define PCM990_CF5 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG5)
  214. #define PCM990_CF6 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG6)
  215. /*
  216. * Wolfson AC97 Touch
  217. */
  218. #define PCM990_AC97_IRQ_GPIO 10
  219. #define PCM990_AC97_IRQ PXA_GPIO_TO_IRQ(PCM990_AC97_IRQ_GPIO)
  220. #define PCM990_AC97_IRQ_EDGE IRQ_TYPE_EDGE_RISING
  221. /*
  222. * MMC phyCORE
  223. */
  224. #define PCM990_MMC0_IRQ_GPIO 9
  225. #define PCM990_MMC0_IRQ PXA_GPIO_TO_IRQ(PCM990_MMC0_IRQ_GPIO)
  226. #define PCM990_MMC0_IRQ_EDGE IRQ_TYPE_EDGE_FALLING
  227. /*
  228. * USB phyCore
  229. */
  230. #define PCM990_USB_OVERCURRENT (88 | GPIO_ALT_FN_1_IN)
  231. #define PCM990_USB_PWR_EN (89 | GPIO_ALT_FN_2_OUT)