[U-Boot-Users] [PATCH] Fix initrd booting

Jerry Van Baren gvb.uboot at gmail.com
Wed Aug 8 04:28:01 CEST 2007


Wolfgang Denk wrote:
> Dear Andy,
> 
> in message <2acbd3e40708071212y6396de53l49b8b48e6aab9a5f at mail.gmail.com> you wrote:
>> On e500, the blob *must* be in the low 16M of memory.  MUST.  The low
>> 16M is all that is mapped, and the kernel will not map more than that
>> until it reads the blob.  Certainly, it doesn't *always* need to be
>> relocated.  It's been a while since I created this patch, but I
> 
> I think the blob should only be copied (to me "relocate" involves more
> complex operations than just copying) when necessary.
> 
> And I guess this restriction is also true for ramdisk images, or am I
> wrong?
> 
> In any case, I think it wouldbe a good idea if the 16M limit was not
> hard wired, but could be overwritten using the "initrd_high" variable
> like we can do for ramdisks.
> 
> What do you think?
> 
>> I probably need to respin it, though.  I haven't updated it since I
>> first created it, and you may have changed the fdt code, since.
> 
> Thanks.
> 
> Best regards,
> 
> Wolfgang Denk

Hi Andy, Wolfgang,

The chunk I questioned was:

> @@ -753,10 +753,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
>  #else
>  		if (*(ulong *)of_flat_tree == OF_DT_HEADER) {
>  #endif
> -#ifndef CFG_NO_FLASH
> -			if (addr2info((ulong)of_flat_tree) != NULL)
> -				of_data = (ulong)of_flat_tree;
> -#endif
> +			of_data = (ulong)of_flat_tree;
>  		} else if (ntohl(hdr->ih_magic) == IH_MAGIC) {
>  			printf("## Flat Device Tree Image at %08lX\n", hdr);
>  			print_image_hdr(hdr);

Hi Andy,

IMHO, you are abusing unrelated logic to force the blob to be copied. 
Why not directly add the logic you want rather than removing the flash 
logic (warning, untested code):

#ifdef CFG_BOOTMAPSZ
		/*
		 * The blob MUST be within CFG_BOOTMAPSZ, flag it to
		 * be copied if not.
		 */
		if (of_flat_tree >= CFG_BOOTMAPSZ)
			of_data = of_flat_tree;
#endif

Best regards,
gvb

P.S. The way of_data is used makes my head hurt - combined 
boolean/address masquerading as an int used by various unrelated 
snippets of logic (all uncommented) to achieve a single goal.




More information about the U-Boot mailing list