From patchwork Thu Apr 28 22:50:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 1225 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:50:20 -0000 Delivered-To: patches@linaro.org Received: by 10.224.2.73 with SMTP id 9cs165918qai; Thu, 28 Apr 2011 15:50:49 -0700 (PDT) Received: by 10.52.73.234 with SMTP id o10mr587338vdv.16.1304031049065; Thu, 28 Apr 2011 15:50:49 -0700 (PDT) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by mx.google.com with ESMTP id e8si3612947vby.53.2011.04.28.15.50.48; Thu, 28 Apr 2011 15:50:49 -0700 (PDT) Received-SPF: neutral (google.com: 24.201.245.36 is neither permitted nor denied by best guess record for domain of nico@fluxnic.net) client-ip=24.201.245.36; Authentication-Results: mx.google.com; spf=neutral (google.com: 24.201.245.36 is neither permitted nor denied by best guess record for domain of nico@fluxnic.net) smtp.mail=nico@fluxnic.net Content-transfer-encoding: 7BIT Received: from xanadu.home ([66.130.28.92]) by VL-MR-MRZ22.ip.videotron.ca (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTP id <0LKD00G7HWSMR9A0@VL-MR-MRZ22.ip.videotron.ca> for patches@linaro.org; Thu, 28 Apr 2011 18:50:47 -0400 (EDT) From: Nicolas Pitre To: Russell King - ARM Linux Cc: linux-arm-kernel@lists.infradead.org, Tony Lindgren , patches@linaro.org Subject: [PATCH 2/9] ARM: zImage: Fix bad SP address after relocating kernel Date: Thu, 28 Apr 2011 18:50:17 -0400 Message-id: <1304031024-5121-3-git-send-email-nico@fluxnic.net> X-Mailer: git-send-email 1.7.4 In-reply-to: <1304031024-5121-1-git-send-email-nico@fluxnic.net> References: <1304031024-5121-1-git-send-email-nico@fluxnic.net> From: Tony Lindgren Otherwise cache_clean_flush can overwrite some of the relocated area depending on where the kernel image gets loaded. This fixes booting on n900 after commit 6d7d0ae51574943bf571d269da3243257a2d15db (ARM: 6750/1: improvements to compressed/head.S). Thanks to Aaro Koskinen for debugging the address of the relocated area that gets corrupted, and to Nicolas Pitre for the other uncompress related fixes. Signed-off-by: Tony Lindgren Signed-off-by: Nicolas Pitre --- arch/arm/boot/compressed/head.S | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 84ac4d6..55a5bcb 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -253,6 +253,11 @@ restart: adr r0, LC0 /* Preserve offset to relocated code. */ sub r6, r9, r6 +#ifndef CONFIG_ZBOOT_ROM + /* cache_clean_flush may use the stack, so relocate it */ + add sp, sp, r6 +#endif + bl cache_clean_flush adr r0, BSYM(restart)