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 omap7xx.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) \
119 const unsigned int mux_reg
;
122 const unsigned char mask_offset
;
123 const unsigned char mask
;
125 const char *pull_name
;
126 const unsigned int pull_reg
;
127 const unsigned char pull_val
;
128 const unsigned char pull_bit
;
130 const char *pu_pd_name
;
131 const unsigned int pu_pd_reg
;
132 const unsigned char pu_pd_val
;
134 #if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
135 const char *mux_reg_name
;
141 /* OMAP 730 keyboard */
157 W18_7XX_USB_DMCK_OUT
,
182 enum omap1xxx_index
{
183 /* UART1 (BT_UART_GATING)*/
187 /* UART2 (COM_UART_GATING)*/
193 /* UART3 (GIGA_UART_GATING) */
199 UART3_BCLK
, /* 12MHz clock out */
206 /* USB master generic */
289 V5_1610_MMC2_DATDIR0
,
290 W19_1610_MMC2_DATDIR1
,
293 /* OMAP-1610 External Trace Interface */
316 /* OMAP-1610 uWire */
335 /* OMAP-1610 Flash */
336 L3_1610_FLASH_CS2B_OE
,
337 M8_1610_FLASH_CS2B_WE
,
347 /* OMAP-1710 MMC CMDDIR and DATDIR0 */
350 P20_1710_MMC_DATDIR0
,
352 /* OMAP-1610 USB0 alternate pin configuration */
395 /* Power management */
404 /* CompactFlash controller */
411 /* parallel camera */
435 struct omap_mux_cfg
{
436 struct pin_config
*pins
;
438 int (*cfg_reg
)(const struct pin_config
*cfg
);
441 #ifdef CONFIG_OMAP_MUX
442 /* setup pin muxing in Linux */
443 extern int omap1_mux_init(void);
444 extern int omap_mux_register(struct omap_mux_cfg
*);
445 extern int omap_cfg_reg(unsigned long reg_cfg
);
447 /* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
448 static inline int omap1_mux_init(void) { return 0; }
449 static inline int omap_cfg_reg(unsigned long reg_cfg
) { return 0; }
452 extern int omap2_mux_init(void);