From patchwork Thu Mar 30 13:17:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 9654129 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 95A1B60349 for ; Thu, 30 Mar 2017 13:14:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89F32284CF for ; Thu, 30 Mar 2017 13:14:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EA9E269DA; Thu, 30 Mar 2017 13:14:54 +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 20333269DA for ; Thu, 30 Mar 2017 13:14:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933428AbdC3NOw (ORCPT ); Thu, 30 Mar 2017 09:14:52 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:42585 "EHLO epoutp01.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933498AbdC3NOv (ORCPT ); Thu, 30 Mar 2017 09:14:51 -0400 Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by epoutp01.samsung.com (KnoxPortal) with ESMTP id 20170330131443epoutp01f62a5ba1cd82c3c33359afd3dc2f0f53~wqyxmXMpZ1168011680epoutp01_; Thu, 30 Mar 2017 13:14:43 +0000 (GMT) Received: from epsmges5p3.samsung.com (unknown [182.195.42.46]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20170330131443epcas5p4694f5be96e6c2ebbe337067a73fae84b~wqyxIUqNB0490504905epcas5p4e; Thu, 30 Mar 2017 13:14:43 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p3.samsung.com (EPCPMTA) with SMTP id 0C.C9.18112.3C40DD85; Thu, 30 Mar 2017 22:14:43 +0900 (KST) Received: from epcpsbgm2new.samsung.com (u27.gpu120.samsung.co.kr [203.254.230.27]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20170330131442epcas5p4f2be72cb3ec506847d8e832675e682c4~wqywTqIlt1119311193epcas5p4M; Thu, 30 Mar 2017 13:14:42 +0000 (GMT) X-AuditID: b6c32a2e-f79506d0000046c0-c4-58dd04c37ef5 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 13.2B.05013.2C40DD85; Thu, 30 Mar 2017 22:14:42 +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:42 +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 11/12] ARM: EXYNOS: move cpu_restart as a SoC specific hook to exynos_cpu_info Date: Thu, 30 Mar 2017 18:47:05 +0530 Message-id: <1490879826-16754-12-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+NgFnrJIsWRmVeSWpSXmKPExsWy7bCmuu5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89i8pN5jSz+Q17dlFaPH501yARxRbjYZqYkpqUUKqXnJ+SmZeem2 SqEhbroWSgp5ibmptkoRur4hQUoKZYk5pUCekQEacHAOcA9W0rdLcMs4tmgPS8F+gYqeP8kN jNd4uxg5OSQETCTWPDnGDGGLSVy4t54NxBYSmMUosWuidBcjF5D9jlGiY81mJpAEm4CuxJP3 c8EaRAS8JSaf+csOYjMLXGGUODo1E8QWFkiW2NgynxHEZhFQlZi6ah1YDa+Ap8Tdk+dYIJbJ Sdw81wk2hxMofvLRNKjFHhLLTx5jnMDIu4CRYRWjRGpBckFxUnquUV5quV5xYm5xaV66XnJ+ 7iZGcEQ8k97BeHiX+yFGAQ5GJR7eirW3I4RYE8uKK3MPMUpwMCuJ8C5kuhshxJuSWFmVWpQf X1Sak1p8iNEU6LCJzFKiyfnAaM0riTc0MTcxNzawMLe0NDFSEudtnP0sXEggPbEkNTs1tSC1 CKaPiYNTqoHR4gTD7Zmep1/0X2Az7s7p3qGbyZV21XHmm5Dfa/kNzYUPhR2y3usgXNHsdsBO Z8v0PVVlOie3c2SEbGied+DI6vsCwqK5HJdnax9mSZJYrxSnmSSvdsU1kIftrdpJw8nMFr7h U1n27y7e/GXe1akSt/onnhRql/rm6Vl7+bdZzGXRqRPUDMKUWIozEg21mIuKEwEKZWcXngIA AA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170330131442epcas5p4f2be72cb3ec506847d8e832675e682c4 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-CMS-RootMailID: 20170330131442epcas5p4f2be72cb3ec506847d8e832675e682c4 X-RootMTR: 20170330131442epcas5p4f2be72cb3ec506847d8e832675e682c4 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 To handle differences in cpu_restart functionality among various Exynos SoC let's move cpu_restart as a SoC specific function hook to exynos_cpu_info. Signed-off-by: Pankaj Dubey --- arch/arm/mach-exynos/platsmp.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 6f08b15..af9332c 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -39,11 +39,13 @@ extern void exynos4_secondary_startup(void); * @cpu_boot_reg: computes cpu boot address for requested cpu * @cpu_power_down: handles cpu power down routine for requested cpu * @cpu_power_up: handles cpu power up routine for requested cpu + * @cpu_restart: handles cpu restart routine for requested cpu */ struct exynos_cpu_info { void __iomem* (*cpu_boot_reg)(u32 cpu); void (*cpu_power_down)(u32 cpu); void (*cpu_power_up)(u32 cpu); + void (*cpu_restart)(u32 cpu); }; static const struct exynos_cpu_info *cpu_info; @@ -252,16 +254,19 @@ static inline void __iomem *cpu_boot_reg(int cpu) } /* - * Set wake up by local power mode and execute software reset for given core. - * + * exynos_core_restart : restart the specified cpu + * @core_id : the cpu to be restarted * Currently this is needed only when booting secondary CPU on Exynos3250. */ void exynos_core_restart(u32 core_id) { - u32 val; + if (cpu_info && cpu_info->cpu_restart) + cpu_info->cpu_restart(core_id); +} - if (!of_machine_is_compatible("samsung,exynos3250")) - return; +static void exynos3250_core_restart(u32 core_id) +{ + u32 val; while (!pmu_raw_readl(S5P_PMU_SPARE2)) udelay(10); @@ -362,6 +367,7 @@ static const struct exynos_cpu_info exynos3250_cpu_info = { .cpu_boot_reg = exynos_common_cpu_boot_reg, .cpu_power_down = exynos_common_cpu_power_down, .cpu_power_up = exynos3250_cpu_power_up, + .cpu_restart = exynos3250_core_restart, }; static const struct exynos_cpu_info exynos5420_cpu_info = {