uboot大于256K不能正常启动怎么办
我们在uboot下添加了比较多驱动,以至于uboot大小大于了242K,这时候uboot不能够正常启动,在mini2440中,这个问题比较好的解决,他们提供了相关代码: (2)修改u-boot-1.1.6/include/configs/open24x0.h文件
修改NAND FLASH MTD分区表:
C/C++ code?56 /* 57 #define MTDPARTS_DEFAULT "mtdparts=nandflash0:2m@0(kernel)," \ 58 "8m(jffs2)," \ 59 "-(yaffs)" 60 */61 #define MTDPARTS_DEFAULT "mtdparts=nandflash0:" \ 62 "256k@0(boot)," \ 63 "64k(env)," \ 64 "2m(kernel)," \ 65 "-(yaffs)"
但是在OK6410中没有能够找到相关的代码,以至于无法使得较大体积的uboot正常启动,在/cpu/s3c24xx中找到如下代码,大概内容是将nand flash中的内容拷贝至ram中:
C/C++ code?int copy_uboot_to_ram (void) { int large_block = 0; int i; vu_char id; NAND_ENABLE_CE(); NFCMD_REG=NAND_CMD_RESET; NF_TRANSRnB(); NFCMD_REG = NAND_CMD_READID; NFADDR_REG = 0x00; NF_TRANSRnB(); /* wait for a while */ for (i=0; i<200; i++); int factory = NFDATA8_REG; id = NFDATA8_REG; int cellinfo=NFDATA8_REG; int tmp= NFDATA8_REG; //int childType=tmp & 0x03; //Page size int childType=cellinfo; //Page size if (id > 0x80) { large_block = 1; } if(id == 0xd5 && childType==0x94 )//K9GAG08U0D { large_block = 2; } if(id == 0xd5 && childType==0x14 )//K9GAG08U0M { large_block = 2; } if(id == 0xd5 && childType==0x84 )//K9GAG08U0E { large_block = 3; } if(id==0xd7)//K9LBG08U0D { large_block = 2; } if(factory==0x2c && id == 0x48) //MT29F16G08ABACAWP { large_block = 2; }if(factory==0x2c && id == 0x38) //MT29F8G08ABABAWP { large_block = 2; } /* read NAND Block. * 128KB ->240KB because of U-Boot size increase. by scsuh * So, read 0x3c000 bytes not 0x20000(128KB). */ return nandll_read_blocks(CFG_PHY_UBOOT_BASE, 0x3c000, large_block); }
我考虑是不是代码太大,而block最多只有2个block,是不是uboot体积大于2个block,而超出的部分没有拷贝至内存之中而导致的uboot无法启动?
可以把需要做的事情放到另外一个单独的bin里面,这个Bin放到SD-CARD, u-boot去load文件系统里面的bin到RAM,然后跳转到内存,最后在回到u-boot即可
|