memoryOperation.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. /*
  2. * arch/arm/plat-omap/include/mach/mux.h
  3. *
  4. * Table of the Omap register configurations for the FUNC_MUX and
  5. * PULL_DWN combinations.
  6. *
  7. * Copyright (C) 2004 - 2008 Texas Instruments Inc.
  8. * Copyright (C) 2003 - 2008 Nokia Corporation
  9. *
  10. * Written by Tony Lindgren
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 2 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25. *
  26. * NOTE: Please use the following naming style for new pin entries.
  27. * For example, W8_1610_MMC2_DAT0, where:
  28. * - W8 = ball
  29. * - 1610 = 1510 or 1610, none if common for both 1510 and 1610
  30. * - MMC2_DAT0 = function
  31. */
  32. #ifndef __ASM_ARCH_MUX_H
  33. #define __ASM_ARCH_MUX_H
  34. #define PU_PD_SEL_NA 0 /* No pu_pd reg available */
  35. #define PULL_DWN_CTRL_NA 0 /* No pull-down control needed */
  36. #ifdef CONFIG_OMAP_MUX_DEBUG
  37. #define MUX_REG(reg, mode_offset, mode) .mux_reg_name = "FUNC_MUX_CTRL_"#reg, \
  38. .mux_reg = FUNC_MUX_CTRL_##reg, \
  39. .mask_offset = mode_offset, \
  40. .mask = mode,
  41. #define PULL_REG(reg, bit, status) .pull_name = "PULL_DWN_CTRL_"#reg, \
  42. .pull_reg = PULL_DWN_CTRL_##reg, \
  43. .pull_bit = bit, \
  44. .pull_val = status,
  45. #define PU_PD_REG(reg, status) .pu_pd_name = "PU_PD_SEL_"#reg, \
  46. .pu_pd_reg = PU_PD_SEL_##reg, \
  47. .pu_pd_val = status,
  48. #define MUX_REG_7XX(reg, mode_offset, mode) .mux_reg_name = "OMAP7XX_IO_CONF_"#reg, \
  49. .mux_reg = OMAP7XX_IO_CONF_##reg, \
  50. .mask_offset = mode_offset, \
  51. .mask = mode,
  52. #define PULL_REG_7XX(reg, bit, status) .pull_name = "OMAP7XX_IO_CONF_"#reg, \
  53. .pull_reg = OMAP7XX_IO_CONF_##reg, \
  54. .pull_bit = bit, \
  55. .pull_val = status,
  56. #else
  57. #define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \
  58. .mask_offset = mode_offset, \
  59. .mask = mode,
  60. #define PULL_REG(reg, bit, status) .pull_reg = PULL_DWN_CTRL_##reg, \
  61. .pull_bit = bit, \
  62. .pull_val = status,
  63. #define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \
  64. .pu_pd_val = status,
  65. #define MUX_REG_7XX(reg, mode_offset, mode) \
  66. .mux_reg = OMAP7XX_IO_CONF_##reg, \
  67. .mask_offset = mode_offset, \
  68. .mask = mode,
  69. #define PULL_REG_7XX(reg, bit, status) .pull_reg = OMAP7XX_IO_CONF_##reg, \
  70. .pull_bit = bit, \
  71. .pull_val = status,
  72. #endif /* CONFIG_OMAP_MUX_DEBUG */
  73. #define MUX_CFG(desc, mux_reg, mode_offset, mode, \
  74. pull_reg, pull_bit, pull_status, \
  75. pu_pd_reg, pu_pd_status, debug_status) \
  76. { \
  77. .name = desc, \
  78. .debug = debug_status, \
  79. MUX_REG(mux_reg, mode_offset, mode) \
  80. PULL_REG(pull_reg, pull_bit, pull_status) \
  81. PU_PD_REG(pu_pd_reg, pu_pd_status) \
  82. },
  83. /*
  84. * OMAP730/850 has a slightly different config for the pin mux.
  85. * - config regs are the OMAP7XX_IO_CONF_x regs (see omap7xx.h) regs and
  86. * not the FUNC_MUX_CTRL_x regs from hardware.h
  87. * - for pull-up/down, only has one enable bit which is is in the same register
  88. * as mux config
  89. */
  90. #define MUX_CFG_7XX(desc, mux_reg, mode_offset, mode, \
  91. pull_bit, pull_status, debug_status)\
  92. { \
  93. .name = desc, \
  94. .debug = debug_status, \
  95. MUX_REG_7XX(mux_reg, mode_offset, mode) \
  96. PULL_REG_7XX(mux_reg, pull_bit, pull_status) \
  97. PU_PD_REG(NA, 0) \
  98. },
  99. struct pin_config {
  100. char *name;
  101. const unsigned int mux_reg;
  102. unsigned char debug;
  103. const unsigned char mask_offset;
  104. const unsigned char mask;
  105. const char *pull_name;
  106. const unsigned int pull_reg;
  107. const unsigned char pull_val;
  108. const unsigned char pull_bit;
  109. const char *pu_pd_name;
  110. const unsigned int pu_pd_reg;
  111. const unsigned char pu_pd_val;
  112. #if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
  113. const char *mux_reg_name;
  114. #endif
  115. };
  116. enum omap7xx_index {
  117. /* OMAP 730 keyboard */
  118. E2_7XX_KBR0,
  119. J7_7XX_KBR1,
  120. E1_7XX_KBR2,
  121. F3_7XX_KBR3,
  122. D2_7XX_KBR4,
  123. C2_7XX_KBC0,
  124. D3_7XX_KBC1,
  125. E4_7XX_KBC2,
  126. F4_7XX_KBC3,
  127. E3_7XX_KBC4,
  128. /* USB */
  129. AA17_7XX_USB_DM,
  130. W16_7XX_USB_PU_EN,
  131. W17_7XX_USB_VBUSI,
  132. W18_7XX_USB_DMCK_OUT,
  133. W19_7XX_USB_DCRST,
  134. /* MMC */
  135. MMC_7XX_CMD,
  136. MMC_7XX_CLK,
  137. MMC_7XX_DAT0,
  138. /* I2C */
  139. I2C_7XX_SCL,
  140. I2C_7XX_SDA,
  141. /* SPI */
  142. SPI_7XX_1,
  143. SPI_7XX_2,
  144. SPI_7XX_3,
  145. SPI_7XX_4,
  146. SPI_7XX_5,
  147. SPI_7XX_6,
  148. /* UART */
  149. UART_7XX_1,
  150. UART_7XX_2,
  151. };
  152. enum omap1xxx_index {
  153. /* UART1 (BT_UART_GATING)*/
  154. UART1_TX = 0,
  155. UART1_RTS,
  156. /* UART2 (COM_UART_GATING)*/
  157. UART2_TX,
  158. UART2_RX,
  159. UART2_CTS,
  160. UART2_RTS,
  161. /* UART3 (GIGA_UART_GATING) */
  162. UART3_TX,
  163. UART3_RX,
  164. UART3_CTS,
  165. UART3_RTS,
  166. UART3_CLKREQ,
  167. UART3_BCLK, /* 12MHz clock out */
  168. Y15_1610_UART3_RTS,
  169. /* PWT & PWL */
  170. PWT,
  171. PWL,
  172. /* USB master generic */
  173. R18_USB_VBUS,
  174. R18_1510_USB_GPIO0,
  175. W4_USB_PUEN,
  176. W4_USB_CLKO,
  177. W4_USB_HIGHZ,
  178. W4_GPIO58,
  179. /* USB1 master */
  180. USB1_SUSP,
  181. USB1_SEO,
  182. W13_1610_USB1_SE0,
  183. USB1_TXEN,
  184. USB1_TXD,
  185. USB1_VP,
  186. USB1_VM,
  187. USB1_RCV,
  188. USB1_SPEED,
  189. R13_1610_USB1_SPEED,
  190. R13_1710_USB1_SE0,
  191. /* USB2 master */
  192. USB2_SUSP,
  193. USB2_VP,
  194. USB2_TXEN,
  195. USB2_VM,
  196. USB2_RCV,
  197. USB2_SEO,
  198. USB2_TXD,
  199. /* OMAP-1510 GPIO */
  200. R18_1510_GPIO0,
  201. R19_1510_GPIO1,
  202. M14_1510_GPIO2,
  203. /* OMAP1610 GPIO */
  204. P18_1610_GPIO3,
  205. Y15_1610_GPIO17,
  206. /* OMAP-1710 GPIO */
  207. R18_1710_GPIO0,
  208. V2_1710_GPIO10,
  209. N21_1710_GPIO14,
  210. W15_1710_GPIO40,
  211. /* MPUIO */
  212. MPUIO2,
  213. N15_1610_MPUIO2,
  214. MPUIO4,
  215. MPUIO5,
  216. T20_1610_MPUIO5,
  217. W11_1610_MPUIO6,