主题 : uboot-2009-08 stage2执行的一个问题? 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 14440
精华: 0
发帖: 11
金钱: 75 两
威望: 15 点
贡献值: 0 点
综合积分: 22 分
注册时间: 2010-02-09
最后登录: 2011-05-25
楼主  发表于: 2010-03-29 09:58

 uboot-2009-08 stage2执行的一个问题?

stage1执行完后,程序跳到lib_arm/board.c执行start_armboot()函数,里面会执行init_sequence[] 里面定义的函数,如下:
init_fnc_t *init_sequence[] = {
#if defined(CONFIG_ARCH_CPU_INIT)
    arch_cpu_init,        /* basic arch cpu dependent setup */
#endif
    board_init,        /* basic board dependent setup */
#if defined(CONFIG_USE_IRQ)
    interrupt_init,        /* set up exceptions */
#endif
    timer_init,        /* initialize timer */
    env_init,        /* initialize environment */
    init_baudrate,        /* initialze baudrate settings */
    serial_init,        /* serial communications setup */
    console_init_f,        /* stage 1 init of console */
    display_banner,        /* say that we are here */
#if defined(CONFIG_DISPLAY_CPUINFO)
    print_cpuinfo,        /* display cpu info (and speed) */
#endif
#if defined(CONFIG_DISPLAY_BOARDINFO)
    checkboard,        /* display board info */
#endif
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
    init_func_i2c,
#endif
    dram_init,        /* configure available RAM banks */
#if defined(CONFIG_CMD_PCI) || defined (CONFIG_PCI)
    arm_pci_init,
#endif
    display_dram_config,
    NULL,
};


里面有个console_init_f函数,后面解释是/* stage 1 init of console */,我在网上查了下,注释在第一阶段的重定位之前调用此函数。这样我就搞不懂了,这里明明是在stage2调用了这个函数,而stage1里根本没有调用啊!!!这里是怎么回事啊?
谢谢指教!!!!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-03-29 15:55
不要玩文字游戏,此stage1 != 彼stage1
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 14440
精华: 0
发帖: 11
金钱: 75 两
威望: 15 点
贡献值: 0 点
综合积分: 22 分
注册时间: 2010-02-09
最后登录: 2011-05-25
2楼  发表于: 2010-03-30 08:42

 回 1楼(kasim) 的帖子

版主能不能讲详细点呢