From patchwork Wed May 8 18:06:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 242619 X-Patchwork-Delegate: trini@ti.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 1BA962C00E0 for ; Thu, 9 May 2013 04:07:07 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C75904A1A8; Wed, 8 May 2013 20:07:05 +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 YC9HTCmUWFqk; Wed, 8 May 2013 20:07:05 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B9D734A1AA; Wed, 8 May 2013 20:06:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B71634A124 for ; Wed, 8 May 2013 20:06:45 +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 OJWjjQo9-e+9 for ; Wed, 8 May 2013 20:06: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-ve0-f201.google.com (mail-ve0-f201.google.com [209.85.128.201]) by theia.denx.de (Postfix) with ESMTPS id 019624A168 for ; Wed, 8 May 2013 20:06:42 +0200 (CEST) Received: by mail-ve0-f201.google.com with SMTP id m1so204655ves.0 for ; Wed, 08 May 2013 11:06:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=+uvWEPLmpShHT6LBEyKLvjxKGmQ5eS16B20ecAuCZj4=; b=i3zxeAxr2GHDskAmP70oILlbhFEXQ8+G4aALEaA56GVWkO6am9YGXILfUx/R/X/BEH hIpEa34vAHHx/NA1e2SnFwVTpkvO/iVKvhslrADJtJshCmU/VvDfOCyFzwGKFy5hVvcY w4Prn28yeD7QW8Iajcx87qN8DQd8Oeqfu2IVgoRG6C0o/QBc/PIOxzQXkVFXGKZlEslA zKtfcRRT15HyQA3ufsV61qGfW8aoqg6t6DkPhotzE3DoFWz+kpPTg/zui+Uya9SRkqi4 TNGtO6YVe1rRXojkJmycsRHSfZnIQUi1FQm1p8mOgmN5cqErVTumyOYUfP7XpBCQGKf6 RCYQ== X-Received: by 10.236.137.206 with SMTP id y54mr4486539yhi.36.1368036401899; Wed, 08 May 2013 11:06:41 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id h2si2180360yhj.2.2013.05.08.11.06.41 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 08 May 2013 11:06:41 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id BA95F5A41FA; Wed, 8 May 2013 11:06:41 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 99DA7160980; Wed, 8 May 2013 11:06:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 8 May 2013 11:06:06 -0700 Message-Id: <1368036368-3660-10-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1368036368-3660-1-git-send-email-sjg@chromium.org> References: <1368036368-3660-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQlTVvy3hVZePtq2eelmZ0cVXIwlouIRjxDC1w5dGewvM58EsRo6g44sYyD5RjM12pbONv1daFJHgsb1Dxfm3W+vga3IuRzBrleRqEAUc64nSbA/ioRcS4O99zDjktBZIHiqpjW8peG/Barcy8/rLvRPAqLMc5ApLkWOZKOWgGV/KwUffVz2dK75Crj8Sh8pf75pMGx8 Cc: Tom Rini , u-boor-review@google.com Subject: [U-Boot] [PATCH v3 10/12] sparc: Use image_setup_linux() instead of local code 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 Sparc only really sets up the ramdisk, but we should still use image_setup_linux() so that setup is common across all architectures that use the FDT. Cover-letter Introduce a common image_setup_linux() function This series continues the work to tidy up the image code. Each architecture has its own code for setting up ready for booting linux. An attempt is made here to unify these in a single image_setup_linux() function. The part of the image code that deals with FDT is split into image-fdt.c and a few tweaks are added to make FIT images more viable in SPL. END Signed-off-by: Simon Glass --- Changes in v3: - Split the image_setup_linux() commits into their own series Changes in v2: None arch/sparc/lib/bootm.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/arch/sparc/lib/bootm.c b/arch/sparc/lib/bootm.c index bcc6358..1a9343c 100644 --- a/arch/sparc/lib/bootm.c +++ b/arch/sparc/lib/bootm.c @@ -95,10 +95,8 @@ void arch_lmb_reserve(struct lmb *lmb) int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t * images) { char *bootargs; - ulong initrd_start, initrd_end; ulong rd_len; void (*kernel) (struct linux_romvec *, void *); - struct lmb *lmb = &images->lmb; int ret; if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) @@ -131,24 +129,23 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t * im * extracted and is writeable. */ + ret = image_setup_linux(images); + if (ret) { + puts("### Failed to relocate RAM disk\n"); + goto error; + } + /* Calc length of RAM disk, if zero no ramdisk available */ rd_len = images->rd_end - images->rd_start; if (rd_len) { - ret = boot_ramdisk_high(lmb, images->rd_start, rd_len, - &initrd_start, &initrd_end); - if (ret) { - puts("### Failed to relocate RAM disk\n"); - goto error; - } - /* Update SPARC kernel header so that Linux knows * what is going on and where to find RAM disk. * * Set INITRD Image address relative to RAM Start */ linux_hdr->hdr_input.ver_0203.sparc_ramdisk_image = - initrd_start - CONFIG_SYS_RAM_BASE; + images->initrd_start - CONFIG_SYS_RAM_BASE; linux_hdr->hdr_input.ver_0203.sparc_ramdisk_size = rd_len; /* Clear READ ONLY flag if set to non-zero */ linux_hdr->hdr_input.ver_0203.root_flags = 1;