From patchwork Thu Jun 25 16:42:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 32421 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5PGiN20007730 for ; Thu, 25 Jun 2009 16:44:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757535AbZFYQn1 (ORCPT ); Thu, 25 Jun 2009 12:43:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758790AbZFYQn1 (ORCPT ); Thu, 25 Jun 2009 12:43:27 -0400 Received: from mail-pz0-f189.google.com ([209.85.222.189]:35146 "EHLO mail-pz0-f189.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758886AbZFYQn0 (ORCPT ); Thu, 25 Jun 2009 12:43:26 -0400 Received: by mail-pz0-f189.google.com with SMTP id 27so1461235pzk.33 for ; Thu, 25 Jun 2009 09:43:29 -0700 (PDT) Received: by 10.142.180.10 with SMTP id c10mr915444wff.17.1245948209702; Thu, 25 Jun 2009 09:43:29 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id 28sm10363682wfd.24.2009.06.25.09.43.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 25 Jun 2009 09:43:29 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Cc: linux-omap@vger.kernel.org Subject: [PATCH 08/11] OMAP3: PM: reset USB OTG module on boot Date: Thu, 25 Jun 2009 09:42:01 -0700 Message-Id: <1245948124-24111-9-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.2 In-Reply-To: <1245948124-24111-8-git-send-email-khilman@deeprootsystems.com> References: <1245948124-24111-1-git-send-email-khilman@deeprootsystems.com> <1245948124-24111-2-git-send-email-khilman@deeprootsystems.com> <1245948124-24111-3-git-send-email-khilman@deeprootsystems.com> <1245948124-24111-4-git-send-email-khilman@deeprootsystems.com> <1245948124-24111-5-git-send-email-khilman@deeprootsystems.com> <1245948124-24111-6-git-send-email-khilman@deeprootsystems.com> <1245948124-24111-7-git-send-email-khilman@deeprootsystems.com> <1245948124-24111-8-git-send-email-khilman@deeprootsystems.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Rather than simply setting force-idle mode on boot, do a reset of the OTG module. This really ensures that any bootloader/bootstrap code that leaves it active will not prevent future retention. After reset, OTG module will be in force-idle, force-standby mode. Problem reported by Mike Chan Tested-by: Mike Chan Signed-off-by: Kevin Hilman --- arch/arm/mach-omap2/usb-musb.c | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index d85296d..3efa19c 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c @@ -26,18 +26,32 @@ #include +#include + #include #include #include #include -#define OTG_SYSCONFIG (OMAP34XX_HSUSB_OTG_BASE + 0x404) +#define OTG_SYSCONFIG 0x404 +#define OTG_SYSC_SOFTRESET BIT(1) static void __init usb_musb_pm_init(void) { - /* Ensure force-idle mode for OTG controller */ - if (cpu_is_omap34xx()) - omap_writel(0, OTG_SYSCONFIG); + void __iomem *otg_base; + + if (!cpu_is_omap34xx()) + return; + + otg_base = ioremap(OMAP34XX_HSUSB_OTG_BASE, SZ_4K); + if (WARN_ON(!otg_base)) + return; + + /* Reset OTG controller. After reset, it will be in + * force-idle, force-standby mode. */ + __raw_writel(OTG_SYSC_SOFTRESET, otg_base + OTG_SYSCONFIG); + + iounmap(otg_base); } #ifdef CONFIG_USB_MUSB_SOC