2 * linux/include/asm-arm/arch-omap/mux.h
4 * Table of the Omap register configurations for the FUNC_MUX and
5 * PULL_DWN combinations.
7 * Copyright (C) 2003 - 2005 Nokia Corporation
9 * Written by Tony Lindgren <tony.lindgren@nokia.com>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * NOTE: Please use the following naming style for new pin entries.
26 * For example, W8_1610_MMC2_DAT0, where:
28 * - 1610 = 1510 or 1610, none if common for both 1510 and 1610
29 * - MMC2_DAT0 = function
32 * Added entry for the I2C interface. (02Feb 2004)
33 * Copyright (C) 2004 Texas Instruments
35 * Added entry for the keypad and uwire CS1. (09Mar 2004)
36 * Copyright (C) 2004 Texas Instruments
40 #ifndef __ASM_ARCH_MUX_H
41 #define __ASM_ARCH_MUX_H
43 #define PU_PD_SEL_NA 0 /* No pu_pd reg available */
44 #define PULL_DWN_CTRL_NA 0 /* No pull-down control needed */
46 #ifdef CONFIG_OMAP_MUX_DEBUG
47 #define MUX_REG(reg, mode_offset, mode) .mux_reg_name = "FUNC_MUX_CTRL_"#reg, \
48 .mux_reg = FUNC_MUX_CTRL_##reg, \
49 .mask_offset = mode_offset, \
52 #define PULL_REG(reg, bit, status) .pull_name = "PULL_DWN_CTRL_"#reg, \
53 .pull_reg = PULL_DWN_CTRL_##reg, \
57 #define PU_PD_REG(reg, status) .pu_pd_name = "PU_PD_SEL_"#reg, \
58 .pu_pd_reg = PU_PD_SEL_##reg, \
61 #define MUX_REG_730(reg, mode_offset, mode) .mux_reg_name = "OMAP730_IO_CONF_"#reg, \
62 .mux_reg = OMAP730_IO_CONF_##reg, \
63 .mask_offset = mode_offset, \
66 #define PULL_REG_730(reg, bit, status) .pull_name = "OMAP730_IO_CONF_"#reg, \
67 .pull_reg = OMAP730_IO_CONF_##reg, \
73 #define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \
74 .mask_offset = mode_offset, \
77 #define PULL_REG(reg, bit, status) .pull_reg = PULL_DWN_CTRL_##reg, \
81 #define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \
84 #define MUX_REG_730(reg, mode_offset, mode) \
85 .mux_reg = OMAP730_IO_CONF_##reg, \
86 .mask_offset = mode_offset, \
89 #define PULL_REG_730(reg, bit, status) .pull_reg = OMAP730_IO_CONF_##reg, \
93 #endif /* CONFIG_OMAP_MUX_DEBUG */
95 #define MUX_CFG(desc, mux_reg, mode_offset, mode, \
96 pull_reg, pull_bit, pull_status, \
97 pu_pd_reg, pu_pd_status, debug_status) \
100 .debug = debug_status, \
101 MUX_REG(mux_reg, mode_offset, mode) \
102 PULL_REG(pull_reg, pull_bit, pull_status) \
103 PU_PD_REG(pu_pd_reg, pu_pd_status) \
108 * OMAP730 has a slightly different config for the pin mux.
109 * - config regs are the OMAP730_IO_CONF_x regs (see omap730.h) regs and
110 * not the FUNC_MUX_CTRL_x regs from hardware.h
111 * - for pull-up/down, only has one enable bit which is is in the same register
114 #define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \
115 pull_reg, pull_bit, pull_status, \
116 pu_pd_reg, pu_pd_status, debug_status)\
119 .debug = debug_status, \
120 MUX_REG_730(mux_reg, mode_offset, mode) \
121 PULL_REG_730(mux_reg, pull_bit, pull_status) \
122 PU_PD_REG(pu_pd_reg, pu_pd_status) \
125 #define MUX_CFG_24XX(desc, reg_offset, mode, \
126 pull_en, pull_mode, dbg) \
130 .mux_reg = reg_offset, \
132 .pull_val = pull_en, \
133 .pu_pd_val = pull_mode, \
137 #define PULL_DISABLED 0
138 #define PULL_ENABLED 1
148 const char *mux_reg_name
;
149 const unsigned int mux_reg
;
150 const unsigned char mask_offset
;
151 const unsigned char mask
;
153 const char *pull_name
;
154 const unsigned int pull_reg
;
155 const unsigned char pull_val
;
156 const unsigned char pull_bit
;
158 const char *pu_pd_name
;
159 const unsigned int pu_pd_reg
;
160 const unsigned char pu_pd_val
;
164 /* OMAP 730 keyboard */
177 enum omap1xxx_index
{
178 /* UART1 (BT_UART_GATING)*/
182 /* UART2 (COM_UART_GATING)*/
188 /* UART3 (GIGA_UART_GATING) */
194 UART3_BCLK
, /* 12MHz clock out */
201 /* USB master generic */
284 V5_1610_MMC2_DATDIR0
,
285 W19_1610_MMC2_DATDIR1
,
288 /* OMAP-1610 External Trace Interface */
311 /* OMAP-1610 uWire */
319 /* OMAP-1610 Flash */
320 L3_1610_FLASH_CS2B_OE
,
321 M8_1610_FLASH_CS2B_WE
,
331 /* OMAP-1710 MMC CMDDIR and DATDIR0 */
334 P20_1710_MMC_DATDIR0
,
336 /* OMAP-1610 USB0 alternate pin configuration */
379 /* Power management */
388 /* CompactFlash controller */
396 enum omap24xx_index
{
403 /* 24xx Menelaus interrupt */
411 #ifdef CONFIG_OMAP_MUX
412 /* setup pin muxing in Linux */
413 extern int omap1_mux_init(void);
414 extern int omap2_mux_init(void);
415 extern int omap_mux_register(struct pin_config
* pins
, unsigned long size
);
416 extern int omap_cfg_reg(unsigned long reg_cfg
);
418 /* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
419 static inline int omap1_mux_init(void) { return 0; }
420 static inline int omap2_mux_init(void) { return 0; }
421 static inline int omap_cfg_reg(unsigned long reg_cfg
) { return 0; }