板子SOC是am3354,使用的NAND芯片是MT29F4G08ABADAWP
现在的情况是nand可以正确识别,nand read命令读也没问题,但是nand erase和nand write命令出错
=> nand erase 0x400000 0x20000
NAND erase: device 0 offset 0x400000, size 0x20000
nand_isbad_bbt(): bbt info for offs 0x00400000: (block 32) 0x00
nand_base: nand_erase_nand: start = 0x000000400000, len = 131072
nand_erase_nand: device is write protected!
nand0: MTD Erase failure: -5
OK
=>
nand_erase() ->nand_erase_nand() ->nand_check_wp(mtd)
擦函数总是提示写保护,把>nand_check_wp()中擦注掉可以继续,但是实际上没有擦除成功
nand write命令同样写不成功
=> nand write 0x82000000 0x400000 0x800
NAND write: device 0 offset 0x400000, size 0x800
nand_isbad_bbt(): bbt info for offs 0x00400000: (block 32) 0x00
NAND write to offset 400000 failed -5
0 bytes written: ERROR
Command failed, result=1
=>
查看GPMC_CONFIG中写保护bit位WRITEPROTECT,已经是高电平了,已经取消写保护了。板子上NAND_WP管脚并没有管脚复用的情况。
=> md.l 0x50000050 1
50000050: 00000012=>
board_nand_init()初始化时也是取消了nand的写保护了啊
gpmc_config = readl(&gpmc_cfg->config);
/* Disable Write protect */
gpmc_config |= 0x10;
writel(gpmc_config, &gpmc_cfg->config);
有碰到这种情况的没有?可以提供点参考意见,多谢多谢!
yongqing wang:
有没有在参考的开发板上试过?
Shine:
回复 jianbo wang:
感谢分享解决方法。