From patchwork Tue May 1 12:09:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Afzal X-Patchwork-Id: 156077 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 60852B6FAB for ; Tue, 1 May 2012 22:45:04 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SPCQm-0003S7-6m; Tue, 01 May 2012 12:43:48 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SPC9d-000797-3t; Tue, 01 May 2012 12:26:06 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q41CPsQX018766; Tue, 1 May 2012 07:25:54 -0500 Received: from DFLE71.ent.ti.com (dfle71.ent.ti.com [128.247.5.62]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q41CPsEE015732; Tue, 1 May 2012 07:25:54 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle71.ent.ti.com (128.247.5.62) with Microsoft SMTP Server id 14.1.323.3; Tue, 1 May 2012 07:25:54 -0500 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with SMTP id q41CPmM7005728; Tue, 1 May 2012 07:25:48 -0500 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id 93C62158002; Tue, 1 May 2012 17:55:47 +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 q41CPlI18434; Tue, 1 May 2012 17:55:47 +0530 (IST) From: Afzal Mohammed To: , , , , , , , , , , , , , , , , Subject: [PATCH 25/39] ARM: OMAP2+: board 2430sdp: gpmc driver adaptation Date: Tue, 1 May 2012 17:39:03 +0530 Message-ID: X-Mailer: git-send-email 1.7.10 In-Reply-To: References: MIME-Version: 1.0 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.153 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] 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 gpmc code has been converted to driver. Modify the board code to provide gpmc driver with required information. Signed-off-by: Afzal Mohammed --- arch/arm/mach-omap2/board-2430sdp.c | 42 +++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 68679a8..d94ada4 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -46,9 +46,16 @@ #include "hsmmc.h" #include "common-board-devices.h" -#define SDP2430_CS0_BASE 0x04000000 +#define SDP2430_FLASH_CS 0 #define SECONDARY_LCD_GPIO 147 +static struct gpmc_device_pdata *gpmc_device_data[2]; +static struct gpmc_device_pdata **gpmc_cur = gpmc_device_data; + +static struct gpmc_pdata gpmc_data = { + .device_pdata = gpmc_device_data, +}; + static struct mtd_partition sdp2430_partitions[] = { /* bootloader (U-Boot, etc) in first sector */ { @@ -86,24 +93,18 @@ static struct physmap_flash_data sdp2430_flash_data = { .nr_parts = ARRAY_SIZE(sdp2430_partitions), }; -static struct resource sdp2430_flash_resource = { - .start = SDP2430_CS0_BASE, - .end = SDP2430_CS0_BASE + SZ_64M - 1, - .flags = IORESOURCE_MEM, +static struct gpmc_cs_data sdp2430_gpmc_cs_flash_data = { + .cs = SDP2430_FLASH_CS, + .mem_size = SZ_64M, }; -static struct platform_device sdp2430_flash_device = { +static struct gpmc_device_pdata sdp2430_gpmc_flash_device = { .name = "physmap-flash", .id = 0, - .dev = { - .platform_data = &sdp2430_flash_data, - }, - .num_resources = 1, - .resource = &sdp2430_flash_resource, -}; - -static struct platform_device *sdp2430_devices[] __initdata = { - &sdp2430_flash_device, + .pdata = &sdp2430_flash_data, + .pdata_size = sizeof(sdp2430_flash_data), + .cs_data = &sdp2430_gpmc_cs_flash_data, + .num_cs = 1, }; /* LCD */ @@ -181,7 +182,11 @@ static struct omap_smc91x_platform_data board_smc91x_data = { static void __init board_smc91x_init(void) { omap_mux_init_gpio(149, OMAP_PIN_INPUT); - gpmc_smc91x_init(&board_smc91x_data); + *gpmc_cur = gpmc_smc91x_init(&board_smc91x_data); + if (*gpmc_cur) + gpmc_data.num_device++, gpmc_cur++; + else + pr_err("error: unable to initilaize gpmc smsc911x\n"); } #else @@ -276,7 +281,9 @@ static void __init omap_2430sdp_init(void) omap2430_i2c_init(); - platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); + *gpmc_cur++ = &sdp2430_gpmc_flash_device; + gpmc_data.num_device++; + omap_serial_init(); omap_sdrc_init(NULL, NULL); omap_hsmmc_init(mmc); @@ -286,6 +293,7 @@ static void __init omap_2430sdp_init(void) usb_musb_init(NULL); board_smc91x_init(); + omap_init_gpmc(&gpmc_data); /* Turn off secondary LCD backlight */ gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW,