From patchwork Wed Sep 16 20:55:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 1365488 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=uBE/X1wg; dkim=temperror header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=moxyIdzk; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BsC7X0fpvz9sSn for ; Thu, 17 Sep 2020 06:56:24 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=N2aMu3cXYeimo/McWUU2vPOHJy9cgNm0E3Fv9jb/Yxc=; b=uBE/X1wgXG5koNpH847ZRrA4eD Q1gso0+l0oq4A/xqbroXSqRZKX/Mj04KVUbhNwbk6vFtuF4cNBbtWfYJUf+s3Vbt8BAt+bZ/bDAM5 S70biR2qOWd/kYxQuJHJ+C39cEPUzXD8g7lbiUO3qRXGYclSHZID500FWP8MT7zH3CSOZz0mdhmFk xiiG/bZM4Z1ieMZflHbqOqIEqcJlzJRldm67oKwq2X6krBgLPijKLxlIIQ/qRM5nK4h6ajsv/Wj5D PbaSz8njZ7dyldrLpWTaI0S1YoS4w7A5bBiyaYeH6WAgyIASOM+w1nSoGvbkstn7EP4WjyMMoRFNR SL2Lyagw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIeTA-0006ii-Kk; Wed, 16 Sep 2020 20:56:00 +0000 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIeT1-0006fn-3M for linux-arm-kernel@lists.infradead.org; Wed, 16 Sep 2020 20:55:52 +0000 Received: by mail-qv1-xf41.google.com with SMTP id z18so4292311qvp.6 for ; Wed, 16 Sep 2020 13:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xlr3leNCtmg5lGhoiV0RJvwzeoH75Ap2iawoMOs+/ss=; b=moxyIdzkKfdRzqStsir31MSUueua8eZllctoPq0RBBhSJMQ4eJS9kxX+INQUfaja1C p7nEfSPtPuREu63XB/80NKb53I1qoJdurYy39dCc5z3I4VsAqH20xIXB2Y9Ja72xw9o+ eDBfK48dPXxm7hx77CgKQS4JNfgOtBRHEQ/DZF+zaoVbbJAgsSYYiT9qezybWp2E96x9 /UcJHYe8CWRSwJnTAauXtAwV37ijjPo/o5y2VGT9XdZrTfx3pgGcUxjd4idPHUwp27Vm 9UiFJ1IjmAFnbNRP6KJcXlFbKnhCy11+Ks1M8deW08wQ4TQfx2uy1ew5ZhRd/ulqy8HQ 6G5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Xlr3leNCtmg5lGhoiV0RJvwzeoH75Ap2iawoMOs+/ss=; b=VH0SbXor+ga86i4J26Nwdmi6mHqsyHgYw3FZ+gdKF1MpfNFXED2dU1l/LHwe4nJhjO Ap3w6M3BaJjj9yJMOgWpFvpwvOsItVzHqK2STF3OoosvpHgoYqLXZfyBN0D3gEw39SIk JUUSJiGBNC1V8kDrDCCTLGImB+03kLbZmVa4YtN3kuHvvSmPusc7St8ImgvLGPChFN33 938+U3AomwUIl6knELUOjWoTVG1IuBcMPbkm7RFJtb7WBY8VS+TVALArk7m0fi1AjvCC 9b9H/9SzFludT2pBODqPntaAqFsTIae3HvrgIDBA7ST8fj33ffju1wYE3aPeMQay94gx KuOg== X-Gm-Message-State: AOAM531ch+fCm+0hnYB+LZRH9z7BbzhX4+flYd5i0XvEyCmK/zkWb2AD fBraGg2fxf3SBUfHfFWZty7gx/UpsFw= X-Google-Smtp-Source: ABdhPJzHgXNxF7qZOosIhJWeFVgzTnYcH+1NVS+C9XvnifQsai7h6yw0QebCC6eCwR4SNUNtWfD6qw== X-Received: by 2002:a0c:ca08:: with SMTP id c8mr8654405qvk.42.1600289749426; Wed, 16 Sep 2020 13:55:49 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:482:640:9cc0:878:419e:8021]) by smtp.gmail.com with ESMTPSA id q142sm20320897qke.48.2020.09.16.13.55.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 13:55:48 -0700 (PDT) From: Fabio Estevam To: shawnguo@kernel.org Subject: [PATCH 04/13] ARM: imx27: Retrieve the CCM base address from devicetree Date: Wed, 16 Sep 2020 17:55:13 -0300 Message-Id: <20200916205522.8783-5-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200916205522.8783-1-festevam@gmail.com> References: <20200916205522.8783-1-festevam@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200916_165551_174960_CB8ADDFB X-CRM114-Status: GOOD ( 14.89 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:f41 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [festevam[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Fabio Estevam , arnd@arndb.de, linux-imx@nxp.com, kernel@pengutronix.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org Now that imx27 has been converted to a devicetree-only platform, retrieve the CCM base address from devicetree. Signed-off-by: Fabio Estevam --- arch/arm/mach-imx/pm-imx27.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c index d943535566c8..020e6deb67c8 100644 --- a/arch/arm/mach-imx/pm-imx27.c +++ b/arch/arm/mach-imx/pm-imx27.c @@ -7,6 +7,7 @@ * modify it under the terms of the GNU General Public License. */ +#include #include #include #include @@ -15,13 +16,20 @@ static int mx27_suspend_enter(suspend_state_t state) { + void __iomem *ccm_base; + struct device_node *np; u32 cscr; + + np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm"); + ccm_base = of_iomap(np, 0); + BUG_ON(!ccm_base); + switch (state) { case PM_SUSPEND_MEM: /* Clear MPEN and SPEN to disable MPLL/SPLL */ - cscr = imx_readl(MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR)); + cscr = imx_readl(ccm_base); cscr &= 0xFFFFFFFC; - imx_writel(cscr, MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR)); + imx_writel(cscr, ccm_base); /* Executes WFI */ cpu_do_idle(); break;