From patchwork Thu Jan 31 09:23:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vishwanathrao Badarkhe, Manish" X-Patchwork-Id: 2071741 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by patchwork2.kernel.org (Postfix) with ESMTP id 20FF8DF2E5 for ; Thu, 31 Jan 2013 09:33:17 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0V9XGa5005393 for ; Thu, 31 Jan 2013 03:33:16 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0V9XGXm028900 for ; Thu, 31 Jan 2013 03:33:16 -0600 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Thu, 31 Jan 2013 03:33:16 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0V9XGA8010599 for ; Thu, 31 Jan 2013 03:33:16 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 701A6806AC for ; Thu, 31 Jan 2013 03:33:09 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp20.itg.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by linux.omap.com (Postfix) with ESMTP id 300EF80626 for ; Thu, 31 Jan 2013 03:33:04 -0600 (CST) Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0V9X3RV014312; Thu, 31 Jan 2013 15:03:03 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Thu, 31 Jan 2013 15:03:03 +0530 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with SMTP id r0V9Womj002519; Thu, 31 Jan 2013 15:02:50 +0530 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id 6CBB215800A; Thu, 31 Jan 2013 14:52:22 +0530 (IST) Received: from ubuntu-psp-linux.india.ext.ti.com (ubuntu-psp-linux [192.168.247.46]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r0V9MJR27976; Thu, 31 Jan 2013 14:52:20 +0530 (IST) From: "Vishwanathrao Badarkhe, Manish" To: , , Subject: [PATCH RFC] davinci: poll for sleep completion in resume routine. Date: Thu, 31 Jan 2013 14:53:41 +0530 Message-ID: <1359624221-5378-1-git-send-email-manishv.b@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 CC: X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com As per OMAP-L138 TRM, Software must poll for SLEEPCOMPLETE bit until it is set to 1 before clearing SLEEPENABLE bit in DEEPSLEEP register in resume routine. Modifications are as per datasheet: http://www.ti.com/lit/ug/spruh77a/spruh77a.pdf See sections 10.10.2.2 and 11.5.21 for more detailed explanation. Tested on da850-evm. Signed-off-by: Vishwanathrao Badarkhe, Manish --- :100644 100644 d4e9316... 976f096... M arch/arm/mach-davinci/sleep.S arch/arm/mach-davinci/sleep.S | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/sleep.S b/arch/arm/mach-davinci/sleep.S index d4e9316..976f096 100644 --- a/arch/arm/mach-davinci/sleep.S +++ b/arch/arm/mach-davinci/sleep.S @@ -35,6 +35,7 @@ #define PLL_LOCK_CYCLES (PLL_LOCK_TIME * 25) #define DEEPSLEEP_SLEEPENABLE_BIT BIT(31) +#define DEEPSLEEP_SLEEPCOMPLETE_BIT BIT(30) .text /* @@ -110,6 +111,13 @@ ENTRY(davinci_cpu_suspend) /* Wake up from sleep */ + /* wait for sleep complete */ +sleep_complete: + ldr ip, [r4] + and ip, ip, #DEEPSLEEP_SLEEPCOMPLETE_BIT + cmp ip, #DEEPSLEEP_SLEEPCOMPLETE_BIT + bne sleep_complete + /* Clear sleep enable */ ldr ip, [r4] bic ip, ip, #DEEPSLEEP_SLEEPENABLE_BIT