From patchwork Thu Apr 5 15:47:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Afzal X-Patchwork-Id: 159538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3C59FB6FBB for ; Wed, 16 May 2012 16:58:54 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SUY9j-0007WW-UP; Wed, 16 May 2012 06:56:20 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SFpBK-0006pO-SY; Thu, 05 Apr 2012 16:05:08 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q35G4sps014011; Thu, 5 Apr 2012 11:04:54 -0500 Received: from DFLE70.ent.ti.com (dfle70.ent.ti.com [128.247.5.40]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q35G4sfF027507; Thu, 5 Apr 2012 11:04:54 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle70.ent.ti.com (128.247.5.40) with Microsoft SMTP Server id 14.1.323.3; Thu, 5 Apr 2012 11:04:54 -0500 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with SMTP id q35G4nfx017925; Thu, 5 Apr 2012 11:04:49 -0500 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id 83005158002; Thu, 5 Apr 2012 21:34:48 +0530 (IST) Received: from linux-psp-server.india.ext.ti.com (linux-psp-server [192.168.247.76]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id q35G4mq05231; Thu, 5 Apr 2012 21:34:48 +0530 (IST) From: Afzal Mohammed To: , , , , , , , , , , , , , , Subject: [TMP] OMAP3EVM: Test gpmc nand & smsc911x Date: Thu, 5 Apr 2012 21:17:19 +0530 Message-ID: X-Mailer: git-send-email 1.7.9.3 In-Reply-To: References: MIME-Version: 1.0 X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.152 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Mailman-Approved-At: Wed, 16 May 2012 02:56:17 -0400 Cc: Afzal Mohammed X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Signed-off-by: Afzal Mohammed --- arch/arm/mach-omap2/board-omap3evm.c | 95 +++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 49df127..60938af 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -41,6 +42,7 @@ #include #include +#include #include #include #include "common.h" @@ -52,6 +54,7 @@ #include "sdram-micron-mt46h32m32lf-6.h" #include "hsmmc.h" #include "common-board-devices.h" +#include "board-flash.h" #define OMAP3_EVM_TS_GPIO 175 #define OMAP3_EVM_EHCI_VBUS 22 @@ -102,6 +105,36 @@ static void __init omap3_evm_get_revision(void) } } +static struct gpmc_device_pdata *gpmc_data_array[3]; +static struct gpmc_device_pdata **gpmc_data_cur = gpmc_data_array; + +static struct gpmc_pdata gpmc_data = { + .device_pdata = gpmc_data_array, +}; + +static struct resource gpmc_resources[] = { + { + .start = OMAP34XX_GPMC_BASE, + .end = OMAP34XX_GPMC_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + { + .start = INT_34XX_GPMC_IRQ, + .end = INT_34XX_GPMC_IRQ, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device gpmc_device = { + .name = "omap-gpmc", + .id = -1, + .num_resources = ARRAY_SIZE(gpmc_resources), + .resource = gpmc_resources, + .dev = { + .platform_data = &gpmc_data, + } +}; + #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) #include @@ -114,6 +147,8 @@ static struct omap_smsc911x_platform_data smsc911x_cfg = { static inline void __init omap3evm_init_smsc911x(void) { + struct gpmc_device_pdata *gpmc_smsc911x_info; + /* Configure ethernet controller reset gpio */ if (cpu_is_omap3430()) { if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) @@ -122,7 +157,11 @@ static inline void __init omap3evm_init_smsc911x(void) smsc911x_cfg.gpio_reset = OMAP3EVM_GEN2_ETHR_GPIO_RST; } - gpmc_smsc911x_init(&smsc911x_cfg); + gpmc_smsc911x_info = gpmc_smsc911x_init(&smsc911x_cfg); + if (gpmc_smsc911x_info) + *gpmc_data_cur++ = gpmc_smsc911x_info; + else + pr_err("error: unable to initilaize gpmc smsc911x\n"); } #else @@ -523,6 +562,41 @@ static struct usbhs_omap_board_data usbhs_bdata __initdata = { .reset_gpio_port[2] = -EINVAL }; +/* + * NAND + */ +static struct mtd_partition omap3_evm_nand_partitions[] = { + /* All the partition sizes are listed in terms of NAND block size */ + { + .name = "X-Loader-NAND", + .offset = 0, + .size = 4 * (64 * 2048), + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, + { + .name = "U-Boot-NAND", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ + .size = 10 * (64 * 2048), + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, + { + .name = "Boot Env-NAND", + + .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */ + .size = 6 * (64 * 2048), + }, + { + .name = "Kernel-NAND", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ + .size = 40 * (64 * 2048), + }, + { + .name = "File System - NAND", + .size = MTDPART_SIZ_FULL, + .offset = MTDPART_OFS_APPEND, /* Offset = 0x780000 */ + }, +}; + #ifdef CONFIG_OMAP_MUX static struct omap_board_mux omap35x_board_mux[] __initdata = { OMAP3_MUX(SYS_NIRQ, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP | @@ -630,6 +704,8 @@ static struct regulator_consumer_supply dummy_supplies[] = { static void __init omap3_evm_init(void) { + struct omap_nand_platform_data *nand_data; + omap3_evm_get_revision(); regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); @@ -681,6 +757,23 @@ static void __init omap3_evm_init(void) omap3evm_init_smsc911x(); omap3_evm_display_init(); omap3_evm_wl12xx_init(); + /* NAND */ + nand_data = omap_nand_init(omap3_evm_nand_partitions, + ARRAY_SIZE(omap3_evm_nand_partitions), + 0, NAND_BUSWIDTH_16, nand_default_timings); +/* nand_data->xfer_type = NAND_OMAP_PREFETCH_IRQ; + */ if (nand_data != NULL) { + *gpmc_data_cur = gpmc_nand_init(nand_data); + (*gpmc_data_cur++)->is_nand = true; + } else + pr_err("omap_nand_init() failed\n"); + + + gpmc_data.fclk_period = gpmc_get_fclk_period(); + gpmc_data.irq_start = OMAP_GPMC_IRQ_BASE; + gpmc_data.num_irq = OMAP_GPMC_NR_IRQS; + + platform_device_register(&gpmc_device); } MACHINE_START(OMAP3EVM, "OMAP3 EVM")