diff mbox

[v2,1/2] davinci: dm646x: Add IDE setup

Message ID 1247148800-16364-1-git-send-email-hemantp@ti.com (mailing list archive)
State Accepted
Headers show

Commit Message

Hemant Pedanekar July 9, 2009, 2:13 p.m. UTC
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 <hemantp@ti.com>
---
 arch/arm/mach-davinci/dm646x.c              |   32 +++++++++++++++++++++++++++
 arch/arm/mach-davinci/include/mach/dm646x.h |    3 ++
 2 files changed, 35 insertions(+), 0 deletions(-)

Comments

Kevin Hilman July 15, 2009, 11:19 p.m. UTC | #1
Hemant Pedanekar <hemantp@ti.com> writes:

> 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 <hemantp@ti.com>

Thanks, pushing to davinci git.

Kevin

> ---
>  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);
>  
> -- 
> 1.6.2.4
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
diff mbox

Patch

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);