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

在配置一款新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

配置文件修改如下:

#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

3 个回复