From patchwork Thu Mar 30 13:16:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 9654107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 34C5460349 for ; Thu, 30 Mar 2017 13:14:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 296D227D0E for ; Thu, 30 Mar 2017 13:14:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E27128501; Thu, 30 Mar 2017 13:14:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4C5827D0E for ; Thu, 30 Mar 2017 13:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933401AbdC3NO0 (ORCPT ); Thu, 30 Mar 2017 09:14:26 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:53446 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933254AbdC3NOZ (ORCPT ); Thu, 30 Mar 2017 09:14:25 -0400 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ONM004K1Q3ZAR50@mailout3.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 30 Mar 2017 22:14:23 +0900 (KST) Received: from epsmges5p3.samsung.com (unknown [182.195.42.46]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20170330131422epcas5p2f9b9718171f6eedb6e496138ebdae78c~wqydcU8cR2440324403epcas5p2x; Thu, 30 Mar 2017 13:14:22 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p3.samsung.com (EPCPMTA) with SMTP id C6.C9.18112.EA40DD85; Thu, 30 Mar 2017 22:14:22 +0900 (KST) Received: from epcpsbgm2new.samsung.com (u27.gpu120.samsung.co.kr [203.254.230.27]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20170330131421epcas5p40b0ad9c1003d3ab807667ae2b05d25bc~wqydO-q2d2027120271epcas5p4O; Thu, 30 Mar 2017 13:14:21 +0000 (GMT) X-AuditID: b6c32a2e-f79506d0000046c0-a4-58dd04ae23c8 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id DC.1B.05013.DA40DD85; Thu, 30 Mar 2017 22:14:21 +0900 (KST) Received: from pankaj.com ([107.108.83.125]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ONM009R0Q3AAC60@mmp2.samsung.com>; Thu, 30 Mar 2017 22:14:21 +0900 (KST) From: Pankaj Dubey To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: krzk@kernel.org, arnd@arndb.de, m.szyprowski@samsung.com, kgene@kernel.org, m.reichl@fivetechno.de, a.hajda@samsung.com, cwchoi00@gmail.com, javier@osg.samsung.com, Pankaj Dubey Subject: [PATCH v9 02/12] ARM: EXYNOS: remove usage of soc_is_exynosMMMM from pm.c Date: Thu, 30 Mar 2017 18:46:56 +0530 Message-id: <1490879826-16754-3-git-send-email-pankaj.dubey@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1490879826-16754-1-git-send-email-pankaj.dubey@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDIsWRmVeSWpSXmKP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+Q17dlFaPH501yARxRbjYZqYkpqUUKqXnJ+SmZeem2 SqEhbroWSgp5ibmptkoRur4hQUoKZYk5pUCekQEacHAOcA9W0rdLcMs4s+sWY8Fv6YoHs76x NDCuE+9i5OSQEDCR2DPjJROELSZx4d56ti5GLg4hgVmMEqf2r2eEcN4xSsxo/cAIUsUmoCvx 5P1cZhBbRMBbYvKZv+wgNrPAFUaJo1MzQWxhgRCJg9MmsoLYLAKqEpcO7QGyOTh4BTwklh+S h1gmJ3HzXCfYGE4BT4mTj6axgdhCICUnjzFOYORdwMiwilEitSC5oDgpPdcoL7Vcrzgxt7g0 L10vOT93EyM4Jp5J72A8vMv9EKMAB6MSD2/F2tsRQqyJZcWVuYcYJTiYlUR4FzLdjRDiTUms rEotyo8vKs1JLT7EaAp010RmKdHkfGC85pXEG5qYm5gbG1iYW1qaGCmJ8zbOfhYuJJCeWJKa nZpakFoE08fEwSnVwFhcPPmu/p14TWWj8gOzGffwRZTyZx5pZ6o1/HH9YbLh/LC3Hk9ZpZw2 OHUkbOV98j0pg+Wk9M+l9/V2Hd8ZLfKvY2vgRLNFcek2Hd/VLVes1X/TNuN99TefzV7HL24q jDH89Y8pePuxVy2Bl3qcWO/89+f+P9dERnXlq4/tSmfWW77Zv5JDYp4SS3FGoqEWc1FxIgAu 0IOtnwIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170330131421epcas5p40b0ad9c1003d3ab807667ae2b05d25bc X-Msg-Generator: CA X-Sender-IP: 203.254.230.27 X-Local-Sender: =?UTF-8?B?7YyQ7Lm07KaIG1NTSVItVHVybiBLZXkgU29sdXRpb25zGw==?= =?UTF-8?B?7IK87ISx7KCE7J6QGy4vU2VuaW9yIENoaWVmIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?UEFOS0FKIEtVTUFSIERVQkVZG1NTSVItVHVybiBLZXkgU29s?= =?UTF-8?B?dXRpb25zG1NhbXN1bmcgRWxlY3Ryb25pY3MbLi9TZW5pb3IgQ2hpZWYgRW5n?= =?UTF-8?B?aW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1NXQUhRG0MxMElEMDdJRDAxMDk5Nw==?= CMS-TYPE: 105P X-HopCount: 7 X-CMS-RootMailID: 20170330131421epcas5p40b0ad9c1003d3ab807667ae2b05d25bc X-RootMTR: 20170330131421epcas5p40b0ad9c1003d3ab807667ae2b05d25bc References: <1490879826-16754-1-git-send-email-pankaj.dubey@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP soc_is_exynosMMMM is staged for removal after adopting to exynos-chipid driver, so let's remove/minimize usage of any such helper function usage from pm.c. Signed-off-by: Pankaj Dubey Reviewed-by: Krzysztof Kozlowski --- arch/arm/mach-exynos/pm.c | 22 ++++++++++++---------- include/linux/soc/samsung/exynos-regs-pmu.h | 3 +++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c index 1a7e5b5..4a73b02 100644 --- a/arch/arm/mach-exynos/pm.c +++ b/arch/arm/mach-exynos/pm.c @@ -123,11 +123,13 @@ int exynos_pm_central_resume(void) } /* Ext-GIC nIRQ/nFIQ is the only wakeup source in AFTR */ -static void exynos_set_wakeupmask(long mask) +static void exynos_set_wakeupmask(void) { - pmu_raw_writel(mask, S5P_WAKEUP_MASK); - if (soc_is_exynos3250()) + if (of_machine_is_compatible("samsung,exynos3250")) { + pmu_raw_writel(EXYNOS3_WAKEUP_MASK_VAL, S5P_WAKEUP_MASK); pmu_raw_writel(0x0, S5P_WAKEUP_MASK2); + } else + pmu_raw_writel(EXYNOS_WAKEUP_MASK_VAL, S5P_WAKEUP_MASK); } static void exynos_cpu_set_boot_vector(long flags) @@ -141,7 +143,7 @@ static int exynos_aftr_finisher(unsigned long flags) { int ret; - exynos_set_wakeupmask(soc_is_exynos3250() ? 0x40003ffe : 0x0000ff3e); + exynos_set_wakeupmask(); /* Set value of power down register for aftr mode */ exynos_sys_powerdown_conf(SYS_AFTR); @@ -162,7 +164,7 @@ void exynos_enter_aftr(void) cpu_pm_enter(); - if (soc_is_exynos3250()) + if (of_machine_is_compatible("samsung,exynos3250")) exynos_set_boot_flag(cpuid, C2_STATE); exynos_pm_central_suspend(); @@ -184,7 +186,7 @@ void exynos_enter_aftr(void) exynos_pm_central_resume(); - if (soc_is_exynos3250()) + if (of_machine_is_compatible("samsung,exynos3250")) exynos_clear_boot_flag(cpuid, C2_STATE); cpu_pm_exit(); @@ -255,7 +257,7 @@ static int exynos_cpu0_enter_aftr(void) while (exynos_cpu_power_state(1) != S5P_CORE_LOCAL_PWR_EN) cpu_relax(); - if (soc_is_exynos3250()) { + if (of_machine_is_compatible("samsung,exynos3250")) { while (!pmu_raw_readl(S5P_PMU_SPARE2) && !atomic_read(&cpu1_wakeup)) cpu_relax(); @@ -277,7 +279,7 @@ static int exynos_cpu0_enter_aftr(void) call_firmware_op(cpu_boot, 1); - if (soc_is_exynos3250()) + if (of_machine_is_compatible("samsung,exynos3250")) dsb_sev(); else arch_send_wakeup_ipi_mask(cpumask_of(1)); @@ -289,7 +291,7 @@ static int exynos_cpu0_enter_aftr(void) static int exynos_wfi_finisher(unsigned long flags) { - if (soc_is_exynos3250()) + if (of_machine_is_compatible("samsung,exynos3250")) flush_cache_all(); cpu_do_idle(); @@ -311,7 +313,7 @@ static int exynos_cpu1_powerdown(void) */ exynos_cpu_power_down(1); - if (soc_is_exynos3250()) + if (of_machine_is_compatible("samsung,exynos3250")) pmu_raw_writel(0, S5P_PMU_SPARE2); ret = cpu_suspend(0, exynos_wfi_finisher); diff --git a/include/linux/soc/samsung/exynos-regs-pmu.h b/include/linux/soc/samsung/exynos-regs-pmu.h index 49df0a01..3a7e63f 100644 --- a/include/linux/soc/samsung/exynos-regs-pmu.h +++ b/include/linux/soc/samsung/exynos-regs-pmu.h @@ -50,6 +50,9 @@ #define S5P_WAKEUP_MASK 0x0608 #define S5P_WAKEUP_MASK2 0x0614 +#define EXYNOS_WAKEUP_MASK_VAL 0x0000FF3E +#define EXYNOS3_WAKEUP_MASK_VAL 0x40003FFE + #define S5P_INFORM0 0x0800 #define S5P_INFORM1 0x0804 #define S5P_INFORM5 0x0814