diff options
author | Vikram Pandita <vikram.pandita@ti.com> | 2008-10-06 08:49:16 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-10-06 08:49:16 -0400 |
commit | 2351872c44be50c27001bbfa91d6e14e3cee8b88 (patch) | |
tree | d1e703382191b27760023e88dac3750395fab659 /arch/arm/plat-omap/include/mach | |
parent | 0e564848693b06b037ec05e68c9e4b266250789e (diff) |
ARM: OMAP2: Add pinmux support for omap34xx
This patch adds pinmux support for OMAP3. Incorporated review comments
from Tony to make mux_value as bit mask. Tested on 3430SDP.
Also merge in adding of I2C pins from Jarkko Nikula.
Acked-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/include/mach')
-rw-r--r-- | arch/arm/plat-omap/include/mach/mux.h | 156 |
1 files changed, 145 insertions, 11 deletions
diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h index 614b2c1327c7..5670d563f378 100644 --- a/arch/arm/plat-omap/include/mach/mux.h +++ b/arch/arm/plat-omap/include/mach/mux.h | |||
@@ -125,20 +125,64 @@ | |||
125 | .pu_pd_val = pull_mode, \ | 125 | .pu_pd_val = pull_mode, \ |
126 | }, | 126 | }, |
127 | 127 | ||
128 | 128 | /* 24xx/34xx mux bit defines */ | |
129 | #define PULL_DISABLED 0 | 129 | #define OMAP2_PULL_ENA (1 << 3) |
130 | #define PULL_ENABLED 1 | 130 | #define OMAP2_PULL_UP (1 << 4) |
131 | 131 | #define OMAP2_ALTELECTRICALSEL (1 << 5) | |
132 | #define PULL_DOWN 0 | 132 | |
133 | #define PULL_UP 1 | 133 | /* 34xx specific mux bit defines */ |
134 | #define OMAP3_INPUT_EN (1 << 8) | ||
135 | #define OMAP3_OFF_EN (1 << 9) | ||
136 | #define OMAP3_OFFOUT_EN (1 << 10) | ||
137 | #define OMAP3_OFFOUT_VAL (1 << 11) | ||
138 | #define OMAP3_OFF_PULL_EN (1 << 12) | ||
139 | #define OMAP3_OFF_PULL_UP (1 << 13) | ||
140 | #define OMAP3_WAKEUP_EN (1 << 14) | ||
141 | |||
142 | /* 34xx mux mode options for each pin. See TRM for options */ | ||
143 | #define OMAP34XX_MUX_MODE0 0 | ||
144 | #define OMAP34XX_MUX_MODE1 1 | ||
145 | #define OMAP34XX_MUX_MODE2 2 | ||
146 | #define OMAP34XX_MUX_MODE3 3 | ||
147 | #define OMAP34XX_MUX_MODE4 4 | ||
148 | #define OMAP34XX_MUX_MODE5 5 | ||
149 | #define OMAP34XX_MUX_MODE6 6 | ||
150 | #define OMAP34XX_MUX_MODE7 7 | ||
151 | |||
152 | /* 34xx active pin states */ | ||
153 | #define OMAP34XX_PIN_OUTPUT 0 | ||
154 | #define OMAP34XX_PIN_INPUT OMAP3_INPUT_EN | ||
155 | #define OMAP34XX_PIN_INPUT_PULLUP (OMAP2_PULL_ENA | OMAP3_INPUT_EN \ | ||
156 | | OMAP2_PULL_UP) | ||
157 | #define OMAP34XX_PIN_INPUT_PULLDOWN (OMAP2_PULL_ENA | OMAP3_INPUT_EN) | ||
158 | |||
159 | /* 34xx off mode states */ | ||
160 | #define OMAP34XX_PIN_OFF_NONE 0 | ||
161 | #define OMAP34XX_PIN_OFF_OUTPUT_HIGH (OMAP3_OFF_EN | OMAP3_OFFOUT_EN \ | ||
162 | | OMAP3_OFFOUT_VAL) | ||
163 | #define OMAP34XX_PIN_OFF_OUTPUT_LOW (OMAP3_OFF_EN | OMAP3_OFFOUT_EN) | ||
164 | #define OMAP34XX_PIN_OFF_INPUT_PULLUP (OMAP3_OFF_EN | OMAP3_OFF_PULL_EN \ | ||
165 | | OMAP3_OFF_PULL_UP) | ||
166 | #define OMAP34XX_PIN_OFF_INPUT_PULLDOWN (OMAP3_OFF_EN | OMAP3_OFF_PULL_EN) | ||
167 | #define OMAP34XX_PIN_OFF_WAKEUPENABLE OMAP3_WAKEUP_EN | ||
168 | |||
169 | #define MUX_CFG_34XX(desc, reg_offset, mux_value) { \ | ||
170 | .name = desc, \ | ||
171 | .debug = 0, \ | ||
172 | .mux_reg = reg_offset, \ | ||
173 | .mux_val = mux_value \ | ||
174 | }, | ||
134 | 175 | ||
135 | struct pin_config { | 176 | struct pin_config { |
136 | char *name; | 177 | char *name; |
137 | unsigned char busy; | 178 | const unsigned int mux_reg; |
138 | unsigned char debug; | 179 | unsigned char debug; |
139 | 180 | ||
140 | const char *mux_reg_name; | 181 | #if defined(CONFIG_ARCH_OMAP34XX) |
141 | const unsigned int mux_reg; | 182 | u16 mux_val; /* Wake-up, off mode, pull, mux mode */ |
183 | #endif | ||
184 | |||
185 | #if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP24XX) | ||
142 | const unsigned char mask_offset; | 186 | const unsigned char mask_offset; |
143 | const unsigned char mask; | 187 | const unsigned char mask; |
144 | 188 | ||
@@ -150,6 +194,12 @@ struct pin_config { | |||
150 | const char *pu_pd_name; | 194 | const char *pu_pd_name; |
151 | const unsigned int pu_pd_reg; | 195 | const unsigned int pu_pd_reg; |
152 | const unsigned char pu_pd_val; | 196 | const unsigned char pu_pd_val; |
197 | #endif | ||
198 | |||
199 | #if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS) | ||
200 | const char *mux_reg_name; | ||
201 | #endif | ||
202 | |||
153 | }; | 203 | }; |
154 | 204 | ||
155 | enum omap730_index { | 205 | enum omap730_index { |
@@ -593,6 +643,90 @@ enum omap24xx_index { | |||
593 | 643 | ||
594 | }; | 644 | }; |
595 | 645 | ||
646 | enum omap34xx_index { | ||
647 | /* 34xx I2C */ | ||
648 | K21_34XX_I2C1_SCL, | ||
649 | J21_34XX_I2C1_SDA, | ||
650 | AF15_34XX_I2C2_SCL, | ||
651 | AE15_34XX_I2C2_SDA, | ||
652 | AF14_34XX_I2C3_SCL, | ||
653 | AG14_34XX_I2C3_SDA, | ||
654 | AD26_34XX_I2C4_SCL, | ||
655 | AE26_34XX_I2C4_SDA, | ||
656 | |||
657 | /* PHY - HSUSB: 12-pin ULPI PHY: Port 1*/ | ||
658 | Y8_3430_USB1HS_PHY_CLK, | ||
659 | Y9_3430_USB1HS_PHY_STP, | ||
660 | AA14_3430_USB1HS_PHY_DIR, | ||
661 | AA11_3430_USB1HS_PHY_NXT, | ||
662 | W13_3430_USB1HS_PHY_DATA0, | ||
663 | W12_3430_USB1HS_PHY_DATA1, | ||
664 | W11_3430_USB1HS_PHY_DATA2, | ||
665 | Y11_3430_USB1HS_PHY_DATA3, | ||
666 | W9_3430_USB1HS_PHY_DATA4, | ||
667 | Y12_3430_USB1HS_PHY_DATA5, | ||
668 | W8_3430_USB1HS_PHY_DATA6, | ||
669 | Y13_3430_USB1HS_PHY_DATA7, | ||
670 | |||
671 | /* PHY - HSUSB: 12-pin ULPI PHY: Port 2*/ | ||
672 | AA8_3430_USB2HS_PHY_CLK, | ||
673 | AA10_3430_USB2HS_PHY_STP, | ||
674 | AA9_3430_USB2HS_PHY_DIR, | ||
675 | AB11_3430_USB2HS_PHY_NXT, | ||
676 | AB10_3430_USB2HS_PHY_DATA0, | ||
677 | AB9_3430_USB2HS_PHY_DATA1, | ||
678 | W3_3430_USB2HS_PHY_DATA2, | ||
679 | T4_3430_USB2HS_PHY_DATA3, | ||
680 | T3_3430_USB2HS_PHY_DATA4, | ||
681 | R3_3430_USB2HS_PHY_DATA5, | ||
682 | R4_3430_USB2HS_PHY_DATA6, | ||
683 | T2_3430_USB2HS_PHY_DATA7, | ||
684 | |||
685 | |||
686 | /* TLL - HSUSB: 12-pin TLL Port 1*/ | ||
687 | Y8_3430_USB1HS_TLL_CLK, | ||
688 | Y9_3430_USB1HS_TLL_STP, | ||
689 | AA14_3430_USB1HS_TLL_DIR, | ||
690 | AA11_3430_USB1HS_TLL_NXT, | ||
691 | W13_3430_USB1HS_TLL_DATA0, | ||
692 | W12_3430_USB1HS_TLL_DATA1, | ||
693 | W11_3430_USB1HS_TLL_DATA2, | ||
694 | Y11_3430_USB1HS_TLL_DATA3, | ||
695 | W9_3430_USB1HS_TLL_DATA4, | ||
696 | Y12_3430_USB1HS_TLL_DATA5, | ||
697 | W8_3430_USB1HS_TLL_DATA6, | ||
698 | Y13_3430_USB1HS_TLL_DATA7, | ||
699 | |||
700 | /* TLL - HSUSB: 12-pin TLL Port 2*/ | ||
701 | AA8_3430_USB2HS_TLL_CLK, | ||
702 | AA10_3430_USB2HS_TLL_STP, | ||
703 | AA9_3430_USB2HS_TLL_DIR, | ||
704 | AB11_3430_USB2HS_TLL_NXT, | ||
705 | AB10_3430_USB2HS_TLL_DATA0, | ||
706 | AB9_3430_USB2HS_TLL_DATA1, | ||
707 | W3_3430_USB2HS_TLL_DATA2, | ||
708 | T4_3430_USB2HS_TLL_DATA3, | ||
709 | T3_3430_USB2HS_TLL_DATA4, | ||
710 | R3_3430_USB2HS_TLL_DATA5, | ||
711 | R4_3430_USB2HS_TLL_DATA6, | ||
712 | T2_3430_USB2HS_TLL_DATA7, | ||
713 | |||
714 | /* TLL - HSUSB: 12-pin TLL Port 3*/ | ||
715 | AA6_3430_USB3HS_TLL_CLK, | ||
716 | AB3_3430_USB3HS_TLL_STP, | ||
717 | AA3_3430_USB3HS_TLL_DIR, | ||
718 | Y3_3430_USB3HS_TLL_NXT, | ||
719 | AA5_3430_USB3HS_TLL_DATA0, | ||
720 | Y4_3430_USB3HS_TLL_DATA1, | ||
721 | Y5_3430_USB3HS_TLL_DATA2, | ||
722 | W5_3430_USB3HS_TLL_DATA3, | ||
723 | AB12_3430_USB3HS_TLL_DATA4, | ||
724 | AB13_3430_USB3HS_TLL_DATA5, | ||
725 | AA13_3430_USB3HS_TLL_DATA6, | ||
726 | AA12_3430_USB3HS_TLL_DATA7 | ||
727 | |||
728 | }; | ||
729 | |||
596 | struct omap_mux_cfg { | 730 | struct omap_mux_cfg { |
597 | struct pin_config *pins; | 731 | struct pin_config *pins; |
598 | unsigned long size; | 732 | unsigned long size; |