大家好,在移植AM335X的时候又遇到了一个问题:在u-boot操作NAND Flash时很慢,具体情况如下:
SDK版本:ti-processor-sdk-linux-am335x-evm-03.02.00.05
问题描述:我有两块板子,第一块是网上买的demo,上面是512MByte的NAND(型号:29F4G08ABADA);第二块是自己做的板子,上面是256MByte的NAND(型号:29F4G08ABADA),我编译好Uboot后在装置上运行,两块板子均能正确识别NAND,但是当执行nand erase.chip进行擦除时出了问题,第一块板子512M的NAND很快擦除,大概几秒钟就完成,但是第二块256M的NAND则很慢,大概需要20几分钟,这是什么原因呢?
nand_pin_mux如下:
static struct module_pin_mux hxdw_nand_pin_mux[] = {
{OFFSET(gpmc_ad0), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD0 */
{OFFSET(gpmc_ad1), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD1 */
{OFFSET(gpmc_ad2), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD2 */
{OFFSET(gpmc_ad3), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD3 */
{OFFSET(gpmc_ad4), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD4 */
{OFFSET(gpmc_ad5), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD5 */
{OFFSET(gpmc_ad6), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD6 */
{OFFSET(gpmc_ad7), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD7 */
#ifdef CONFIG_SYS_NAND_BUSWIDTH_16BIT
{OFFSET(gpmc_ad8), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD8 */
{OFFSET(gpmc_ad9), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD9 */
{OFFSET(gpmc_ad10), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD10 */
{OFFSET(gpmc_ad11), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD11 */
{OFFSET(gpmc_ad12), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD12 */
{OFFSET(gpmc_ad13), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD13 */
{OFFSET(gpmc_ad14), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD14 */
{OFFSET(gpmc_ad15), (MODE(0) | PULLUDDIS | RXACTIVE)}, /* AD15 */
#endif
{OFFSET(gpmc_wait0), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* nWAIT */
{OFFSET(gpmc_wpn), (MODE(7) | PULLUP_EN)}, /* nWP */
{OFFSET(gpmc_csn0), (MODE(0) | PULLUP_EN)}, /* nCS */
{OFFSET(gpmc_wen), (MODE(0) | PULLDOWN_EN)}, /* WEN */
{OFFSET(gpmc_oen_ren), (MODE(0) | PULLDOWN_EN)}, /* OE */
{OFFSET(gpmc_advn_ale), (MODE(0) | PULLDOWN_EN)}, /* ADV_ALE */
{OFFSET(gpmc_be0n_cle), (MODE(0) | PULLDOWN_EN)}, /* BE_CLE */
{-1},
};
配置代码如下:
else if (board_is_hxdw()) {
configure_module_pin_mux(rgmii1_pin_mux);
configure_module_pin_mux(hxdw_mmc0_pin_mux);
configure_module_pin_mux(hxdw_nand_pin_mux);
}
各自的打印信息如下:
第二块板子:
U-Boot SPL 2016.05-00304-gad06f64-dirty (Apr 09 2017 – 13:33:00)
Trying to boot from MMC1
reading args
spl_load_image_fat_os: error reading image args, err – -1
reading u-boot.img
reading u-boot.img
reading u-boot.img
reading u-boot.img
U-Boot 2016.05-00304-gad06f64-dirty (Apr 09 2017 – 13:33:00 +0800)
CPU : AM335X-GP rev 2.1
Model: TI AM335x HXDW
Watchdog enabled
DRAM: 256 MiB
NAND: 256 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
reading uboot.env
** Unable to read "uboot.env" from mmc0:1 **
Using default environment
<ethaddr> not set. Validating first E-fuse MAC
Net: Could not get PHY for ethernet@4a100000: addr 0
eth0: ethernet@4a100000
Warning: usb_ether MAC addresses don't match:
Address in SROM is de:ad:be:ef:00:01
Address in environment is 84:eb:18:bd:a8:9e
, eth1: usb_ether
Press SPACE to abort autoboot in 2 seconds
=> nand erase.chip
NAND erase.chip: device 0 whole chip
Erasing at 0xbae0000 — 73% complete.(很慢)
第一块板子:
U-Boot SPL 2016.05-00304-gad06f64-dirty (Apr 09 2017 – 13:33:00)
Trying to boot from MMC1
reading args
spl_load_image_fat_os: error reading image args, err – -1
reading u-boot.img
reading u-boot.img
reading u-boot.img
reading u-boot.img
U-Boot 2016.05-00304-gad06f64-dirty (Apr 09 2017 – 13:33:00 +0800)
CPU : AM335X-GP rev 2.1
Model: TI AM335x HXDW
Watchdog enabled
DRAM: 512 MiB
NAND: 512 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
reading uboot.env
** Unable to read "uboot.env" from mmc0:1 **
Using default environment
<ethaddr> not set. Validating first E-fuse MAC
Net: Could not get PHY for ethernet@4a100000: addr 0
eth0: ethernet@4a100000
Warning: usb_ether MAC addresses don't match:
Address in SROM is de:ad:be:ef:00:01
Address in environment is b0:d5:cc:81:84:a3
, eth1: usb_ether
Press SPACE to abort autoboot in 2 seconds
=> nand erase.chip
NAND erase.chip: device 0 whole chip
Erasing at 0x1ffe0000 — 100% complete.
OK
=>(很快)
Zhihua Zhang:
OK,问题解决