summaryrefslogtreecommitdiff
path: root/include/asm-arm/arch-mx51
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-arm/arch-mx51')
-rw-r--r--include/asm-arm/arch-mx51/mxc_nand.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/asm-arm/arch-mx51/mxc_nand.h b/include/asm-arm/arch-mx51/mxc_nand.h
index 843f080..4c37620 100644
--- a/include/asm-arm/arch-mx51/mxc_nand.h
+++ b/include/asm-arm/arch-mx51/mxc_nand.h
@@ -287,7 +287,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)); \
@@ -298,6 +298,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)