[U-Boot] [help] how does u-boot passing ``fdt'' to linux kernel & where is cmd_line?

Kumar Gala galak at kernel.crashing.org
Mon Jul 13 16:27:10 CEST 2009


> My question is how does the kernel cmd line being passed? I know it's
> possible for u-boot to patching the target uImage (assume we're using
> kernel image cuImage.bamboo)'s dtb by overwrite the dtb ``chosen''
> section, but I didn't find any code in u-boot trying to do this.

Did you look at common/fdt_support.c and fdt_chosen()

The command lines is passed in there as "bootargs"

> Even more, after the kernel is bootstraping, (assume we're using a
> bamboo board), we'll run into:
>
> static bd_t bd;
>
> ...
> void platform_init(unsigned long r3, unsigned long r4, unsigned long  
> r5,
> 		unsigned long r6, unsigned long r7)
> {
> 	CUBOOT_INIT();
> 	bamboo_init(&bd.bi_enetaddr, &bd.bi_enet1addr);
> }
>
> ...
>
> void bamboo_init(void *mac0, void *mac1)
> {
> 	platform_ops.fixups = bamboo_fixups;
> 	platform_ops.exit = ibm44x_dbcr_reset;
> 	bamboo_mac0 = mac0;
> 	bamboo_mac1 = mac1;
> 	fdt_init(_dtb_start);
> 	serial_console_init();
> }
> ...
>
> this code will assume $r3 is passed as a ``bd_t'' structure, but $r3
> passed in I think it's the dtb address (not bd_t), and bamboo_init
> will set the NIC wrong MAC addresses. I'm quite sure I misunderstand
> something between u-boot & linux kernel, could some help me to figure
> it out? Thanks in advance!

Where is the code you are referencing above?  This is the "old" bd_t  
style of booting.  Only the boot wrapper code or and old kernel would  
still be using this.

- k


More information about the U-Boot mailing list