From patchwork Fri Dec 7 13:45:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 13416 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 B0A2D23E2C for ; Fri, 7 Dec 2012 13:46:10 +0000 (UTC) Received: from mail-ia0-f176.google.com (mail-ia0-f176.google.com [209.85.210.176]) by fiordland.canonical.com (Postfix) with ESMTP id 561DFA19B63 for ; Fri, 7 Dec 2012 13:46:10 +0000 (UTC) Received: by mail-ia0-f176.google.com with SMTP id k32so545297iak.7 for ; Fri, 07 Dec 2012 05:46:09 -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=pO9Xj/9jb53Vf1FBYvqfr8AyfgKDNJ1ZDylt6lGBQBA=; b=LkF19GGiG4wiFmKJKOMTGERr/RT8JeigH2ix1DYFKP1Ru9XLMhRXKwINmDo5OKEfSJ 6xxUIGsXu7iMWOgq1ndvyf4MmrVDYJjpTrgQGT7N1BJ/STG2+P9gmKn4j7opfzSUZ+ED gRHmVynieZUHCLnhz6Y/TRu/tk4Uc4ueihPG8fytHS+t2oAgIIspIPCPXx5RdF3qH1Yw B50Gwj/yA6bb6GlfJI11ttyWihIDvah4pHmHuOH/JVKdaHbmXYc1KFbbs5CtCHL//el0 TmrTVJWbA/NbzbVwIsl4hBTlVhG5LwEF9qIife8EGz80VHxwK8Ib5KiL6RW/4OnMA5XW CuZg== Received: by 10.50.213.69 with SMTP id nq5mr9148105igc.70.1354887969565; Fri, 07 Dec 2012 05:46:09 -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 n20csp474857igt; Fri, 7 Dec 2012 05:46:08 -0800 (PST) Received: by 10.204.3.206 with SMTP id 14mr1901997bko.120.1354887968073; Fri, 07 Dec 2012 05:46:08 -0800 (PST) Received: from mail-bk0-f43.google.com (mail-bk0-f43.google.com [209.85.214.43]) by mx.google.com with ESMTPS id hs14si17897292bkc.52.2012.12.07.05.46.07 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 07 Dec 2012 05:46:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.43 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=209.85.214.43; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.43 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-f43.google.com with SMTP id jf20so239557bkc.2 for ; Fri, 07 Dec 2012 05:46:07 -0800 (PST) Received: by 10.204.4.131 with SMTP id 3mr1893671bkr.25.1354887967110; Fri, 07 Dec 2012 05:46:07 -0800 (PST) Received: from e103592.peterhouse.linaro.org (fw-lnat.cambridge.arm.com. [217.140.96.63]) by mx.google.com with ESMTPS id l17sm9165757bkw.12.2012.12.07.05.46.05 (version=SSLv3 cipher=OTHER); Fri, 07 Dec 2012 05:46:06 -0800 (PST) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Marko Katic , Russell King , Eric Miao , Haojian Zhuang , Marc Zyngier Subject: [PATCH] ARM: head: Remove boot-time HYP mode check for v5 and below Date: Fri, 7 Dec 2012 13:45:59 +0000 Message-Id: <1354887959-14863-1-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQltYWbXhM4JFbrRgckOPn2EjgJJWM3T3qAmGMggqDR2N3TaLuP2se2jdAsmLfAIA+Xn8S3J 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 --- 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 /*