public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] image: Don't relocate ramdisk to highmem
Date: Fri, 20 Sep 2013 15:35:51 +0200	[thread overview]
Message-ID: <1379684152-24693-1-git-send-email-treding@nvidia.com> (raw)

The Linux kernel cannot unpack a ramdisk that's stored in high memory.
Unless the initrd_high environment variable is explicitly set, abide by
that restriction using the getenv_bootm_low() and getenv_bootm_mapsize()
helpers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
Changes in v2:
- update function header comment

 common/image.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/common/image.c b/common/image.c
index 2c88091..47336f2 100644
--- a/common/image.c
+++ b/common/image.c
@@ -966,7 +966,8 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
  *      end address (after possible relocation)
  *
  * boot_ramdisk_high() takes a relocation hint from "initrd_high" environement
- * variable and if requested ramdisk data is moved to a specified location.
+ * variable and if requested ramdisk data is moved to a specified location. If
+ * no such hint is given, the default is to relocate the initrd to low memory.
  *
  * Initrd_start and initrd_end are set to final (after relocation) ramdisk
  * start/end addresses if ramdisk image start and len were provided,
@@ -991,8 +992,8 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
 		if (initrd_high == ~0)
 			initrd_copy_to_ram = 0;
 	} else {
-		/* not set, no restrictions to load high */
-		initrd_high = ~0;
+		/* make sure to put ramdisk in low memory */
+		initrd_high = getenv_bootm_low() + getenv_bootm_mapsize();
 	}
 
 
-- 
1.8.4

             reply	other threads:[~2013-09-20 13:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 13:35 Thierry Reding [this message]
2013-09-20 13:35 ` [U-Boot] [PATCH 2/2] image: Only relocate ramdisk when necessary Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379684152-24693-1-git-send-email-treding@nvidia.com \
    --to=thierry.reding@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox