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: 9654177 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 7767460349 for ; Thu, 30 Mar 2017 13:21:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A0EE2094F for ; Thu, 30 Mar 2017 13:21:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EA8F284A5; Thu, 30 Mar 2017 13:21:14 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C6CA2094F for ; Thu, 30 Mar 2017 13:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=JEWR1d35EA1D2Qla0knbVjhpUGrucbkxB5p6pLBYtvE=; b=NAJxcvtGnr0uDmmDEj78zHub4G zE6l33i/fd2zhB3YOL9E71SNLUFvndhFEypeln/uvetUJ9h/LLYQwAH2HKJpnMp/E9CBbm+xDv6/A UZxHB/4dpj1MVjOH0sAPp2jc4/ARxgqKMGdNuoZBg6fM4WfNX4CRmENpsRJCLnf08TSH+vWHkolDH grm0IucTY+uZ+EUTqVY5zEl+lkbRXmizZHKy0R/DeK2YpVj78M3K63MePKHWJWC+LEobb/anVfs9y 3HHT5Me1Fq8gfjc7VmA3UCdkTI4tvqBR4UVmUnp/MEQUVxTVbSvOERpfjVFarrNC3jZWol4rabs63 EhotbHMg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cta0k-00080W-56; Thu, 30 Mar 2017 13:21:10 +0000 Received: from mailout1.samsung.com ([203.254.224.24] helo=epoutp01.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctZum-0000MM-Md for linux-arm-kernel@lists.infradead.org; Thu, 30 Mar 2017 13:15:10 +0000 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 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+NgFnrJIsWRmVeSWpSXmKPExsWy7bCmuu5hlrsRBm3XhSxurTvHavF30jF2 i2dHtS3evF3DZNH/+DWzxfnzG9gtNj2+xmox4/w+JouXR34wWqw9cpfdYtHWL+wO3B6/f01i 9Lh1p95j56y77B6bVnWyeWxeUu+xpR/I69uyitHj8ya5AI4oLpuU1JzMstQifbsEroxji/aw FOwXqOj5k9zAeI23i5GDQ0LARGL2ZNYuRk4gU0ziwr31bF2MXBxCAksZJT62f2UHSQgJtDNJ nLqsBlFkIrHmyTFmiKI5jBL/W2axQzjvGCW2HrvCAlLFJqAr8eT9XGYQW0TAW2Lymb9gRcwC 1xglFnavAEsICyRLnDv+FqyBRUBVYuqqdWDreAU8Je6ePMcCsU5O4ua5TrB6TqD4yUfTwO6T EJjHLnHrwQl2iB9kJTYdYIaod5E4MWsmG4QtLPHq+BZ2CFta4u/SW4wQvd2MEr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riTc0MTcxNzawMLe0NDFSEudtnP0sXEggPbEkNTs1tSC1 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170330_061501_126768_C4B1B71F X-CRM114-Status: GOOD ( 11.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, javier@osg.samsung.com, Pankaj Dubey , krzk@kernel.org, m.reichl@fivetechno.de, a.hajda@samsung.com, kgene@kernel.org, cwchoi00@gmail.com, m.szyprowski@samsung.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 = {