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: tip-bot for Dave Martin X-Patchwork-Id: 1850911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 219AD3FCD5 for ; Fri, 7 Dec 2012 13:48:56 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TgyFs-0007P4-82; Fri, 07 Dec 2012 13:46:16 +0000 Received: from mail-bk0-f49.google.com ([209.85.214.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TgyFn-0007Ob-1T for linux-arm-kernel@lists.infradead.org; Fri, 07 Dec 2012 13:46:12 +0000 Received: by mail-bk0-f49.google.com with SMTP id jm19so229625bkc.36 for ; Fri, 07 Dec 2012 05:46:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=pO9Xj/9jb53Vf1FBYvqfr8AyfgKDNJ1ZDylt6lGBQBA=; b=Iwtn3BA6Nyhv6JR9VRWReXRnjk4LL7d6xmPLk4PJz6chNEPDGzZjQsZpcUjq9O7Pt3 YBxA/GxwhTH228P/8Ue0Ct1/6gJZDfNCtMokNfWTZllQax/Fc8FXzcnwok7kLvnpbqvi kCZP9rQaNyK2KfUL+dl3GAes0jUTKmhOMtdCL+btp4xQW1Ee2YUVK4M5kcA0iHErnlNW Ujke5z51VrwEBKGgXontbIfLjyRrRszS5noj7TLN7Wh8oz/T0d+9uMNLigwWoYg/4c48 tYlo4hE2tmgjST0wioDMMbHeV5Z4viG7eIQxX03iaED/1i5Lu38I3g2iUmihxjCL3Qqv HueQ== 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 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: ALoCoQly4+9IdIABMqk4dhaq/qut5L6DqiFUMErSCU15Xmoerj8lMbh4oKowDlc0A4+3bQYFkGQ3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121207_084611_250689_D4AE93CB X-CRM114-Status: GOOD ( 12.61 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Eric Miao , patches@linaro.org, Marko Katic , Haojian Zhuang , Marc Zyngier , Russell King X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 /*