U-boot 2014 启动流程详细分析

来源:互联网 发布:中国国民收入数据库 编辑:程序博客网 时间:2024/04/30 12:36
U-boot 2014 启动流程:
-> _start: b     reset     (arch/arm/cpu/armv7/start.S line 28)
-> bl     _main     (line 151)
     ->ENTRY(_main)     (arch/arm/lib/crt0.S line 58)      
     -> bl     board_init_f     (line 74)
          ->void __weak board_init_f(ulong dummy)     (arch/arm/lib/spl.c line 26)      
          ->board_init_r(NULL, 0);     (line 34)      
               ->void board_init_r(gd_t *id, ulong dest_addr)     (arch/arm/lib/board.c line 513)     
               ->board_init();     (line 529)
               ->mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN);     (line 552) 
               ->flash_init();     (line 562)
               ->nand_init();     (line 588)
               ->mmc_initialize(gd->bd);     (line 597)
               ->env_relocate();     (line 607)
               ->console_init_r();     (line 624)
               ->interrupt_init();     (line 645)
               ->enable_interrupts();     (line 647)
               ->eth_initialize(gd->bd);     (line 661)
               ->main_loop();     (line 697)
                    ->void main_loop(void)     (common/main.c line 416)    
                    ->process_boot_delay();     (line 475)          //串口监听实现
                         ->static void process_boot_delay(void)     (common/main.c line 322)          
                         ->s = getenv ("bootdelay");     (line 342)
                         ->bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;     (line 343)     
                         ->if (bootdelay != -1 && s && !abortboot(bootdelay))     (line 394)
                         ->run_command_list(s, -1, 0);     (line 399)     //启动内核的入口函数     s = getenv ("bootcmd");
                              ->查找bootcmd环境变量指定命令->最终执行bootm命令
                              ->bootm,     CONFIG_SYS_MAXARGS,     1,     do_bootm,     (common/cmd_bootm.c line 1054 ~ line 1057)     
                                   ->int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])     (common/cmd_bootm.c line 777)     
                                   ->return do_bootm_states(cmdtp, flag, argc, argv, BOOTM_STATE_START |     (line 816)
                                        ->static int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc,     (common/cmd_bootm.c line 619)
                                        ->boot_fn = boot_os[images->os.os];     (line 687)
                                             ->static boot_os_fn *boot_os[] = {     (common/cmd_bootm.c line 144)
                                             ->[IH_OS_LINUX] = do_bootm_linux,     (line 147)
                                                  ->int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)          
                                                    (arch/arm/lib/bootm.c line 301)
                                                  ->boot_jump_linux(images, flag);     (line 318)
                                                       ->static void boot_jump_linux(。。。。) (arch/arm/lib/bootm.c line 249)
                                                       ->kernel_entry(0, machid, r2);     (line 291)             // linux kernel run       
                    ->parse_file_outer();     (common/main.c line 481)            //进入u-boot命令行进行命令解析
                         ->static int parse_file_outer(FILE *f)     (common/hush.c line 3248)     
                         ->rcode = parse_stream_outer(&input, FLAG_PARSE_SEMICOLON);     ( line 3260)     
                              ->static int parse_stream_outer(struct in_str *inp, int flag)     (common/hush.cline 3150)
                              ->run_list(ctx.list_head);     (line 3179)
                                   ->static int run_list(struct pipe *pi)     (common/hush.c line 1996)
                                   ->rcode = run_list_real(pi);     (line 2002)
                                        ->static int run_list_real(struct pipe *pi)     (common/hush.c line 1740)
                                        ->rcode = run_pipe_real(pi);     (line 1854)
                                             ->static int run_pipe_real(struct pipe *pi)     (common/hush.c line 1514)
                                             ->return cmd_process(flag, child->argc, child->argv,     (line 1656)
                                                  ->enum command_ret_t cmd_process(。。。)     (common/command.c/line 499)
                                                  ->cmdtp = find_cmd(argv[0]);     (line 506)
                                                  ->else if (cmdtp->cmd == do_bootd) {     (line 518)     //命令解析并执行完成
                                                      
函数流程跟踪记录规则
有函数跳转时,另起一行并分级,然后加上文件路径和行号。
没有函数跳转时,另起一行不分级,然后加上行号即可,不需要文件路径,因为没有跳转。
0 0
原创粉丝点击