From patchwork Thu Jul 9 14:13:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Pedanekar X-Patchwork-Id: 34815 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 n69EErf6015222 for ; Thu, 9 Jul 2009 14:14:53 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n69EDRco013462; Thu, 9 Jul 2009 09:13:32 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id n69EDQE4014090; Thu, 9 Jul 2009 09:13:26 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id A802680627; Thu, 9 Jul 2009 09:13:25 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp31.itg.ti.com (dbdp31.itg.ti.com [172.24.170.98]) by linux.omap.com (Postfix) with ESMTP id 2E8D480626 for ; Thu, 9 Jul 2009 09:13:23 -0500 (CDT) Received: from psplinux051.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id n69EDKjC029103; Thu, 9 Jul 2009 19:43:21 +0530 (IST) Received: from psplinux051.india.ti.com (localhost [127.0.0.1]) by psplinux051.india.ti.com (8.13.1/8.13.1) with ESMTP id n69EDKl5016405; Thu, 9 Jul 2009 19:43:20 +0530 Received: (from a0393588@localhost) by psplinux051.india.ti.com (8.13.1/8.13.1/Submit) id n69EDKh4016402; Thu, 9 Jul 2009 19:43:20 +0530 From: Hemant Pedanekar To: davinci-linux-open-source@linux.davincidsp.com Date: Thu, 9 Jul 2009 19:43:20 +0530 Message-Id: <1247148800-16364-1-git-send-email-hemantp@ti.com> X-Mailer: git-send-email 1.6.2.4 Cc: Subject: [PATCH v2 1/2] 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@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com 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 --- 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 7e2c036..40512b9 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -596,6 +596,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", @@ -765,6 +791,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);