[U-Boot-Users] [PATCH] Fix initrd/dtb interaction

Wolfgang Denk wd at denx.de
Tue Aug 14 02:19:42 CEST 2007


Dear Andy,

in message <11870460962397-git-send-email-afleming at freescale.com> you wrote:
> The original code would wrongly relocate the blob to be right before
> the initrd if it existed.  The blob *must* be within CFG_BOOTMAPSZ,
> if it is defined.  So we make two changes:
> 
> 1) flag the blob for relocation whenever its address is above BOOTMAPSZ
> 
> 2) If the blob is being relocated, relocate it before kbd, not initrd
> 
> Signed-off-by: Andy Fleming <afleming at freescale.com>

NAK.


I'm afraid I have to reject this patch.


> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> index 2436581..580a9f0 100644
> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c
> @@ -21,6 +21,7 @@
>   * MA 02111-1307 USA
>   */
>  
> +#define DEBUG

First, please don't enable DEBUG like this in common files.


> +#ifdef CFG_BOOTMAPSZ
> +	/*
> +	 * The blob must be within CFG_BOOTMAPSZ,
> +	 * so we flag it to be copied if it is
> +	 */
> +	if (of_flat_tree >= (char *)CFG_BOOTMAPSZ)
> +		of_data = of_flat_tree;
> +#endif
> +
>  #if defined(CONFIG_OF_LIBFDT)
>  	/* move of_flat_tree if needed */
>  	if (of_data) {
> @@ -932,11 +942,9 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
>  		ulong of_start, of_len;
>  
>  		of_len = be32_to_cpu(fdt_totalsize(of_data));
> -		/* position on a 4K boundary before the initrd/kbd */
> -		if (initrd_start)
> -			of_start = initrd_start - of_len;
> -		else
> -			of_start  = (ulong)kbd - of_len;
> +
> +		/* position on a 4K boundary before the kbd */
> +		of_start  = (ulong)kbd - of_len;

Second, I asked you before to implement this similar like the  initrd
location  can  be  controlled  using  the  "initrd_high"  environment
variable (see my message Tue, 07 Aug 2007 21:21:19 +0200). AFAICT you
never replied to this.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A fail-safe circuit will destroy others.                 -- Klipstein




More information about the U-Boot mailing list