diff options
| -rw-r--r-- | arch/arm/mach-omap2/board-am3517crane.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c index 781ed2558e12..71acb5ab281c 100644 --- a/arch/arm/mach-omap2/board-am3517crane.c +++ b/arch/arm/mach-omap2/board-am3517crane.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
| 21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 22 | #include <linux/gpio.h> | ||
| 22 | 23 | ||
| 23 | #include <mach/hardware.h> | 24 | #include <mach/hardware.h> |
| 24 | #include <asm/mach-types.h> | 25 | #include <asm/mach-types.h> |
| @@ -27,8 +28,14 @@ | |||
| 27 | 28 | ||
| 28 | #include <plat/board.h> | 29 | #include <plat/board.h> |
| 29 | #include <plat/common.h> | 30 | #include <plat/common.h> |
| 31 | #include <plat/usb.h> | ||
| 30 | 32 | ||
| 31 | #include "mux.h" | 33 | #include "mux.h" |
| 34 | #include "control.h" | ||
| 35 | |||
| 36 | #define GPIO_USB_POWER 35 | ||
| 37 | #define GPIO_USB_NRESET 38 | ||
| 38 | |||
| 32 | 39 | ||
| 33 | /* Board initialization */ | 40 | /* Board initialization */ |
| 34 | static struct omap_board_config_kernel am3517_crane_config[] __initdata = { | 41 | static struct omap_board_config_kernel am3517_crane_config[] __initdata = { |
| @@ -52,10 +59,51 @@ static void __init am3517_crane_init_irq(void) | |||
| 52 | omap_init_irq(); | 59 | omap_init_irq(); |
| 53 | } | 60 | } |
| 54 | 61 | ||
| 62 | static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { | ||
| 63 | .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, | ||
| 64 | .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
| 65 | .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, | ||
| 66 | |||
| 67 | .phy_reset = true, | ||
| 68 | .reset_gpio_port[0] = GPIO_USB_NRESET, | ||
| 69 | .reset_gpio_port[1] = -EINVAL, | ||
| 70 | .reset_gpio_port[2] = -EINVAL | ||
| 71 | }; | ||
| 72 | |||
| 55 | static void __init am3517_crane_init(void) | 73 | static void __init am3517_crane_init(void) |
| 56 | { | 74 | { |
| 75 | int ret; | ||
| 76 | |||
| 57 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 77 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
| 58 | omap_serial_init(); | 78 | omap_serial_init(); |
| 79 | |||
| 80 | /* Configure GPIO for EHCI port */ | ||
| 81 | if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) { | ||
| 82 | pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", | ||
| 83 | GPIO_USB_NRESET); | ||
| 84 | return; | ||
| 85 | } | ||
| 86 | |||
| 87 | if (omap_mux_init_gpio(GPIO_USB_POWER, OMAP_PIN_OUTPUT)) { | ||
| 88 | pr_err("Can not configure mux for GPIO_USB_POWER %d\n", | ||
| 89 | GPIO_USB_POWER); | ||
| 90 | return; | ||
| 91 | } | ||
| 92 | |||
| 93 | ret = gpio_request(GPIO_USB_POWER, "usb_ehci_enable"); | ||
| 94 | if (ret < 0) { | ||
| 95 | pr_err("Can not request GPIO %d\n", GPIO_USB_POWER); | ||
| 96 | return; | ||
| 97 | } | ||
| 98 | |||
| 99 | ret = gpio_direction_output(GPIO_USB_POWER, 1); | ||
| 100 | if (ret < 0) { | ||
| 101 | gpio_free(GPIO_USB_POWER); | ||
| 102 | pr_err("Unable to initialize EHCI power\n"); | ||
| 103 | return; | ||
| 104 | } | ||
| 105 | |||
| 106 | usb_ehci_init(&ehci_pdata); | ||
| 59 | } | 107 | } |
| 60 | 108 | ||
| 61 | MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") | 109 | MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") |
