From patchwork Fri Apr 4 07:48:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 3936941 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 88A7ABFF02 for ; Fri, 4 Apr 2014 07:48:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99B9D203DC for ; Fri, 4 Apr 2014 07:48:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 985EA203E3 for ; Fri, 4 Apr 2014 07:48:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752270AbaDDHs0 (ORCPT ); Fri, 4 Apr 2014 03:48:26 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:56730 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbaDDHsH (ORCPT ); Fri, 4 Apr 2014 03:48:07 -0400 Received: by mail-wi0-f178.google.com with SMTP id bs8so684033wib.11 for ; Fri, 04 Apr 2014 00:48:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WcNjTCdk1lUUARIwT9ojZy3WWtnAc/Fyr9omHZ94Q4E=; b=diT/VLEHHWA5P76dyk3NooVw2i+pQH1XAv+2fK2/o1YO1qiDdpKV1D/9UKH6R6SnBF +IgQ3UL9wIvKIgTfL3TOviffPGot4kuVYDN2AQ0dAe160IlSv0ZEFK1zPmDheR7jJrAE +8SjTHU17mZGw4w1PW72jJGgh3ICU5UUWKRP0Oi1HYR1lgggV9TysA+plKYBDGCwdOa0 j0mF5r+uhF7zYNfkHwHteizSZlAodKIw0uyV7lKZ7z/68xJdlj+mZZNtjGfsHC1RN10z s0VknEt5xHR5NEvHXCUoKeq9zioojMScNhlPGff6xo8gm4VbLzoaQFnsimnF+dpFuuhE e+ag== X-Gm-Message-State: ALoCoQn+3nVGTkv8Yesy+Kk/X8XfkIeCgFWkvMrqYC43a5YJtSznJPuY8RbJvUEPVNilCEHJqV1/ X-Received: by 10.194.205.35 with SMTP id ld3mr17495226wjc.82.1396597686204; Fri, 04 Apr 2014 00:48:06 -0700 (PDT) Received: from localhost.localdomain (AToulouse-654-1-451-172.w83-205.abo.wanadoo.fr. [83.205.74.172]) by mx.google.com with ESMTPSA id t1sm3028163wia.1.2014.04.04.00.48.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 00:48:05 -0700 (PDT) From: Daniel Lezcano To: kgene.kim@samsung.com Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, t.figa@samsung.com, linaro-kernel@lists.linaro.org, rjw@rjwysocki.net Subject: [PATCH 14/17] ARM: exynos: cpuidle: Move the boot vector in pm.c Date: Fri, 4 Apr 2014 09:48:00 +0200 Message-Id: <1396597683-6969-15-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396597683-6969-1-git-send-email-daniel.lezcano@linaro.org> References: <1396597683-6969-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 As usual, move the boot vector setting in the pm.c file and use the cpu_pm notifier to set it up. Remove the unused headers. Signed-off-by: Daniel Lezcano Reviewed-by: Viresh Kumar --- arch/arm/mach-exynos/cpuidle.c | 22 ---------------------- arch/arm/mach-exynos/pm.c | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 3872c1e..1916dc6 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c @@ -8,42 +8,20 @@ * published by the Free Software Foundation. */ -#include -#include #include #include -#include -#include -#include #include #include #include -#include #include #include -#include - -#include -#include #include "common.h" -#include "regs-pmu.h" - -#define REG_DIRECTGO_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \ - S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \ - (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0)) -#define REG_DIRECTGO_FLAG (samsung_rev() == EXYNOS4210_REV_1_1 ? \ - S5P_INFORM6 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \ - (S5P_VA_SYSRAM + 0x20) : S5P_INFORM1)) static int idle_finisher(unsigned long flags) { - - __raw_writel(virt_to_phys(s3c_cpu_resume), REG_DIRECTGO_ADDR); - __raw_writel(S5P_CHECK_AFTR, REG_DIRECTGO_FLAG); - /* Set value of power down register for aftr mode */ exynos_sys_powerdown_conf(SYS_AFTR); diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 1c9d253..47fa9bd 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -79,6 +79,14 @@ #define EXYNOS5_PWR_CTRL2_CORE2_UP_RATIO (1 << 4) #define EXYNOS5_PWR_CTRL2_CORE1_UP_RATIO (1 << 0) +#define EXYNOS_BOOT_VECTOR_ADDR (samsung_rev() == EXYNOS4210_REV_1_1 ? \ + S5P_INFORM7 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \ + (S5P_VA_SYSRAM + 0x24) : S5P_INFORM0)) + +#define EXYNOS_BOOT_VECTOR_FLAG (samsung_rev() == EXYNOS4210_REV_1_1 ? \ + S5P_INFORM6 : (samsung_rev() == EXYNOS4210_REV_1_0 ? \ + (S5P_VA_SYSRAM + 0x20) : S5P_INFORM1)) + static const struct sleep_save exynos4_set_clksrc[] = { { .reg = EXYNOS4_CLKSRC_MASK_TOP , .val = 0x00000001, }, { .reg = EXYNOS4_CLKSRC_MASK_CAM , .val = 0x11111111, }, @@ -189,6 +197,12 @@ static void __init exynos5_core_down_clk(void) __raw_writel(tmp, EXYNOS5_PWR_CTRL2); } +static void exynos_cpu_set_boot_vector(void) +{ + __raw_writel(virt_to_phys(s3c_cpu_resume), EXYNOS_BOOT_VECTOR_ADDR); + __raw_writel(S5P_CHECK_AFTR, EXYNOS_BOOT_VECTOR_FLAG); +} + static int exynos_cpu_suspend(unsigned long arg) { #ifdef CONFIG_CACHE_L2X0 @@ -450,6 +464,7 @@ static int exynos_cpu_pm_notifier(struct notifier_block *self, exynos_pm_central_suspend(); exynos_cpu_save_register(); exynos_set_wakeupmask(); + exynos_cpu_set_boot_vector(); break; case CPU_PM_EXIT: