From patchwork Fri Jul 17 22:17:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 36117 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6HMJnfY006784 for ; Fri, 17 Jul 2009 22:19:49 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMJiQi028130 for ; Fri, 17 Jul 2009 17:19:49 -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 n6HMJiN2016272 for ; Fri, 17 Jul 2009 17:19:44 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C86F08067B for ; Fri, 17 Jul 2009 17:19:39 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 459968063A for ; Fri, 17 Jul 2009 17:18:09 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n6HMI9HO004865 for ; Fri, 17 Jul 2009 17:18:09 -0500 (CDT) Received: from mail107-sin-R.bigfish.com (mail-sin.bigfish.com [207.46.51.102]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id n6HMI3a7024776 for ; Fri, 17 Jul 2009 17:18:08 -0500 Received: from mail107-sin (localhost.localdomain [127.0.0.1]) by mail107-sin-R.bigfish.com (Postfix) with ESMTP id E7923B600BD for ; Fri, 17 Jul 2009 22:17:47 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh62h) X-Spam-TCS-SCL: 1:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 74.125.92.145; Service: EHS Received: by mail107-sin (MessageSwitch) id 1247869066176812_21244; Fri, 17 Jul 2009 22:17:46 +0000 (UCT) Received: from qw-out-1920.google.com (qw-out-1920.google.com [74.125.92.145]) by mail107-sin.bigfish.com (Postfix) with ESMTP id 7329A638050 for ; Fri, 17 Jul 2009 22:17:45 +0000 (UTC) Received: by qw-out-1920.google.com with SMTP id 14so359731qwa.64 for ; Fri, 17 Jul 2009 15:17:59 -0700 (PDT) Received: by 10.224.28.130 with SMTP id m2mr1145259qac.52.1247869078911; Fri, 17 Jul 2009 15:17:58 -0700 (PDT) Received: from localhost (deeprooted.net [216.254.16.51]) by mx.google.com with ESMTPS id 7sm2276887qwf.9.2009.07.17.15.17.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 17 Jul 2009 15:17:58 -0700 (PDT) From: Kevin Hilman To: linux-arm-kernel@lists.arm.linux.org.uk Date: Fri, 17 Jul 2009 15:17:29 -0700 Message-Id: <1247869060-10719-7-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1247869060-10719-6-git-send-email-khilman@deeprootsystems.com> References: <1247869060-10719-1-git-send-email-khilman@deeprootsystems.com> <1247869060-10719-2-git-send-email-khilman@deeprootsystems.com> <1247869060-10719-3-git-send-email-khilman@deeprootsystems.com> <1247869060-10719-4-git-send-email-khilman@deeprootsystems.com> <1247869060-10719-5-git-send-email-khilman@deeprootsystems.com> <1247869060-10719-6-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 06/17] davinci: dm646x: Add IDE setup 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: Hemant Pedanekar This patch adds platform data and init function for IDE which could be called from board specific file to register IDE device. Note that for 594MHz device the transfer mode is limited to UDMA4 since ideclk rate is less than 100 MHz, which forces udma_mask in palm_bk3710.c to UDMA4, while for 729MHz device, it is UDMA5. Signed-off-by: Hemant Pedanekar Signed-off-by: Kevin Hilman --- arch/arm/mach-davinci/dm646x.c | 32 +++++++++++++++++++++++++++ arch/arm/mach-davinci/include/mach/dm646x.h | 3 ++ 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 50f01e0..3516f76 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -600,6 +600,32 @@ static struct platform_device dm646x_edma_device = { .resource = edma_resources, }; +static struct resource ide_resources[] = { + { + .start = DM646X_ATA_REG_BASE, + .end = DM646X_ATA_REG_BASE + 0x7ff, + .flags = IORESOURCE_MEM, + }, + { + .start = IRQ_DM646X_IDE, + .end = IRQ_DM646X_IDE, + .flags = IORESOURCE_IRQ, + }, +}; + +static u64 ide_dma_mask = DMA_BIT_MASK(32); + +static struct platform_device ide_dev = { + .name = "palm_bk3710", + .id = -1, + .resource = ide_resources, + .num_resources = ARRAY_SIZE(ide_resources), + .dev = { + .dma_mask = &ide_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, +}; + static struct resource dm646x_mcasp0_resources[] = { { .name = "mcasp0", @@ -769,6 +795,12 @@ static struct davinci_soc_info davinci_soc_info_dm646x = { .sram_len = SZ_32K, }; +void __init dm646x_init_ide() +{ + davinci_cfg_reg(DM646X_ATAEN); + platform_device_register(&ide_dev); +} + void __init dm646x_init_mcasp0(struct snd_platform_data *pdata) { dm646x_mcasp0_device.dev.platform_data = pdata; diff --git a/arch/arm/mach-davinci/include/mach/dm646x.h b/arch/arm/mach-davinci/include/mach/dm646x.h index 0585484..feb1e02 100644 --- a/arch/arm/mach-davinci/include/mach/dm646x.h +++ b/arch/arm/mach-davinci/include/mach/dm646x.h @@ -22,7 +22,10 @@ #define DM646X_EMAC_MDIO_OFFSET (0x4000) #define DM646X_EMAC_CNTRL_RAM_SIZE (0x2000) +#define DM646X_ATA_REG_BASE (0x01C66000) + void __init dm646x_init(void); +void __init dm646x_init_ide(void); void __init dm646x_init_mcasp0(struct snd_platform_data *pdata); void __init dm646x_init_mcasp1(struct snd_platform_data *pdata);