1. We are having a device which uses TI's Sitara-am335x processor(Part No: AM3356BZCZD60). We are Currently trying to upgrade to new Micron 8Gb:x8 Flash-model (8SC Part No: MT29F8G08ABACAH4-IT:C)
with page size=4096 Bytes, Block size=256K (256*1024 Bytes).
2. Previously we were using Micron Flash with Part No: MT29F2G08ABAEAH4 with page size=2048 Bytes, Block size=128K (128*1024 Bytes).
3. With the new flash, nand write from U-boot is getting failed with error "nand0: partition (NAND.SPL) size alignment incorrect"
4. We are using U-boot Source code downloaded from TI Website, which contains support for block-size 128K by default. Although the device Id (0xD3) of new Flash Model is present in the source-Code, it is not supporting the new flash Model.
We had made the below modifications in Uboot source code
File: include/confgs/am335x_evm.h
#define MTDPARTS_DEFAULT "mtdparts=nand.0:" \
"256k(NAND.SPL)," \
"256k(NAND.SPL.backup1)," \
"256k(NAND.SPL.backup2)," \
"256k(NAND.SPL.backup3)," \
"1m(NAND.u-boot)," \
"256k(NAND.u-boot-env1)," \
"256k(NAND.u-boot-env2)," \
"-(NAND.RBlob)"
/*Previous defs below*/
/* #define MTDPARTS_DEFAULT "mtdparts=nand.0:" \
"128k(NAND.SPL)," \
"128k(NAND.SPL.backup1)," \
"128k(NAND.SPL.backup2)," \
"128k(NAND.SPL.backup3)," \
"1m(NAND.u-boot)," \
"128k(NAND.u-boot-env1)," \
"128k(NAND.u-boot-env2)," \
"-(NAND.RBlob)"*/
#define CONFIG_ENV_SIZE (256 << 10) // 128 << 10 previously
#define CONFIG_SYS_NAND_BLOCK_SIZE (256*1024) //128*1024 previously
#define CONFIG_SYS_NAND_PAGE_SIZE 4096 //2048 previously
Uboot compiled with above changes when tested returned error
"Size of write exceeds partition or device limit
0 bytes written: ERROR"
Please advise if any other changes are needed/ corrections needed in above.
=>printenv (mtd-related env variables at this instance looks like below)
mtddevname=NAND.SPL
mtddevnum=0
mtdids=nand0=nand.0
mtdparts=mtdparts=nand.0:256k(NAND.SPL),256k(NAND.SPL.backup1),256k(NAND.SPL.backup2),256k(NAND.SPL.backup3),1m(NAND.u-boot),256k(NAND.u-boot-env1),256k(NAND.u-boot-env2),-(NAND.RBlob)
partition=nand0,0