From patchwork Tue Apr 13 17:37:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sukumar Ghorai X-Patchwork-Id: 92220 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 o3DHbYfL005005 for ; Tue, 13 Apr 2010 17:37:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751983Ab0DMRhc (ORCPT ); Tue, 13 Apr 2010 13:37:32 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:56852 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751316Ab0DMRhb (ORCPT ); Tue, 13 Apr 2010 13:37:31 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o3DHbS32011044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 13 Apr 2010 12:37:31 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o3DHbQWT021548; Tue, 13 Apr 2010 23:07:27 +0530 (IST) From: Sukumar Ghorai To: linux-omap@vger.kernel.org Cc: Sukumar Ghorai , Vimal Singh Subject: [PATCH v3 1/8] omap3: zoom: Introducing 'board-zoom-flash.c' Date: Tue, 13 Apr 2010 23:07:13 +0530 Message-Id: <1271180246-31779-2-git-send-email-s-ghorai@ti.com> X-Mailer: git-send-email 1.5.4.7 In-Reply-To: <1271180246-31779-1-git-send-email-s-ghorai@ti.com> References: <1271180246-31779-1-git-send-email-s-ghorai@ti.com> 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]); Tue, 13 Apr 2010 17:37:34 +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..55e173b --- /dev/null +++ b/arch/arm/mach-omap2/board-zoom-flash.c @@ -0,0 +1,82 @@ +/* + * 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 = 3, /* 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);