From patchwork Thu Nov 1 23:42:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 196414 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 164042C0346 for ; Fri, 2 Nov 2012 10:42:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CD1834A693; Fri, 2 Nov 2012 00:42:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zWAeoz-jpZY2; Fri, 2 Nov 2012 00:42:21 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 646A54A688; Fri, 2 Nov 2012 00:42:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C8EA4A688 for ; Fri, 2 Nov 2012 00:42:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ctOkDVtNrGAo for ; Fri, 2 Nov 2012 00:42:18 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qc0-f202.google.com (mail-qc0-f202.google.com [209.85.216.202]) by theia.denx.de (Postfix) with ESMTPS id 00A6C4A67F for ; Fri, 2 Nov 2012 00:42:16 +0100 (CET) Received: by mail-qc0-f202.google.com with SMTP id s25so58177qcq.3 for ; Thu, 01 Nov 2012 16:42:15 -0700 (PDT) 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=clXZ6Dpw2aLBHqVfkgy2gxi6hPy23ledKQQDH3+c35k=; b=A2urE8ulS9mOcQMIb1quqDjJ0AbiXCowt/vMVN71rKYYRt/cVQrSVZOxCc5MNV6ubj AIOEVTE1AtM1nhnQE4pOh2uz4SteTnUoQNWNJzD2pgjK0BQI0SfHGr1ztcMdQoLYXsaX nQfinwqYZ2e2p2+SyoBATskQFnBY/sT1UDMyk4H7bu6kCoe6I7gytTTCzsr84gbm1AFG grDXoJCW9wJK7mHM2eR826dcsyEFWdrRami7gJweV6lYxgqlPZiZz0ld2DNRD+1BO9Vb 5EZ9kHnzJw3f1DRDXrQPZbvoUIX09Df4WcME9qZZ2vlYWqxpB0FUYvpmrvhdmeMJ1hH7 vGbQ== Received: by 10.236.134.232 with SMTP id s68mr30464562yhi.31.1351813335330; Thu, 01 Nov 2012 16:42:15 -0700 (PDT) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id l20si531274yhi.2.2012.11.01.16.42.15 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 01 Nov 2012 16:42:15 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id ABD93100048; Thu, 1 Nov 2012 16:42:14 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 504CC16091E; Thu, 1 Nov 2012 16:42:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Thu, 1 Nov 2012 16:42:01 -0700 Message-Id: <1351813330-23741-1-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 X-Gm-Message-State: ALoCoQmsUfEUp/wqSkJEN0PjZfovRNCJF6dZZeKiMinQzZpjoy5mWB8AZ+s8qnjgCzp2k6xx+joll4eRKjuE9c+ggxKSrfmpfKNs3F4eUgJqDMzo7EWY3ralI44JkR4mW4u/4sAflYglyf0MEj3rW+xLh1NZaLFr/jvIcJE4139qlf88ABYA+wpnfMo8JDqQbdk/OMZyh3OL Subject: [U-Boot] [PATCH 01/10] arm: Compile cache_disable() with -O2 to avoid failure X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de It is good to have these functions written in C instead of assembler, but with -O0 the cache_disable() function doesn't return. Rather than revert to assembler, this fix just forces this to be built with -O2. Signed-off-by: Simon Glass --- arch/arm/lib/cache-cp15.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c index 939de10..8f8385d 100644 --- a/arch/arm/lib/cache-cp15.c +++ b/arch/arm/lib/cache-cp15.c @@ -110,6 +110,16 @@ static void cache_enable(uint32_t cache_bit) set_cr(reg | cache_bit); } +/* + * Big hack warning! + * + * Devs like to compile with -O0 to get a nice debugging illusion. But this + * function does not survive that since -O0 causes the compiler to read the + * PC back from the stack after the dcache flush. Might it be possible to fix + * this by flushing the write buffer? + */ +static void cache_disable(uint32_t cache_bit) __attribute__ ((optimize(2))); + /* cache_bit must be either CR_I or CR_C */ static void cache_disable(uint32_t cache_bit) {