diff options
author | Jason <r64343@freescale.com> | 2009-11-30 17:35:50 +0800 |
---|---|---|
committer | Jason <r64343@freescale.com> | 2009-12-08 18:11:50 +0800 |
commit | a012066c0996d8b79b815470aded18e266733e2b (patch) | |
tree | f2c908671b70a642baa09650dfff05b45053287c /include | |
parent | d8667412a8b7e1ad96979bc2191b4e3fa90c8254 (diff) | |
download | u-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')
-rw-r--r-- | include/asm-arm/arch-mx25/mxc_nand.h | 14 | ||||
-rw-r--r-- | include/asm-arm/arch-mx35/mxc_nand.h | 15 | ||||
-rw-r--r-- | include/configs/mx35_3stack.h | 4 | ||||
-rw-r--r-- | include/linux/mtd/nand.h | 2 |
4 files changed, 25 insertions, 10 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) 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) diff --git a/include/configs/mx35_3stack.h b/include/configs/mx35_3stack.h index f0d3d63..b2fb714 100644 --- a/include/configs/mx35_3stack.h +++ b/include/configs/mx35_3stack.h @@ -196,7 +196,7 @@ #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE /* Address and size of Redundant Environment Sector */ -#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_ENV_OFFSET_REDUND (2 * 1024 * 1024) #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE /* @@ -215,7 +215,7 @@ #if defined(CONFIG_FSL_ENV_IN_NAND) #define CONFIG_ENV_IS_IN_NAND 1 - #define CONFIG_ENV_OFFSET (768 * 1024) + #define CONFIG_ENV_OFFSET (1024 * 1024) #elif defined(CONFIG_FSL_ENV_IS_IN_FLASH) #define CONFIG_ENV_IS_IN_FLASH 1 #endif diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7d5196a..ea90961 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -437,6 +437,8 @@ struct nand_chip { #define NAND_MFR_HYNIX 0xad #define NAND_MFR_MICRON 0x2c #define NAND_MFR_AMD 0x01 +#define NAND_MFR_SANDISK 0x45 +#define NAND_MFR_INTEL 0x89 /** * struct nand_flash_dev - NAND Flash Device ID Structure |