Skip to contentSkip to conversation

ARM DaVinci: EMIF settings

PATCH New Thomas Lange 3 participants 4 messages May 3, 2009 – Jun 7, 2009

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

PATCH 1/1 ARM DaVinci: EMIF settings

NAND module should not modify EMIF registers unrelated to CS2 that is used for NAND, i.e. do not modify EWAIT config register or registers for other Chip Selects.

Without this patch, EMIF configurations made in board_init() will be invalidated.

---
 drivers/mtd/nand/davinci_nand.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)
drivers/mtd/nand/davinci_nand.c +3 -9
index a974667..8ef18b8 100644
@@ -386,9 +386,6 @@ static int nand_davinci_waitfunc(struct mtd_info *mtd, struct nand_chip *this)
 static void nand_flash_init(void)
 {
 	u_int32_t	acfg1 = 0x3ffffffc;
-	u_int32_t	acfg2 = 0x3ffffffc;
-	u_int32_t	acfg3 = 0x3ffffffc;
-	u_int32_t	acfg4 = 0x3ffffffc;
 	emifregs	emif_regs;
 
 	/*------------------------------------------------------------------*
@@ -413,12 +410,9 @@ static void nand_flash_init(void)
 
 	emif_regs = (emifregs)DAVINCI_ASYNC_EMIF_CNTRL_BASE;
 
-	emif_regs->AWCCR |= 0x10000000;
-	emif_regs->AB1CR = acfg1;	/* 0x08244128 */;
-	emif_regs->AB2CR = acfg2;
-	emif_regs->AB3CR = acfg3;
-	emif_regs->AB4CR = acfg4;
-	emif_regs->NANDFCR = 0x00000101;
+	emif_regs->AB1CR = acfg1; /* CS2 */
+
+	emif_regs->NANDFCR = 0x00000101; /* NAND flash on CS2 */
 }
 
 int board_nand_init(struct nand_chip *nand)
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 ARM DaVinci: EMIF settings

Quoted 9 lines · Thomas Lange

NAND module should not modify EMIF registers unrelated to CS2 that is used for NAND, i.e. do not modify EWAIT config register or registers for other Chip Selects.

Without this patch, EMIF configurations made in board_init() will be invalidated.

---

David, Sandeep
is one of you can test it on some boards too?

Best Regards,
J.

#2 lore raw

PATCH 1/1 ARM DaVinci: EMIF settings

Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · Thomas Lange

NAND module should not modify EMIF registers unrelated to CS2 that is used for NAND, i.e. do not modify EWAIT config register or registers for other Chip Selects.

Quoted 7 lines
Quoted 5 lines

Without this patch, EMIF configurations made in board_init() will be invalidated.

---

David, Sandeep
is one of you can test it on some boards too?

I'd just merge it as-is (it builds, yes?).

That code is *extremely* dubious already, and the boards using that driver only use NAND on CS2. Code reconfiguring other chipselects is broken.

That code is already dm6446-specific. I have one dm6446 board, which only uses CS2 ... so the only error I could turn up would be a build error.

#3 lore raw

PATCH 1/1 ARM DaVinci: EMIF settings

In reply to Thomas Lange
Quoted 11 lines · Thomas Lange

NAND module should not modify EMIF registers unrelated to CS2 that is used for NAND, i.e. do not modify EWAIT config register or registers for other Chip Selects.

Without this patch, EMIF configurations made in board_init() will be invalidated.

---
 drivers/mtd/nand/davinci_nand.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

applied to arm/next

Best Regards,
J.