From patchwork Fri Jun 18 05:35:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 56124 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 B0C3FB7D84 for ; Fri, 18 Jun 2010 15:42:24 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OPUJn-0005Wl-Nx; Fri, 18 Jun 2010 05:40:44 +0000 Received: from mail-pv0-f177.google.com ([74.125.83.177]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OPUEj-0007xn-L7; Fri, 18 Jun 2010 05:35:31 +0000 Received: by mail-pv0-f177.google.com with SMTP id 21so355484pvc.36 for ; Thu, 17 Jun 2010 22:35:29 -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=YRpkuMAVaGPyQdNVtBPlFr15tTmCB6q/RTVn21DsYA8=; b=w4q+BY5pUqUF8qBLZNVCE6Z1t2QMo5xBxUs/Ky3DUY72ViaW26ZTW5Khq4EqvoNZxu Rf192wnEqNVvw3VIbkz8yuHeZWTdKtajM3NcRA1SprB0b2JtgI5P3KcXEaG4AdPXYqSe 0gMaw9CujzTfNElfsINGv8fbXr5oD2pnm2ScQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=pmPCHogZeDiHh8sSZJWVrQpLdIGtovpybDSGGCdq5e+cnmS4sWHVIV4srLvDRFcQ3L fteX5rE1+/cBNzLXEmJHnLH9K3o5lZm7z3PSrnadx3sK2IcfDA7+jplR3Gfsh6nCOJyk Gms6aTmaRzaz+SpDtzF6l0Xn/8uaUi3PaGMXo= MIME-Version: 1.0 Received: by 10.142.250.21 with SMTP id x21mr374968wfh.263.1276839329200; Thu, 17 Jun 2010 22:35:29 -0700 (PDT) Received: by 10.142.114.3 with HTTP; Thu, 17 Jun 2010 22:35:29 -0700 (PDT) Date: Fri, 18 Jun 2010 13:35:29 +0800 Message-ID: Subject: [PATCH 15/25] 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-20100618_013530_757865_0408500B X-CRM114-Status: GOOD ( 19.61 ) 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 [74.125.83.177 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 101a60a64c8ba605c742bed19a0d49c0a8be7dfe Mon Sep 17 00:00:00 2001 From: Lei Wen Date: Thu, 3 Jun 2010 16:21:04 +0800 Subject: [PATCH 15/25] mmp: add nand support to mmp2 Signed-off-by: Lei Wen Signed-off-by: Haojian Zhuang --- arch/arm/configs/mmp2_defconfig | 4 +- arch/arm/mach-mmp/include/mach/mmp2.h | 6 ++++ arch/arm/mach-mmp/jasper.c | 52 +++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/arch/arm/configs/mmp2_defconfig b/arch/arm/configs/mmp2_defconfig index 4b55dcb..e63dec3 100644 --- a/arch/arm/configs/mmp2_defconfig +++ b/arch/arm/configs/mmp2_defconfig @@ -469,7 +469,7 @@ CONFIG_MTD_CMDLINE_PARTS=y # # User Modules And Translation Layers # -# CONFIG_MTD_CHAR is not set +CONFIG_MTD_CHAR=y CONFIG_MTD_BLKDEVS=y CONFIG_MTD_BLOCK=y # CONFIG_FTL is not set @@ -525,7 +525,7 @@ CONFIG_MTD_NAND=y # CONFIG_MTD_NAND_GPIO is not set CONFIG_MTD_NAND_IDS=y # CONFIG_MTD_NAND_DISKONCHIP is not set -# CONFIG_MTD_NAND_PXA3xx is not set +CONFIG_MTD_NAND_PXA3xx=y # CONFIG_MTD_NAND_NANDSIM is not set # CONFIG_MTD_NAND_PLATFORM is not set CONFIG_MTD_ONENAND=y diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h index fec220b..d68890b 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 d77dd41..5d055f3 100644 --- a/arch/arm/mach-mmp/jasper.c +++ b/arch/arm/mach-mmp/jasper.c @@ -67,6 +67,57 @@ static unsigned long jasper_pin_config[] __initdata = { PMIC_PMIC_INT | MFP_LPM_EDGE_FALL, }; +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.controller_attrs = PXA3XX_ARBI_EN | PXA3XX_NAKED_CMD_EN + | PXA3XX_DMA_EN | PXA3XX_ADV_TIME_TUNING | PXA3XX_TWO_CHIP_EN; + jasper_nand_info.parts[0] = jasper_nand_partitions; + jasper_nand_info.nr_parts[0] = ARRAY_SIZE(jasper_nand_partitions); + mmp2_add_nand(&jasper_nand_info); +} + static struct regulator_consumer_supply max8649_supply[] = { REGULATOR_SUPPLY("vcc_core", NULL), }; @@ -128,6 +179,7 @@ static void __init jasper_init(void) /* on-chip devices */ mmp2_add_uart(1); mmp2_add_uart(3); + jasper_init_flash(); mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info)); regulator_has_full_constraints();