手机版
你好,游客 登录 注册
背景:
阅读新闻

U-Boot中timer定时器的设置

[日期:2013-03-20] 来源:Linux社区  作者:sonbai [字体:大 中 小]

uboot中timer定时器的设置,uboot汇编部分没有对timer初始化,而是在C中。在C入口函数void start_armboot(void)中,首先是通过如下代码方式调用:

typedef int (init_fnc_t) (void);

init_fnc_t *init_sequence[] = {
 a/a/l/board.c                                                                                                                     
#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 */
#ifdef CONFIG_FSL_ESDHC
    get_clocks,
#endif
    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,
};

这里是u-boot的C代码部分的入口:

void start_armboot (void)
{
    init_fnc_t **init_fnc_ptr;
              。
              。
              。
 
    for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
        if ((*init_fnc_ptr)() != 0) {
            hang ();
        }
    }

linux
相关资讯       U-boot  定时器 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款