From patchwork Mon Feb 9 13:12:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 5801241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A20909F30C for ; Mon, 9 Feb 2015 13:15:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB32C2010E for ; Mon, 9 Feb 2015 13:15:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 045B220109 for ; Mon, 9 Feb 2015 13:15:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YKo9H-0001wr-7B; Mon, 09 Feb 2015 13:13:11 +0000 Received: from mail-oi0-f54.google.com ([209.85.218.54]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YKo96-0001qA-Cj; Mon, 09 Feb 2015 13:13:01 +0000 Received: by mail-oi0-f54.google.com with SMTP id v63so17129027oia.13; Mon, 09 Feb 2015 05:12:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xp92jYzXRYpm/XyWemdaThPTYVZqSZuNOlM0ASqa51Y=; b=kiGjE830/bk5oEJV2Bs2VAvuvWEswHQd0ma9UO9ancwqFaVeWkR0bcwRjeqkMRMnz/ 80ebr3HOezu7nPawR79m4wjxnpiG7TQIJOOALiAkGEpZQ6MLXz0OK0hKsOdPOBFXsd3V mzU8IFCzqw3XfKn+nbsqLODxbVhhpR0EUEZAGkAuAOIDPuFfM75BbCUA7FTcN8yAayu2 uSKcMf4cnqmhtwmAyqbtydy6lMogTu0Ew/DfiScW+tOtdQf8UZXouyXGOHKa4D0oHQ70 DAKGRZnNivbPUdABnEAD4/xU7rdZmiWI8nGw7erMYhEbSOJ+F8x8mTgj7Cj1UvT+7mhV zZHA== X-Received: by 10.60.139.1 with SMTP id qu1mr11674661oeb.83.1423487559029; Mon, 09 Feb 2015 05:12:39 -0800 (PST) Received: from localhost.localdomain ([192.255.70.18]) by mx.google.com with ESMTPSA id y2sm5217261oei.1.2015.02.09.05.12.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Feb 2015 05:12:38 -0800 (PST) From: Chris Zhong To: heiko@sntech.de, dianders@chromium.org, djkurtz@chromium.org, sonnyrao@chromium.org Subject: [PATCH 2/2] ARM: rockchip: disable watchdog during suspend Date: Mon, 9 Feb 2015 21:12:23 +0800 Message-Id: <1423487543-10593-2-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423487543-10593-1-git-send-email-zyw@rock-chips.com> References: <1423487543-10593-1-git-send-email-zyw@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150209_051300_540254_F74D9345 X-CRM114-Status: GOOD ( 11.79 ) X-Spam-Score: 1.5 (+) Cc: Russell King , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Daniel Kurtz , Chris Zhong , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_BLACK autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The watchdog clock should be disable in dw_wdt_suspend, but we set a dummy clock to watchdog for rk3288. So the watchdog will continue to work during suspend. And we switch the system clock to 32khz from 24Mhz, during suspend, so the watchdog timer over count will increase to 755 times, about 12.5 hours, the original value is 60 seconds. So watchdog will reset the system over a night, but voltage are all incorrect, then it hang on reset. Signed-off-by: Chris Zhong Signed-off-by: Daniel Kurtz Reviewed-by: Doug Anderson Tested-by: Doug Anderson --- arch/arm/mach-rockchip/pm.c | 11 ++++++++--- arch/arm/mach-rockchip/pm.h | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c index a3ab397..b07d886 100644 --- a/arch/arm/mach-rockchip/pm.c +++ b/arch/arm/mach-rockchip/pm.c @@ -75,9 +75,13 @@ static void rk3288_slp_mode_set(int level) regmap_read(pmu_regmap, RK3288_PMU_PWRMODE_CON, &rk3288_pmu_pwr_mode_con); - /* set bit 8 so that system will resume to FAST_BOOT_ADDR */ + /* + * SGRF_FAST_BOOT_EN - system to boot from FAST_BOOT_ADDR + * PCLK_WDT_GATE - disable WDT during suspend. + */ regmap_write(sgrf_regmap, RK3288_SGRF_SOC_CON0, - SGRF_FAST_BOOT_EN | SGRF_FAST_BOOT_EN_WRITE); + SGRF_PCLK_WDT_GATE | SGRF_FAST_BOOT_EN + | SGRF_PCLK_WDT_GATE_WRITE | SGRF_FAST_BOOT_EN_WRITE); /* booting address of resuming system is from this register value */ regmap_write(sgrf_regmap, RK3288_SGRF_FAST_BOOT_ADDR, @@ -122,7 +126,8 @@ static void rk3288_slp_mode_set_resume(void) rk3288_pmu_pwr_mode_con); regmap_write(sgrf_regmap, RK3288_SGRF_SOC_CON0, - rk3288_sgrf_soc_con0 | SGRF_FAST_BOOT_EN_WRITE); + rk3288_sgrf_soc_con0 | SGRF_PCLK_WDT_GATE_WRITE + | SGRF_FAST_BOOT_EN_WRITE); } static int rockchip_lpmode_enter(unsigned long arg) diff --git a/arch/arm/mach-rockchip/pm.h b/arch/arm/mach-rockchip/pm.h index 96beaa0..d463978 100644 --- a/arch/arm/mach-rockchip/pm.h +++ b/arch/arm/mach-rockchip/pm.h @@ -44,6 +44,8 @@ void __init rockchip_suspend_init(void); #define RK3288_SGRF_SOC_CON0 (0x0000) #define RK3288_SGRF_FAST_BOOT_ADDR (0x0120) +#define SGRF_PCLK_WDT_GATE BIT(6) +#define SGRF_PCLK_WDT_GATE_WRITE BIT(22) #define SGRF_FAST_BOOT_EN BIT(8) #define SGRF_FAST_BOOT_EN_WRITE BIT(24)