From patchwork Wed Feb 4 09:08:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 5360 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n1499GQb013676 for ; Wed, 4 Feb 2009 09:09:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751128AbZBDJJP (ORCPT ); Wed, 4 Feb 2009 04:09:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751589AbZBDJJP (ORCPT ); Wed, 4 Feb 2009 04:09:15 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:48398 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751128AbZBDJJN convert rfc822-to-8bit (ORCPT ); Wed, 4 Feb 2009 04:09:13 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n14992up030950; Wed, 4 Feb 2009 03:09:08 -0600 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id n1498xgJ029712; Wed, 4 Feb 2009 14:39:00 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde71.ent.ti.com ([172.24.170.149]) with mapi; Wed, 4 Feb 2009 14:38:59 +0530 From: "Shilimkar, Santosh" To: Tony Lindgren CC: "linux-omap@vger.kernel.org" Date: Wed, 4 Feb 2009 14:38:58 +0530 Subject: [PATCH] OMAP: sDMA: DMA channel reservation using bootargs Thread-Topic: [PATCH] OMAP: sDMA: DMA channel reservation using bootargs Thread-Index: AcmGqDaKy7PTZsplR5iekdOgVgzP/A== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Tony, Here is the first patch as promised. From: Santosh Shilimkar 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 Acked By: Nishant Kamat cc: Tony Lindgren --- 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 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); +