From patchwork Tue May 10 11:41:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan DE FARIA X-Patchwork-Id: 774072 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4ABgmNG013965 for ; Tue, 10 May 2011 11:42:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753870Ab1EJLmq (ORCPT ); Tue, 10 May 2011 07:42:46 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:38061 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753264Ab1EJLmp (ORCPT ); Tue, 10 May 2011 07:42:45 -0400 Received: by wwa36 with SMTP id 36so6773950wwa.1 for ; Tue, 10 May 2011 04:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer; bh=H9+DZ+ybizxztDKQPPvl+wKfrA8hqysMgGGntKbuoiI=; b=lr5NVTMMvH+glfrW64nll5nJIGHhkxQ8IGmyR7gr5dyOsxx0OiiGEOWkI30SHuXQfh bPkRxFrGyUi0sYS/IcZKlhT3w8rI9GKeg01brQWTaRKjMofNbLbEEqbO8VDUSHPU7YeW ThdpI2C2TDQPkSZfEKGZiqv0iFU02wF1JFEr0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=mImBU2aAKACqDamwyGhF7DC+9iEWukBXSmkOrkWSY7w/osZdCDbXExw9MwFL7PMhCr HQ2giHOqXQEcc3aX3hoKt0eN6job5OIp9RGqh87OIrD1bqF+P6HqhKMnXUYpVO5l10nY 13Z7T1kR4CLWkEeq1BYs0p+YXX4+YUIOHjCd8= Received: by 10.216.142.224 with SMTP id i74mr2295473wej.3.1305027764654; Tue, 10 May 2011 04:42:44 -0700 (PDT) Received: from localhost.localdomain ([213.144.218.64]) by mx.google.com with ESMTPS id m84sm2673003weq.36.2011.05.10.04.42.41 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 10 May 2011 04:42:43 -0700 (PDT) From: Bryan DE FARIA To: linux-omap@vger.kernel.org Cc: Bryan DE FARIA , tony@atomide.com, jjhiblot@adetelgroup.com Subject: [PATCH] omap3evm: add support for nand Date: Tue, 10 May 2011 13:41:58 +0200 Message-Id: <1305027718-18998-1-git-send-email-bdefaria@adeneo-embedded.com> X-Mailer: git-send-email 1.7.4.1 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.6 (demeter2.kernel.org [140.211.167.43]); Tue, 10 May 2011 11:42:48 +0000 (UTC) This patch adds a basic nand support for the omap3evm. Signed-off-by: Bryan DE FARIA --- arch/arm/mach-omap2/board-omap3evm.c | 38 ++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 5066b0b..6b5b5e1 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -30,6 +30,8 @@ #include #include +#include + #include #include #include @@ -46,6 +48,7 @@ #include #include #include +#include #include "mux.h" #include "sdram-micron-mt46h32m32lf-6.h" @@ -69,6 +72,8 @@ #define OMAP3EVM_GEN1_ETHR_GPIO_RST 64 #define OMAP3EVM_GEN2_ETHR_GPIO_RST 7 +#define NAND_BLOCK_SIZE SZ_128K + static u8 omap3_evm_version; u8 get_omap3_evm_rev(void) @@ -315,6 +320,37 @@ static struct omap_dss_board_info omap3_evm_dss_data = { .default_device = &omap3_evm_lcd_device, }; +static struct mtd_partition omap3evm_nand_partitions[] = { + /* All the partition sizes are listed in terms of NAND block size */ + { + .name = "X-Loader", + .offset = 0, + .size = 4 * NAND_BLOCK_SIZE, + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, + { + .name = "U-Boot", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */ + .size = 15 * NAND_BLOCK_SIZE, + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, + { + .name = "U-Boot Env", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */ + .size = 1 * NAND_BLOCK_SIZE, + }, + { + .name = "Kernel", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */ + .size = 32 * NAND_BLOCK_SIZE, + }, + { + .name = "File System", + .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */ + .size = MTDPART_SIZ_FULL, + }, +}; + static struct regulator_consumer_supply omap3evm_vmmc1_supply = { .supply = "vmmc", }; @@ -766,6 +802,8 @@ static void __init omap3_evm_init(void) usb_musb_init(&musb_board_data); usbhs_init(&usbhs_bdata); omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL); + omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions, + ARRAY_SIZE(omap3evm_nand_partitions)); omap3evm_init_smsc911x(); omap3_evm_display_init();