This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x U-Boot 2018.01-00228-g4579b130f0 OOB Size错误,无法从Nand Flash启动

Other Parts Discussed in Thread: AM3354

在配置一款新Flash H27U4G8_6F2D ,配置文件中如下修改,OOB Size明明写的是64是,但系统打印出来的OOB Size却是128,可能是这个原因导致Uboot无法从Nand Flash启动,一直打印CCCCCCCCC

试着修改CONFIG_SYS_NAND_OOBSIZE 为任意值,都显示为128b,好像自己根据什么值算出来的   。在nand_flash_detect_onfi函数中mtd->oobsize = le16_to_cpu(p->spare_bytes_per_page);强制设置为64,值更改了但还是无法从Flash启动,可能还有些地方没改到。

nand info显示如下:
Device 0: nand0, sector size 128 KiB
  Page size       2048 b
  OOB size         128 b
  Erase size    131072 b
  subpagesize      512 b
  options     0x4000400c
  bbt options 0x00008000

配置文件修改如下:

/* NAND: device related configs */
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_PAGE_COUNT  (CONFIG_SYS_NAND_BLOCK_SIZE / \
                     CONFIG_SYS_NAND_PAGE_SIZE)
#define CONFIG_SYS_NAND_PAGE_SIZE   2048
#define CONFIG_SYS_NAND_OOBSIZE     64
#define CONFIG_SYS_NAND_BLOCK_SIZE  (128*1024)
/* NAND: driver related configs */
#define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
#define CONFIG_SYS_NAND_ECCPOS  { 2, 3, 4, 5, 6, 7, 8, 9, \
                     10, 11, 12, 13, 14, 15, 16, 17, \
                     18, 19, 20, 21, 22, 23, 24, 25, \
                     26, 27, 28, 29, 30, 31, 32, 33, \
                     34, 35, 36, 37, 38, 39, 40, 41, \
                     42, 43, 44, 45, 46, 47, 48, 49, \
                     50, 51, 52, 53, 54, 55, 56, 57, }

#define CONFIG_SYS_NAND_ECCSIZE     512
#define CONFIG_SYS_NAND_ECCBYTES    14
#define CONFIG_SYS_NAND_ONFI_DETECTION
#define CONFIG_NAND_OMAP_ECCSCHEME  OMAP_ECC_BCH8_CODE_HW
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x00140000
  • 请检查一下sysboot管脚上的电平值是否正确?用示波器抓一下Rom Bootloader读nand flash的时序是否正确。
  • 感谢您的回复,sysboot管脚电平值是正确的,用另外一款三星8G的Flash是正常的,Flash的时序有一些偏差,但数据的读写测试也都正常,用nand read 和nand write写入后再读出来是一致的。是否还有其它可疑的地方? H27U4G8_6F2D这顆Flash AM3354是否支持(规格书如下附件)?
    另外Flash时序的配置,有没有指导文档,看了这些宏定义和Flash规格书的对应不上来,调起来有点矇~

    6371.H27U4G_datasheet.pdf

    感谢!

    #define _CSROFF 4 /* 44ns */
    #define _CSWOFF 4 /* 44ns */
    #define _ADON 0 /* 6ns */
    #define _ADROFF 4 /* 34ns */
    #define _ADWOFF 4 /* 44ns */
    #define _OEON 1 /* 0ns */
    #define _OEOFF 3 /* 54ns */
    #define _WEON 1 /* 0ns */
    #define _WEOFF 3 /* 40ns */
    #define _RDCY 6 /* 82ns */
    #define _WRCY 6 /* 82ns */
    #define _RDACC 3 /* 64ns */
    #define _CSHIGH 10 /* 0ns */ /* 100ns tADL! 60ns tWHR! */
    #define _WBURST 0 /* 0ns */
    #define _WRACC 2 /* 40ns */
    #define _BTURN 10 /* ??? */ /* 100ns tRHW */

  • 今天再换了另外一颗S34ML04G1 的Flash,结果也是一样。难道S34ML04G1、H27U4G8_6F2D这两颗Flash都不支持,还是我哪里配置有问题?请帮忙再确认指导下,感谢!
  • 该问题已经解决了,给大家分享下吧,OOB Size要设置为128b的,ECC要设置为BCH16。