From patchwork Fri Jun 26 21:35:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 32616 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5QLbnuP032556 for ; Fri, 26 Jun 2009 21:37:50 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id n5QLaV3O015249; Fri, 26 Jun 2009 16:36:36 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id n5QLaUsp027940; Fri, 26 Jun 2009 16:36:30 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 87AFB8065A; Fri, 26 Jun 2009 16:36:14 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 93D5B80627 for ; Fri, 26 Jun 2009 16:35:40 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n5QLZe1m000084 for ; Fri, 26 Jun 2009 16:35:40 -0500 (CDT) Received: from mail128-dub-R.bigfish.com (mail-dub.bigfish.com [213.199.154.10]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n5QLZYmb029443 for ; Fri, 26 Jun 2009 16:35:40 -0500 Received: from mail128-dub (localhost.localdomain [127.0.0.1]) by mail128-dub-R.bigfish.com (Postfix) with ESMTP id 693C9C88085 for ; Fri, 26 Jun 2009 21:35:34 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh63h) X-Spam-TCS-SCL: 2:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.200.172; Service: EHS Received: by mail128-dub (MessageSwitch) id 1246052133582451_13456; Fri, 26 Jun 2009 21:35:33 +0000 (UCT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.172]) by mail128-dub.bigfish.com (Postfix) with ESMTP id 2956D105004B for ; Fri, 26 Jun 2009 21:35:32 +0000 (UTC) Received: by wf-out-1314.google.com with SMTP id 29so170462wff.31 for ; Fri, 26 Jun 2009 14:35:31 -0700 (PDT) Received: by 10.143.5.21 with SMTP id h21mr1525143wfi.293.1246052131543; Fri, 26 Jun 2009 14:35:31 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id 30sm10605104wff.29.2009.06.26.14.35.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 26 Jun 2009 14:35:30 -0700 (PDT) From: Kevin Hilman To: David Brownell Date: Fri, 26 Jun 2009 14:35:24 -0700 Message-Id: <1246052125-18463-3-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.2 In-Reply-To: <1246052125-18463-2-git-send-email-khilman@deeprootsystems.com> References: <1246052125-18463-1-git-send-email-khilman@deeprootsystems.com> <1246052125-18463-2-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 2/3] musb_hdrc updates for dm355 X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: David Brownell Update musb/davinci.c and Kconfig for the newish DM355 chips: - Support new controls: * PHY control bits for swapping D+/D- signals, OTG powerdown * DRVVBUS control bits - The DM355 EVM board swaps D+/D- for better signal integrity - Use clk_enable()/clk_disable() now that they work right Plus some minor cleanup: "void __iomem *" pointers work right now (after some arch/arm changes), the DM6446 EVM stuff vanishes more completely on other boards. Eventually the board-specific stuff should move out of this part of the driver, but that will affect more generic MUSB code. Signed-off-by: David Brownell Signed-off-by: Kevin Hilman --- drivers/usb/musb/davinci.c | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 10d11ab..2bf4592 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -417,6 +418,21 @@ int __init musb_platform_init(struct musb *musb) __raw_writel(phy_ctrl, USB_PHY_CTRL); } + /* On dm355, the default-A state machine needs DRVVBUS control. + * If we won't be a host, there's no need to turn it on. + */ + if (cpu_is_davinci_dm355()) { + u32 deepsleep = __raw_readl(DM355_DEEPSLEEP); + + if (is_host_enabled(musb)) { + deepsleep &= ~DRVVBUS_OVERRIDE; + } else { + deepsleep &= ~DRVVBUS_FORCE; + deepsleep |= DRVVBUS_OVERRIDE; + } + __raw_writel(deepsleep, DM355_DEEPSLEEP); + } + /* reset the controller */ musb_writel(tibase, DAVINCI_USB_CTRL_REG, 0x1); @@ -439,6 +455,15 @@ int musb_platform_exit(struct musb *musb) if (is_host_enabled(musb)) del_timer_sync(&otg_workaround); + /* force VBUS off */ + if (cpu_is_davinci_dm355()) { + u32 deepsleep = __raw_readl(DM355_DEEPSLEEP); + + deepsleep &= ~DRVVBUS_FORCE; + deepsleep |= DRVVBUS_OVERRIDE; + __raw_writel(deepsleep, DM355_DEEPSLEEP); + } + davinci_source_power(musb, 0 /*off*/, 1); /* delay, to avoid problems with module reload */