From patchwork Fri May 14 06:22:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 52561 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 61ED4B7E80 for ; Fri, 14 May 2010 16:32:41 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1OCoPK-0007Rl-AJ; Fri, 14 May 2010 06:30:02 +0000 Received: from mail-pw0-f49.google.com ([209.85.160.49]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1OCoHl-0001GN-Md; Fri, 14 May 2010 06:22:14 +0000 Received: by pwi3 with SMTP id 3so10463pwi.36 for ; Thu, 13 May 2010 23:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=Lmgw2R2g5LXzPK0BSYBI6XvLcsjR+FaeRWadVj/DXio=; b=pq2MfRkPwM0RAAiKybPFCPGrcUuhxWwfa1tE4F7FAFKKR8P6H8/e3hcKdVE+WhtUAY IdBGI8AK4VPVEvum+87/YIXGWrYX52VjSMWakcyPN+1hRilM6qw8W/oUSZRhaoRcRyDl u2E43xlg95wevwY9mW2MaFmqBrq06twGmrc4Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=h3XInUgGtK+Pbd6sh0azomgQNkFWSKC56+K5NkiJZ/2INlQnK2tnM7KiMbcwctQ45n +TbRcG8MByz2mTJky6jBoe3fLQj4zU+fLt8B6tBcj/ETTeKNf3irNcSYusUX9hOJxRlz gOzKwh6trD60ZY4wnUK7lqoLcPI1oinbmLMrs= MIME-Version: 1.0 Received: by 10.142.209.5 with SMTP id h5mr407955wfg.85.1273818132867; Thu, 13 May 2010 23:22:12 -0700 (PDT) Received: by 10.142.252.16 with HTTP; Thu, 13 May 2010 23:22:12 -0700 (PDT) Date: Fri, 14 May 2010 14:22:12 +0800 Message-ID: Subject: [PATCH 15/20] mmp: add nand support to mmp2 From: Haojian Zhuang To: Marc Kleine-Budde , David Woodhouse , David Woodhouse , linux-mtd@lists.infradead.org, Eric Miao , linux-arm-kernel X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100514_022214_189255_9013C299 X-CRM114-Status: GOOD ( 17.67 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (haojian.zhuang[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 f4f717eb01fa0dc41f450edeb0dd3e3434f739b0 Mon Sep 17 00:00:00 2001 From: Lei Wen Date: Fri, 14 May 2010 13:30:21 +0800 Subject: [PATCH] mmp: add nand support to mmp2 Signed-off-by: Lei Wen Signed-off-by: Haojian Zhuang --- arch/arm/mach-mmp/include/mach/mmp2.h | 6 ++++ arch/arm/mach-mmp/jasper.c | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h index 459f3be..5d706ed 100644 --- a/arch/arm/mach-mmp/include/mach/mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mmp2.h @@ -4,6 +4,7 @@ #include #include #include +#include extern struct pxa_device_desc mmp2_device_uart1; extern struct pxa_device_desc mmp2_device_uart2; @@ -15,6 +16,7 @@ extern struct pxa_device_desc mmp2_device_twsi3; extern struct pxa_device_desc mmp2_device_twsi4; extern struct pxa_device_desc mmp2_device_twsi5; extern struct pxa_device_desc mmp2_device_twsi6; +extern struct pxa_device_desc mmp2_device_nand; static inline int mmp2_add_uart(int id) { @@ -56,5 +58,9 @@ static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data, return pxa_register_device(d, data, sizeof(*data)); } +static inline int mmp2_add_nand(struct pxa3xx_nand_platform_data *data) +{ + return pxa_register_device(&mmp2_device_nand, data, sizeof(*data)); +} #endif /* __ASM_MACH_MMP2_H */ diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c index cfd4d66..80a571e 100644 --- a/arch/arm/mach-mmp/jasper.c +++ b/arch/arm/mach-mmp/jasper.c @@ -58,8 +58,60 @@ static unsigned long jasper_pin_config[] __initdata = { GPIO149_ND_CLE, GPIO112_ND_RDY0, GPIO160_ND_RDY1, + GPIO154_SMC_IRQ, }; +static struct mtd_partition jasper_nand_partitions[] = { + [0] = { + .name = "Bootloader", + .offset = 0, + .size = 0x100000, + .mask_flags = MTD_WRITEABLE, + }, + [1] = { + .name = "Reserve", + .offset = 0x100000, + .size = 0x080000, + }, + [2] = { + .name = "Reserve", + .offset = 0x180000, + .size = 0x800000, + .mask_flags = MTD_WRITEABLE, + }, + [3] = { + .name = "Kernel", + .offset = 0x980000, + .size = 0x300000, + .mask_flags = MTD_WRITEABLE, + }, + [4] = { + .name = "system", + .offset = 0x0c80000, + .size = 0x7000000, + }, + [5] = { + .name = "userdata", + .offset = 0x7c80000, + .size = 0x7000000, + }, + [6] = { + .name = "filesystem", + .offset = 0x0ec80000, + .size = MTDPART_SIZ_FULL, + } +}; + +static struct pxa3xx_nand_platform_data jasper_nand_info; +static void __init jasper_init_flash(void) +{ + jasper_nand_info.parts[0] = jasper_nand_partitions; + jasper_nand_info.nr_parts[0] = ARRAY_SIZE(jasper_nand_partitions); + jasper_nand_info.enable_arbiter = 1; + jasper_nand_info.naked_cmd_support = 1; + mmp2_add_nand(&jasper_nand_info); +} + static void __init jasper_init(void) { mfp_config(ARRAY_AND_SIZE(jasper_pin_config)); @@ -67,6 +119,7 @@ static void __init jasper_init(void) /* on-chip devices */ mmp2_add_uart(1); mmp2_add_uart(3); + jasper_init_flash(); } MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")