From patchwork Wed Jul 20 17:12:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 992732 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6KHCidD010465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 20 Jul 2011 17:13:05 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QjaJo-0004Vf-IZ; Wed, 20 Jul 2011 17:12:20 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QjaJo-0007GH-6W; Wed, 20 Jul 2011 17:12:20 +0000 Received: from mail-fx0-f43.google.com ([209.85.161.43]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QjaJl-0007Fy-K9 for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2011 17:12:18 +0000 Received: by fxg17 with SMTP id 17so1648010fxg.16 for ; Wed, 20 Jul 2011 10:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding:content-type; bh=LbB45GqIrFIugPWKvHtnF7EoT3bDSv5ORCDZub0cDvo=; b=rjMfTZnX/qqEKdTbOtuWl2BuyLtwWHGU29UzW7PETxPaOVOvV13ubqTriuAiT1ndNY CUiCjzvkPDCH5RXZ7CegH/ceGtEwfmNu42ID6GRWkGfpWL7ouVrE3hVHqKO+OxkySBgC nDNfxG3KRkrtwYxsEamiHPMaAChe794VRwdRw= Received: by 10.223.17.141 with SMTP id s13mr535402faa.7.1311181935682; Wed, 20 Jul 2011 10:12:15 -0700 (PDT) Received: from flatron.localnet (178-73-0-134.home.aster.pl [178.73.0.134]) by mx.google.com with ESMTPS id r12sm797456fam.24.2011.07.20.10.12.13 (version=SSLv3 cipher=OTHER); Wed, 20 Jul 2011 10:12:14 -0700 (PDT) From: Tomasz Figa To: linux-arm-kernel@lists.infradead.org Subject: Re: S3C6410 UART resume problem Date: Wed, 20 Jul 2011 19:12:15 +0200 Message-ID: <8865715.7kkxAXkp10@flatron> User-Agent: KMail/4.6.0 (Linux/2.6.39-gentoo-r2; KDE/4.6.4; x86_64; ; ) In-Reply-To: <1534460.6WAISbrX4v@flatron> References: <1534460.6WAISbrX4v@flatron> MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110720_131217_843627_4718468C X-CRM114-Status: GOOD ( 13.67 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.161.43 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomasz.figa[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 T_TO_NO_BRKTS_FREEMAIL To: misformatted and free email service Cc: Kukjin Kim , Ben Dooks X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 20 Jul 2011 17:13:05 +0000 (UTC) I have managed to implement a workaround that works for me, but I am not sure whether it could not be done in a better way. I have attached a patch based on Linux 2.6.38. P.S. Please excuse me sending my last message incorrectly, using To instead of CC fields, as my mail client automatically sets all address text fields as To and I have forgotten to switch them to CC. --- arch/arm/mach-s3c64xx/pm.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c index 79412f7..7818bdd 100644 --- a/arch/arm/mach-s3c64xx/pm.c +++ b/arch/arm/mach-s3c64xx/pm.c @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -29,6 +30,8 @@ #include #include +#include + #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK #include @@ -101,12 +104,36 @@ void s3c_pm_configure_extint(void) void s3c_pm_restore_core(void) { + u32 pclkgate, tmp; + int i; + __raw_writel(0, S3C64XX_EINT_MASK); s3c_pm_debug_smdkled(1 << 2, 0); s3c_pm_do_restore_core(core_save, ARRAY_SIZE(core_save)); s3c_pm_do_restore(misc_save, ARRAY_SIZE(misc_save)); + + tmp = pclkgate = __raw_readl(S3C_PCLK_GATE); + + /* re-start uart clocks */ + tmp |= S3C_CLKCON_PCLK_UART0; + tmp |= S3C_CLKCON_PCLK_UART1; + tmp |= S3C_CLKCON_PCLK_UART2; + tmp |= S3C_CLKCON_PCLK_UART3; + + __raw_writel(tmp, S3C_PCLK_GATE); + + udelay(10); + + for (i = 0; i < 4; ++i) { + __raw_writel(15, S3C_VA_UARTx(i) + S3C64XX_UINTM); + __raw_writel(15, S3C_VA_UARTx(i) + S3C64XX_UINTP); + } + + udelay(10); + + __raw_writel(pclkgate, S3C_PCLK_GATE); } void s3c_pm_save_core(void)