public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [u-boot PATCH] arm, lib/bootm.c: Exclude HIGHMEM from being used by u-boot
Date: Sat, 20 Aug 2011 08:01:21 +0200	[thread overview]
Message-ID: <4E4F4DB1.2040501@aribaud.net> (raw)
In-Reply-To: <1313776646.21313.6.camel@dave-Dell-System-XPS-L502X>

Hi David,

Le 19/08/2011 19:57, David Long a ?crit :
>
> Reserve any memory above 768MB to prevent u-boot from relocating fdt or initrd
> data into memory that Linux cannot reference during early boot. Code taken (with
> modifications) from the powerpc bootm.c.

What exactly prevents ARM Linux from booting when FDT or initrd are 
above 768MB? Can this limitation not be lifter on the Linux side?

Also:

> Signed-off-by: David A. Long<dave.long@linaro.org>
> ---
>   arch/arm/lib/bootm.c |   24 +++++++++++++++++++++++-
>   1 files changed, 23 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index 802e833..437ef35 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -32,6 +32,10 @@
>
>   DECLARE_GLOBAL_DATA_PTR;
>
> +#ifndef CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE
> +#define CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE	(768*1024*1024)
> +#endif

I'd tend to think that if no max size was defined, then we should not limit.

> +
>   #if defined (CONFIG_SETUP_MEMORY_TAGS) || \
>       defined (CONFIG_CMDLINE_TAG) || \
>       defined (CONFIG_INITRD_TAG) || \
> @@ -60,7 +64,25 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images);
>
>   void arch_lmb_reserve(struct lmb *lmb)
>   {
> -	ulong sp;
> +	phys_size_t bootm_size;
> +	ulong size, sp, bootmap_base;
> +
> +	bootmap_base = getenv_bootm_low();
> +	bootm_size = getenv_bootm_size();
> +
> +#ifdef DEBUG
> +	if (((u64)bootmap_base + bootm_size)>
> +	    (CONFIG_SYS_SDRAM_BASE + (u64) gd->ram_size))
> +		puts("WARNING: bootm_low + bootm_size exceed total memory\n");
> +#endif
> +
> +	size = min(bootm_size, CONFIG_SYS_LINUX_LOWMEM_MAX_SIZE);
> +
> +	if (size<  bootm_size) {
> +		ulong base = bootmap_base + size;
> +		printf("WARNING: adjusting available memory to %lx\n", size);
> +		lmb_reserve(lmb, base, bootm_size - size);
> +	}
>
>   	/*
>   	 * Booting a (Linux) kernel image

Amicalement,
-- 
Albert.

  reply	other threads:[~2011-08-20  6:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-19 17:57 [U-Boot] [u-boot PATCH] arm, lib/bootm.c: Exclude HIGHMEM from being used by u-boot David Long
2011-08-20  6:01 ` Albert ARIBAUD [this message]
2011-08-20 20:39   ` David Long

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=4E4F4DB1.2040501@aribaud.net \
    --to=albert.u.boot@aribaud.net \
    --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