From patchwork Thu Mar 10 02:16:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 8552861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1D9B8C0553 for ; Thu, 10 Mar 2016 02:24:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D040202B8 for ; Thu, 10 Mar 2016 02:24:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5436E20259 for ; Thu, 10 Mar 2016 02:24:52 +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 1adqFr-0001QH-Go; Thu, 10 Mar 2016 02:23:11 +0000 Received: from mail.kmu-office.ch ([178.209.48.109]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adqAU-0002nG-AQ for linux-arm-kernel@lists.infradead.org; Thu, 10 Mar 2016 02:17:41 +0000 Received: from trochilidae.toradex.int (75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 5A85A5C121E; Thu, 10 Mar 2016 03:16:44 +0100 (CET) From: Stefan Agner To: shawnguo@kernel.org, mturquette@baylibre.com, sboyd@codeaurora.org Subject: [PATCH 16/18] ARM: vf610: PM: enable Suspend-to-RAM only if hardware fixes are in place Date: Wed, 9 Mar 2016 18:16:57 -0800 Message-Id: <1457576219-7971-17-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1457576219-7971-1-git-send-email-stefan@agner.ch> References: <1457576219-7971-1-git-send-email-stefan@agner.ch> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1457576207; bh=dYzzBVNikvXFI8kgD8wMQ9sYK9ZzWvLj8AFH4QQW/tM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=FV1YG3IfkM8P09WzLuLtFHrKFyagWiT3HYXsAMtcPBPbNE5g6BqRltmEYWksdl2Eb53bYGAlNqk0PCTOHNUUiGVkkCzdXnuWh/wOZmxYg7+u43PeYP8ugm6c5pDw2YMFtdPqyiL+FVWiX8uTigYcOHw+HsF0SrX7ZSqJ4CpIY7U= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160309_181738_773747_5DDDAA80 X-CRM114-Status: GOOD ( 10.82 ) X-Spam-Score: -2.0 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, jason@lakedaemon.net, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, Stefan Agner , robh+dt@kernel.org, sergeimir@emcraft.com, kernel@pengutronix.de, galak@codeaurora.org, tglx@linutronix.de, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 To use self-refresh mode for DDR3 SDRAM memory in LPSTOPx mode, the hardware need to have pull-ups/downs populated on RESET/CKE line of the DDR memory. Read the device tree property which indicates whether a given board has such resistors populated. Signed-off-by: Stefan Agner --- arch/arm/mach-imx/pm-vf610.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/pm-vf610.c b/arch/arm/mach-imx/pm-vf610.c index ecc7c9c..3da93e9 100644 --- a/arch/arm/mach-imx/pm-vf610.c +++ b/arch/arm/mach-imx/pm-vf610.c @@ -93,6 +93,7 @@ static void __iomem *suspend_ocram_base; static void (*vf610_suspend_in_ocram_fn)(void __iomem *ocram_vbase); +static bool has_cke_reset_pulls; #ifdef DEBUG static void __iomem *uart_membase; @@ -382,7 +383,8 @@ static int vf610_pm_enter(suspend_state_t state) static int vf610_pm_valid(suspend_state_t state) { - return (state == PM_SUSPEND_STANDBY || state == PM_SUSPEND_MEM); + return (state == PM_SUSPEND_STANDBY || + (state == PM_SUSPEND_MEM && has_cke_reset_pulls)); } static const struct platform_suspend_ops vf610_pm_ops = { @@ -476,6 +478,19 @@ static int __init vf610_suspend_init(const struct vf610_pm_socdata *socdata) return ret; #endif + node = of_find_compatible_node(NULL, NULL, socdata->ddrmc_compat); + if (node) { + has_cke_reset_pulls = + of_property_read_bool(node, "fsl,has-cke-reset-pulls"); + + of_node_put(node); + } + + if (has_cke_reset_pulls) + pr_info("PM: CKE/RESET pulls available, enable Suspend-to-RAM\n"); + else + pr_info("PM: No CKE/RESET pulls, disable Suspend-to-RAM\n"); + suspend_set_ops(&vf610_pm_ops); node = of_find_compatible_node(NULL, NULL, "mmio-sram");