Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222011 > unrolled thread

[PATCH 09/21] ARM: davinci: Add set dma_mask to eDMA devices

Started byPeter Ujfalusi <peter.ujfalusi@ti.com>
First post2015-09-10 10:40 +0200
Last post2015-09-10 11:20 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 09/21] ARM: davinci: Add set dma_mask to eDMA devices Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-09-10 10:40 +0200
    Re: [PATCH 09/21] ARM: davinci: Add set dma_mask to eDMA devices Arnd Bergmann <arnd@arndb.de> - 2015-09-10 10:50 +0200
      Re: [PATCH 09/21] ARM: davinci: Add set dma_mask to eDMA devices Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-09-10 11:20 +0200

#1222011 — [PATCH 09/21] ARM: davinci: Add set dma_mask to eDMA devices

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2015-09-10 10:40 +0200
Subject[PATCH 09/21] ARM: davinci: Add set dma_mask to eDMA devices
Message-ID<q75yH-4zn-35@gated-at.bofh.it>
The upcoming change to merge the arch/arm/common/edma.c into
drivers/dma/edma.c will need this change when booting daVinci devices in
no DT mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/mach-davinci/devices-da8xx.c | 8 ++++++++
 arch/arm/mach-davinci/dm355.c         | 8 +++++++-
 arch/arm/mach-davinci/dm644x.c        | 8 +++++++-
 arch/arm/mach-davinci/dm646x.c        | 8 +++++++-
 4 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 9ae049ae816a..495e9293ed2a 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -213,21 +213,29 @@ static struct resource da850_edma1_resources[] = {
 	},
 };
 
+static u64 da8xx_edma0_dmamask = DMA_BIT_MASK(32);
+
 static struct platform_device da8xx_edma0_device = {
 	.name		= "edma",
 	.id		= 0,
 	.dev = {
 		.platform_data = &da8xx_edma0_pdata,
+		.dma_mask = &da8xx_edma0_dmamask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
 	},
 	.num_resources	= ARRAY_SIZE(da8xx_edma0_resources),
 	.resource	= da8xx_edma0_resources,
 };
 
+static u64 da850_edma1_dmamask = DMA_BIT_MASK(32);
+
 static struct platform_device da850_edma1_device = {
 	.name		= "edma",
 	.id		= 1,
 	.dev = {
 		.platform_data = &da850_edma1_pdata,
+		.dma_mask = &da850_edma1_dmamask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
 	},
 	.num_resources	= ARRAY_SIZE(da850_edma1_resources),
 	.resource	= da850_edma1_resources,
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index a50bb9c66952..0f8c0ab48872 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -613,10 +613,16 @@ static struct resource edma_resources[] = {
 	/* not using (or muxing) TC*_ERR */
 };
 
+static u64 dm355_edma_dmamask = DMA_BIT_MASK(32);
+
 static struct platform_device dm355_edma_device = {
 	.name			= "edma",
 	.id			= 0,
-	.dev.platform_data	= &dm355_edma_pdata,
+	.dev = {
+		.platform_data	= &dm355_edma_pdata,
+		.dma_mask	= &dm355_edma_dmamask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
+	},
 	.num_resources		= ARRAY_SIZE(edma_resources),
 	.resource		= edma_resources,
 };
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index d759ca8e58e8..fc8950e5a9a0 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -542,10 +542,16 @@ static struct resource edma_resources[] = {
 	/* not using TC*_ERR */
 };
 
+static u64 dm644x_edma_dmamask = DMA_BIT_MASK(32);
+
 static struct platform_device dm644x_edma_device = {
 	.name			= "edma",
 	.id			= 0,
-	.dev.platform_data	= &dm644x_edma_pdata,
+	.dev = {
+		.platform_data	= &dm644x_edma_pdata,
+		.dma_mask	= &dm644x_edma_dmamask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
+	},
 	.num_resources		= ARRAY_SIZE(edma_resources),
 	.resource		= edma_resources,
 };
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 219ebc8f674a..77df905949bc 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -589,10 +589,16 @@ static struct resource edma_resources[] = {
 	/* not using TC*_ERR */
 };
 
+static u64 dm646x_edma_dmamask = DMA_BIT_MASK(32);
+
 static struct platform_device dm646x_edma_device = {
 	.name			= "edma",
 	.id			= 0,
-	.dev.platform_data	= &dm646x_edma_pdata,
+	.dev = {
+		.platform_data	= &dm646x_edma_pdata,
+		.dma_mask	= &dm646x_edma_dmamask,
+		.coherent_dma_mask = DMA_BIT_MASK(32),
+	},
 	.num_resources		= ARRAY_SIZE(edma_resources),
 	.resource		= edma_resources,
 };
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1222027

FromArnd Bergmann <arnd@arndb.de>
Date2015-09-10 10:50 +0200
Message-ID<q75Im-4L3-29@gated-at.bofh.it>
In reply to#1222011
On Thursday 10 September 2015 11:37:38 Peter Ujfalusi wrote:
> +static u64 da8xx_edma0_dmamask = DMA_BIT_MASK(32);
> +
>  static struct platform_device da8xx_edma0_device = {
>         .name           = "edma",
>         .id             = 0,
>         .dev = {
>                 .platform_data = &da8xx_edma0_pdata,
> +               .dma_mask = &da8xx_edma0_dmamask,
> +               .coherent_dma_mask = DMA_BIT_MASK(32),
>         },
>         .num_resources  = ARRAY_SIZE(da8xx_edma0_resources),
>         .resource       = da8xx_edma0_resources,
>  };

While this is technically correct for all I can tell, could you
convert it to use __initconst platform_device_info and
platform_device_register_full() instead?

statically declaring platform_devices has been frowned upon for a long
time (even though a lot of arm platforms still do it), and statically
declaring the dma mask seems worse to me (and yes, I realize we also
do that elsewhere).

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1222050

FromPeter Ujfalusi <peter.ujfalusi@ti.com>
Date2015-09-10 11:20 +0200
Message-ID<q76bn-5y3-3@gated-at.bofh.it>
In reply to#1222027
On 09/10/2015 11:45 AM, Arnd Bergmann wrote:
> On Thursday 10 September 2015 11:37:38 Peter Ujfalusi wrote:
>> +static u64 da8xx_edma0_dmamask = DMA_BIT_MASK(32);
>> +
>>  static struct platform_device da8xx_edma0_device = {
>>         .name           = "edma",
>>         .id             = 0,
>>         .dev = {
>>                 .platform_data = &da8xx_edma0_pdata,
>> +               .dma_mask = &da8xx_edma0_dmamask,
>> +               .coherent_dma_mask = DMA_BIT_MASK(32),
>>         },
>>         .num_resources  = ARRAY_SIZE(da8xx_edma0_resources),
>>         .resource       = da8xx_edma0_resources,
>>  };
> 
> While this is technically correct for all I can tell, could you
> convert it to use __initconst platform_device_info and
> platform_device_register_full() instead?

Yes, I can do that for the eDMAs. I was also thought about this, but looking
around the mach-davinci, I thought to stick with this mode.

> statically declaring platform_devices has been frowned upon for a long
> time (even though a lot of arm platforms still do it), and statically
> declaring the dma mask seems worse to me (and yes, I realize we also
> do that elsewhere).

Will be part of v2.

-- 
Péter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web