mux.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /*
  2. * Table of the DAVINCI register configurations for the PINMUX combinations
  3. *
  4. * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
  5. *
  6. * Based on linux/include/asm-arm/arch-omap/mux.h:
  7. * Copyright (C) 2003 - 2005 Nokia Corporation
  8. *
  9. * Written by Tony Lindgren
  10. *
  11. * 2007 (c) MontaVista Software, Inc. This file is licensed under
  12. * the terms of the GNU General Public License version 2. This program
  13. * is licensed "as is" without any warranty of any kind, whether express
  14. * or implied.
  15. *
  16. * Copyright (C) 2008 Texas Instruments.
  17. */
  18. #ifndef __INC_MACH_MUX_H
  19. #define __INC_MACH_MUX_H
  20. /* System module registers */
  21. #define PINMUX0 0x00
  22. #define PINMUX1 0x04
  23. /* dm355 only */
  24. #define PINMUX2 0x08
  25. #define PINMUX3 0x0c
  26. #define PINMUX4 0x10
  27. #define INTMUX 0x18
  28. #define EVTMUX 0x1c
  29. struct mux_config {
  30. const char *name;
  31. const char *mux_reg_name;
  32. const unsigned char mux_reg;
  33. const unsigned char mask_offset;
  34. const unsigned char mask;
  35. const unsigned char mode;
  36. bool debug;
  37. };
  38. enum davinci_dm644x_index {
  39. /* ATA and HDDIR functions */
  40. DM644X_HDIREN,
  41. DM644X_ATAEN,
  42. DM644X_ATAEN_DISABLE,
  43. /* HPI functions */
  44. DM644X_HPIEN_DISABLE,
  45. /* AEAW functions */
  46. DM644X_AEAW,
  47. /* Memory Stick */
  48. DM644X_MSTK,
  49. /* I2C */
  50. DM644X_I2C,
  51. /* ASP function */
  52. DM644X_MCBSP,
  53. /* UART1 */
  54. DM644X_UART1,
  55. /* UART2 */
  56. DM644X_UART2,
  57. /* PWM0 */
  58. DM644X_PWM0,
  59. /* PWM1 */
  60. DM644X_PWM1,
  61. /* PWM2 */
  62. DM644X_PWM2,
  63. /* VLYNQ function */
  64. DM644X_VLYNQEN,
  65. DM644X_VLSCREN,
  66. DM644X_VLYNQWD,
  67. /* EMAC and MDIO function */
  68. DM644X_EMACEN,
  69. /* GPIO3V[0:16] pins */
  70. DM644X_GPIO3V,
  71. /* GPIO pins */
  72. DM644X_GPIO0,
  73. DM644X_GPIO3,
  74. DM644X_GPIO43_44,
  75. DM644X_GPIO46_47,
  76. /* VPBE */
  77. DM644X_RGB666,
  78. /* LCD */
  79. DM644X_LOEEN,
  80. DM644X_LFLDEN,
  81. };
  82. enum davinci_dm646x_index {
  83. /* ATA function */
  84. DM646X_ATAEN,
  85. /* AUDIO Clock */
  86. DM646X_AUDCK1,
  87. DM646X_AUDCK0,
  88. /* CRGEN Control */
  89. DM646X_CRGMUX,
  90. /* VPIF Control */
  91. DM646X_STSOMUX_DISABLE,
  92. DM646X_STSIMUX_DISABLE,
  93. DM646X_PTSOMUX_DISABLE,
  94. DM646X_PTSIMUX_DISABLE,
  95. /* TSIF Control */
  96. DM646X_STSOMUX,
  97. DM646X_STSIMUX,
  98. DM646X_PTSOMUX_PARALLEL,
  99. DM646X_PTSIMUX_PARALLEL,
  100. DM646X_PTSOMUX_SERIAL,
  101. DM646X_PTSIMUX_SERIAL,
  102. };
  103. enum davinci_dm355_index {
  104. /* MMC/SD 0 */
  105. DM355_MMCSD0,
  106. /* MMC/SD 1 */
  107. DM355_SD1_CLK,
  108. DM355_SD1_CMD,
  109. DM355_SD1_DATA3,
  110. DM355_SD1_DATA2,
  111. DM355_SD1_DATA1,
  112. DM355_SD1_DATA0,
  113. /* I2C */
  114. DM355_I2C_SDA,
  115. DM355_I2C_SCL,
  116. /* ASP0 function */
  117. DM355_MCBSP0_BDX,
  118. DM355_MCBSP0_X,
  119. DM355_MCBSP0_BFSX,
  120. DM355_MCBSP0_BDR,
  121. DM355_MCBSP0_R,
  122. DM355_MCBSP0_BFSR,
  123. /* SPI0 */
  124. DM355_SPI0_SDI,
  125. DM355_SPI0_SDENA0,
  126. DM355_SPI0_SDENA1,
  127. /* IRQ muxing */
  128. DM355_INT_EDMA_CC,
  129. DM355_INT_EDMA_TC0_ERR,
  130. DM355_INT_EDMA_TC1_ERR,
  131. /* EDMA event muxing */
  132. DM355_EVT8_ASP1_TX,
  133. DM355_EVT9_ASP1_RX,
  134. DM355_EVT26_MMC0_RX,
  135. };
  136. #ifdef CONFIG_DAVINCI_MUX
  137. /* setup pin muxing */
  138. extern void davinci_mux_init(void);
  139. extern int davinci_mux_register(const struct mux_config *pins,
  140. unsigned long size);
  141. extern int davinci_cfg_reg(unsigned long reg_cfg);
  142. #else
  143. /* boot loader does it all (no warnings from CONFIG_DAVINCI_MUX_WARNINGS) */
  144. static inline void davinci_mux_init(void) {}
  145. static inline int davinci_mux_register(const struct mux_config *pins,
  146. unsigned long size) { return 0; }
  147. static inline int davinci_cfg_reg(unsigned long reg_cfg) { return 0; }
  148. #endif
  149. #endif /* __INC_MACH_MUX_H */