Skip to contentSkip to conversation

83xx: nand support for MPC837XRDB boards

PATCH New Anton Vorontsov 2 participants 3 messages Mar 7, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 83xx: nand support for MPC837XRDB boards

---
 include/configs/MPC837XERDB.h |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)
include/configs/MPC837XERDB.h +22 -2
index 2da4f29..7c19d1e 100644
@@ -251,9 +251,29 @@
 #define CFG_FLASH_ERASE_TOUT	60000	/* Flash Erase Timeout (ms) */
 #define CFG_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (ms) */
 
-#define CFG_VSC7385_BASE	0xF0000000
+/*
+ * NAND Flash on the Local Bus
+ */
+#define CFG_NAND_BASE		0xE0600000	/* 0xE0600000 */
+#define CFG_BR1_PRELIM		(CFG_NAND_BASE | \
+				 (2 << BR_DECC_SHIFT) |	/* Use HW ECC */ \
+				 BR_PS_8 |		/* Port Size = 8 bit */ \
+				 BR_MS_FCM |		/* MSEL = FCM */ \
+				 BR_V)			/* valid */
+#define CFG_OR1_PRELIM		(0xFFFF8000 |		/* length 32K */ \
+				 OR_FCM_CSCT | \
+				 OR_FCM_CST | \
+				 OR_FCM_CHT | \
+				 OR_FCM_SCY_1 | \
+				 OR_FCM_TRLX | \
+				 OR_FCM_EHTR)
+#define CFG_LBLAWBAR1_PRELIM	CFG_NAND_BASE
+#define CFG_LBLAWAR1_PRELIM	0x8000000E	/* 32KB  */
 
-/* VSC7385 Gigabit Switch support */
+/*
+ * VSC7385 Gigabit Switch support
+ */
+#define CFG_VSC7385_BASE	0xF0000000
 #define CONFIG_VSC7385_ENET
 #define CFG_BR2_PRELIM		0xf0000801		/* Base address */
 #define CFG_OR2_PRELIM		0xfffe09ff		/* 128K bytes*/
Signature · 1 line
1.5.2.2
#1 lore raw

PATCH 1/3 83xx: nand support for MPC837XRDB boards

include/configs/MPC837XERDB.h line 269

Quoted 7 lines · Anton Vorontsov
include/configs/MPC837XERDB.h +7 -0
+#define CFG_OR1_PRELIM		(0xFFFF8000 |		/* length 32K */ \
+				 OR_FCM_CSCT | \
+				 OR_FCM_CST | \
+				 OR_FCM_CHT | \
+				 OR_FCM_SCY_1 | \
+				 OR_FCM_TRLX | \
+				 OR_FCM_EHTR)

Are you sure that SCY_1 is correct? The 8313erdb config sets it, and it's too low -- I get errors if I don't increase it. I don't know what the minimal correct value should be, though.

-Scott

#2 lore raw

PATCH 1/3 83xx: nand support for MPC837XRDB boards

Quoted 12 lines · Scott Wood

Review

Quoted 7 lines · Anton Vorontsov
(quoted diff) +7 -0
+#define CFG_OR1_PRELIM		(0xFFFF8000 |		/* length 32K */ \
+				 OR_FCM_CSCT | \
+				 OR_FCM_CST | \
+				 OR_FCM_CHT | \
+				 OR_FCM_SCY_1 | \
+				 OR_FCM_TRLX | \
+				 OR_FCM_EHTR)

Are you sure that SCY_1 is correct? The 8313erdb config sets it, and it's too low -- I get errors if I don't increase it. I don't know what the minimal correct value should be, though.

I'm getting errors even with SCY_7. ;-) More specifically, I'm getting errors when writing to nand (nandwrite), reading and erasing works ok. Writing somehow confuses elbc, and it stops sending irqs. I've tried to increase timings, but there is no effect of doing this.

The patch below helps though, and nandwrite works ok with it, so I strongly believe this is software issue. Ideas?

drivers/mtd/nand/fsl_elbc_nand.c +2 -0
index b025dfe..f1e97fb 100644
@@ -691,6 +691,8 @@ static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len)
 
 	memcpy_toio(&ctrl->addr[ctrl->index], buf, len);
 	ctrl->index += len;
+
+	ndelay(100);
 }
 
 /*