From patchwork Fri Mar 4 15:33:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 329 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:41:45 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs18690qah; Fri, 4 Mar 2011 07:34:22 -0800 (PST) Received: by 10.227.150.101 with SMTP id x37mr657342wbv.225.1299252861418; Fri, 04 Mar 2011 07:34:21 -0800 (PST) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id o13si4361735wee.160.2011.03.04.07.34.20 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 07:34:21 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 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-ww0-f50.google.com with SMTP id 31so2967094wwb.31 for ; Fri, 04 Mar 2011 07:34:20 -0800 (PST) Received: by 10.227.101.2 with SMTP id a2mr692162wbo.20.1299252860709; Fri, 04 Mar 2011 07:34:20 -0800 (PST) Received: from e200948.cambridge.arm.com (host86-184-75-253.range86-184.btcentralplus.com [86.184.75.253]) by mx.google.com with ESMTPS id bd8sm1875824wbb.13.2011.03.04.07.34.17 (version=SSLv3 cipher=OTHER); Fri, 04 Mar 2011 07:34:19 -0800 (PST) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Tony Lindgren , Santosh Shilimkar , Jean Pihet , Kevin Hilman , linux-omap@vger.kernel.org, Nicolas Pitre , linaro-dev@lists.linaro.org Subject: [PATCH v5 1/5] ARM: omap4: Provide do_wfi() for Thumb-2 Date: Fri, 4 Mar 2011 15:33:53 +0000 Message-Id: <1299252837-18074-2-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1299252837-18074-1-git-send-email-dave.martin@linaro.org> References: <1299252837-18074-1-git-send-email-dave.martin@linaro.org> For CONFIG_THUMB2_KERNEL, the existing definition of do_wfi() will insert invalid code into the instruction stream. Any assembler which can assemble Thumb-2 is guaranteed to accept the "wfi" mnemonic, so for the Thumb-2 case, just use the mnemonic. The ARM case is left as-is. Signed-off-by: Dave Martin --- arch/arm/mach-omap2/include/mach/omap4-common.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h index 5b0270b..de441c0 100644 --- a/arch/arm/mach-omap2/include/mach/omap4-common.h +++ b/arch/arm/mach-omap2/include/mach/omap4-common.h @@ -17,8 +17,12 @@ * wfi used in low power code. Directly opcode is used instead * of instruction to avoid mulit-omap build break */ +#ifdef CONFIG_THUMB2_KERNEL +#define do_wfi() __asm__ __volatile__ ("wfi" : : : "memory") +#else #define do_wfi() \ __asm__ __volatile__ (".word 0xe320f003" : : : "memory") +#endif #ifdef CONFIG_CACHE_L2X0 extern void __iomem *l2cache_base;