diff mbox

OMAP: sDMA: DMA channel reservation using bootargs

Message ID EAF47CD23C76F840A9E7FCE10091EFAB02A3E3D868@dbde02.ent.ti.com (mailing list archive)
State Accepted
Commit c94500eeeafe4b66c690abd96044340b2e5372e7
Delegated to: Tony Lindgren
Headers show

Commit Message

Santosh Shilimkar Feb. 4, 2009, 9:08 a.m. UTC
Tony,
Here is the first patch as promised.

From: Santosh Shilimkar <santosh.shilimkar@ti.com>

    This patch set up a cmdline option for omap dma for masking the
    available channels. It is needed since the OMAP DMA is a system wide
    resource and can be used by another software apart from the kernel.

    To reserve the omap SDMA channels for kernel dma usage, use cmdline
    bootarg "omap_dma_reserve_ch=". The valid range is 1 to 32.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked By: Nishant Kamat <nskamat@ti.com>
cc: Tony Lindgren <tony@atomide.com>
---
 arch/arm/plat-omap/dma.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletion(-)


Regards,
Santosh
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Santosh Shilimkar Feb. 9, 2009, 11:40 a.m. UTC | #1
Tony,
Did you happen to have a look at these couple of patches ?
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org 
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of 
> Shilimkar, Santosh
> Sent: Wednesday, February 04, 2009 2:39 PM
> To: Tony Lindgren
> Cc: linux-omap@vger.kernel.org
> Subject: [PATCH] OMAP: sDMA: DMA channel reservation using bootargs
> 
> Tony,
> Here is the first patch as promised.
> 
> From: Santosh Shilimkar <santosh.shilimkar@ti.com>
> 
>     This patch set up a cmdline option for omap dma for masking the
>     available channels. It is needed since the OMAP DMA is a 
> system wide
>     resource and can be used by another software apart from 
> the kernel.
> 
>     To reserve the omap SDMA channels for kernel dma usage, 
> use cmdline
>     bootarg "omap_dma_reserve_ch=". The valid range is 1 to 32.
> 
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Acked By: Nishant Kamat <nskamat@ti.com>
> cc: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/plat-omap/dma.c |   20 +++++++++++++++++++-
>  1 files changed, 19 insertions(+), 1 deletion(-)
> 
> Index: omapkernel/arch/arm/plat-omap/dma.c
> ===================================================================
> --- omapkernel.orig/arch/arm/plat-omap/dma.c	2009-02-04 
> 12:11:55.779687209 +0530
> +++ omapkernel/arch/arm/plat-omap/dma.c	2009-02-04 
> 14:05:32.971853579 +0530
> @@ -131,6 +131,7 @@ static struct dma_link_info *dma_linked_
>  
>  static int dma_lch_count;
>  static int dma_chan_count;
> +static int omap_dma_reserve_channels;
>  
>  static spinlock_t dma_chan_lock;
>  static struct omap_dma_lch *dma_chan;
> @@ -2409,6 +2410,10 @@ static int __init omap_init_dma(void)
>  		return -ENODEV;
>  	}
>  
> +	if (cpu_class_is_omap2() && omap_dma_reserve_channels
> +			&& (omap_dma_reserve_channels <= dma_lch_count))
> +		dma_lch_count = omap_dma_reserve_channels;
> +
>  	dma_chan = kzalloc(sizeof(struct omap_dma_lch) * dma_lch_count,
>  				GFP_KERNEL);
>  	if (!dma_chan)
> @@ -2459,7 +2464,7 @@ static int __init omap_init_dma(void)
>  		u8 revision = dma_read(REVISION) & 0xff;
>  		printk(KERN_INFO "OMAP DMA hardware revision %d.%d\n",
>  		       revision >> 4, revision & 0xf);
> -		dma_chan_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
> +		dma_chan_count = dma_lch_count;
>  	} else {
>  		dma_chan_count = 0;
>  		return 0;
> @@ -2525,4 +2530,17 @@ static int __init omap_init_dma(void)
>  
>  arch_initcall(omap_init_dma);
>  
> +/*
> + * Reserve the omap SDMA channels using cmdline bootarg
> + * "omap_dma_reserve_ch=". The valid range is 1 to 32
> + */
> +static int __init omap_dma_cmdline_reserve_ch(char *str)
> +{
> +	if (get_option(&str, &omap_dma_reserve_channels) != 1)
> +		omap_dma_reserve_channels = 0;
> +	return 1;
> +}
> +
> +__setup("omap_dma_reserve_ch=", omap_dma_cmdline_reserve_ch);
> +
>  
> 
> Regards,
> Santosh
> --
> To unsubscribe from this list: send the line "unsubscribe 
> linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> --
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren Feb. 27, 2009, 7:37 p.m. UTC | #2
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Commit: c94500eeeafe4b66c690abd96044340b2e5372e7

PatchWorks
http://patchwork.kernel.org/patch/5360/

Git
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=c94500eeeafe4b66c690abd96044340b2e5372e7


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: omapkernel/arch/arm/plat-omap/dma.c
===================================================================
--- omapkernel.orig/arch/arm/plat-omap/dma.c	2009-02-04 12:11:55.779687209 +0530
+++ omapkernel/arch/arm/plat-omap/dma.c	2009-02-04 14:05:32.971853579 +0530
@@ -131,6 +131,7 @@  static struct dma_link_info *dma_linked_
 
 static int dma_lch_count;
 static int dma_chan_count;
+static int omap_dma_reserve_channels;
 
 static spinlock_t dma_chan_lock;
 static struct omap_dma_lch *dma_chan;
@@ -2409,6 +2410,10 @@  static int __init omap_init_dma(void)
 		return -ENODEV;
 	}
 
+	if (cpu_class_is_omap2() && omap_dma_reserve_channels
+			&& (omap_dma_reserve_channels <= dma_lch_count))
+		dma_lch_count = omap_dma_reserve_channels;
+
 	dma_chan = kzalloc(sizeof(struct omap_dma_lch) * dma_lch_count,
 				GFP_KERNEL);
 	if (!dma_chan)
@@ -2459,7 +2464,7 @@  static int __init omap_init_dma(void)
 		u8 revision = dma_read(REVISION) & 0xff;
 		printk(KERN_INFO "OMAP DMA hardware revision %d.%d\n",
 		       revision >> 4, revision & 0xf);
-		dma_chan_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
+		dma_chan_count = dma_lch_count;
 	} else {
 		dma_chan_count = 0;
 		return 0;
@@ -2525,4 +2530,17 @@  static int __init omap_init_dma(void)
 
 arch_initcall(omap_init_dma);
 
+/*
+ * Reserve the omap SDMA channels using cmdline bootarg
+ * "omap_dma_reserve_ch=". The valid range is 1 to 32
+ */
+static int __init omap_dma_cmdline_reserve_ch(char *str)
+{
+	if (get_option(&str, &omap_dma_reserve_channels) != 1)
+		omap_dma_reserve_channels = 0;
+	return 1;
+}
+
+__setup("omap_dma_reserve_ch=", omap_dma_cmdline_reserve_ch);
+