From patchwork Mon Dec 10 17:35:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 13460 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7F0A023FC0 for ; Mon, 10 Dec 2012 17:35:35 +0000 (UTC) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) by fiordland.canonical.com (Postfix) with ESMTP id 2EC0EA19928 for ; Mon, 10 Dec 2012 17:35:35 +0000 (UTC) Received: by mail-ie0-f170.google.com with SMTP id k10so16783786iea.1 for ; Mon, 10 Dec 2012 09:35:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=4WeE2dao2SDUTYYbqeZ8YOBwkqca8NMWBfTjva+j0aI=; b=U9UrdDIyYdPVLcHf6aU9Nw6AoelfupL9uOv1hmYf4LBTiM2Rphnr5zDirdrkYNcoM5 XB1kuC5Xd1jEcQ3yy/1gQBm6OPM4N7e553wIVUbE1OUEoN4rZPHnkFzd1cGuUM109f47 F5nbVQDp6RvyP8zNma6Q/eCwKc2s1jyw7pyF3SG/Hwn0yxx6qEJeVfGhmlaE1Sq1IRe4 dNs3ImynxXLPmmWRxMJ01iEHmzuVb49/Dg5AtK1xWtt59auN5U4zyFWOH2yth6wZF2Qx unH0tTBSA1/zoHdZ4ks9dOL3W4+sUESj0WxLKSkUzolwhJKEO1Mxlw3h4eIiZAG0Tjlq toxQ== Received: by 10.50.91.195 with SMTP id cg3mr7259864igb.57.1355160934562; Mon, 10 Dec 2012 09:35:34 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp81162igt; Mon, 10 Dec 2012 09:35:33 -0800 (PST) Received: by 10.204.136.207 with SMTP id s15mr4827572bkt.5.1355160932604; Mon, 10 Dec 2012 09:35:32 -0800 (PST) Received: from mail-bk0-f48.google.com (mail-bk0-f48.google.com [209.85.214.48]) by mx.google.com with ESMTPS id hi14si27100503bkc.72.2012.12.10.09.35.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2012 09:35:32 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.48 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=209.85.214.48; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.48 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by mail-bk0-f48.google.com with SMTP id jc3so1311130bkc.35 for ; Mon, 10 Dec 2012 09:35:31 -0800 (PST) Received: by 10.204.157.152 with SMTP id b24mr4715119bkx.92.1355160931512; Mon, 10 Dec 2012 09:35:31 -0800 (PST) Received: from e103592.peterhouse.linaro.org (fw-lnat.cambridge.arm.com. [217.140.96.63]) by mx.google.com with ESMTPS id l17sm14791372bkw.12.2012.12.10.09.35.29 (version=SSLv3 cipher=OTHER); Mon, 10 Dec 2012 09:35:30 -0800 (PST) From: Dave Martin To: patches@arm.linux.org.uk Cc: patches@linaro.org, Dave Martin Subject: [PATCH] ARM: head: Remove boot-time HYP mode check for v5 and below Date: Mon, 10 Dec 2012 17:35:22 +0000 Message-Id: <1355160922-21816-1-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnfXpAWNqEXZrX4AhU4FURcOLUkL842dGMFg3LRvZDtfyv3sgK7dA5kUJb724I9jVhhNSHY The kernel can only be entered on HYP mode on CPUs which actually support it, i.e. >= ARMv7. pre-v6 platform support cannot coexist in the same kernel as support for v7 and higher, so there is no advantage in having the HYP mode check on pre-v6 hardware. At least one pre-v6 board is known to fail when the HYP mode check code is present, although the exact cause remains unknown and may be unrelated. [1] This patch restores the old behaviour for pre-v6 platforms, whereby the CPSR is forced directly to SVC mode with IRQs and FIQs masked. All kernels capable of booting on v7 hardware will retain the check, so this should not impair functionality. [1] http://lists.arm.linux.org.uk/lurker/message/20121130.013814.19218413.en.html ([ARM] head.S change broke platform device registration?) Signed-off-by: Dave Martin --- KernelVersion: 3.7-rc6 arch/arm/include/asm/assembler.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 2ef9581..eb87200 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h @@ -250,6 +250,7 @@ * Beware, it also clobers LR. */ .macro safe_svcmode_maskall reg:req +#if __LINUX_ARM_ARCH__ >= 6 mrs \reg , cpsr mov lr , \reg and lr , lr , #MODE_MASK @@ -266,6 +267,13 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) __ERET 1: msr cpsr_c, \reg 2: +#else +/* + * workaround for possibly broken pre-v6 hardware + * (akita, Sharp Zaurus C-1000, PXA270-based) + */ + setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, \reg +#endif .endm /*