From patchwork Wed Oct 6 21:14:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Anders, David" X-Patchwork-Id: 237141 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o96LEkvO018276 for ; Wed, 6 Oct 2010 21:14:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933123Ab0JFVOp (ORCPT ); Wed, 6 Oct 2010 17:14:45 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:37784 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933101Ab0JFVOp (ORCPT ); Wed, 6 Oct 2010 17:14:45 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o96LEbi3013211 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Oct 2010 16:14:37 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o96LEam0020289; Wed, 6 Oct 2010 16:14:36 -0500 (CDT) Received: from localhost (ccd-dev.am.dhcp.ti.com [128.247.77.58]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o96LEaf05774; Wed, 6 Oct 2010 16:14:36 -0500 (CDT) From: David Anders To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.arm.linux.org.uk Cc: David Anders , Anand Gadiyar Subject: [PATCH 4/4] omap4: pandaboard: enable the ehci port on pandaboard Date: Wed, 6 Oct 2010 16:14:33 -0500 Message-Id: <1286399673-912-5-git-send-email-x0132446@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1286399673-912-1-git-send-email-x0132446@ti.com> References: <1286399673-912-1-git-send-email-x0132446@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 06 Oct 2010 21:14:46 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 94e819c..6163a59 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -39,6 +39,8 @@ #include #include "hsmmc.h" +#define GPIO_HUB_POWER 1 +#define GPIO_HUB_NRESET 62 static void __init omap4_panda_init_irq(void) { @@ -280,6 +282,57 @@ static int __init omap4_panda_i2c_init(void) omap_register_i2c_bus(4, 400, NULL, 0); return 0; } + +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { + .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, + .port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, + .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, + .phy_reset = false, + .reset_gpio_port[0] = -EINVAL, + .reset_gpio_port[1] = -EINVAL, + .reset_gpio_port[2] = -EINVAL +}; + +static void __init omap4_ehci_init(void) +{ + int ret; + + + /* disable the power to the usb hub prior to init */ + ret = gpio_request(GPIO_HUB_POWER, "hub_power"); + if (ret) { + pr_err("Cannot request GPIO %d\n", GPIO_HUB_POWER); + goto error1; + } + gpio_export(GPIO_HUB_POWER, 0); + gpio_direction_output(GPIO_HUB_POWER, 0); + gpio_set_value(GPIO_HUB_POWER, 0); + + /* reset phy+hub */ + ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset"); + if (ret) { + pr_err("Cannot request GPIO %d\n", GPIO_HUB_NRESET); + goto error2; + } + gpio_export(GPIO_HUB_NRESET, 0); + gpio_direction_output(GPIO_HUB_NRESET, 0); + gpio_set_value(GPIO_HUB_NRESET, 0); + gpio_set_value(GPIO_HUB_NRESET, 1); + + usb_ehci_init(&ehci_pdata); + + /* enable power to hub */ + gpio_set_value(GPIO_HUB_POWER, 1); + return; + +error2: + gpio_free(GPIO_HUB_POWER); +error1: + pr_err("Unable to initialize EHCI power/reset\n"); + return; + +} + static void __init omap4_panda_init(void) { omap4_panda_i2c_init(); @@ -287,6 +340,7 @@ static void __init omap4_panda_init(void) omap4_twl6030_hsmmc_init(mmc); /* OMAP4 Panda uses internal transceiver so register nop transceiver */ usb_nop_xceiv_register(); + omap4_ehci_init(); /* FIXME: allow multi-omap to boot until musb is updated for omap4 */ if (!cpu_is_omap44xx()) usb_musb_init(&musb_board_data);