TI中文支持网
TI专业的中文技术问题搜集分享网站

uboot中添加nandecc命令问题

环境:使用的sdk6.0的uboot

目的:在uboot中能够使用nandecc hw 0 命令

下面是我处理的思路: //不知道是否正确。

发现该命令在armv7/omap3/board.c里面,而我使用的armv7/am33xx/board.c 下面 

因此直接复制代码

static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
if (argc < 2 || argc > 3)
goto usage;

if (strncmp(argv[1], "hw", 2) == 0) {
if (argc == 2) {
omap_nand_switch_ecc(1, 1);
} else {
if (strncmp(argv[2], "hamming", 7) == 0)
omap_nand_switch_ecc(1, 1);
else if (strncmp(argv[2], "bch8", 4) == 0)
omap_nand_switch_ecc(1, 8);
else
goto usage;
}
} else if (strncmp(argv[1], "sw", 2) == 0) {
omap_nand_switch_ecc(0, 0);
} else {
goto usage;
}

return 0;

usage:
printf ("Usage: nandecc %s\n", cmdtp->usage);
return 1;
}

U_BOOT_CMD(
nandecc, 3, 1, do_switch_ecc,
"switch OMAP3 NAND ECC calculation algorithm",
"hw [hamming|bch8] – Switch between NAND hardware 1-bit hamming and"
" 8-bit BCH\n"
" ecc calculation (second parameter may"
" be omitted).\n"
"nandecc sw – Switch to NAND software ecc algorithm."
);

编译出现告警:

/home/335X/mytq335x/drivers/mtd/nand/nand_base.c:516: undefined reference to `nand_isbad_bbt'
drivers/mtd/nand/libnand.o: In function `nand_erase_nand':
/home/335X/mytq335x/drivers/mtd/nand/nand_base.c:2410: undefined reference to `nand_update_bbt'
drivers/mtd/nand/libnand.o: In function `omap_nand_switch_ecc':
/home/335X/mytq335x/drivers/mtd/nand/omap_gpmc.c:837: undefined reference to `nand_curr_device'
/home/335X/mytq335x/drivers/mtd/nand/omap_gpmc.c:837: undefined reference to `nand_info'
make[1]: *** [/home/335X/mytq335x/spl/u-boot-spl] 错误 1
make[1]:正在离开目录 `/home/335X/mytq335x/spl'
make: *** [spl/u-boot-spl.bin] 错误 2

问题:为什么会出现上面的告警???

Steven Liu1:

相关的函数没找到定义,跟代码就好了。

不过在你进行这项工作之前,我想知道,为什么要加入nandecc的命令?

如果是使用TI发布的SDK话,在SDK5.07后,仅使用BCH8,所以就没必要使用该命令了,因此后面也被移除了。你使用的SDK6.0版本也是这样,现在为什么又要加上呢?这里改了,后面读取识别的时候怎么处理?也改吗?

http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#NAND_ECC_algorithm_selection

Starting with the 04.06.00.09-rc2 release only BCH8 is supported, and is used by default in all cases. No user interaction is required to select the algorithm and locations where the nandecc command are required can be seen by looking at the history of this page.

andarm lin1:

回复 Steven Liu1:

谢谢了。。

一些编译调用顺序问题。

将nandecc代码放到cmd_nand.c文件下就行了。

赞(0)
未经允许不得转载:TI中文支持网 » uboot中添加nandecc命令问题
分享到: 更多 (0)