1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * arch/arm/plat-omap/include/mach/mux.h
5 * Table of the Omap register configurations for the FUNC_MUX and
6 * PULL_DWN combinations.
8 * Copyright (C) 2004 - 2008 Texas Instruments Inc.
9 * Copyright (C) 2003 - 2008 Nokia Corporation
11 * Written by Tony Lindgren
13 * NOTE: Please use the following naming style for new pin entries.
14 * For example, W8_1610_MMC2_DAT0, where:
16 * - 1610 = 1510 or 1610, none if common for both 1510 and 1610
17 * - MMC2_DAT0 = function
20 #ifndef __ASM_ARCH_MUX_H
21 #define __ASM_ARCH_MUX_H
23 #define PU_PD_SEL_NA 0 /* No pu_pd reg available */
24 #define PULL_DWN_CTRL_NA 0 /* No pull-down control needed */
26 #ifdef CONFIG_OMAP_MUX_DEBUG
27 #define MUX_REG(reg, mode_offset, mode) .mux_reg_name = "FUNC_MUX_CTRL_"#reg, \
28 .mux_reg = FUNC_MUX_CTRL_##reg, \
29 .mask_offset = mode_offset, \
32 #define PULL_REG(reg, bit, status) .pull_name = "PULL_DWN_CTRL_"#reg, \
33 .pull_reg = PULL_DWN_CTRL_##reg, \
37 #define PU_PD_REG(reg, status) .pu_pd_name = "PU_PD_SEL_"#reg, \
38 .pu_pd_reg = PU_PD_SEL_##reg, \
41 #define MUX_REG_7XX(reg, mode_offset, mode) .mux_reg_name = "OMAP7XX_IO_CONF_"#reg, \
42 .mux_reg = OMAP7XX_IO_CONF_##reg, \
43 .mask_offset = mode_offset, \
46 #define PULL_REG_7XX(reg, bit, status) .pull_name = "OMAP7XX_IO_CONF_"#reg, \
47 .pull_reg = OMAP7XX_IO_CONF_##reg, \
53 #define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \
54 .mask_offset = mode_offset, \
57 #define PULL_REG(reg, bit, status) .pull_reg = PULL_DWN_CTRL_##reg, \
61 #define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \
64 #define MUX_REG_7XX(reg, mode_offset, mode) \
65 .mux_reg = OMAP7XX_IO_CONF_##reg, \
66 .mask_offset = mode_offset, \
69 #define PULL_REG_7XX(reg, bit, status) .pull_reg = OMAP7XX_IO_CONF_##reg, \
73 #endif /* CONFIG_OMAP_MUX_DEBUG */
75 #define MUX_CFG(desc, mux_reg, mode_offset, mode, \
76 pull_reg, pull_bit, pull_status, \
77 pu_pd_reg, pu_pd_status, debug_status) \
80 .debug = debug_status, \
81 MUX_REG(mux_reg, mode_offset, mode) \
82 PULL_REG(pull_reg, pull_bit, pull_status) \
83 PU_PD_REG(pu_pd_reg, pu_pd_status) \
88 * OMAP730/850 has a slightly different config for the pin mux.
89 * - config regs are the OMAP7XX_IO_CONF_x regs (see omap7xx.h) regs and
90 * not the FUNC_MUX_CTRL_x regs from hardware.h
91 * - for pull-up/down, only has one enable bit which is in the same register
94 #define MUX_CFG_7XX(desc, mux_reg, mode_offset, mode, \
95 pull_bit, pull_status, debug_status)\
98 .debug = debug_status, \
99 MUX_REG_7XX(mux_reg, mode_offset, mode) \
100 PULL_REG_7XX(mux_reg, pull_bit, pull_status) \
106 const unsigned int mux_reg
;
109 const unsigned char mask_offset
;
110 const unsigned char mask
;
112 const char *pull_name
;
113 const unsigned int pull_reg
;
114 const unsigned char pull_val
;
115 const unsigned char pull_bit
;
117 const char *pu_pd_name
;
118 const unsigned int pu_pd_reg
;
119 const unsigned char pu_pd_val
;
121 #if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
122 const char *mux_reg_name
;
128 /* OMAP 730 keyboard */
144 W18_7XX_USB_DMCK_OUT
,
169 enum omap1xxx_index
{
170 /* UART1 (BT_UART_GATING)*/
174 /* UART2 (COM_UART_GATING)*/
180 /* UART3 (GIGA_UART_GATING) */
186 UART3_BCLK
, /* 12MHz clock out */
193 /* USB master generic */
276 V5_1610_MMC2_DATDIR0
,
277 W19_1610_MMC2_DATDIR1
,
280 /* OMAP-1610 External Trace Interface */
303 /* OMAP-1610 uWire */
322 /* OMAP-1610 Flash */
323 L3_1610_FLASH_CS2B_OE
,
324 M8_1610_FLASH_CS2B_WE
,
334 /* OMAP-1710 MMC CMDDIR and DATDIR0 */
337 P20_1710_MMC_DATDIR0
,
339 /* OMAP-1610 USB0 alternate pin configuration */
382 /* Power management */
391 /* CompactFlash controller */
398 /* parallel camera */
422 struct omap_mux_cfg
{
423 struct pin_config
*pins
;
425 int (*cfg_reg
)(const struct pin_config
*cfg
);
428 #ifdef CONFIG_OMAP_MUX
429 /* setup pin muxing in Linux */
430 extern int omap1_mux_init(void);
431 extern int omap_mux_register(struct omap_mux_cfg
*);
432 extern int omap_cfg_reg(unsigned long reg_cfg
);
434 /* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */
435 static inline int omap1_mux_init(void) { return 0; }
436 static inline int omap_cfg_reg(unsigned long reg_cfg
) { return 0; }
439 extern int omap2_mux_init(void);