From patchwork Thu Nov 19 14:16:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vimal singh X-Patchwork-Id: 61358 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAJEHPSD004938 for ; Thu, 19 Nov 2009 14:17:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427AbZKSORG (ORCPT ); Thu, 19 Nov 2009 09:17:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753346AbZKSORG (ORCPT ); Thu, 19 Nov 2009 09:17:06 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:64359 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752794AbZKSORD (ORCPT ); Thu, 19 Nov 2009 09:17:03 -0500 Received: by bwz27 with SMTP id 27so2385831bwz.21 for ; Thu, 19 Nov 2009 06:17:08 -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=cpay86McneZyL4EFzYcWTUMzsgyq7bX7ApiHcLGfcY0=; b=BLXI8Sioot0jxwjLBjnO2hyIfry06vChtPn0oIxtIogFdh4BxycrOH4PclJj4nQdoK ExhTMhrE9HCNUXdtE6CN6VXhBXoZjPqn8yu+E8EdwJzn5OJvgoCJzLrEAt5a5PCP5l6Z LXoyS2gT7huHGa+bvbPTeXa06i/rFtg54NiEU= 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=j4n8HnX02VBm5c7KPy58OZBWHwdT7cvltqaD1RAEomJvGdOdoXolRbplfc9+zt64w6 fAMNntUkEYe2/FC9/9HilA0Z7rpgtoJnzcnd6VwApjXjbz+Dwoagq4viAU8uHkMI1Nj8 EJAEfPtyfxJjB6C1xkJXlvP+cPxIoBScMzXTM= MIME-Version: 1.0 Received: by 10.204.151.210 with SMTP id d18mr5886639bkw.203.1258640226887; Thu, 19 Nov 2009 06:17:06 -0800 (PST) From: Vimal Singh Date: Thu, 19 Nov 2009 19:46:43 +0530 Message-ID: Subject: [PATCH-v6 2/4] OMAP3: Add support for NAND on ZOOM/LDP boards To: linux-omap@vger.kernel.org, Linux MTD Cc: Tony Lindgren , vimal singh Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index b0e5b46..c2ca76e 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -62,6 +62,7 @@ obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \ mmc-twl4030.o obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o \ + board-zoom-flash.o \ mmc-twl4030.o obj-$(CONFIG_MACH_OVERO) += board-overo.o \ mmc-twl4030.o @@ -78,10 +79,12 @@ obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ board-rx51-peripherals.o \ mmc-twl4030.o obj-$(CONFIG_MACH_OMAP_ZOOM2) += board-zoom2.o \ + board-zoom-flash.o \ board-zoom-peripherals.o \ mmc-twl4030.o \ board-zoom-debugboard.o obj-$(CONFIG_MACH_OMAP_ZOOM3) += board-zoom3.o \ + board-zoom-flash.o \ board-zoom-peripherals.o \ mmc-twl4030.o \ board-zoom-debugboard.o diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index c062238..8aebdf9 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -42,6 +42,7 @@ #include #include #include +#include #include "mmc-twl4030.h" @@ -385,6 +386,7 @@ static void __init omap_ldp_init(void) ads7846_dev_init(); omap_serial_init(); usb_musb_init(); + zoom_flash_init(); twl4030_mmc_init(mmc); /* link regulators to MMC adapters */ 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..1867d6a --- /dev/null +++ b/arch/arm/mach-omap2/board-zoom-flash.c @@ -0,0 +1,92 @@ +/* + * board-zoom-flash.c + * + * Copyright (C) 2008-09 Texas Instruments Inc. + * + * Modified from mach-omap2/board-2430sdp-flash.c + * Author(s): Vimal Singh + * Rohit Choraria + * + * 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 +#include + +#include + +static struct mtd_partition zoom_nand_partitions[] = { + /* All the partition sizes are listed in terms of NAND block size */ + { + .name = "X-Loader-NAND", + .offset = 0, + .size = 4 * (64 * 2048), /* 512KB, 0x80000 */ + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, + { + .name = "U-Boot-NAND", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ + .size = 10 * (64 * 2048), /* 1.25MB, 0x140000 */ + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, + { + .name = "Boot Env-NAND", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x1c0000 */ + .size = 2 * (64 * 2048), /* 256KB, 0x40000 */ + }, + { + .name = "Kernel-NAND", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x0200000*/ + .size = 240 * (64 * 2048), /* 30M, 0x1E00000 */ + }, + { + .name = "File System - NAND", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x2000000 */ + .size = MTDPART_SIZ_FULL, + }, +}; + +/* NAND chip access: 16 bit */ +static struct omap_nand_platform_data zoom_nand_data = { + .parts = zoom_nand_partitions, + .nr_parts = ARRAY_SIZE(zoom_nand_partitions), + .nand_setup = NULL, + .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(void) +{ + u8 nandcs = GPMC_CS_NUM + 1; + u32 gpmc_base_add = OMAP34XX_GPMC_VIRT; + + /* pop nand part */ + nandcs = LDP3430_NAND_CS; + + zoom_nand_data.cs = nandcs; + zoom_nand_data.gpmc_cs_baseaddr = (void *)(gpmc_base_add + + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE); + zoom_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add); + + gpmc_nand_init(&zoom_nand_data); +} + diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index f14baa3..fcc2836 100755 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -264,4 +265,5 @@ void __init zoom_peripherals_init(void) omap_i2c_init(); omap_serial_init(); usb_musb_init(); + zoom_flash_init(); } diff --git a/arch/arm/plat-omap/include/plat/board-zoom.h b/arch/arm/plat-omap/include/plat/board-zoom.h new file mode 100644 index 0000000..8d63f7e --- /dev/null +++ b/arch/arm/plat-omap/include/plat/board-zoom.h @@ -0,0 +1,36 @@ +/* + * board-zoom.h + * + * Hardware definitions for TI OMAP3 LDP/ZOOM2. + * + * Copyright (C) 2008-09 Texas Instruments Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __ASM_ARCH_OMAP_LDP_H +#define __ASM_ARCH_OMAP_LDP_H + +extern void zoom_flash_init(void); + +#define LDP3430_NAND_CS 0 + +#endif /* __ASM_ARCH_OMAP_LDP_H */