From patchwork Thu Mar 25 15:25:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulius Zaleckas X-Patchwork-Id: 48529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8F131B7C98 for ; Fri, 26 Mar 2010 02:27:22 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Nuovt-0000ns-Of; Thu, 25 Mar 2010 15:25:17 +0000 Received: from mail-bw0-f218.google.com ([209.85.218.218]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Nuovn-0000jq-1B; Thu, 25 Mar 2010 15:25:15 +0000 Received: by bwz10 with SMTP id 10so10128698bwz.2 for ; Thu, 25 Mar 2010 08:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:subject:to:cc:date :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=SKymrPrhVUZKWRXGkhhLFk+qzuXoRb0/ZvkGwcdsJ9M=; b=rnxG1n/UDQ3IugfEeW6PbDaD8h6KmVamPkR5pL9DH0FfH564CIGh11gWvybi0sEHuu e9lg5KN4FF96Qb2JKVUAaDTN5DZX195mDmNgJftSh5mE+lbsGlzy/fZkdA8c1k22+iQ9 VJMcQSh77nalOjpFRn6zxD/U3gVweYYf6OjtU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:subject:to:cc:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; b=TmN6L3ysXU7f7GHjeqKYZrzS6RUoE32m0GanXUj+QzqoWZkkSt5g40x0n8sNsy5DRD sD7iNooXE60cY3t0S16lgIonxnXS2/vUj351i7PGla7CmuF/yBfPDxLmyhPtGwOynPFf KHqKTyBee7J2zE405oOosBwiPvBnFRZu7b9ig= Received: by 10.204.137.1 with SMTP id u1mr2064701bkt.151.1269530709245; Thu, 25 Mar 2010 08:25:09 -0700 (PDT) Received: from [127.0.0.1] ([89.249.92.238]) by mx.google.com with ESMTPS id 13sm839997bwz.3.2010.03.25.08.25.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 25 Mar 2010 08:25:07 -0700 (PDT) From: Paulius Zaleckas Subject: [PATCH v2] MTD: Fix Orion NAND driver compilation with ARM OABI To: dwmw2@infradead.org Date: Thu, 25 Mar 2010 17:25:05 +0200 Message-ID: <20100325152505.17612.40158.stgit@pauliusz> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100325_112511_189043_2207D758 X-CRM114-Status: GOOD ( 15.91 ) X-Spam-Score: 2.4 (++) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (2.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- 2.4 DNS_FROM_OPENWHOIS RBL: Envelope sender listed in bl.open-whois.org. Cc: nico@fluxnic.net, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, u.kleine-koenig@pengutronix.de, simon.kagstrom@netinsight.net, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We must tell GCC to use even register for variable passed to ldrd instruction. Without this patch GCC 4.2.1 puts this variable to r2/r3 on EABI and r3/r4 on OABI, so force it to r2/r3. This does not change anything when EABI and OABI compilation works OK. Without this patch and with OABI I get: CC drivers/mtd/nand/orion_nand.o /tmp/ccMkwOCs.s: Assembler messages: /tmp/ccMkwOCs.s:63: Error: first destination register must be even -- `ldrd r3,[ip]' make[5]: *** [drivers/mtd/nand/orion_nand.o] Error 1 Signed-off-by: Paulius Zaleckas Acked-by: Nicolas Pitre --- drivers/mtd/nand/orion_nand.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index f59c074..d60fc57 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c @@ -60,7 +60,13 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) } buf64 = (uint64_t *)buf; while (i < len/8) { - uint64_t x; + /* + * Since GCC has no proper constraint (PR 43518) + * force x variable to r2/r3 registers as ldrd instruction + * requires first register to be even. + */ + register uint64_t x asm ("r2"); + asm volatile ("ldrd\t%0, [%1]" : "=&r" (x) : "r" (io_base)); buf64[i++] = x; }