From patchwork Mon Jun 15 09:47:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 6607481 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 BA69AC0020 for ; Mon, 15 Jun 2015 09:51:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD0C2203B8 for ; Mon, 15 Jun 2015 09:51:41 +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 E161F2039D for ; Mon, 15 Jun 2015 09:51:40 +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 1Z4R0U-0006Hu-HX; Mon, 15 Jun 2015 09:48:42 +0000 Received: from mail-pd0-x230.google.com ([2607:f8b0:400e:c02::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4R0R-0006Fm-1z for linux-arm-kernel@lists.infradead.org; Mon, 15 Jun 2015 09:48:39 +0000 Received: by pdjm12 with SMTP id m12so69253852pdj.3 for ; Mon, 15 Jun 2015 02:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=V4H4hzprL1qwG1YNYj9rr752DDxpR6ML6ediL2uBw6Q=; b=k17lyE2QAvtR/jtoTwVAIruxHbMBu20zLOHgiThXAogsO1RXFpXZwiYz0XqGlNokvr D5IB5kW0L03LQKEfS8wxtj3nzp6BnD7VTAZm4XLbfXvU+LVXguQdnHBtbXHAtQg6JTDy x75UU+dDrYKFWHmLOX4leZyjP1SmZi2oY76jMaUHl+Ga02yR3Y8lqaN9J/gi7qirQiq9 qWrRKEs0C2RNqqtcVRgno3NEXd67+rzUrLqzbN3uCtkp7lnG8f0ajpwTComzL+O7AjcP L64F9bTUvidhThT7hNl5Nrh3mDN/A2ZoGs49MHYJ45MSn0HOnoMk4D6DTSpAyBu5Sl83 FGAw== X-Received: by 10.66.228.73 with SMTP id sg9mr5139912pac.88.1434361696609; Mon, 15 Jun 2015 02:48:16 -0700 (PDT) Received: from localhost.localdomain ([125.130.175.98]) by mx.google.com with ESMTPSA id q4sm11640225pdo.42.2015.06.15.02.48.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jun 2015 02:48:15 -0700 (PDT) From: Krzysztof Kozlowski To: Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: EXYNOS: Remove duplicated define of SLEEP_MAGIC Date: Mon, 15 Jun 2015 18:47:25 +0900 Message-Id: <1434361645-10233-1-git-send-email-k.kozlowski.k@gmail.com> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150615_024839_128073_9D0E18A0 X-CRM114-Status: GOOD ( 11.63 ) X-Spam-Score: -0.8 (/) Cc: Krzysztof Kozlowski 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=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY 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 magic cookie for entering sleep state was defined and used in two different places: firmware.c and suspend.c. Move it to one common place to reduce duplication. Signed-off-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/common.h | 6 ++++++ arch/arm/mach-exynos/firmware.c | 2 -- arch/arm/mach-exynos/suspend.c | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index e3a9256ed55f..153492513c40 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -128,6 +128,12 @@ void exynos_firmware_init(void); /* CPU BOOT mode flag for Exynos3250 SoC bootloader */ #define C2_STATE (1 << 3) +/* + * Magic values for bootloader indicating chosen low power mode. + * See also Documentation/arm/Samsung/Bootloader-interface.txt + */ +#define EXYNOS_SLEEP_MAGIC 0x00000bad +#define EXYNOS_AFTR_MAGIC 0xfcba0d10 void exynos_set_boot_flag(unsigned int cpu, unsigned int mode); void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode); diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index 245f6dec1ded..111cfbf66fdb 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c @@ -25,8 +25,6 @@ #include "common.h" #include "smc.h" -#define EXYNOS_SLEEP_MAGIC 0x00000bad -#define EXYNOS_AFTR_MAGIC 0xfcba0d10 #define EXYNOS_BOOT_ADDR 0x8 #define EXYNOS_BOOT_FLAG 0xc diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index f572219c7a40..c506f8e9c3e5 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -38,8 +38,6 @@ #include "regs-pmu.h" #include "exynos-pmu.h" -#define S5P_CHECK_SLEEP 0x00000BAD - #define REG_TABLE_END (-1U) #define EXYNOS5420_CPU_STATE 0x28 @@ -331,7 +329,7 @@ static void exynos_pm_enter_sleep_mode(void) { /* Set value of power down register for sleep mode */ exynos_sys_powerdown_conf(SYS_SLEEP); - pmu_raw_writel(S5P_CHECK_SLEEP, S5P_INFORM1); + pmu_raw_writel(EXYNOS_SLEEP_MAGIC, S5P_INFORM1); } static void exynos_pm_prepare(void)