From patchwork Fri Jul 17 22:12:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 36113 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6HMIXmI006574 for ; Fri, 17 Jul 2009 22:18:33 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMGqaY022217; Fri, 17 Jul 2009 17:16:57 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id n6HMGqqw022988; Fri, 17 Jul 2009 17:16:52 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C50CB80638; Fri, 17 Jul 2009 17:16:41 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 116538062E for ; Fri, 17 Jul 2009 17:13:40 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id n6HMDdfg003274 for ; Fri, 17 Jul 2009 17:13:39 -0500 (CDT) Received: from mail69-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.112]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMDYJ3023883 for ; Fri, 17 Jul 2009 17:13:39 -0500 Received: from mail69-tx2 (localhost.localdomain [127.0.0.1]) by mail69-tx2-R.bigfish.com (Postfix) with ESMTP id B189C15E8348 for ; Fri, 17 Jul 2009 22:13:34 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh61h) X-Spam-TCS-SCL: 0:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 74.125.92.148; Service: EHS Received: by mail69-tx2 (MessageSwitch) id 1247868811913834_15586; Fri, 17 Jul 2009 22:13:31 +0000 (UCT) Received: from qw-out-1920.google.com (qw-out-1920.google.com [74.125.92.148]) by mail69-tx2.bigfish.com (Postfix) with ESMTP id C07EF1B7805A for ; Fri, 17 Jul 2009 22:13:31 +0000 (UTC) Received: by qw-out-1920.google.com with SMTP id 14so358960qwa.64 for ; Fri, 17 Jul 2009 15:13:31 -0700 (PDT) Received: by 10.224.74.18 with SMTP id s18mr1106162qaj.293.1247868811611; Fri, 17 Jul 2009 15:13:31 -0700 (PDT) Received: from localhost (deeprooted.net [216.254.16.51]) by mx.google.com with ESMTPS id 7sm2388109qwb.10.2009.07.17.15.13.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Jul 2009 15:13:31 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Date: Fri, 17 Jul 2009 15:12:32 -0700 Message-Id: <1247868758-10423-19-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1247868758-10423-18-git-send-email-khilman@deeprootsystems.com> References: <1247868758-10423-1-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-2-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-3-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-4-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-5-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-6-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-7-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-8-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-9-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-10-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-11-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-12-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-13-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-14-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-15-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-16-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-17-git-send-email-khilman@deeprootsystems.com> <1247868758-10423-18-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 18/24] davinci: dm365: add NAND support to EVM board X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Sandeep Paulraj Signed-off-by: Sandeep Paulraj Signed-off-by: Kevin Hilman --- arch/arm/mach-davinci/board-dm365-evm.c | 84 +++++++++++++++++++++++++++++++ 1 files changed, 84 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index e62d1ab..3675e84 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -20,6 +20,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -34,10 +37,84 @@ #include #include #include +#include + +#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01d10000 +#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 #define DM365_EVM_PHY_MASK (0x2) #define DM365_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ +/* NOTE: this is geared for the standard config, with a socketed + * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you + * swap chips with a different block size, partitioning will + * need to be changed. This NAND chip MT29F16G08FAA is the default + * NAND shipped with the Spectrum Digital DM365 EVM + */ +#define NAND_BLOCK_SIZE SZ_128K + +static struct mtd_partition davinci_nand_partitions[] = { + { + /* UBL (a few copies) plus U-Boot */ + .name = "bootloader", + .offset = 0, + .size = 28 * NAND_BLOCK_SIZE, + .mask_flags = MTD_WRITEABLE, /* force read-only */ + }, { + /* U-Boot environment */ + .name = "params", + .offset = MTDPART_OFS_APPEND, + .size = 2 * NAND_BLOCK_SIZE, + .mask_flags = 0, + }, { + .name = "kernel", + .offset = MTDPART_OFS_APPEND, + .size = SZ_4M, + .mask_flags = 0, + }, { + .name = "filesystem1", + .offset = MTDPART_OFS_APPEND, + .size = SZ_512M, + .mask_flags = 0, + }, { + .name = "filesystem2", + .offset = MTDPART_OFS_APPEND, + .size = MTDPART_SIZ_FULL, + .mask_flags = 0, + } + /* two blocks with bad block table (and mirror) at the end */ +}; + +static struct davinci_nand_pdata davinci_nand_data = { + .mask_chipsel = BIT(14), + .parts = davinci_nand_partitions, + .nr_parts = ARRAY_SIZE(davinci_nand_partitions), + .ecc_mode = NAND_ECC_HW, + .options = NAND_USE_FLASH_BBT, +}; + +static struct resource davinci_nand_resources[] = { + { + .start = DM365_ASYNC_EMIF_DATA_CE0_BASE, + .end = DM365_ASYNC_EMIF_DATA_CE0_BASE + SZ_32M - 1, + .flags = IORESOURCE_MEM, + }, { + .start = DM365_ASYNC_EMIF_CONTROL_BASE, + .end = DM365_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct platform_device davinci_nand_device = { + .name = "davinci_nand", + .id = 0, + .num_resources = ARRAY_SIZE(davinci_nand_resources), + .resource = davinci_nand_resources, + .dev = { + .platform_data = &davinci_nand_data, + }, +}; + static struct at24_platform_data eeprom_info = { .byte_len = (256*1024) / 8, .page_size = 64, @@ -122,6 +199,10 @@ static void __init evm_init_i2c(void) i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info)); } +static struct platform_device *dm365_evm_devices[] __initdata = { + &davinci_nand_device, +}; + static struct davinci_uart_config uart_config __initdata = { .enabled_uarts = (1 << 0), }; @@ -135,6 +216,9 @@ static __init void dm365_evm_init(void) { struct davinci_soc_info *soc_info = &davinci_soc_info; + platform_add_devices(dm365_evm_devices, + ARRAY_SIZE(dm365_evm_devices)); + evm_init_i2c(); davinci_serial_init(&uart_config);