From patchwork Sun Nov 16 00:52:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 411246 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 1CFBE1400B6 for ; Sun, 16 Nov 2014 11:52:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1A6604B9CA; Sun, 16 Nov 2014 01:52:29 +0100 (CET) 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 U94zkhiP1FV1; Sun, 16 Nov 2014 01:52:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 772FD4B7C7; Sun, 16 Nov 2014 01:52:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C83D84B6BB for ; Sun, 16 Nov 2014 01:52:16 +0100 (CET) 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 RzvuU04yfrhj for ; Sun, 16 Nov 2014 01:52:16 +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-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by theia.denx.de (Postfix) with ESMTPS id A2CAA4B6B3 for ; Sun, 16 Nov 2014 01:52:13 +0100 (CET) Received: by mail-wg0-f52.google.com with SMTP id b13so21931928wgh.11 for ; Sat, 15 Nov 2014 16:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rHsLtG+oLsHsNpZT+yQprui8Jw5fvTwFWW5lCvb/fGg=; b=eQwNZWr9kDOzPqfzdpui9q7lwZUrimjk5EVhKmtdyzryXzDGmTyz6+tVMi/8QcrwB2 4auasuxumPMycbOnh1JN8L/VzjV8qtYFK9yWtzCFRLNQuBYOQ3Fvi+5vjZbTeW7bXwZX CeuH8TjhWro7EnjGxjgVmyvqUqL+c0owblNngirUyXBeq5P4G+js2vwS03vtINiDyrWH NDnCuO3kn3ffPu+PZhOPgZlyJ/M/8D5xv7xowYc/pv5d7tYUOd2MyHp2Z7qAGtvZE+3M vdJqZuTYDdYMsuHT0qOXRuQCdpFJhIy5jjF6qYuPg8L+xDdB5r+I4d/PoXW3utEf20Vj bZMw== X-Received: by 10.194.222.98 with SMTP id ql2mr27091142wjc.10.1416099132896; Sat, 15 Nov 2014 16:52:12 -0800 (PST) Received: from workstation.zombienet.local (pD9EBEB67.dip0.t-ipconnect.de. [217.235.235.103]) by mx.google.com with ESMTPSA id ek9sm8868575wib.21.2014.11.15.16.52.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 15 Nov 2014 16:52:12 -0800 (PST) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Sun, 16 Nov 2014 01:52:01 +0100 Message-Id: <1416099127-16057-2-git-send-email-daniel.schwierzeck@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1416099127-16057-1-git-send-email-daniel.schwierzeck@gmail.com> References: <1416099127-16057-1-git-send-email-daniel.schwierzeck@gmail.com> Subject: [U-Boot] [PATCH 1/7] MIPS: bootm: add missing initramfs relocation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 The initramfs is currently only relocated if the user calls the bootm ramdisk subcommand. If bootm should be used without subcommands, the arch-specific bootm code needs to implement the relocation. Signed-off-by: Daniel Schwierzeck --- arch/mips/lib/bootm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index 71bb0d2..f947fd6 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -52,6 +52,20 @@ void arch_lmb_reserve(struct lmb *lmb) lmb_reserve(lmb, sp, CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp); } +static int boot_setup_linux(bootm_headers_t *images) +{ + int ret; + ulong rd_len; + + rd_len = images->rd_end - images->rd_start; + ret = boot_ramdisk_high(&images->lmb, images->rd_start, + rd_len, &images->initrd_start, &images->initrd_end); + if (ret) + return ret; + + return 0; +} + static void linux_cmdline_init(void) { linux_argc = 1; @@ -224,6 +238,8 @@ static void boot_jump_linux(bootm_headers_t *images) int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *images) { + int ret; + /* No need for those on MIPS */ if (flag & BOOTM_STATE_OS_BD_T) return -1; @@ -243,6 +259,10 @@ int do_bootm_linux(int flag, int argc, char * const argv[], return 0; } + ret = boot_setup_linux(images); + if (ret) + return ret; + boot_cmdline_linux(images); boot_prep_linux(images); boot_jump_linux(images);