TI中文支持网
TI专业的中文技术问题搜集分享网站

PROCESSOR-SDK-AM335X: AM335X 无法从NAND flash启动

Part Number:PROCESSOR-SDK-AM335X

板子调试中遇到问题,请求大神帮助。

目前我手里有块板子,一个板子的nand flash型号是MT29F8G08ABABAWP,另一个板子的NAND型号是 MX60LF8G18AC。其中MX60LF8G18AC的板子可以正常从NAND中启动uboot。但是MT29F8G08ABABAWP的板子没办法引导启动uboot,一直串口打印“CCCCCCCCCCCCCCCCCCCC”。通一个MLO和uboot.img,通过SD卡启动后,可以正常读写nand。

获取mtdparts获取NAND分区如下:

=> mtdparts

device nand0 <nand.0>, # parts = 7
#: name size offset mask_flags
0: NAND.SPL 0x00080000 0x00000000 0
1: NAND.SPL.backup1 0x00080000 0x00080000 0
2: NAND.u-boot 0x00200000 0x00100000 0
3: NAND.u-boot-env 0x00100000 0x00300000 0
4: NAND.u-boot-spl-os 0x00100000 0x00400000 0
5: NAND.kernel 0x00800000 0x00500000 0
6: NAND.file-system 0x3f300000 0x00d00000 0

active partition: nand0,0 – (NAND.SPL) 0x00080000 @ 0x00000000

defaults:
mtdids : nand0=nand.0
mtdparts: mtdparts=nand.0:512k(NAND.SPL),512k(NAND.SPL.backup1),2m(NAND.u-boot),1m(NAND.u-boot-env),1m(NAND.u-boot-spl-os),8m(NAND.kernel),-(NAND.file-system)
=>

利用如下命令将uboot写到NAND中:

fatload mmc 0:1 82000000 MLO;
nand erase.part NAND.SPL;
nand write 82000000 NAND.SPL 80000;

fatload mmc 0:1 82000000 u-boot.img;
nand erase.part NAND.u-boot;
nand write 82000000 NAND.u-boot 100000;

另外头文件中做了如下变动:

#ifdef CONFIG_NAND
/* 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)
#if 0 

/*这个中是MX60LF8G18AC差异的部分*/
#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
#else

/*这个中是MT29F8G08ABABAWP差异的部分*/
#define CONFIG_SYS_NAND_PAGE_SIZE 4096
#define CONFIG_SYS_NAND_OOBSIZE 224
#define CONFIG_SYS_NAND_BLOCK_SIZE (512*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, 58, 59, 60, 61, 62, 63,\
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,\
76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,\
88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,\
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,\
110, 111, 112, 113, 114, 115, 116, 117, 118, 119,\
120, 121, 122, 123, 124, 125, 126, 127, 128, 129,\
130, 131, 132, 133, 134, 135, 136, 137, 138, 139,\
140, 141, 142, 143, 144, 145, 146, 147, 148, 149,\
150, 151, 152, 153, 154, 155, 156, 157, 158, 159,\
160, 161, 162, 163, 164, 165, 166, 167, 168, 169,\
170, 171, 172, 173, 174, 175, 176, 177, 178, 179,\
180, 181, 182, 183, 184, 185, 186, 187, 188, 189,\
190, 191, 192, 193, 194, 195, 196, 197, 198, 199,\
200, 201, 202, 203, 204, 205, 206, 207, 208, 209, }

#define CONFIG_SYS_NAND_ECCSIZE 512
#define CONFIG_SYS_NAND_ECCBYTES 26
#endif
#define CONFIG_SYS_NAND_ONFI_DETECTION
#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x00100000
/* NAND: SPL related configs */
#ifdef CONFIG_SPL_OS_BOOT
#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00500000 /* kernel offset */
#endif
#endif /* !CONFIG_NAND */

MX60LF8G18AC手册

MXMA-S-A0003161395-1.pdf

MT29F8G08ABABAWP手册

MT29F8G08ABABAWPB-datasheet-pdf-www.findic.com.pdf

有哪位大神帮忙给分析一下,谢谢!

Shine:

请问您使用的哪个版本的Processor SDK? 是最新的吗?https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-AM335X

,

雪松10210:

我这验证了一下好像和ECC的校验有关系

MX60LF8G18AC需要配置如下:

#define CONFIG_SYS_NAND_ECCSIZE 512

#define CONFIG_SYS_NAND_ECCBYTES 14

#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW

MT29F8G08ABABAWP需要的配置如下:

#define CONFIG_SYS_NAND_ECCSIZE 512

#define CONFIG_SYS_NAND_ECCBYTES 26

#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH16_CODE_HW

这个里面CONFIG_SYS_NAND_ECCBYTES 的大小和校验方式有关BCH8是14,BCH16是26。但是我不太明白CONFIG_NAND_OMAP_ECCSCHEME 采用用BCH16还是用BCH8是根据什么选择的?难道是片内rom中的固件程序对不同型号的NAND采用哪个校验方式做了区分吗?如果固件程序判断到这个ECC校验不对会放弃从NAND启动。

,

Shine:

如果是老版本的SDK,不支持BCH16,请看下面的帖子讨论。https://e2echina.ti.com/support/processors/f/processors-forum/130812/am335x-nand/365467#365467

赞(0)
未经允许不得转载:TI中文支持网 » PROCESSOR-SDK-AM335X: AM335X 无法从NAND flash启动
分享到: 更多 (0)