From patchwork Wed Mar 4 21:53:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 9933 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 n24LnqLb031369 for ; Wed, 4 Mar 2009 21:53:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754492AbZCDVxn (ORCPT ); Wed, 4 Mar 2009 16:53:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754490AbZCDVxn (ORCPT ); Wed, 4 Mar 2009 16:53:43 -0500 Received: from mho-01-bos.mailhop.org ([63.208.196.178]:59503 "EHLO mho-01-bos.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754492AbZCDVxn (ORCPT ); Wed, 4 Mar 2009 16:53:43 -0500 Received: from c-69-181-40-92.hsd1.ca.comcast.net ([69.181.40.92] helo=[127.0.0.1]) by mho-01-bos.mailhop.org with esmtpa (Exim 4.68) (envelope-from ) id 1Lez24-000C2k-8S; Wed, 04 Mar 2009 21:53:40 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 69.181.40.92 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/u8SvD5jceQV4DqgZmMBie Subject: [PATCH 5/7] ARM: OMAP: Get available DMA channels from cmdline To: linux-arm-kernel@lists.arm.linux.org.uk From: Tony Lindgren Cc: Nishant Kamat , linux-omap@vger.kernel.org, Santosh Shilimkar Date: Wed, 04 Mar 2009 13:53:38 -0800 Message-ID: <20090304215338.21101.39176.stgit@localhost> In-Reply-To: <20090304214540.21101.72079.stgit@localhost> References: <20090304214540.21101.72079.stgit@localhost> User-Agent: StGit/0.14.3.343.g0584 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/dma.c | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) -- 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 --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 47ec77a..eca43bb 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -123,6 +123,7 @@ static struct dma_link_info *dma_linked_lch; 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; @@ -2321,6 +2322,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) @@ -2371,7 +2376,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; @@ -2437,4 +2442,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); +