From patchwork Fri Apr 21 21:55:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9693841 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 786216038D for ; Fri, 21 Apr 2017 21:56:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6836028680 for ; Fri, 21 Apr 2017 21:56:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CEBD28682; Fri, 21 Apr 2017 21:56: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=ham 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 E383728680 for ; Fri, 21 Apr 2017 21:56: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: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:In-Reply-To: References:List-Owner; bh=+5kUGuf61FKRfasLy7kLc3Z8fPjufc/afVIJCmxJfus=; b=MpF OyEol0dE7pvtCQBBZmvtXouE53caCZPABnlz9B+S8i2wBHD/1NFcdLD0/erF5ra3Nf9uMKIEWA5vR 8GLaR6T7jCNO4V1sUJOukWxw5nLOy5T6GqnhmKRbkZDIR1vor/SeBYk4tIGnNjlzBtXt2Kcy61aSE JtqBvWkvV2pgx7KKJ+YcELTvBcOvRT1DhDpyj6FnwgvVg8pFSHN9ZQmV7EzSmUEjszXWrycL0v/lj GJ6/15MMJ9NysTrUc1DqHfAeS/T2gOOenXA15zsDVjWChaYlBSm35gE7gVeqJOJcxzuIOTM4xF5LI DLlpW084fYZxwxYziCGiZoNtHbGPrvw==; 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 1d1gXF-0003VT-Jl; Fri, 21 Apr 2017 21:56:13 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d1gXB-0003T9-Ln for linux-arm-kernel@lists.infradead.org; Fri, 21 Apr 2017 21:56:11 +0000 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0LZl8O-1cIg3x0V4u-00lYbO; Fri, 21 Apr 2017 23:55:45 +0200 From: Arnd Bergmann To: Tony Lindgren Subject: [PATCH] ARM: omap2+: make omap4_get_cpu1_ns_pa_addr declaration usable Date: Fri, 21 Apr 2017 23:55:28 +0200 Message-Id: <20170421215556.2244576-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:clKbzWglAiWYXQo+Cxs1bhgZz4oR5zilWiafnoZRnJL0/gSTC+y ToiI9ESbDH+q1QDEIHexJolNM9KosJ/sBTzKE2nMzNNTypSO7UHoQkj22iLLX6cP1pRHOCL IWnXot1JfmBuxQ0WO9eIr+EmoypikS35/yztZgaOzo9ySi9AoDx9gkJxApZP+P8uoOwoN4+ 2K4nuYkYCYbvJdUyqdx8Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:1NDACi1aVB4=:SB91qbYjRlUkxTi8Bk84sO I/jxNH7Ict/L/sDrkun74vLEhVR/x1eEU7qHdCyAaLoOgVMIA5Vr374sdJCz8FMVQfM2kk3UP 4yjkMVqEHgbB7Iw0uFq1kx0U03WRTWxPkhCvygYei/JTajFHwJts1+dMavX+L6J6/1RmxQ6Uj S/GILqJiZGzw9n20X2t8lHP2egsWGT1DK75lC3SzcCfkDkWzG5vnYqhDBnM42bvWtfFFR2SOM BCK+J01jF5wspnbm78ZOl6330tBrhV6XU15QjNClblRE6qYpRYEqWxj2/vnpxQBH9IMk9/mwW bH0oiN7mx0EISFWX1ZdNalvOp3AJ2V6plm+OOS26ESzGtYfYA/MFTPR8n4QCrwxHkPIFMLH+i IIb7znt3KXN42Nz0MQ77x0p7FwNkv431grixGFrtW33LI0zl6Qzgefkx6X1wEqRwEhDeU5jZJ GZPESzxv/KQ8mNMRa+YHOO7Zccinf8EJ2wb2mI55vAkVKGPG45WqBnDYMh0dTezW5DRVUP+Ed ukzM72iMO+ypmXWvzp+4mkuvNgjSQR05L0mji+Bi18i5DYY0QvHTkOaIhaZapkBL/SbeVNy3a WsNfy09exOQMpWcSvHhj4f5hreRiT7SNeODh1EDVsWOkT8ltuykzEfOZ5lA9MWBbYQAj0E90q HI20BgiOLZg4LuNoGJhN/F2+jf59HH+EgdD2iO2gTYOxkviLB4ljixjTq7zYvx3xcG3U= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170421_145610_109884_D2ED5B31 X-CRM114-Status: GOOD ( 14.87 ) 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: Nishanth Menon , Arnd Bergmann , linux-kernel@vger.kernel.org, Tero Kristo , Tomi Valkeinen , Santosh Shilimkar , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 When CONFIG_PM is disabled, we get a build error: arch/arm/mach-omap2/omap-smp.c: In function 'omap4_smp_maybe_reset_cpu1': arch/arm/mach-omap2/omap-smp.c:309:20: error: implicit declaration of function 'omap4_get_cpu1_ns_pa_addr'; did you mean 'omap4_get_scu_base'? [-Werror=implicit-function-declaration] We need to fix this in multiple files, to ensure the declaration is visible, to actually build the function without CONFIG_PM, and to only call it when OMAP4 and/or OMAP5 are enabled. Fixes: 351b7c490700 ("ARM: omap2+: Revert omap-smp.c changes resetting CPU1 during boot") Signed-off-by: Arnd Bergmann Acked-by: Tony Lindgren --- arch/arm/mach-omap2/common.h | 3 ++- arch/arm/mach-omap2/omap-mpuss-lowpower.c | 10 +++++----- arch/arm/mach-omap2/omap-smp.c | 11 +++++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 3089d3bfa19b..8cc6338fcb12 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h @@ -266,11 +266,12 @@ extern int omap4_cpu_kill(unsigned int cpu); extern const struct smp_operations omap4_smp_ops; #endif +extern u32 omap4_get_cpu1_ns_pa_addr(void); + #if defined(CONFIG_SMP) && defined(CONFIG_PM) extern int omap4_mpuss_init(void); extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state); extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state); -extern u32 omap4_get_cpu1_ns_pa_addr(void); #else static inline int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state) diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c index 03ec6d307c82..4cfc4f9b2c69 100644 --- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c +++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c @@ -213,11 +213,6 @@ static void __init save_l2x0_context(void) {} #endif -u32 omap4_get_cpu1_ns_pa_addr(void) -{ - return old_cpu1_ns_pa_addr; -} - /** * omap4_enter_lowpower: OMAP4 MPUSS Low Power Entry Function * The purpose of this function is to manage low power programming @@ -457,6 +452,11 @@ int __init omap4_mpuss_init(void) #endif +u32 omap4_get_cpu1_ns_pa_addr(void) +{ + return old_cpu1_ns_pa_addr; +} + /* * For kexec, we must set CPU1_WAKEUP_NS_PA_ADDR to point to * current kernel's secondary_startup() early before diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 3faf454ba487..33e4953c61a8 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c @@ -306,7 +306,6 @@ static void __init omap4_smp_maybe_reset_cpu1(struct omap_smp_config *c) cpu1_startup_pa = readl_relaxed(cfg.wakeupgen_base + OMAP_AUX_CORE_BOOT_1); - cpu1_ns_pa_addr = omap4_get_cpu1_ns_pa_addr(); /* Did the configured secondary_startup() get overwritten? */ if (!omap4_smp_cpu1_startup_valid(cpu1_startup_pa)) @@ -316,9 +315,13 @@ static void __init omap4_smp_maybe_reset_cpu1(struct omap_smp_config *c) * If omap4 or 5 has NS_PA_ADDR configured, CPU1 may be in a * deeper idle state in WFI and will wake to an invalid address. */ - if ((soc_is_omap44xx() || soc_is_omap54xx()) && - !omap4_smp_cpu1_startup_valid(cpu1_ns_pa_addr)) - needs_reset = true; + if ((soc_is_omap44xx() || soc_is_omap54xx())) { + cpu1_ns_pa_addr = omap4_get_cpu1_ns_pa_addr(); + if (!omap4_smp_cpu1_startup_valid(cpu1_ns_pa_addr)) + needs_reset = true; + } else { + cpu1_ns_pa_addr = 0; + } if (!needs_reset || !c->cpu1_rstctrl_va) return;