From 6532550c9f7e96cbe32488f24ca53b2e3648fef1 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 12 Oct 2009 10:48:31 +0800 Subject: ENGR00116924 Uboot: Boot up hang at detecting NAND when cold boot Boot from MMC card failed at detecting NAND. The fix will 1. Set RBB_MODE to 1 and using atomic status command 2. Set FW correctly by adding CONFIG_NAND_FW_8 config 3. Correct the BLS register value Signed-off-by:Jason Liu (cherry picked from commit 7142651386271c340a6ae061a6e2893695675724) --- include/asm-arm/arch-mx51/mxc_nand.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'include/asm-arm/arch-mx51') diff --git a/include/asm-arm/arch-mx51/mxc_nand.h b/include/asm-arm/arch-mx51/mxc_nand.h index 539d0fd..ee5bf91 100644 --- a/include/asm-arm/arch-mx51/mxc_nand.h +++ b/include/asm-arm/arch-mx51/mxc_nand.h @@ -72,7 +72,7 @@ #define IS_4BIT_ECC \ ( \ - is_soc_rev(CHIP_REV_2_0) == 0 ? \ + is_soc_rev(CHIP_REV_2_0) >= 0 ? \ !((raw_read(NFC_CONFIG2) & NFC_ECC_MODE_4) >> 6) : \ ((raw_read(NFC_CONFIG2) & NFC_ECC_MODE_4) >> 6) \ ) @@ -84,7 +84,7 @@ #define NFC_SET_ECC_MODE(v) \ do { \ - if (is_soc_rev(CHIP_REV_2_0) == 0) { \ + if (is_soc_rev(CHIP_REV_2_0) >= 0) { \ if ((v) == NFC_SPAS_218 || (v) == NFC_SPAS_112) \ raw_write(((raw_read(NFC_CONFIG2) & \ NFC_ECC_MODE_MASK) | \ @@ -201,9 +201,9 @@ do { \ #define NFC_PPB_256 (3 << 7) #define NFC_PPB_RESET (~(3 << 7)) -#define NFC_BLS_LOCKED (0 << 16) -#define NFC_BLS_LOCKED_DEFAULT (1 << 16) -#define NFC_BLS_UNLCOKED (2 << 16) +#define NFC_BLS_LOCKED (0 << 6) +#define NFC_BLS_LOCKED_DEFAULT (1 << 6) +#define NFC_BLS_UNLCOKED (2 << 6) #define NFC_BLS_RESET (~(3 << 16)) #define NFC_WPC_LOCK_TIGHT 1 #define NFC_WPC_LOCK (1 << 1) @@ -335,7 +335,8 @@ do { \ /*should set the fw,ps,spas,ppb*/ #define NFC_SET_NFMS(v) \ do { \ - NFC_SET_FW(NFC_FW_8); \ + if (!(v)) \ + NFC_SET_FW(NFC_FW_8); \ if (((v) & (1 << NFMS_NF_DWIDTH))) \ NFC_SET_FW(NFC_FW_16); \ if (((v) & (1 << NFMS_NF_PG_SZ))) { \ @@ -356,7 +357,8 @@ do { \ NFC_SET_SPAS(GET_NAND_OOB_SIZE >> 1); \ NFC_SET_ECC_MODE(GET_NAND_OOB_SIZE >> 1); \ NFC_SET_ST_CMD(0x70); \ - raw_write(raw_read(NFC_CONFIG3) | 1 << 20, NFC_CONFIG3); \ + raw_write(raw_read(NFC_CONFIG3) | NFC_NO_SDMA, NFC_CONFIG3); \ + raw_write(raw_read(NFC_CONFIG3) | NFC_RBB_MODE, NFC_CONFIG3); \ } \ } while (0) -- cgit v1.1