From patchwork Tue Feb 23 14:43:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102691 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1868437lbl; Tue, 23 Feb 2016 06:44:15 -0800 (PST) X-Received: by 10.98.19.205 with SMTP id 74mr46756400pft.31.1456238655495; Tue, 23 Feb 2016 06:44:15 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 133si47807273pfa.203.2016.02.23.06.44.15; Tue, 23 Feb 2016 06:44:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753397AbcBWOoN (ORCPT + 30 others); Tue, 23 Feb 2016 09:44:13 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:50388 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752589AbcBWOoL (ORCPT ); Tue, 23 Feb 2016 09:44:11 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue004) with ESMTPA (Nemesis) id 0MgaVX-1aKfwH1iFD-00NzvL; Tue, 23 Feb 2016 15:43:34 +0100 From: Arnd Bergmann To: Santosh Shilimkar Cc: linux-arm-kernel@lists.infradead.org, Nishanth Menon , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] [RFC] ARM: keystone: possibly fix big-endian kernels Date: Tue, 23 Feb 2016 15:43:21 +0100 Message-Id: <1456238609-962461-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:8ZRPVL7Y1gf0eef3a/wRLshcsFRiuc2w/S3W61bFcYLllruu/4+ KDlFhlF6/d/PtmZ9hLEJFQ2bcgwAYulc/a1fUSupadk/R0mtb97I4lF9oRnVivArPpdvhcV 3LJdMWAwc+uj1tk2pCEYgHrZ6I1Ys9WW42C4IuPpC8PQodt0EtT0cVSjxBy4J8QEuecXHIA Efkvn+DJvTI+PmIco3ObA== X-UI-Out-Filterresults: notjunk:1; V01:K0:VV10sNifmTo=:T5edlWxye62A3BgOY+jXKb H5Nkd68kY+s9bMiXB6XKtcqd9PMrZbaTuwQ/VgY9dMG+BhO9qxRqZDvculEtU85UShfkj11+M MYz+6EYf3L7VQBeKZLbtt/AUuS1P+PPS3WDejlb3p72orFijcJcSds8Bw2A4w+eTX9stwRxgA 8LQhUPvhhgFXeIbdqyInhBO6Mnr+/v36isgeUnj/POSo+cNNkxdKu+b9licHnUZbS+M9xvCnG t3mIB4PYX/B5B+jJyqnUSQP2dHPwonGxjBeA15u4yYpl9kO+Uwcyd/iRjHUwum91hnTPjXBg2 IM4AftPq+ut/b14EbWcP8ePyROmajLO4Vung8hSXpbmq8bkmybU4Be6e1yQmcRXmjag2QE06n YTE1qHWjOyOOunb4Aqq5Pn8lMA9qGBtXScOtnzxyxYhGECTeik4AJYF64vN5HZDsOeTohvTUq De6TnUrzhB6B+RlBQ3hS7tZZeY5Llw+YCuu+EvQd3E/iIo4zwXE5Di+9kgCMTAEujGSr8Dwwc 4d4UFLEcjVtrSo5BgjP/OLjSt3EPMk5b0bxj1T076zz8JSXaTuFWItWZN7Sk6Tm85mjZEdEGb /6vFmOh1XaPyV281UAt0KHjbSFcZavO3yvJpvi3iRhHSEGpMq1hgAGgyACpbxDRZRcJsN2Q/c UEiFLaAAlKiwQya+COQNKln7F7t1UrhL1z1YGMhv8W78Cv7tiz5ym+UY9s/npPVX4aL0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While discussing a regressing in the netcp driver, I wondered whether Keystone can work with a big-endian kernel, and noticed that we don't switch endianess when we enter the kernel on the secondary CPU, or when we call into smc. I don't know whether this works on the machine, but on others it does not, so this adds the explicit switch to big-endian in keystone_secondary_startup. Signed-off-by: Arnd Bergmann --- arch/arm/mach-keystone/keystone.h | 2 +- arch/arm/mach-keystone/platsmp.c | 2 +- arch/arm/mach-keystone/smc.S | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) -- 2.7.0 diff --git a/arch/arm/mach-keystone/keystone.h b/arch/arm/mach-keystone/keystone.h index 33eaa037af5a..016ae7644e73 100644 --- a/arch/arm/mach-keystone/keystone.h +++ b/arch/arm/mach-keystone/keystone.h @@ -16,7 +16,7 @@ #ifndef __ASSEMBLER__ extern const struct smp_operations keystone_smp_ops; -extern void secondary_startup(void); +extern void keystone_secondary_startup(void); extern u32 keystone_cpu_smc(u32 command, u32 cpu, u32 addr); extern int keystone_pm_runtime_init(void); diff --git a/arch/arm/mach-keystone/platsmp.c b/arch/arm/mach-keystone/platsmp.c index 5665276972ec..c427787f78d1 100644 --- a/arch/arm/mach-keystone/platsmp.c +++ b/arch/arm/mach-keystone/platsmp.c @@ -26,7 +26,7 @@ static int keystone_smp_boot_secondary(unsigned int cpu, struct task_struct *idle) { - unsigned long start = virt_to_idmap(&secondary_startup); + unsigned long start = virt_to_idmap(&keystone_secondary_startup); int error; pr_debug("keystone-smp: booting cpu %d, vector %08lx\n", diff --git a/arch/arm/mach-keystone/smc.S b/arch/arm/mach-keystone/smc.S index d15de8179fab..81604c0d4e1b 100644 --- a/arch/arm/mach-keystone/smc.S +++ b/arch/arm/mach-keystone/smc.S @@ -10,6 +10,7 @@ */ #include +#include /** * u32 keystone_cpu_smc(u32 command, u32 cpu, u32 addr) @@ -26,3 +27,10 @@ ENTRY(keystone_cpu_smc) smc #0 ldmfd sp!, {r4-r11, pc} ENDPROC(keystone_cpu_smc) + +#ifdef CONFIG_SMP +ENTRY(keystone_secondary_startup) +ARM_BE8(setend be) @ go BE8 if entered LE + b secondary_startup +ENDPROC(keystone_secondary_startup) +#endif