[U-Boot] [PATCH 2/6] Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not defined

Jerry Van Baren gvb.uboot at gmail.com
Tue Apr 5 15:34:33 CEST 2011


Hi Grant,

On 03/28/2011 03:58 PM, Grant Likely wrote:
> From: Grant Likely<grant.likely at linaro.org>
>
> This patch adds a function getenv_bootm_mapsize() for obtaining the
> size of the early mapped region accessible by the kernel during early
> boot.  It defaults to CONFIG_SYS_BOOTMAPSZ, or if not defined,
> defaults to getenv_bootm_size(), which in turn defaults to the size of
> RAM.
>
> getenv_bootm_mapsize() can also be overridden with a "bootm_mapsize"
> environmental variable.
>
> Signed-off-by: Grant Likely<grant.likely at linaro.org>
> ---
>   README                   |   16 ++++++++++++++--
>   arch/powerpc/lib/bootm.c |    2 +-
>   common/image.c           |   22 +++++++++++++++++++---
>   include/image.h          |    1 +
>   4 files changed, 35 insertions(+), 6 deletions(-)

[snip]

> @@ -1207,7 +1223,7 @@ int boot_relocate_fdt (struct lmb *lmb, char **of_flat_tree, ulong *of_size)
>   	/* Pad the FDT by a specified amount */
>   	of_len = *of_size + CONFIG_SYS_FDT_PAD;
>   	of_start = (void *)(unsigned long)lmb_alloc_base(lmb, of_len, 0x1000,
> -			CONFIG_SYS_BOOTMAPSZ + getenv_bootm_low());
> +			getenv_bootm_mapsize() + getenv_bootm_low());
_________________________________________________^^^^^^^^^^^^^^^^^^

>
>   	if (of_start == 0) {
>   		puts("device tree - allocation error\n");
> @@ -1581,7 +1597,7 @@ int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end)
>   	char *s;
>
>   	cmdline = (char *)(ulong)lmb_alloc_base(lmb, CONFIG_SYS_BARGSIZE, 0xf,
> -				     CONFIG_SYS_BOOTMAPSZ + getenv_bootm_low());
> +				getenv_bootm_mapsize() + getenv_bootm_base());
_________________________________________________________^^^^^^^^^^^^^^^^^^

getenv_bootm_base() doesn't exist in my tree, should it have been 
getenv_bootm_low()?

>   	if (cmdline == NULL)
>   		return -1;
> @@ -1617,7 +1633,7 @@ int boot_get_cmdline (struct lmb *lmb, ulong *cmd_start, ulong *cmd_end)
>   int boot_get_kbd (struct lmb *lmb, bd_t **kbd)
>   {
>   	*kbd = (bd_t *)(ulong)lmb_alloc_base(lmb, sizeof(bd_t), 0xf,
> -				     CONFIG_SYS_BOOTMAPSZ + getenv_bootm_low());
> +				getenv_bootm_mapsize() + getenv_bootm_low());
_________________________________________________________^^^^^^^^^^^^^^^^^^

I don't have access to my 8360 board at the moment to execute test the 
code. :-/

[snip]

Thanks,
gvb


More information about the U-Boot mailing list