From patchwork Thu Feb 11 05:19:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vimal singh X-Patchwork-Id: 78637 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1B5JbP9028367 for ; Thu, 11 Feb 2010 05:19:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751170Ab0BKFTg (ORCPT ); Thu, 11 Feb 2010 00:19:36 -0500 Received: from mail-bw0-f219.google.com ([209.85.218.219]:64079 "EHLO mail-bw0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077Ab0BKFTg (ORCPT ); Thu, 11 Feb 2010 00:19:36 -0500 Received: by bwz19 with SMTP id 19so21019bwz.28 for ; Wed, 10 Feb 2010 21:19:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:cc:content-type; bh=ijh1ToEPi5ahCMiNlHSQ3kZl5TQaKq3aGF9ij4JLKYQ=; b=EbAGt9V7isMiEEu3mLBquj3Ecab3sw9vO6YZV5WTLqyr1DfTLwsWMLS+x2qaMrPYct h+EZlffegOhGipUH2VcvBJUwhOzAulDgTVhCM0NV9TnVUZ0UA/YQPhHcVeWQ8FTb95JR XhjgO8myK/Xk9eyL250GVHuNNP8r533D8t6I0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; b=wv456GajrF57IGjza3xSmYtEBo2gGvvK6qXUzqcnHkGqBYzUHKzCIIR+JkZtvdgGEE Dj1A0CVViI+JyLRfDzYYh7iilV/qE4jOLMMBhGp+E8JiS5CP0Gx+Mb83nhOSNDJC2ftd QvaW/4JCPFL8f9yvhR/BaGrbPdSFHJR6j3taE= MIME-Version: 1.0 Received: by 10.204.10.151 with SMTP id p23mr847648bkp.80.1265865574661; Wed, 10 Feb 2010 21:19:34 -0800 (PST) From: Vimal Singh Date: Thu, 11 Feb 2010 10:49:14 +0530 Message-ID: Subject: [PATCH v2 1/3] OMAP: ZOOM: Introducing 'board-zoom-flash.c' To: linux-omap@vger.kernel.org Cc: Tony Lindgren Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 11 Feb 2010 05:19:38 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-zoom-flash.c b/arch/arm/mach-omap2/board-zoom-flash.c new file mode 100644 index 0000000..f2328a4 --- /dev/null +++ b/arch/arm/mach-omap2/board-zoom-flash.c @@ -0,0 +1,85 @@ +/* + * board-zoom-flash.c + * + * Copyright (C) 2009 Texas Instruments Inc. + * Vimal Singh + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#if defined(CONFIG_MTD_NAND_OMAP2) || \ + defined(CONFIG_MTD_NAND_OMAP2_MODULE) + +/* Note that all values in this struct are in nanoseconds */ +static struct gpmc_timings nand_timings = { + + .sync_clk = 0, + + .cs_on = 0, + .cs_rd_off = 36, + .cs_wr_off = 36, + + .adv_on = 6, + .adv_rd_off = 24, + .adv_wr_off = 36, + + .we_off = 30, + .oe_off = 48, + + .access = 54, + .rd_cycle = 72, + .wr_cycle = 72, + + .wr_access = 30, + .wr_data_mux_bus = 0, +}; + +/* NAND chip access: 16 bit */ +static struct omap_nand_platform_data zoom_nand_data = { + .nand_setup = NULL, + .gpmc_t = &nand_timings, + .dma_channel = -1, /* disable DMA in OMAP NAND driver */ + .dev_ready = NULL, + .devsize = 1, /* '0' for 8-bit, '1' for 16-bit device */ +}; + +/** + * zoom_flash_init - Identify devices connected to GPMC and register. + * + * @return - void. + */ +void __init zoom_flash_init(struct flash_partitions zoom_nand_parts[], int cs) +{ + u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; + + zoom_nand_data.cs = cs; + zoom_nand_data.parts = zoom_nand_parts[0].parts; + zoom_nand_data.nr_parts = zoom_nand_parts[0].nr_parts; + zoom_nand_data.gpmc_baseaddr = (void *)(gpmc_base_add); + zoom_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add + + GPMC_CS0_BASE + + cs * GPMC_CS_SIZE); + gpmc_nand_init(&zoom_nand_data); +} +#else +void __init zoom_flash_init(struct flash_partitions zoom_nand_parts[], int cs) +{ +} +#endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ + diff --git a/arch/arm/mach-omap2/include/mach/board-zoom.h b/arch/arm/mach-omap2/include/mach/board-zoom.h index c93b29e..f4469d3 100644 --- a/arch/arm/mach-omap2/include/mach/board-zoom.h +++ b/arch/arm/mach-omap2/include/mach/board-zoom.h @@ -1,5 +1,16 @@ /* * Defines for zoom boards */ +#include +#include + +struct flash_partitions { + struct mtd_partition *parts; + int nr_parts; +}; + +#define ZOOM_NAND_CS 0 + +extern void __init zoom_flash_init(struct flash_partitions [], int); extern int __init zoom_debugboard_init(void); extern void __init zoom_peripherals_init(void);