diff options
author | Valentin Longchamp <valentin.longchamp@epfl.ch> | 2009-08-10 12:33:11 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-14 06:40:49 -0400 |
commit | b23f1534bb0e0dc97e46fc52bf9bde0c2226763c (patch) | |
tree | d455f4683b355544974a60ef5fb5d8247e6588c5 | |
parent | 89829d5fe31dc42825f2560c3c2c641709ed594e (diff) |
mx31moboard: added usb xcvr reset for mx31moboard
Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard-devboard.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard-marxbot.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-mx3/mx31moboard.c | 18 |
3 files changed, 49 insertions, 27 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c index 4704405165a1..2f2f142f075e 100644 --- a/arch/arm/mach-mx3/mx31moboard-devboard.c +++ b/arch/arm/mach-mx3/mx31moboard-devboard.c | |||
@@ -116,23 +116,25 @@ static struct fsl_usb2_platform_data usb_pdata = { | |||
116 | .phy_mode = FSL_USB2_PHY_ULPI, | 116 | .phy_mode = FSL_USB2_PHY_ULPI, |
117 | }; | 117 | }; |
118 | 118 | ||
119 | #define OTG_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST) | 119 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ |
120 | #define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC) | 120 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) |
121 | |||
122 | #define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC) | ||
121 | 123 | ||
122 | static void devboard_usbotg_init(void) | 124 | static void devboard_usbotg_init(void) |
123 | { | 125 | { |
124 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, OTG_PAD_CFG); | 126 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG); |
125 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, OTG_PAD_CFG); | 127 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG); |
126 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, OTG_PAD_CFG); | 128 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG); |
127 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, OTG_PAD_CFG); | 129 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG); |
128 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, OTG_PAD_CFG); | 130 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG); |
129 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, OTG_PAD_CFG); | 131 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG); |
130 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, OTG_PAD_CFG); | 132 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG); |
131 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, OTG_PAD_CFG); | 133 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG); |
132 | mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, OTG_PAD_CFG); | 134 | mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG); |
133 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, OTG_PAD_CFG); | 135 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG); |
134 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, OTG_PAD_CFG); | 136 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); |
135 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, OTG_PAD_CFG); | 137 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); |
136 | 138 | ||
137 | gpio_request(OTG_EN_B, "usb-udc-en"); | 139 | gpio_request(OTG_EN_B, "usb-udc-en"); |
138 | gpio_direction_output(OTG_EN_B, 0); | 140 | gpio_direction_output(OTG_EN_B, 0); |
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c index 641c3d6153ae..b817a4a5bcba 100644 --- a/arch/arm/mach-mx3/mx31moboard-marxbot.c +++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c | |||
@@ -120,23 +120,25 @@ static struct fsl_usb2_platform_data usb_pdata = { | |||
120 | .phy_mode = FSL_USB2_PHY_ULPI, | 120 | .phy_mode = FSL_USB2_PHY_ULPI, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | #define OTG_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST) | 123 | #define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ |
124 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) | ||
125 | |||
124 | #define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC) | 126 | #define OTG_EN_B IOMUX_TO_GPIO(MX31_PIN_USB_OC) |
125 | 127 | ||
126 | static void marxbot_usbotg_init(void) | 128 | static void marxbot_usbotg_init(void) |
127 | { | 129 | { |
128 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, OTG_PAD_CFG); | 130 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, USB_PAD_CFG); |
129 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, OTG_PAD_CFG); | 131 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, USB_PAD_CFG); |
130 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, OTG_PAD_CFG); | 132 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, USB_PAD_CFG); |
131 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, OTG_PAD_CFG); | 133 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, USB_PAD_CFG); |
132 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, OTG_PAD_CFG); | 134 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, USB_PAD_CFG); |
133 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, OTG_PAD_CFG); | 135 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, USB_PAD_CFG); |
134 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, OTG_PAD_CFG); | 136 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, USB_PAD_CFG); |
135 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, OTG_PAD_CFG); | 137 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, USB_PAD_CFG); |
136 | mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, OTG_PAD_CFG); | 138 | mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, USB_PAD_CFG); |
137 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, OTG_PAD_CFG); | 139 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, USB_PAD_CFG); |
138 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, OTG_PAD_CFG); | 140 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, USB_PAD_CFG); |
139 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, OTG_PAD_CFG); | 141 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, USB_PAD_CFG); |
140 | 142 | ||
141 | gpio_request(OTG_EN_B, "usb-udc-en"); | 143 | gpio_request(OTG_EN_B, "usb-udc-en"); |
142 | gpio_direction_output(OTG_EN_B, 0); | 144 | gpio_direction_output(OTG_EN_B, 0); |
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mx31moboard.c index b86b8a757c99..53ce60bdc823 100644 --- a/arch/arm/mach-mx3/mx31moboard.c +++ b/arch/arm/mach-mx3/mx31moboard.c | |||
@@ -16,6 +16,7 @@ | |||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/delay.h> | ||
19 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
20 | #include <linux/init.h> | 21 | #include <linux/init.h> |
21 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
@@ -56,6 +57,8 @@ static unsigned int moboard_pins[] = { | |||
56 | MX31_PIN_SD1_DATA1__SD1_DATA1, MX31_PIN_SD1_DATA0__SD1_DATA0, | 57 | MX31_PIN_SD1_DATA1__SD1_DATA1, MX31_PIN_SD1_DATA0__SD1_DATA0, |
57 | MX31_PIN_SD1_CLK__SD1_CLK, MX31_PIN_SD1_CMD__SD1_CMD, | 58 | MX31_PIN_SD1_CLK__SD1_CLK, MX31_PIN_SD1_CMD__SD1_CMD, |
58 | MX31_PIN_ATA_CS0__GPIO3_26, MX31_PIN_ATA_CS1__GPIO3_27, | 59 | MX31_PIN_ATA_CS0__GPIO3_26, MX31_PIN_ATA_CS1__GPIO3_27, |
60 | /* USB reset */ | ||
61 | MX31_PIN_GPIO1_0__GPIO1_0, | ||
59 | }; | 62 | }; |
60 | 63 | ||
61 | static struct physmap_flash_data mx31moboard_flash_data = { | 64 | static struct physmap_flash_data mx31moboard_flash_data = { |
@@ -143,6 +146,19 @@ static struct imxmmc_platform_data sdhc1_pdata = { | |||
143 | .exit = moboard_sdhc1_exit, | 146 | .exit = moboard_sdhc1_exit, |
144 | }; | 147 | }; |
145 | 148 | ||
149 | /* | ||
150 | * this pin is dedicated for all mx31moboard systems, so we do it here | ||
151 | */ | ||
152 | #define USB_RESET_B IOMUX_TO_GPIO(MX31_PIN_GPIO1_0) | ||
153 | |||
154 | static void usb_xcvr_reset(void) | ||
155 | { | ||
156 | gpio_request(USB_RESET_B, "usb-reset"); | ||
157 | gpio_direction_output(USB_RESET_B, 0); | ||
158 | mdelay(1); | ||
159 | gpio_set_value(USB_RESET_B, 1); | ||
160 | } | ||
161 | |||
146 | static struct platform_device *devices[] __initdata = { | 162 | static struct platform_device *devices[] __initdata = { |
147 | &mx31moboard_flash, | 163 | &mx31moboard_flash, |
148 | }; | 164 | }; |
@@ -168,6 +184,8 @@ static void __init mxc_board_init(void) | |||
168 | 184 | ||
169 | mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata); | 185 | mxc_register_device(&mxcsdhc_device0, &sdhc1_pdata); |
170 | 186 | ||
187 | usb_xcvr_reset(); | ||
188 | |||
171 | switch (mx31moboard_baseboard) { | 189 | switch (mx31moboard_baseboard) { |
172 | case MX31NOBOARD: | 190 | case MX31NOBOARD: |
173 | break; | 191 | break; |