u-boot 2016.03支持nand flash boot

工作背景:

目标板:imx6ul SOC+底板    u-boot:uboot2016.03

nand flash: Micron MT29F8G08ABABAWP 1G

kernel启动过程中关于nand flash的打印信息如下:

===============================

nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x38
nand: Micron MT29F8G08ABABAWP
nand: 1024 MiB, SLC, erase size: 512 KiB, page size: 4096, OOB size: 224
gpmi-nand 1806000.gpmi-nand: enable the asynchronous EDO mode 4

Scanning device for bad blocks
8 ofpart partitions found on MTD device gpmi-nand
Creating 8 MTD partitions on "gpmi-nand":
0x000000000000-0x000000800000 : "boot"
0x000000800000-0x000000a00000 : "logo"
0x000000a00000-0x000000b00000 : "ENV"
0x000000b00000-0x000000e00000 : "DTB"
0x000000e00000-0x000001600000 : "kernel"
0x000001600000-0x000001700000 : "DTBbak"
0x000001700000-0x000001f00000 : "kernelbak"
0x000001f00000-0x000040000000 : "rootfs"

gpmi-nand 1806000.gpmi-nand: driver registered.

===================================

但是u-boot在引导OS启动过程中关于nand flash 会有如下报错:

NAND read from offset 600000 failed -74

*** Warning - readenv() failed, using default environment

扫描二维码关注公众号,回复: 543782 查看本文章

NAND read from offset 800000 failed -74

0 bytes read: ERROR

NAND read from offset e00000 failed -74

0 bytes read: ERROR

NAND read from offset b00000 failed -74

0 bytes read: ERROR

从打印信息的read error 来看,是我们从nand flash的 每个偏移位置都没有读到有效数据,

但是执行md 0x80800000 0x100 会发现已经从flash(这样测试的是0xb00000偏移位置读)读出数据到ram了,部分读出数据如下:


跟踪到这步我依然不确定问题出现在那了,

接下来,我将整个uboot擦除:

=> nand erase.chip

之后在uboot中就可以正确读取nand flash 中的数据。


擦除过程就是写入全ff,所以读取均是ff。


当我将u-boot 2016.03源码根目录下的文件include/configs/mx6ul_14x14_evk.h 做如下修改后:

第一条报错问题解决。

事实上我在kernel中(dts中)对nand flash进行了分区,我在u-boot的env中将flash分区规划同kernel中对mtd 分区规划保持一致。

但是u-boot对nand 的每一个物理偏移的读 都不正确。

未完待续









猜你喜欢

转载自blog.csdn.net/hanpca/article/details/80228658