[U-Boot] [RFC 2/4] mxc_nand: Update driver to work with i.MX31.

Magnus Lilja lilja.magnus at gmail.com
Sun Nov 8 11:55:37 CET 2009


Comment:
Given how mxc_nand.c looks like (it was written with i.MX27 in mind),
this is the straight forward way of adding i.MX31 support. Personally
I don't like the #ifdef's and prefer the solution presented in a
later patch in this series.
---
 drivers/mtd/nand/mxc_nand.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index eb0323f..3e4254a 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -871,9 +871,15 @@ int board_nand_init(struct nand_chip *this)
 	writew(0x4, &host->regs->nfc_wrprot);
 
 	/* NAND bus width determines access funtions used by upper layer */
+#ifdef CONFIG_MX27
 	if (readl(&sc_regs->fmcr) & NF_16BIT_SEL)
 		this->options |= NAND_BUSWIDTH_16;
-
+#elif defined(CONFIG_MX31)
+	if (readl(&sc_regs->rcsr) & CCM_RCSR_NF16B)
+		this->options |= NAND_BUSWIDTH_16;
+#else
+#warning "No autodetection of 8/16 bit NAND"
+#endif
 	host->pagesize_2k = 0;
 
 	return err;
-- 
1.5.6



More information about the U-Boot mailing list