From patchwork Fri Aug 5 11:25:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hrishikesh Bhandiwad X-Patchwork-Id: 1038362 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p75BQL8r007727 for ; Fri, 5 Aug 2011 11:26:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755855Ab1HEL0C (ORCPT ); Fri, 5 Aug 2011 07:26:02 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:57415 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753914Ab1HEL0A (ORCPT ); Fri, 5 Aug 2011 07:26:00 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p75BPoir017393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Aug 2011 06:25:52 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p75BPnro007231; Fri, 5 Aug 2011 16:55:50 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 8.3.106.1; Fri, 5 Aug 2011 16:55:49 +0530 Received: from localhost.localdomain (dbdp20.itg.ti.com [172.24.170.38]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p75BPnmZ018070; Fri, 5 Aug 2011 16:55:49 +0530 (IST) From: Hrishikesh Bhandiwad To: , , CC: Hrishikesh Bhandiwad Subject: [PATCH] AM3517: NAND: Adding NAND support and specifying NAND partitions. Date: Fri, 5 Aug 2011 16:55:49 +0530 Message-ID: <1312543549-31869-1-git-send-email-hrishikesh.b@ti.com> X-Mailer: git-send-email 1.6.2.4 MIME-Version: 1.0 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 (demeter1.kernel.org [140.211.167.41]); Fri, 05 Aug 2011 11:26:52 +0000 (UTC) This patch adds the NAND support on AM3517 platform and creates the partitions. Referred to file: arch/arm/mach-omap2/board-omap3beagle.c Signed-off-by: Hrishikesh Bhandiwad --- arch/arm/mach-omap2/board-am3517evm.c | 38 +++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 63af417..dceb996 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include @@ -39,6 +41,7 @@ #include "mux.h" #include "control.h" +#include "common-board-devices.h" #define AM35XX_EVM_MDIO_FREQUENCY (1000000) @@ -460,6 +463,37 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata) static struct omap_board_config_kernel am3517_evm_config[] __initdata = { }; +static struct mtd_partition am3517_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 void __init am3517_evm_init(void) { omap_board_config = am3517_evm_config; @@ -473,6 +507,10 @@ static void __init am3517_evm_init(void) /* Configure GPIO for EHCI port */ omap_mux_init_gpio(57, OMAP_PIN_OUTPUT); usbhs_init(&usbhs_bdata); + /*NAND*/ + omap_nand_flash_init(NAND_BUSWIDTH_16, am3517_nand_partitions, + ARRAY_SIZE(am3517_nand_partitions)); + am3517_evm_hecc_init(&am3517_evm_hecc_pdata); /* DSS */ am3517_evm_display_init();