From patchwork Wed Sep 17 06:11:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 4922821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 106EABEEA5 for ; Wed, 17 Sep 2014 06:14:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A8FA20166 for ; Wed, 17 Sep 2014 06:14:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 448B32015A for ; Wed, 17 Sep 2014 06:14:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XU8Ss-0005Vt-QH; Wed, 17 Sep 2014 06:11:42 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XU8Sq-0005T3-2s for linux-arm-kernel@lists.infradead.org; Wed, 17 Sep 2014 06:11:40 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0] ident=Debian-exim) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1XU8SN-00035u-8d; Wed, 17 Sep 2014 08:11:11 +0200 Received: from ukl by ptx.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1XU8SM-0003tT-Vd; Wed, 17 Sep 2014 08:11:10 +0200 Date: Wed, 17 Sep 2014 08:11:10 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Joachim Eastwood Subject: Re: Cortex-M and zImage Message-ID: <20140917061110.GM3755@pengutronix.de> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140916_231140_345268_0A29E3A5 X-CRM114-Status: GOOD ( 23.29 ) X-Spam-Score: -0.7 (/) Cc: catalin.marinas@arm.com, Russell King - ARM Linux , "linux-arm-kernel@lists.infradead.org" , Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello Joachim, On Tue, Sep 16, 2014 at 10:25:02PM +0200, Joachim Eastwood wrote: > I am working on Linux support for the NXP LPC18xx/43xx family of > Cortex-M3/M4 microcontrollers. Building zImage for Cortex-M fails > with the following two errors: > error: arch/arm/boot/compressed/piggy.gzip.o: Conflicting architecture > profiles M/A > linux/arch/arm/boot/compressed/head.S:794: undefined reference to > `CONFIG_PROCESSOR_ID' > > The last error is easy to fix. But the first about conflicting arch is > harder. Do you send a patch? I was able to compile a zImage with the patch below. For the "Conflicting architecture profiles" error the most relevant hunk is the first. And of course this needs some #ifdefs. Best regards Uwe > As far as I know zImage on Cortex-M is not supported or not tested. > > Are there any plans to support zImage on Cortex-M? > If so does anyone have an idea how the conflicting arch issue could > be solved? > > btw, building with 'make Image' works fine and I have been running > Linux for a while on the NXP LPC4357. diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 413fd94b5301..abad996484f1 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -11,7 +11,7 @@ #include #include - .arch armv7-a + .arch armv7-m /* * Debugging stuff * @@ -114,7 +114,7 @@ * sort out different calling conventions */ .align - .arm @ Always enter in ARM state + @.arm @ Always enter in ARM state start: .type start,#function .rept 7 @@ -133,7 +133,7 @@ start: THUMB( .thumb ) 1: ARM_BE8( setend be ) @ go BE8 if compiled for BE8 - mrs r9, cpsr + @mrs r9, cpsr #ifdef CONFIG_ARM_VIRT_EXT bl __hyp_stub_install @ get into SVC mode, reversibly #endif @@ -145,7 +145,7 @@ start: * FIQs/IRQs (numeric definitions from angel arm.h source). * We only do this if we were in user mode on entry. */ - mrs r2, cpsr @ get current mode + @mrs r2, cpsr @ get current mode tst r2, #3 @ not user? bne not_angel mov r0, #0x17 @ angel_SWIreason_EnterSVC @@ -153,7 +153,7 @@ start: THUMB( svc 0xab ) @ angel_SWI_THUMB not_angel: safe_svcmode_maskall r0 - msr spsr_cxsf, r9 @ Save the CPU boot mode in + @msr spsr_cxsf, r9 @ Save the CPU boot mode in @ SPSR /* * Note that some cache flushing and other stuff may @@ -366,7 +366,7 @@ dtb_check_done: /* Relocate the hyp vector base if necessary */ #ifdef CONFIG_ARM_VIRT_EXT - mrs r0, spsr + @mrs r0, spsr and r0, r0, #MODE_MASK cmp r0, #HYP_MODE bne 1f @@ -500,7 +500,7 @@ not_relocated: mov r0, #0 mov r2, r8 @ restore atags pointer #ifdef CONFIG_ARM_VIRT_EXT - mrs r0, spsr @ Get saved CPU boot mode + @mrs r0, spsr @ Get saved CPU boot mode and r0, r0, #MODE_MASK cmp r0, #HYP_MODE @ if not booted in HYP mode... bne __enter_kernel @ boot kernel directly @@ -791,7 +791,7 @@ call_cache_fn: adr r12, proc_types #ifdef CONFIG_CPU_CP15 mrc p15, 0, r9, c0, c0 @ get processor ID #else - ldr r9, =CONFIG_PROCESSOR_ID + @ldr r9, =CONFIG_PROCESSOR_ID #endif 1: ldr r1, [r12, #0] @ get value ldr r2, [r12, #4] @ get mask