summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/mxc_nd2.h
diff options
context:
space:
mode:
authorJason <r64343@freescale.com>2009-12-08 17:51:09 +0800
committerJustin Waters <justin.waters@timesys.com>2010-03-25 14:01:37 -0400
commitbe62816bfbc56e39a3c0ae065b5f4f8ec35b0b5a (patch)
tree99802228e69b8a33e215d785558d2bbaf45f4cce /drivers/mtd/nand/mxc_nd2.h
parent583c06a1dc3da6e040f5891f8673b9cae280d5e8 (diff)
ENGR00118830 Update NAND driver scan scheme to support new nand type
Update NAND scan scheme to support new nand type. With this patch Linux NAND driver 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 'drivers/mtd/nand/mxc_nd2.h')
-rw-r--r--drivers/mtd/nand/mxc_nd2.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/mtd/nand/mxc_nd2.h b/drivers/mtd/nand/mxc_nd2.h
index b89b9318f372..c0c086eb4414 100644
--- a/drivers/mtd/nand/mxc_nd2.h
+++ b/drivers/mtd/nand/mxc_nd2.h
@@ -562,11 +562,22 @@ do { \
} while (0)
#define GET_ECC_STATUS() __raw_readl(REG_NFC_ECC_STATUS_RESULT);
-#define NFC_SET_NFMS(v) \
-do { \
- (NFMS |= (v)); \
- if (((v) & (1 << NFMS_NF_PG_SZ))) { \
- NFC_SET_SPAS(GET_NAND_OOB_SIZE >> 1); \
+#define NFC_SET_NFMS(v) \
+do { \
+ 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) { \
+ (NFMS &= ~0x00000100); \
+ (NFMS |= 0x00000200); \
+ GET_NAND_OOB_SIZE == 128 ? \
+ NFC_SET_SPAS(NFC_SPAS_128) : \
+ NFC_SET_SPAS(NFC_SPAS_218); \
+ } else { \
+ printk(KERN_ERR "Err for setting page/oob size"); \
+ } \
NFC_SET_ECC_MODE(GET_NAND_OOB_SIZE >> 1); \
} \
} while (0)