From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: Nishant Kamat <nskamat@ti.com>,
linux-omap@vger.kernel.org,
Santosh Shilimkar <santosh.shilimkar@ti.com>
Subject: [PATCH 5/7] ARM: OMAP: Get available DMA channels from cmdline
Date: Wed, 04 Mar 2009 13:53:38 -0800 [thread overview]
Message-ID: <20090304215338.21101.39176.stgit@localhost> (raw)
In-Reply-To: <20090304214540.21101.72079.stgit@localhost>
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>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/plat-omap/dma.c | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
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);
+
next prev parent reply other threads:[~2009-03-04 21:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-04 21:47 [PATCH 0/7] Updates for common omap code for next merge window Tony Lindgren
2009-03-04 21:48 ` [PATCH 1/7] ARM: OMAP: Export dmtimer functions Tony Lindgren
2009-03-04 21:49 ` [PATCH 2/7] ARM: OMAP: Add documentation for function omap_register_i2c_bus Tony Lindgren
2009-03-04 21:51 ` [PATCH 3/7] ARM: OMAP: Add command line option for I2C bus speed Tony Lindgren
2009-03-05 16:20 ` Tony Lindgren
2009-03-05 19:37 ` Felipe Balbi
2009-03-06 7:13 ` Jarkko Nikula
2009-03-06 16:13 ` Tony Lindgren
[not found] ` <20090306161349.GC32353-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2009-03-10 8:47 ` [2.6.29-rc7][take #2][PATCH 0/3] " Jarkko Nikula
[not found] ` <1236674831-3637-1-git-send-email-jarkko.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2009-03-10 8:47 ` [2.6.29-rc7][take #2][PATCH 1/3] ARM: OMAP: Add documentation for function omap_register_i2c_bus Jarkko Nikula
2009-03-10 8:47 ` [2.6.29-rc7][take #2][PATCH 2/3] ARM: OMAP: Add command line option for I2C bus speed Jarkko Nikula
[not found] ` <1236674831-3637-3-git-send-email-jarkko.nikula-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2009-03-10 8:47 ` [2.6.29-rc7][take #2][PATCH 3/3] ARM: OMAP: Add method to register additional I2C busses on the command line Jarkko Nikula
2009-03-16 17:29 ` [2.6.29-rc7][take #2][PATCH 2/3] ARM: OMAP: Add command line option for I2C bus speed Tony Lindgren
[not found] ` <20090316172908.GA19229-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2009-03-17 8:24 ` Jarkko Nikula
2009-03-18 19:30 ` [PATCH 3/7] " Russell King - ARM Linux
2009-03-19 11:22 ` Jarkko Nikula
2009-03-04 21:52 ` [PATCH 4/7] ARM: OMAP: Add method to register additional I2C busses on the command line Tony Lindgren
2009-03-04 21:53 ` Tony Lindgren [this message]
2009-03-04 21:54 ` [PATCH 6/7] ARM: OMAP: Dispatch only relevant DMA interrupts Tony Lindgren
2009-03-04 21:56 ` [PATCH 7/7] ARM: OMAP: get rid of OMAP_TAG_USB Tony Lindgren
2009-03-11 16:31 ` [PATCH 7/7] ARM: OMAP: get rid of OMAP_TAG_USB, v2 Tony Lindgren
2009-03-16 17:31 ` [PATCH 0/7] Updates for common omap code for next merge window Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090304215338.21101.39176.stgit@localhost \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-omap@vger.kernel.org \
--cc=nskamat@ti.com \
--cc=santosh.shilimkar@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox