uboot与linux的参数传递

来源:互联网 发布:win10软件注册表 编辑:程序博客网 时间:2024/05/17 10:52

uboot: 2011.12

linux :3.0.32

powerpc e500v2开发板

---------------------------------------------------------------------------------------------

1. common/cmd_bootm.c -- > int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

 ——————>bootm_start

------------------->bootm_load_os

------------------->lmb_reserve

------------------->arch_preboot_os

------------------->arch_preboot_os

------------------->boot_fn

------------------->do_reset


 596     /* determine if we have a sub command */ 597     if (argc > 1) { 598         char *endp; 599 600         simple_strtoul(argv[1], &endp, 16); 601         /* endp pointing to NULL means that argv[1] was just a 602          * valid number, pass it along to the normal bootm processing 603          * 604          * If endp is ':' or '#' assume a FIT identifier so pass 605          * along for normal processing. 606          * 607          * Right now we assume the first arg should never be '-' 608          */ 609         if ((*endp != 0) && (*endp != ':') && (*endp != '#')) 610             return do_bootm_subcommand(cmdtp, flag, argc, argv); 611     }

这段代码是多cpu启动考虑的,当系统的core多于一个时,通常会使用类似下面的语句先启动其它内核,然后再启动第一个内核:

              => setenv bootm_low 0x40000000
                => setenv bootm_size 0x30000000
                => tftp 41000000 uImage.core1
                => tftp 42000000 ramdiskfile
                => tftp 40c00000 p2020ds.core1.dtb
                => interrupts off
                => bootm start 41000000 42000000 40c00000
                => bootm loados
                => bootm ramdisk
                => bootm fdt
                => fdt boardsetup
                => fdt chosen $initrd_start $initrd_end
                => bootm prep
                => cpu 1 release $bootm_low - $fdtaddr -

if ((*endp != 0) && (*endp != ':') && (*endp != '#')) 判断是不是直接启动,即是不是bootm $loadaddr $ramdiskaddr $fdtaddr这样的形式。
此外只考虑单核情况,即endp ==0,所以do_bootm_subcommand不会执行。


2. bootm_start函数分析:




原创粉丝点击