From patchwork Mon Jul 6 21:14:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 34327 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n66LJx9X016965 for ; Mon, 6 Jul 2009 21:20:00 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id n66LJsKR017811 for ; Mon, 6 Jul 2009 16:19:59 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n66LJsk0014865 for ; Mon, 6 Jul 2009 16:19:54 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 2210B80787 for ; Mon, 6 Jul 2009 16:19:15 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 96F2780636 for ; Mon, 6 Jul 2009 16:18:14 -0500 (CDT) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id n66LIEq8014737 for ; Mon, 6 Jul 2009 16:18:14 -0500 (CDT) Received: from mail192-va3-R.bigfish.com (mail-va3.bigfish.com [216.32.180.114]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id n66LI8QM011112 for ; Mon, 6 Jul 2009 16:18:13 -0500 Received: from mail192-va3 (localhost.localdomain [127.0.0.1]) by mail192-va3-R.bigfish.com (Postfix) with ESMTP id 88D331468171 for ; Mon, 6 Jul 2009 21:18:08 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh61h) X-Spam-TCS-SCL: 0:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.216.201; Service: EHS Received: by mail192-va3 (MessageSwitch) id 1246915077715938_11441; Mon, 6 Jul 2009 21:17:57 +0000 (UCT) Received: from mail-px0-f201.google.com (mail-px0-f201.google.com [209.85.216.201]) by mail192-va3.bigfish.com (Postfix) with ESMTP id 8690914C0052 for ; Mon, 6 Jul 2009 21:17:57 +0000 (UTC) Received: by mail-px0-f201.google.com with SMTP id 39so1158123pxi.4 for ; Mon, 06 Jul 2009 14:17:57 -0700 (PDT) Received: by 10.114.211.2 with SMTP id j2mr8143444wag.74.1246915077062; Mon, 06 Jul 2009 14:17:57 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id l30sm11901990waf.35.2009.07.06.14.17.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 06 Jul 2009 14:17:56 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Date: Mon, 6 Jul 2009 14:14:55 -0700 Message-Id: <1246914900-9034-22-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1246914900-9034-21-git-send-email-khilman@deeprootsystems.com> References: <1246914900-9034-1-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-2-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-3-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-4-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-5-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-6-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-7-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-8-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-9-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-10-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-11-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-12-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-13-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-14-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-15-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-16-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-17-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-18-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-19-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-20-git-send-email-khilman@deeprootsystems.com> <1246914900-9034-21-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 21/26] 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+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@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);