[U-Boot] [PATCH][for 1.3.5] Fix handling of mem reserves for ramdisk

Wolfgang Denk wd at denx.de
Wed Sep 10 11:03:59 CEST 2008


Dear Heiko Schocher,

In message <48C7830B.6010205 at denx.de> you wrote:
> 
> [PATCH] powerpc: Fix bootm to boot up again with a Ramdisk

Please omit this rom the commit message - it just duplicates the
Subject line.

Also, it's probably not "[for 1.3.5]" (which will never see the light
of this virtuality) but "for 2008.10".

> Patch
> http://git.denx.de/?p=u-boot.git;a=commitdiff;h=2a1a2cb6e2b87ee550e6f27b647d23331dfd5e1b#patch3
> 
> didnt remove the dummy mem reservation in fdt_chosen, and
> this stopped Linux from booting with a Ramdisk. This patch
> fixes this, by deleting the useless dummy mem reservation.
> 
> When booting with a Ramdisk, a fix offset FDT_RAMDISK_OVERHEAD
> is now added to of_size, so we dont need anymore a dummy
> mem reservation.
...

> +/* adding a ramdisk needs 0x44 bytes in version 2008-10 */

2008.10, not 2008-10.

> --- a/lib_ppc/bootm.c
> +++ b/lib_ppc/bootm.c
> @@ -145,8 +145,9 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
>  	 * if the user wants it (the logic is in the subroutines).
>  	 */
>  	if (of_size) {
> -		/* pass in dummy initrd info, we'll fix up later */
> -		if (fdt_chosen(of_flat_tree, images->rd_start, images->rd_end, 0) < 0) {
> +		/* we dont have to pass anymore the dummy initrd info!
> +                   we'll add this later, immediately with the right values. */

Incorrect multiline format.

But the information is already included with the  #define  above  and
the commit message. I suggest to delete the comment completely.

> @@ -169,6 +170,9 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
>  			goto error;
>  		of_size = ret;
> 
> +		/* adding a ramdisk needs 0x44 bytes in version 2008-10 */

Ditto - I suggest to delete the redudant information.

> +		if ((of_flat_tree) && (initrd_start && initrd_end))
> +			of_size += FDT_RAMDISK_OVERHEAD;
>  		/* Create a new LMB reservation */
>  		lmb_reserve(lmb, (ulong)of_flat_tree, of_size);

Except for this nitpicking:

Acked-by: Wolfgang Denk <wd at denx.de>


Kumar, what do you think?

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
The use of anthropomorphic terminology when  dealing  with  computing
systems is a symptom of professional immaturity.   -- Edsger Dijkstra


More information about the U-Boot mailing list