uboot大于256K时的启动问题
我们在uboot下添加了比较多驱动,以至于uboot大小大于了242K,这时候uboot不能够正常启动,在mini2440中,这个问题比较好的解决,他们提供了相关代码:
(2)修改u-boot-1.1.6/include/configs/open24x0.h文件
修改NAND FLASH MTD分区表:
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)"
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);
}