![]() |
|
||||||||||||||
| | 首页 | 新闻 | 文库 | 方案 | 技术 | 独家 | 座谈 | 下载 | 电路图 | 开发套件 | 仿真器 | 邮购 | 帮助 | VIP会员 | 芯片代购 | | ||
|
||
|
|||||
| 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 | |||||
| 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 | |||||
| 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!) |
| | 本站介绍 | 合作联络 | 欢迎投稿 | 广告业务 | 网站地图 | 设为首页 | 加入收藏 | 友情链接 | 网站公告 | 联系我们 | | |||
|