summaryrefslogtreecommitdiff
path: root/include/asm-arm/arch-mx25
diff options
context:
space:
mode:
authorJason <r64343@freescale.com>2009-11-30 17:35:50 +0800
committerJason <r64343@freescale.com>2009-12-08 18:11:50 +0800
commita012066c0996d8b79b815470aded18e266733e2b (patch)
treef2c908671b70a642baa09650dfff05b45053287c /include/asm-arm/arch-mx25
parentd8667412a8b7e1ad96979bc2191b4e3fa90c8254 (diff)
downloadu-boot-imx-a012066c0996d8b79b815470aded18e266733e2b.zip
u-boot-imx-a012066c0996d8b79b815470aded18e266733e2b.tar.gz
u-boot-imx-a012066c0996d8b79b815470aded18e266733e2b.tar.bz2
ENGR00118789 Uboot:Update NAND scan scheme to support new nand type
Update NAND scan scheme to support new nand type. With this patch uboot can support new NAND flash on mx25/mx35 board while compatible with old NAND on old boards. Signed-off-by: Jason Liu <r64343@freescale.com>
Diffstat (limited to 'include/asm-arm/arch-mx25')
-rw-r--r--include/asm-arm/arch-mx25/mxc_nand.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/asm-arm/arch-mx25/mxc_nand.h b/include/asm-arm/arch-mx25/mxc_nand.h
index 20a146c..9b2eec6 100644
--- a/include/asm-arm/arch-mx25/mxc_nand.h
+++ b/include/asm-arm/arch-mx25/mxc_nand.h
@@ -31,6 +31,7 @@
== NAND_PAGESIZE_4KB)
#define IS_LARGE_PAGE_NAND ((mtd->writesize / info->num_of_intlv) > 512)
+#define GET_NAND_OOB_SIZE (mtd->oobsize / info->num_of_intlv)
#define NAND_PAGESIZE_2KB 2048
#define NAND_PAGESIZE_4KB 4096
#define NAND_MAX_PAGESIZE 4096
@@ -94,16 +95,21 @@ do { \
#define NFC_SET_NFMS(v) \
do { \
- (NFMS |= (v)); \
if (((v) & (1 << NFMS_NF_PG_SZ))) { \
if (IS_2K_PAGE_NAND) { \
+ (NFMS |= 0x00000100); \
+ (NFMS &= ~0x00000200); \
NFC_SET_SPAS(NFC_SPAS_64); \
} else if (IS_4K_PAGE_NAND) { \
- NFC_SET_SPAS(NFC_SPAS_128); \
+ (NFMS &= ~0x00000100); \
+ (NFMS |= 0x00000200); \
+ GET_NAND_OOB_SIZE == 128 ? \
+ NFC_SET_SPAS(NFC_SPAS_128) : \
+ NFC_SET_SPAS(NFC_SPAS_218); \
} else { \
- NFC_SET_SPAS(NFC_SPAS_16); \
+ printk(KERN_ERR "Err for setting page/oob size"); \
} \
- NFC_SET_ECC_MODE(NFC_SPAS_128); \
+ NFC_SET_ECC_MODE(GET_NAND_OOB_SIZE >> 1); \
} \
} while (0)