From patchwork Sat Jun 8 22:42:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 249988 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com 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 E40642C008C for ; Sun, 9 Jun 2013 08:50:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 489B24A095; Sun, 9 Jun 2013 00:50:08 +0200 (CEST) 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 V7VV8WF+uPVX; Sun, 9 Jun 2013 00:50:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 237FB4A02D; Sun, 9 Jun 2013 00:49:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4FDAE4A08B for ; Sun, 9 Jun 2013 00:49:48 +0200 (CEST) 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 curHnJO7ShxT for ; Sun, 9 Jun 2013 00:49:45 +0200 (CEST) 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-ea0-f180.google.com (mail-ea0-f180.google.com [209.85.215.180]) by theia.denx.de (Postfix) with ESMTPS id 1D2794A08D for ; Sun, 9 Jun 2013 00:49:40 +0200 (CEST) Received: by mail-ea0-f180.google.com with SMTP id k10so4514947eaj.25 for ; Sat, 08 Jun 2013 15:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=P+zheA6BshGAzD2OWM20XkZtMSYJhcZaSwIebj4su+A=; b=ZoqfdpstYacBGvsxtStUY4L4Gh94TYKc9tjZR/lAx7rnRJ1p9S9QXi72g4tHrvMUdf uiMP1FCW0qBKduSWTHJvKi1mmnMmpSGxNXAy1GxkhNh37B4GMa46/GbjSpPjg/Mo35dw yyssLwLQvboeKli8yHfP9Lzi+o1aulOWv2M9JBZ1B8GpS580E/+DCXUbFQqkOlAlYf2k TtaOg3rne3URP6lzi3GqITgOzqdoyzsf872p5jGJQUJ6ZgN4dBnwSCPZllSzbile3FTr wbNkkQ7RQhKPmbWATxmR7o/Xr5raBLZtubjrR+pcRF852EI88lg4M8t1eLSbt81ZZjnp tK/Q== X-Received: by 10.14.8.68 with SMTP id 44mr4578674eeq.56.1370731381442; Sat, 08 Jun 2013 15:43:01 -0700 (PDT) Received: from workstation.zombienet.local (p5DDCAFD5.dip0.t-ipconnect.de. [93.220.175.213]) by mx.google.com with ESMTPSA id u7sm10052133eef.14.2013.06.08.15.43.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 08 Jun 2013 15:43:01 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Sun, 9 Jun 2013 00:42:46 +0200 Message-Id: <1370731370-32767-8-git-send-email-daniel.schwierzeck@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1370731370-32767-1-git-send-email-daniel.schwierzeck@gmail.com> References: <1370731370-32767-1-git-send-email-daniel.schwierzeck@gmail.com> Subject: [U-Boot] [PATCH 07/11] MIPS: bootm: add support for generic relocation of init ramdisks 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 All linux kernels after v2.6 require a page-aligned location of an external init ramdisk. Enable CONFIG_SYS_BOOT_RAMDISK_HIGH to support this with the generic U-Boot relocation code. Signed-off-by: Daniel Schwierzeck --- arch/mips/include/asm/config.h | 1 + arch/mips/lib/bootm.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/config.h b/arch/mips/include/asm/config.h index 36438be..6ddc349 100644 --- a/arch/mips/include/asm/config.h +++ b/arch/mips/include/asm/config.h @@ -22,5 +22,6 @@ #define _ASM_CONFIG_H_ #define CONFIG_LMB +#define CONFIG_SYS_BOOT_RAMDISK_HIGH #endif diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index e13e0d5..741e088 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -170,6 +170,7 @@ static void boot_prep_linux_legacy(bootm_headers_t *images) { char env_buf[12]; const char *cp; + ulong rd_start, rd_size; #ifdef CONFIG_MEMSIZE_IN_BYTES sprintf(env_buf, "%lu", (ulong)gd->ram_size); @@ -180,14 +181,17 @@ static void boot_prep_linux_legacy(bootm_headers_t *images) (ulong)(gd->ram_size >> 20)); #endif /* CONFIG_MEMSIZE_IN_BYTES */ + rd_start = UNCACHED_SDRAM(images->initrd_start); + rd_size = images->initrd_end - images->initrd_start; + linux_env_init(); linux_env_set("memsize", env_buf); - sprintf(env_buf, "0x%08X", (uint) UNCACHED_SDRAM(images->rd_start)); + sprintf(env_buf, "0x%08lX", rd_start); linux_env_set("initrd_start", env_buf); - sprintf(env_buf, "0x%X", (uint) (images->rd_end - images->rd_start)); + sprintf(env_buf, "0x%lX", rd_size); linux_env_set("initrd_size", env_buf); sprintf(env_buf, "0x%08X", (uint) (gd->bd->bi_flashstart));