[PATCH 09/12] board hmi10: enable support for NAND

Jan Luebbe jlu at pengutronix.de
Tue Jun 26 05:51:51 EDT 2012


Signed-off-by: Jan Luebbe <jlu at pengutronix.de>
---
 arch/arm/boards/hmi10/board.c |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/boards/hmi10/board.c b/arch/arm/boards/hmi10/board.c
index be4d920..bc3283d 100644
--- a/arch/arm/boards/hmi10/board.c
+++ b/arch/arm/boards/hmi10/board.c
@@ -31,7 +31,9 @@
 #include <linux/err.h>
 #include <linux/mtd/nand.h>
 
+#include <mach/aemif.h>
 #include <mach/hardware.h>
+#include <mach/nand.h>
 #include <mach/da8xx.h>
 
 #ifdef CONFIG_DRIVER_SERIAL_NS16550
@@ -82,8 +84,29 @@ static int hmi10_mem_init(void)
 }
 mem_initcall(hmi10_mem_init);
 
+static struct davinci_aemif_timing hmi10_nandflash_timing = {
+	.wsetup = 24,
+	.wstrobe = 21,
+	.whold = 14,
+	.rsetup = 19,
+	.rstrobe = 50,
+	.rhold = 0,
+	.ta = 20,
+};
+
+static struct davinci_nand_pdata hmi10_nandflash_data = {
+	.ecc_mode = NAND_ECC_HW,
+	.ecc_bits = 4,
+	.options = NAND_USE_FLASH_BBT,
+	.timing = &hmi10_nandflash_timing,
+};
+
 static int hmi10_devices_init(void)
 {
+	lpsc_on(DAVINCI_LPSC_AEMIF);
+	add_generic_device("davinci_nand", -1, NULL, DAVINCI_ASYNC_EMIF_CNTRL_BASE, 0,
+			   IORESOURCE_MEM, &hmi10_nandflash_data);
+
 	armlinux_set_bootparams((void *)0xc0000100);
 	armlinux_set_architecture(MACH_TYPE_DAVINCI_HE_HMI10);
 
-- 
1.7.10




More information about the barebox mailing list