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_bit, pull_status, debug_status)\
118 .debug = debug_status, \
119 MUX_REG_730(mux_reg, mode_offset, mode) \
120 PULL_REG_730(mux_reg, pull_bit, pull_status) \
124 #define MUX_CFG_24XX(desc, reg_offset, mode, \
125 pull_en, pull_mode, dbg) \
129 .mux_reg = reg_offset, \
131 .pull_val = pull_en, \
132 .pu_pd_val = pull_mode, \
136 #define PULL_DISABLED 0
137 #define PULL_ENABLED 1
147 const char *mux_reg_name
;
148 const unsigned int mux_reg
;
149 const unsigned char mask_offset
;
150 const unsigned char mask
;
152 const char *pull_name
;
153 const unsigned int pull_reg
;
154 const unsigned char pull_val
;
155 const unsigned char pull_bit
;
157 const char *pu_pd_name
;
158 const unsigned int pu_pd_reg
;
159 const unsigned char pu_pd_val
;
163 /* OMAP 730 keyboard */
181 enum omap1xxx_index
{
182 /* UART1 (BT_UART_GATING)*/
186 /* UART2 (COM_UART_GATING)*/
192 /* UART3 (GIGA_UART_GATING) */
198 UART3_BCLK
, /* 12MHz clock out */
205 /* USB master generic */
288 V5_1610_MMC2_DATDIR0
,
289 W19_1610_MMC2_DATDIR1
,
292 /* OMAP-1610 External Trace Interface */
315 /* OMAP-1610 uWire */
334 /* OMAP-1610 Flash */
335 L3_1610_FLASH_CS2B_OE
,
336 M8_1610_FLASH_CS2B_WE
,
346 /* OMAP-1710 MMC CMDDIR and DATDIR0 */
349 P20_1710_MMC_DATDIR0
,
351 /* OMAP-1610 USB0 alternate pin configuration */
394 /* Power management */
403 /* CompactFlash controller */
410 /* parallel camera */
434 enum omap24xx_index
{
441 /* 24xx Menelaus interrupt */
447 /* 24xx GPMC chipselects, wait pin monitoring */
456 Y15_24XX_MCBSP2_CLKX
,
489 /* 24xx external DMA requests */
510 F19_24XX_MMC_DAT_DIR0
,
511 E20_24XX_MMC_DAT_DIR1
,
512 F18_24XX_MMC_DAT_DIR2
,
513 E18_24XX_MMC_DAT_DIR3
,
514 G18_24XX_MMC_CMD_DIR
,
539 AA4_24XX_USB2_TLLSE0
,
556 /* 24xx Menelaus Keypad GPIO */
562 #ifdef CONFIG_OMAP_MUX
563 /* setup pin muxing in Linux */
564 extern int omap1_mux_init(void);
565 extern int omap2_mux_init(void);
566 extern int omap_mux_register(struct pin_config
* pins
, unsigned long size
);
567 extern int omap_cfg_reg(unsigned long reg_cfg
);
569 /* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
570 static inline int omap1_mux_init(void) { return 0; }
571 static inline int omap2_mux_init(void) { return 0; }
572 static inline int omap_cfg_reg(unsigned long reg_cfg
) { return 0; }