aboutsummaryrefslogtreecommitdiff
path: root/include/asm-arm/arch-mx53/mxc_nand.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/arch-mx53/mxc_nand.h')
-rw-r--r--include/asm-arm/arch-mx53/mxc_nand.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/asm-arm/arch-mx53/mxc_nand.h b/include/asm-arm/arch-mx53/mxc_nand.h
index 68c2dc623..eb0a3b455 100644
--- a/include/asm-arm/arch-mx53/mxc_nand.h
+++ b/include/asm-arm/arch-mx53/mxc_nand.h
@@ -275,7 +275,7 @@ do { \
#define UNLOCK_ADDR(start_addr, end_addr) \
{ \
int i = 0; \
- for (; i < NAND_MAX_CHIPS; i++) \
+ for (; i < NFC_GET_MAXCHIP_SP(); i++) \
raw_write(start_addr | \
(end_addr << NFC_UNLOCK_END_ADDR_SHIFT), \
REG_UNLOCK_BLK_ADD0 + (i << 2)); \
@@ -286,6 +286,10 @@ do { \
(NFC_FIELD_RESET(NFC_ACTIVE_CS_WIDTH, NFC_ACTIVE_CS_SHIFT))) | \
((val) << NFC_ACTIVE_CS_SHIFT), NFC_CONFIG1);
+#define NFC_GET_NFC_ACTIVE_CS() \
+ ((raw_read(NFC_CONFIG1) >> NFC_ACTIVE_CS_SHIFT) & \
+ ((1 << NFC_ACTIVE_CS_WIDTH) - 1))
+
#define NFC_GET_MAXCHIP_SP() 8
#define NFC_SET_BLS(val) ((raw_read(REG_NFC_BLS) & NFC_BLS_RESET) | val)