Skip to contentSkip to conversation

omap3evm : enable nand support

PATCH In review Sriramakrishnan 2 participants 2 messages Oct 29, 2009 – Nov 10, 2009

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

PATCH 1/1 omap3evm : enable nand support

Enable Nand suport on the OMAP3EVM.

---
This patch has been generated against the tip of for-next branch.

 arch/arm/configs/omap3_evm_defconfig |    2 +
 arch/arm/mach-omap2/board-omap3evm.c |  102 ++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+), 0 deletions(-)
arch/arm/configs/omap3_evm_defconfig +2 -0
index d5ff477..5675281 100644
@@ -516,6 +516,8 @@ CONFIG_MTD_NAND=y
 # CONFIG_MTD_NAND_ECC_SMC is not set
 # CONFIG_MTD_NAND_MUSEUM_IDS is not set
 # CONFIG_MTD_NAND_GPIO is not set
+CONFIG_MTD_NAND_OMAP2=y
+# CONFIG_MTD_NAND_OMAP_PREFETCH is not set
 CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_DISKONCHIP is not set
 # CONFIG_MTD_NAND_NANDSIM is not set
arch/arm/mach-omap2/board-omap3evm.c +102 -0

132 lines not on this page · raw message

Signature · 1 line
1.6.2.4
maintainer
#1 lore raw

Hi,

Quoted 10 lines · Sriramakrishnan

Enable Nand suport on the OMAP3EVM.

---
This patch has been generated against the tip of for-next branch.

 arch/arm/configs/omap3_evm_defconfig |    2 +
 arch/arm/mach-omap2/board-omap3evm.c |  102 ++++++++++++++++++++++++++++++++++
 2 files changed, 104 insertions(+), 0 deletions(-)

<snip>

Quoted 25 lines
arch/arm/mach-omap2/board-omap3evm.c +25 -0
+void __init omap3evm_flash_init(void)
+{
+	u8 cs = 0;
+	u8 nandcs = GPMC_CS_NUM + 1;
+	u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+	while (cs < GPMC_CS_NUM) {
+		u32 ret = 0;
+		ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+		if ((ret & 0xC00) == 0x800) {
+			/* Found it!! */
+			if (nandcs > GPMC_CS_NUM)
+				nandcs = cs;
+		}
+		cs++;
+	}
+	if (nandcs > GPMC_CS_NUM) {
+		printk(KERN_INFO "NAND: Unable to find configuration "
+			" in GPMC\n ");
+		return;
+	}
+
+	if (nandcs < GPMC_CS_NUM) {
+		omap3evm_nand_data.cs   = nandcs;

arch/arm/mach-omap2/board-omap3evm.c line 154

Quoted 10 lines
arch/arm/mach-omap2/board-omap3evm.c +10 -0
+		omap3evm_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add +
+					GPMC_CS0_BASE + nandcs*GPMC_CS_SIZE);
+		omap3evm_nand_data.gpmc_baseaddr   = (void *) (gpmc_base_add);
+
+		if (platform_device_register(&omap3evm_nand_device) < 0) {
+			printk(KERN_ERR "Unable to register NAND device\n");
+			}
+	}
+}
+

To me it looks like this should work with the sdp-flash.c once the flash detection code is done in a clean way.

Not adding yet more cut and paste hacks, please coordinate within TI on adding the flash detection in a sane way.

Regards,

Tony