From a012066c0996d8b79b815470aded18e266733e2b Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 30 Nov 2009 17:35:50 +0800 Subject: 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 --- include/asm-arm/arch-mx35/mxc_nand.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'include/asm-arm/arch-mx35/mxc_nand.h') diff --git a/include/asm-arm/arch-mx35/mxc_nand.h b/include/asm-arm/arch-mx35/mxc_nand.h index 047b232..5946703 100644 --- a/include/asm-arm/arch-mx35/mxc_nand.h +++ b/include/asm-arm/arch-mx35/mxc_nand.h @@ -31,6 +31,8 @@ == 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 @@ -93,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) -- cgit v1.1