网站公告列表

  没有公告

加入收藏
设为首页
联系本站
您现在的位置: Analog安诺电子网 >> 文章 >> 技术交流 >> 文章正文
  U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(12):第二阶段的程序入口           ★★★ 【字体:
U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(12):第二阶段的程序入口
作者:快乐虾    文章来源:http://blog.csdn.net/lights_joy    点击数:    更新时间:2008-4-21    
在start.s的最后,CPU初始化已经完成,需要进入第二阶段的执行:
       /* Now lower ourselves from the highest interrupt level to
        * the lowest. We do this by masking all interrupts but 15,
        * setting the 15 handler to "board_init_f", raising the 15
        * interrupt, and then returning from the highest interrupt
        * level to the dummy "jump" until the interrupt controller
        * services the pending 15 interrupt.
        */
       serial_early_puts("Lower to 15")
       r0 = r7;
       r1 = r6;
       p0.l = LO(EVT15);
       p0.h = HI(EVT15);
       //p1.l = _cpu_init_f;
       //p1.h = _cpu_init_f;
       p1.l = _main;
       p1.h = _main;
       [p0] = p1;
       p2.l = LO(IMASK);
       p2.h = HI(IMASK);
       p3.l = LO(EVT_IVG15);
       p3.h = HI(EVT_IVG15);
       [p2] = p3;
       raise 15;
       p4.l = .LWAIT_HERE;
       p4.h = .LWAIT_HERE;
       reti = p4;
       rti;
在这段代码中,将_cpu_init_f写入到INT15的向量表中,然后用raise 15进入下一阶段的运行,这是因为CPU复位之后处于RESET中断的状态,这是优先级很高的一个中断,在这种情况下,虽然可以对CPU进行完全的操作(Supervisor mode),但是却无法响应其它的中断请求。因此上述代码将自身跳到中断15再运行,这样同时可以响应其它的中断,CPU也仍然处在Supervisor mode,可以进行完整的控制。
不过在此处,为了使用main,我将原来跳转的cpu_init_f函数替换为main,这样每次下载u-boot之后,VDSP都会自动在main中中断下来,否则它会犯傻的,呵呵!
经过修改的main变成了:
 
__attribute__ ((__noreturn__))
void main(ulong bootflag, ulong loaded_from_ldr)
{
       /* The default startup code does not include any functionality to allow core
          A to enable core B. A convenient way to enable core B is to use the
          'adi_core_b_enable()' function. */
       //adi_core_b_enable();
      
       cpu_init_f(bootflag, loaded_from_ldr);
 
}
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章: 没有了
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    U-boot-1.1.6-2008R1到vdsp5
    U-boot-1.1.6-2008R1到vdsp5
    U-boot-1.1.6-2008R1到vdsp5
    数据采集系统设计的思考
    数字电位器
    常用数字电位器AD7376A/AD52
    使用KEILUV3开发高性能单片机
    集成运放综合参数测试仪
    U-boot-1.1.6-2008R1到vdsp5
    U-boot-1.1.6-2008R1到vdsp5
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    版权所有:Analog安诺电子网 湘ICP备06016315号