2 * arch/arm/plat-omap/include/mach/mux.h
4 * Table of the Omap register configurations for the FUNC_MUX and
5 * PULL_DWN combinations.
7 * Copyright (C) 2004 - 2008 Texas Instruments Inc.
8 * Copyright (C) 2003 - 2008 Nokia Corporation
10 * Written by Tony Lindgren
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.
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.
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
26 * NOTE: Please use the following naming style for new pin entries.
27 * For example, W8_1610_MMC2_DAT0, where:
29 * - 1610 = 1510 or 1610, none if common for both 1510 and 1610
30 * - MMC2_DAT0 = function
33 #ifndef __ASM_ARCH_MUX_H
34 #define __ASM_ARCH_MUX_H
36 #define PU_PD_SEL_NA 0 /* No pu_pd reg available */
37 #define PULL_DWN_CTRL_NA 0 /* No pull-down control needed */
39 #ifdef CONFIG_OMAP_MUX_DEBUG
40 #define MUX_REG(reg, mode_offset, mode) .mux_reg_name = "FUNC_MUX_CTRL_"#reg, \
41 .mux_reg = FUNC_MUX_CTRL_##reg, \
42 .mask_offset = mode_offset, \
45 #define PULL_REG(reg, bit, status) .pull_name = "PULL_DWN_CTRL_"#reg, \
46 .pull_reg = PULL_DWN_CTRL_##reg, \
50 #define PU_PD_REG(reg, status) .pu_pd_name = "PU_PD_SEL_"#reg, \
51 .pu_pd_reg = PU_PD_SEL_##reg, \
54 #define MUX_REG_7XX(reg, mode_offset, mode) .mux_reg_name = "OMAP7XX_IO_CONF_"#reg, \
55 .mux_reg = OMAP7XX_IO_CONF_##reg, \
56 .mask_offset = mode_offset, \
59 #define PULL_REG_7XX(reg, bit, status) .pull_name = "OMAP7XX_IO_CONF_"#reg, \
60 .pull_reg = OMAP7XX_IO_CONF_##reg, \
66 #define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \
67 .mask_offset = mode_offset, \
70 #define PULL_REG(reg, bit, status) .pull_reg = PULL_DWN_CTRL_##reg, \
74 #define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \
77 #define MUX_REG_7XX(reg, mode_offset, mode) \
78 .mux_reg = OMAP7XX_IO_CONF_##reg, \
79 .mask_offset = mode_offset, \
82 #define PULL_REG_7XX(reg, bit, status) .pull_reg = OMAP7XX_IO_CONF_##reg, \
86 #endif /* CONFIG_OMAP_MUX_DEBUG */
88 #define MUX_CFG(desc, mux_reg, mode_offset, mode, \
89 pull_reg, pull_bit, pull_status, \
90 pu_pd_reg, pu_pd_status, debug_status) \
93 .debug = debug_status, \
94 MUX_REG(mux_reg, mode_offset, mode) \
95 PULL_REG(pull_reg, pull_bit, pull_status) \
96 PU_PD_REG(pu_pd_reg, pu_pd_status) \
101 * OMAP730/850 has a slightly different config for the pin mux.
102 * - config regs are the OMAP7XX_IO_CONF_x regs (see omap730.h) regs and
103 * not the FUNC_MUX_CTRL_x regs from hardware.h
104 * - for pull-up/down, only has one enable bit which is is in the same register
107 #define MUX_CFG_7XX(desc, mux_reg, mode_offset, mode, \
108 pull_bit, pull_status, debug_status)\
111 .debug = debug_status, \
112 MUX_REG_7XX(mux_reg, mode_offset, mode) \
113 PULL_REG_7XX(mux_reg, pull_bit, pull_status) \
117 #define MUX_CFG_24XX(desc, reg_offset, mode, \
118 pull_en, pull_mode, dbg) \
122 .mux_reg = reg_offset, \
124 .pull_val = pull_en, \
125 .pu_pd_val = pull_mode, \
128 /* 24xx/34xx mux bit defines */
129 #define OMAP2_PULL_ENA (1 << 3)
130 #define OMAP2_PULL_UP (1 << 4)
131 #define OMAP2_ALTELECTRICALSEL (1 << 5)
135 const unsigned int mux_reg
;
138 #if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP24XX)
139 const unsigned char mask_offset
;
140 const unsigned char mask
;
142 const char *pull_name
;
143 const unsigned int pull_reg
;
144 const unsigned char pull_val
;
145 const unsigned char pull_bit
;
147 const char *pu_pd_name
;
148 const unsigned int pu_pd_reg
;
149 const unsigned char pu_pd_val
;
152 #if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
153 const char *mux_reg_name
;
159 /* OMAP 730 keyboard */
175 W18_7XX_USB_DMCK_OUT
,
196 enum omap1xxx_index
{
197 /* UART1 (BT_UART_GATING)*/
201 /* UART2 (COM_UART_GATING)*/
207 /* UART3 (GIGA_UART_GATING) */
213 UART3_BCLK
, /* 12MHz clock out */
220 /* USB master generic */
303 V5_1610_MMC2_DATDIR0
,
304 W19_1610_MMC2_DATDIR1
,
307 /* OMAP-1610 External Trace Interface */
330 /* OMAP-1610 uWire */
349 /* OMAP-1610 Flash */
350 L3_1610_FLASH_CS2B_OE
,
351 M8_1610_FLASH_CS2B_WE
,
361 /* OMAP-1710 MMC CMDDIR and DATDIR0 */
364 P20_1710_MMC_DATDIR0
,
366 /* OMAP-1610 USB0 alternate pin configuration */
409 /* Power management */
418 /* CompactFlash controller */
425 /* parallel camera */
449 enum omap24xx_index
{
456 /* 24xx Menelaus interrupt */
462 /* 24xx GPMC chipselects, wait pin monitoring */
471 Y15_24XX_MCBSP2_CLKX
,
509 /* 24xx external DMA requests */
528 F19_24XX_MMC_DAT_DIR0
,
529 E20_24XX_MMC_DAT_DIR1
,
530 F18_24XX_MMC_DAT_DIR2
,
531 E18_24XX_MMC_DAT_DIR3
,
532 G18_24XX_MMC_CMD_DIR
,
557 AA4_24XX_USB2_TLLSE0
,
574 /* 24xx Menelaus Keypad GPIO */
593 AD9_2430_USB0HS_DATA3
,
594 Y11_2430_USB0HS_DATA4
,
595 AD7_2430_USB0HS_DATA5
,
596 AE7_2430_USB0HS_DATA6
,
597 AD4_2430_USB0HS_DATA2
,
598 AF9_2430_USB0HS_DATA0
,
599 AE6_2430_USB0HS_DATA1
,
604 AC7_2430_USB0HS_DATA7
,
609 AB2_2430_MCBSP1_CLKR
,
616 AC10_2430_MCBSP2_FSX
,
617 AD16_2430_MCBSP2_CLX
,
620 AC10_2430_MCBSP2_FSX_OFF
,
621 AD16_2430_MCBSP2_CLX_OFF
,
622 AE13_2430_MCBSP2_DX_OFF
,
623 AD13_2430_MCBSP2_DR_OFF
,
625 AC9_2430_MCBSP3_CLKX
,
633 AC25_2430_MCBSP4_FSX
,
635 AE16_2430_MCBSP5_CLKX
,
636 AF12_2430_MCBSP5_FSX
,
642 AD15_2430_MCSPI1_SIMO
,
643 AE17_2430_MCSPI1_SOMI
,
646 /* Touchscreen GPIO */
651 struct omap_mux_cfg
{
652 struct pin_config
*pins
;
654 int (*cfg_reg
)(const struct pin_config
*cfg
);
657 #ifdef CONFIG_OMAP_MUX
658 /* setup pin muxing in Linux */
659 extern int omap1_mux_init(void);
660 extern int omap_mux_register(struct omap_mux_cfg
*);
661 extern int omap_cfg_reg(unsigned long reg_cfg
);
663 /* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
664 static inline int omap1_mux_init(void) { return 0; }
665 static inline int omap_cfg_reg(unsigned long reg_cfg
) { return 0; }
668 extern int omap2_mux_init(void);