From patchwork Fri Oct 16 10:49:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 54224 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 n9GB8hRZ026877 for ; Fri, 16 Oct 2009 11:08:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758435AbZJPLEe (ORCPT ); Fri, 16 Oct 2009 07:04:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757717AbZJPLEe (ORCPT ); Fri, 16 Oct 2009 07:04:34 -0400 Received: from smtp.nokia.com ([192.100.105.134]:19602 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758339AbZJPLEb (ORCPT ); Fri, 16 Oct 2009 07:04:31 -0400 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9GB33U7009629 for ; Fri, 16 Oct 2009 06:03:04 -0500 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Oct 2009 14:02:56 +0300 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Oct 2009 14:02:56 +0300 Received: from localhost.localdomain (sokoban.ntc.nokia.com [172.22.144.95]) by mgw-sa02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9GB2fa5022261; Fri, 16 Oct 2009 14:02:55 +0300 From: Tero Kristo To: linux-omap@vger.kernel.org Cc: Peter De-Schrijver Subject: [PATCH 11/17] Make USBHOST powerdomain go to sleep after warm reset. Date: Fri, 16 Oct 2009 13:49:04 +0300 Message-Id: <1255690150-16853-12-git-send-email-tero.kristo@nokia.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <1255690150-16853-11-git-send-email-tero.kristo@nokia.com> References: <> <1255690150-16853-1-git-send-email-tero.kristo@nokia.com> <1255690150-16853-2-git-send-email-tero.kristo@nokia.com> <1255690150-16853-3-git-send-email-tero.kristo@nokia.com> <1255690150-16853-4-git-send-email-tero.kristo@nokia.com> <1255690150-16853-5-git-send-email-tero.kristo@nokia.com> <1255690150-16853-6-git-send-email-tero.kristo@nokia.com> <1255690150-16853-7-git-send-email-tero.kristo@nokia.com> <1255690150-16853-8-git-send-email-tero.kristo@nokia.com> <1255690150-16853-9-git-send-email-tero.kristo@nokia.com> <1255690150-16853-10-git-send-email-tero.kristo@nokia.com> <1255690150-16853-11-git-send-email-tero.kristo@nokia.com> X-OriginalArrivalTime: 16 Oct 2009 11:02:56.0442 (UTC) FILETIME=[373AA1A0:01CA4E50] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h index 6923deb..3152553 100644 --- a/arch/arm/mach-omap2/cm-regbits-34xx.h +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h @@ -680,6 +680,7 @@ #define OMAP3430_CLKSEL_GPT2_SHIFT 0 /* CM_SLEEPDEP_PER specific bits */ +#define OMAP3430_CM_SLEEPDEP_PER_EN_MPU (1 << 1) #define OMAP3430_CM_SLEEPDEP_PER_EN_IVA2 (1 << 2) /* CM_CLKSTCTRL_PER */ diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 47f5738..1fa778f 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -934,6 +935,24 @@ static void __init prcm_setup_regs(void) prm_write_mod_reg(0, OMAP3430_CAM_MOD, PM_WKDEP); prm_write_mod_reg(0, OMAP3430_PER_MOD, PM_WKDEP); if (omap_rev() > OMAP3430_REV_ES1_0) { + + /* + * This workaround is needed to prevent SGX and USBHOST from + * failing to transition to RET/OFF after a warm reset in OFF + * mode. Workaround sets a sleepdep of each of these domains + * with MPU, waits for a min 2 sysclk cycles and clears the + * sleepdep. + */ + cm_write_mod_reg(OMAP3430_CM_SLEEPDEP_PER_EN_MPU, + OMAP3430ES2_USBHOST_MOD, OMAP3430_CM_SLEEPDEP); + cm_write_mod_reg(OMAP3430_CM_SLEEPDEP_PER_EN_MPU, + OMAP3430ES2_SGX_MOD, OMAP3430_CM_SLEEPDEP); + udelay(100); + cm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, + OMAP3430_CM_SLEEPDEP); + cm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, + OMAP3430_CM_SLEEPDEP); + prm_write_mod_reg(0, OMAP3430ES2_SGX_MOD, PM_WKDEP); prm_write_mod_reg(0, OMAP3430ES2_USBHOST_MOD, PM_WKDEP); } else