From patchwork Thu Dec 8 18:51:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rick Altherr X-Patchwork-Id: 704192 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 3tZPcB37xVz9vDc for ; Fri, 9 Dec 2016 05:52:09 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="FCURSLCO"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DEF60A75BF; Thu, 8 Dec 2016 19:52:04 +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 O9-MdDtCsf9m; Thu, 8 Dec 2016 19:52:04 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1C4A3A75A9; Thu, 8 Dec 2016 19:52:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F3A38A75A9 for ; Thu, 8 Dec 2016 19:52:00 +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 2XsdY3e8TSaz for ; Thu, 8 Dec 2016 19:52:00 +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-pg0-f41.google.com (mail-pg0-f41.google.com [74.125.83.41]) by theia.denx.de (Postfix) with ESMTPS id 2A714A757A for ; Thu, 8 Dec 2016 19:51:57 +0100 (CET) Received: by mail-pg0-f41.google.com with SMTP id p66so176708807pga.2 for ; Thu, 08 Dec 2016 10:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=2FPqGnI4dif2zFrPFGbJfp4fmvws05IZW4f1zzodthc=; b=FCURSLCOIj9yYml81YF+QxWoQf0mHjNN0u1/ekuvqv6tGxNh2FBcKRYziSoKbkOMbX 9/3Rb9onQRT9JxBWCk9XdIp4B9TcBrhtyFEyv3j8qX/gXeCU7U7svxJL5JvRVeEaUhsr o5S9kHndXqVY6kZAiomDzsIhgOV4LwOWbbUTMczKXfsxJ7axbLh59qmvd6GC+0P0ZIp1 PIpSN1brmrEPgAuZy3uOSOWfYhO7GIrbz99MlXQNTNU3vm+/1dMR8MGxjmjjMg3H/wjz 02G1jH7diGjHbPP4Pmi0q2CwTPFMIq8ovMya8vXiobbHd9sUbZg5d75VtOK0/QTY0+vT X+fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2FPqGnI4dif2zFrPFGbJfp4fmvws05IZW4f1zzodthc=; b=mKCZxroHxZTwJ3i5fvbgl6FYh6V5URJnnH9oU6/XLwfEtvyYIx3NUjyX7Lt3vbZqSU cb8QtPZSkmPrfFyW3NC0Qit3oVQoa6z2jIqVx65lvhtjHU4hmlxCdSd+Rq93hpz5AklJ 8qGgJAkdCcDzJ6+c+tDuMIaxadlLnDroWXTkNuiaOyXtBpS2vaDN9es27xGkTMoxOw+F TiyUJqOkJYdj4OAmaDmBa2Hdnzvm4ACfMSue/tZIyvex2MCK8blMsHCryBEKUb2rsGCi b/FQ3LzwT/XOZiDLCf0XWAY9b+mc6hX1WotVL7xem+Ex4nFxsZB0FtB5SRDBscqBYsIr Deqw== X-Gm-Message-State: AKaTC00y5L3PX7p8E/J4ezZml0BouPg3VUCNuwEBRqOMMwUW/ibNS6su6THohhZUbvA93Wot X-Received: by 10.98.202.211 with SMTP id y80mr75445066pfk.154.1481223115000; Thu, 08 Dec 2016 10:51:55 -0800 (PST) Received: from raltherr-linux.svl.corp.google.com ([100.123.242.49]) by smtp.gmail.com with ESMTPSA id q27sm51869901pfd.49.2016.12.08.10.51.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Dec 2016 10:51:54 -0800 (PST) From: Rick Altherr To: U-Boot List Date: Thu, 8 Dec 2016 10:51:52 -0800 Message-Id: <1481223112-27542-1-git-send-email-raltherr@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Cc: Vagrant Cascadian , Andre Przywara , Michal Simek , Scott Wood Subject: [U-Boot] [PATCH] bootm: relocate ramdisk if CONFIG_SYS_BOOT_RAMDISK_HIGH set X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In 35fc84f, bootm was refactored so plain 'bootm' and 'bootm ' shared a common implementation. The 'bootm ramdisk' command implementation is now part of the common implementation but not invoke by plain 'bootm' since the original implementation never did ramdisk relocation. Instead, ramdisk relocation happened in image_setup_linux() which is typically called during the OS portion of 'bootm'. On ARM, parameters to the Linux kernel can either be passed by FDT or ATAGS. When using FDT, image_setup_linux() is called which also triggers ramdisk relocation. When using ATAGS, image_setup_linux() is _not_ called because it mostly does FDT setup. Instead of calling image_setup_linux() in both FDT and ATAGS cases, include BOOTM_STATE_RAMDISK in the requested states during a plain 'bootm' if CONFIG_SYS_BOOT_RAMDISK_HIGH is set and remove the ramdisk relocation from image_setup_linux(). This causes ramdisk relocation to happen on any system where CONFIG_SYS_BOOT_RAMDISK_HIGH regardless of the OS being booted. Also remove IMAGE_ENABLE_RAMDISK_HIGH as it was only used by the now-removed code from image_setup_linux(). Signed-off-by: Rick Altherr Reviewed-by: Simon Glass Reviewed-by: Joel Stanley Reviewed-by: Cédric Le Goater --- cmd/bootm.c | 3 +++ common/image.c | 10 ---------- include/image.h | 6 ------ 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/cmd/bootm.c b/cmd/bootm.c index 083f3d1..a7e181d 100644 --- a/cmd/bootm.c +++ b/cmd/bootm.c @@ -126,6 +126,9 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return do_bootm_states(cmdtp, flag, argc, argv, BOOTM_STATE_START | BOOTM_STATE_FINDOS | BOOTM_STATE_FINDOTHER | BOOTM_STATE_LOADOS | +#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH + BOOTM_STATE_RAMDISK | +#endif #if defined(CONFIG_PPC) || defined(CONFIG_MIPS) BOOTM_STATE_OS_CMDLINE | #endif diff --git a/common/image.c b/common/image.c index bd07e86..b4a6839 100644 --- a/common/image.c +++ b/common/image.c @@ -1571,10 +1571,7 @@ int image_setup_linux(bootm_headers_t *images) { ulong of_size = images->ft_len; char **of_flat_tree = &images->ft_addr; - ulong *initrd_start = &images->initrd_start; - ulong *initrd_end = &images->initrd_end; struct lmb *lmb = &images->lmb; - ulong rd_len; int ret; if (IMAGE_ENABLE_OF_LIBFDT) @@ -1588,13 +1585,6 @@ int image_setup_linux(bootm_headers_t *images) return ret; } } - if (IMAGE_ENABLE_RAMDISK_HIGH) { - rd_len = images->rd_end - images->rd_start; - ret = boot_ramdisk_high(lmb, images->rd_start, rd_len, - initrd_start, initrd_end); - if (ret) - return ret; - } if (IMAGE_ENABLE_OF_LIBFDT) { ret = boot_relocate_fdt(lmb, of_flat_tree, &of_size); diff --git a/include/image.h b/include/image.h index 575f592..4c39bd7 100644 --- a/include/image.h +++ b/include/image.h @@ -99,12 +99,6 @@ struct lmb; #endif /* IMAGE_ENABLE_FIT */ -#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH -# define IMAGE_ENABLE_RAMDISK_HIGH 1 -#else -# define IMAGE_ENABLE_RAMDISK_HIGH 0 -#endif - #ifdef CONFIG_SYS_BOOT_GET_CMDLINE # define IMAGE_BOOT_GET_CMDLINE 1 #else