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: 38836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F0332B7B7C for ; Fri, 20 Nov 2009 01:18:50 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NB7ow-0006VL-Qb; Thu, 19 Nov 2009 14:17:14 +0000 Received: from mail-bw0-f212.google.com ([209.85.218.212]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NB7oq-0006SU-UI for linux-mtd@lists.infradead.org; Thu, 19 Nov 2009 14:17:13 +0000 Received: by bwz4 with SMTP id 4so2748170bwz.2 for ; Thu, 19 Nov 2009 06:17:07 -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 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20091119_091709_293768_09B98185 X-CRM114-Status: GOOD ( 23.51 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- _SUMMARY_ Cc: Tony Lindgren , vimal singh X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 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 From 43df1ee9e29d454100e59ee4902db157072b81b6 Mon Sep 17 00:00:00 2001 From: Vimal Singh Date: Thu, 19 Nov 2009 14:37:44 +0530 Subject: [PATCH] OMAP3: Add support for NAND on ZOOM/LDP boards Adding NAND support for ZOOM2/3 and LDP board. I have tested it for ZOOM2 boards. Someone can verify it for LDP and ZOOM3 boards, hopefully it should not have any problem. The size of the U-Boot environment partition was increased to 1.25MB. Vikram: Changed ldp name to zoom. Future boards will be called Zoom2/3/4 etc. LDP is a Zoom1. Somhow the LDP name got stuck to that. Signed-off-by: Vimal Singh Cc: Vikram Pandita Cc: Tony Lindgren --- arch/arm/mach-omap2/Makefile | 3 + arch/arm/mach-omap2/board-ldp.c | 2 + arch/arm/mach-omap2/board-zoom-flash.c | 92 ++++++++++++++++++++++++++ arch/arm/mach-omap2/board-zoom-peripherals.c | 2 + arch/arm/plat-omap/include/plat/board-zoom.h | 36 ++++++++++ 5 files changed, 135 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/board-zoom-flash.c create mode 100644 arch/arm/plat-omap/include/plat/board-zoom.h 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 */