|
从nandflash拷贝kernel需要40s
[复制链接]
我的开发板是bios引导wince系统,系统编译后nk.nb0大概35M左右,调试发现从nandflash拷贝系统到SDRAM需要40S时间啊,实在太慢、、把拷贝代码贴出来,还请大侠指点:
static void LoadRunWince(void)
{
U32 i, ram_addr, buf = boot_params.initrd_addr.val;
int size;
//MemoryTest();
printf("Load Kernel...\n");
if(boot_params.osstor.val) //load program from NOR or NAND FLASH
memcpy((void *)buf, (void *)(0x04000000+0x00020000), 0x00fe0000);
else {
StartPage = NandPart[boot_params.start.val].offset>>9; //part 2,3...
size = boot_params.initrd_len.val;//NandPart[boot_params.root_sel.val].size;
ram_addr = buf;
for(i=0; size>0; ) {
if(!(i&0x1f)) {
if(CheckBadBlk(i+StartPage)) {
//printf("Skipped bad block at 0x%x\n", i+StartPage);
i += 32;
//size -= 32<<9;
continue;
}
}
ReadPage((i+StartPage), (U8 *)ram_addr);
i++;
size -= 512;
ram_addr += 512;
//if(!(i%1024))
//printf("#");
}
}
printf("run 0x%08x...\n", boot_params.run_addr.val);
//RelocateNKBIN(buf, &buf, &i, &boot_params.run_addr.val);
call_linux(0, 0, boot_params.run_addr.val);
}
|
|