[U-Boot] Coldfire: bootm: How does bootm pass bootargs to linux?

TC Liew
2009-02-19T00:07:52Z

Richard,

> /*
> * Linux Kernel Parameters (passing board info data):
> * r3: ptr to board info data
> * r4: initrd_start or 0 if no initrd
> * r5: initrd_end - unused if r4 is 0
> * r6: Start of command line string
> * r7: End of command line string
> */
Above is the copy and paste from PPC.

> My question is, how does bootm passes arguments to the kernel for the
coldfire
In ColdFire, the Linux Kernel Parameters is located at u-boot's stack.

> (M5271 specifically)? And what is the recommended way to capture and
process the info
> in the kernel?
In kernel/head.S,
Save the location of u-boot info - cmd line, bd_info, etc
movel %a7, uboot_info_stk /* save uboot info to variable */

In kernel/setup.c,
unsigned long uboot_info_stk;
EXPORT_SYMBOL(uboot_info_stk);
static struct uboot_record uboot_info;

int __init uboot_comandline(char *bootargs)
{
...
uboot_info.bd_info = (*(u32 *)(uboot_info_stk));
uboot_info.initrd_start = (*(u32 *)(uboot_info_stk+4);
...
}

Regards,
TsiChung