主题 : uboot 移植 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 7192
精华: 0
发帖: 7
金钱: 70 两
威望: 65 点
贡献值: 0 点
综合积分: 14 分
注册时间: 2009-07-05
最后登录: 2009-08-30
楼主  发表于: 2009-08-03 21:57

 uboot 移植

管理提醒: 本帖被 arm9home 从 Linux技术交流专区 移动到本区(2010-02-08)
在uboot-2009.06上移植nand,但报出
    -Map u-boot.map -o u-boot
drivers/mtd/nand/libnand.a(nand.o): In function `nand_init_chip':
/opt/uboot/u-boot-2009.06-mini2440/drivers/mtd/nand/nand.c:53: undefined reference to `board_nand_init'
make: *** [u-boot] 错误 1

请问大侠怎么回事?
我试过如果把CONFIG_CMD_NAND宏开关关闭的话,编译能通过,一打开就报错,请帮帮忙吧!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-08-03 22:10
当CONFIG_CMD_NAND定义时,我们需要定义一个board_nand_init()函数用于初始化开发板特定的NAND Flash信息,其实现可以参考board目录下其他同类型CPU开发板。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 7192
精华: 0
发帖: 7
金钱: 70 两
威望: 65 点
贡献值: 0 点
综合积分: 14 分
注册时间: 2009-07-05
最后登录: 2009-08-30
2楼  发表于: 2009-08-04 07:29

 回 1楼(kasim) 的帖子

可是我明明已经在drivers/mtd/nand/s3c2410_nand.c中已经定义了啊!
 int board_nand_init(struct nand_chip *nand)
{
   u_int32_t cfg;
    u_int8_t tacls, twrph0, twrph1;
    S3C24X0_CLOCK_POWER * const clk_power = S3C24X0_GetBase_CLOCK_POWER();

    DEBUGN("board_nand_init()\n");

    clk_power->CLKCON |= (1 << 4);
    
#if defined(CONFIG_S3C2440)
        DEBUGN("CONFIG_S3C2440\n");
        twrph0 = 4; twrph1 = 2; tacls = 0;
        cfg = (tacls<<12)|(twrph0<<8)|(twrph1<<4);
        NFCONF = cfg;
        //DEBUGN("cfg is %x\n",cfg);
        //DEBUGN("NFCONF is %lx\n",NFCONF);
        cfg = (1<<6)|(1<<4)|(0<<1)|(1<<0);
        NFCONT = cfg;
        //DEBUGN("cfg is %lx\n",cfg);
        //DEBUGN("NFCONT is %x\n",NFCONT);
/* initialize nand_chip data structure */
        nand->IO_ADDR_R = nand->IO_ADDR_W = (void *)0x4e000010;
        /* read_buf and write_buf are default */
        /* read_byte and write_byte are default */
        /* hwcontrol always must be implemented */
        nand->cmd_ctrl = s3c2410_hwcontrol;
        nand->dev_ready = s3c2410_dev_ready;
#endif
……
还是编译出错啊!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-08-04 09:07
确保drivers/mtd/nand/s3c2410_nand.c编译进uboot
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 7192
精华: 0
发帖: 7
金钱: 70 两
威望: 65 点
贡献值: 0 点
综合积分: 14 分
注册时间: 2009-07-05
最后登录: 2009-08-30
4楼  发表于: 2009-08-05 19:30

 回 3楼(kasim) 的帖子

是编译的问题,解决了,谢谢!