* [PATCH v10 1/8] ARM: edma: Add AM33XX support to the private EDMA API
@ 2013-06-15 2:32 Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 3/8] ARM: dts: add AM33XX EDMA support Joel A Fernandes
[not found] ` <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
0 siblings, 2 replies; 15+ messages in thread
From: Joel A Fernandes @ 2013-06-15 2:32 UTC (permalink / raw)
To: Tony Lindgren, Sekhar Nori, Matt Porter, Grant Likely,
Rob Herring, Vinod Koul, Mark Brown, Benoit Cousson, Russell King,
Rob Landley, Andrew Morton, Jason Kridner, Koen Kooi
Cc: Joel A Fernandes, Linux DaVinci Kernel List, Arnd Bergmann,
Linux Documentation List, Devicetree Discuss, Linux MMC List,
Linux Kernel Mailing List, Linux SPI Devel List, Linux OMAP List,
Linux ARM Kernel List
From: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Adds support for parsing the TI EDMA DT data into the required EDMA
private API platform data. Enables runtime PM support to initialize
the EDMA hwmod. Enables build on OMAP.
Changes by Joel:
* Setup default one-to-one mapping for queue_priority and queue_tc
mapping as discussed in [1].
* Split out xbar stuff to separate patch. [1]
[1] https://patchwork.kernel.org/patch/2226761/
Signed-off-by: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Acked-by: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>
Signed-off-by: Joel A Fernandes <joelagnel-l0cyMroinI0@public.gmane.org>
---
arch/arm/common/edma.c | 190 +++++++++++++++++++++++++++++++++---
arch/arm/mach-omap2/Kconfig | 1 +
include/linux/platform_data/edma.h | 4 +-
3 files changed, 181 insertions(+), 14 deletions(-)
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index a1db6cd..9823b79 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -24,6 +24,13 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/slab.h>
+#include <linux/edma.h>
+#include <linux/err.h>
+#include <linux/of_address.h>
+#include <linux/of_device.h>
+#include <linux/of_dma.h>
+#include <linux/of_irq.h>
+#include <linux/pm_runtime.h>
#include <linux/platform_data/edma.h>
@@ -1369,31 +1376,173 @@ void edma_clear_event(unsigned channel)
EXPORT_SYMBOL(edma_clear_event);
/*-----------------------------------------------------------------------*/
+static int edma_of_read_u32_to_s8_array(const struct device_node *np,
+ const char *propname, s8 *out_values,
+ size_t sz)
+{
+ int ret;
+
+ ret = of_property_read_u8_array(np, propname, out_values, sz);
+ if (ret)
+ return ret;
+
+ /* Terminate it */
+ *out_values++ = -1;
+ *out_values++ = -1;
+
+ return 0;
+}
+
+static int edma_of_read_u32_to_s16_array(const struct device_node *np,
+ const char *propname, s16 *out_values,
+ size_t sz)
+{
+ int ret;
+
+ ret = of_property_read_u16_array(np, propname, out_values, sz);
+ if (ret)
+ return ret;
+
+ /* Terminate it */
+ *out_values++ = -1;
+ *out_values++ = -1;
+
+ return 0;
+}
-static int __init edma_probe(struct platform_device *pdev)
+static int edma_of_parse_dt(struct device *dev,
+ struct device_node *node,
+ struct edma_soc_info *pdata)
+{
+ int ret = 0, i;
+ u32 value;
+ struct property *prop;
+ size_t sz;
+ struct edma_rsv_info *rsv_info;
+ const s16 (*rsv_chans)[2], (*rsv_slots)[2];
+ s8 (*queue_tc_map)[2], (*queue_priority_map)[2];
+
+ memset(pdata, 0, sizeof(struct edma_soc_info));
+
+ ret = of_property_read_u32(node, "dma-channels", &value);
+ if (ret < 0)
+ return ret;
+ pdata->n_channel = value;
+
+ ret = of_property_read_u32(node, "ti,edma-regions", &value);
+ if (ret < 0)
+ return ret;
+ pdata->n_region = value;
+
+ ret = of_property_read_u32(node, "ti,edma-slots", &value);
+ if (ret < 0)
+ return ret;
+ pdata->n_slot = value;
+
+ pdata->n_cc = 1;
+ pdata->n_tc = 3;
+
+ rsv_info =
+ devm_kzalloc(dev, sizeof(struct edma_rsv_info), GFP_KERNEL);
+ if (!rsv_info)
+ return -ENOMEM;
+ pdata->rsv = rsv_info;
+
+ queue_tc_map = devm_kzalloc(dev, 8*sizeof(s8), GFP_KERNEL);
+ if (!queue_tc_map)
+ return -ENOMEM;
+
+ for (i = 0; i < 3; i++)
+ queue_tc_map[i][0] = queue_tc_map[i][1] = i;
+ queue_tc_map[i][0] = queue_tc_map[i][1] = -1;
+
+ pdata->queue_tc_mapping = queue_tc_map;
+
+ queue_priority_map = devm_kzalloc(dev, 8*sizeof(s8), GFP_KERNEL);
+ if (!queue_priority_map)
+ return -ENOMEM;
+
+ for (i = 0; i < 3; i++)
+ queue_priority_map[i][0] = queue_priority_map[i][1] = i;
+ queue_priority_map[i][0] = queue_priority_map[i][1] = -1;
+
+ pdata->queue_priority_mapping = queue_priority_map;
+
+ pdata->default_queue = 0;
+
+
+ return ret;
+}
+
+static struct of_dma_filter_info edma_filter_info = {
+ .filter_fn = edma_filter_fn,
+};
+
+static int edma_probe(struct platform_device *pdev)
{
struct edma_soc_info **info = pdev->dev.platform_data;
- const s8 (*queue_priority_mapping)[2];
- const s8 (*queue_tc_mapping)[2];
+ struct edma_soc_info *ninfo[EDMA_MAX_CC] = {NULL, NULL};
+ struct edma_soc_info tmpinfo;
+ s8 (*queue_priority_mapping)[2];
+ s8 (*queue_tc_mapping)[2];
int i, j, off, ln, found = 0;
int status = -1;
const s16 (*rsv_chans)[2];
const s16 (*rsv_slots)[2];
int irq[EDMA_MAX_CC] = {0, 0};
int err_irq[EDMA_MAX_CC] = {0, 0};
- struct resource *r[EDMA_MAX_CC] = {NULL};
+ struct resource *r[EDMA_MAX_CC] = {NULL, NULL};
+ struct resource res[EDMA_MAX_CC];
resource_size_t len[EDMA_MAX_CC];
char res_name[10];
char irq_name[10];
+ struct device_node *node = pdev->dev.of_node;
+ struct device *dev = &pdev->dev;
+ int ret;
+
+ if (node) {
+ /* Check if this is a second instance registered */
+ if (arch_num_cc) {
+ dev_err(dev, "only one EDMA instance is supported via DT\n");
+ return -ENODEV;
+ }
+ info = ninfo;
+ edma_of_parse_dt(dev, node, &tmpinfo);
+ info[0] = &tmpinfo;
+
+ dma_cap_set(DMA_SLAVE, edma_filter_info.dma_cap);
+ of_dma_controller_register(dev->of_node,
+ of_dma_simple_xlate,
+ &edma_filter_info);
+ }
if (!info)
return -ENODEV;
+ pm_runtime_enable(dev);
+ ret = pm_runtime_get_sync(dev);
+ if (ret < 0) {
+ dev_err(dev, "pm_runtime_get_sync() failed\n");
+ return ret;
+ }
+
for (j = 0; j < EDMA_MAX_CC; j++) {
- sprintf(res_name, "edma_cc%d", j);
- r[j] = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+ if (!info[j]) {
+ if (!found)
+ return -ENODEV;
+ break;
+ }
+ if (node) {
+ ret = of_address_to_resource(node, j, &res[j]);
+ if (!ret)
+ r[j] = &res[j];
+ } else {
+ sprintf(res_name, "edma_cc%d", j);
+ r[j] = platform_get_resource_byname(pdev,
+ IORESOURCE_MEM,
res_name);
- if (!r[j] || !info[j]) {
+ }
+ if (!r[j]) {
if (found)
break;
else
@@ -1468,8 +1617,13 @@ static int __init edma_probe(struct platform_device *pdev)
}
}
- sprintf(irq_name, "edma%d", j);
- irq[j] = platform_get_irq_byname(pdev, irq_name);
+
+ if (node)
+ irq[j] = irq_of_parse_and_map(node, 0);
+ else {
+ sprintf(irq_name, "edma%d", j);
+ irq[j] = platform_get_irq_byname(pdev, irq_name);
+ }
edma_cc[j]->irq_res_start = irq[j];
status = request_irq(irq[j], dma_irq_handler, 0, "edma",
&pdev->dev);
@@ -1479,8 +1633,12 @@ static int __init edma_probe(struct platform_device *pdev)
goto fail;
}
- sprintf(irq_name, "edma%d_err", j);
- err_irq[j] = platform_get_irq_byname(pdev, irq_name);
+ if (node)
+ err_irq[j] = irq_of_parse_and_map(node, 2);
+ else {
+ sprintf(irq_name, "edma%d_err", j);
+ err_irq[j] = platform_get_irq_byname(pdev, irq_name);
+ }
edma_cc[j]->irq_res_end = err_irq[j];
status = request_irq(err_irq[j], dma_ccerr_handler, 0,
"edma_error", &pdev->dev);
@@ -1541,9 +1699,17 @@ fail1:
return status;
}
+static const struct of_device_id edma_of_ids[] = {
+ { .compatible = "ti,edma3", },
+ {}
+};
static struct platform_driver edma_driver = {
- .driver.name = "edma",
+ .driver = {
+ .name = "edma",
+ .of_match_table = edma_of_ids,
+ },
+ .probe = edma_probe,
};
static int __init edma_init(void)
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index f49cd51..f91b07f 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -17,6 +17,7 @@ config ARCH_OMAP2PLUS
select PROC_DEVICETREE if PROC_FS
select SOC_BUS
select SPARSE_IRQ
+ select TI_PRIV_EDMA
select USE_OF
help
Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h
index 2344ea2..317f2be 100644
--- a/include/linux/platform_data/edma.h
+++ b/include/linux/platform_data/edma.h
@@ -175,8 +175,8 @@ struct edma_soc_info {
/* Resource reservation for other cores */
struct edma_rsv_info *rsv;
- const s8 (*queue_tc_mapping)[2];
- const s8 (*queue_priority_mapping)[2];
+ s8 (*queue_tc_mapping)[2];
+ s8 (*queue_priority_mapping)[2];
};
#endif
--
1.7.9.5
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v10 3/8] ARM: dts: add AM33XX EDMA support
2013-06-15 2:32 [PATCH v10 1/8] ARM: edma: Add AM33XX support to the private EDMA API Joel A Fernandes
@ 2013-06-15 2:32 ` Joel A Fernandes
[not found] ` <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
1 sibling, 0 replies; 15+ messages in thread
From: Joel A Fernandes @ 2013-06-15 2:32 UTC (permalink / raw)
To: Tony Lindgren, Sekhar Nori, Matt Porter, Grant Likely,
Rob Herring, Vinod Koul, Mark Brown, Benoit Cousson, Russell King,
Rob Landley, Andrew Morton, Jason Kridner, Koen Kooi
Cc: Devicetree Discuss, Linux OMAP List, Linux ARM Kernel List,
Linux DaVinci Kernel List, Linux Kernel Mailing List,
Linux Documentation List, Linux MMC List, Linux SPI Devel List,
Arnd Bergmann, Joel A Fernandes
From: Matt Porter <mdp@ti.com>
Adds AM33XX EDMA support to the am33xx.dtsi as documented in
Documentation/devicetree/bindings/dma/ti-edma.txt
Joel: Drop DT entries that are non-hardware-description for now as discussed in [1]
[1] https://patchwork.kernel.org/patch/2226761/
Signed-off-by: Matt Porter <mporter@ti.com>
Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
---
arch/arm/boot/dts/am33xx.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 70c86a0..f8a8f19 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -89,6 +89,18 @@
reg = <0x48200000 0x1000>;
};
+ edma: edma@49000000 {
+ compatible = "ti,edma3";
+ ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
+ reg = <0x49000000 0x10000>,
+ <0x44e10f90 0x10>;
+ interrupts = <12 13 14>;
+ #dma-cells = <1>;
+ dma-channels = <64>;
+ ti,edma-regions = <4>;
+ ti,edma-slots = <256>;
+ };
+
gpio0: gpio@44e07000 {
compatible = "ti,omap4-gpio";
ti,hwmods = "gpio1";
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
[parent not found: <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>]
* [PATCH v10 2/8] ARM: edma: Add AM33XX EDMA crossbar event mux support
[not found] ` <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
@ 2013-06-15 2:32 ` Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 4/8] dmaengine: edma: enable build for AM33XX Joel A Fernandes
` (4 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Joel A Fernandes @ 2013-06-15 2:32 UTC (permalink / raw)
To: Tony Lindgren, Sekhar Nori, Matt Porter, Grant Likely,
Rob Herring, Vinod Koul, Mark Brown, Benoit Cousson, Russell King,
Rob Landley, Andrew Morton, Jason Kridner, Koen Kooi
Cc: Joel A Fernandes, Linux DaVinci Kernel List, Arnd Bergmann,
Linux Documentation List, Devicetree Discuss, Linux MMC List,
Linux Kernel Mailing List, Linux SPI Devel List, Linux OMAP List,
Linux ARM Kernel List
From: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Changes by Joel:
* Split EDMA xbar support out of original EDMA DT parsing patch
to keep it easier for review.
* rewrite shift and offset calculation as per
Suggested-by: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>
Suggested by: Andy Shevchenko <andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Joel A Fernandes <joelagnel-l0cyMroinI0@public.gmane.org>
Reference:
[1] https://patchwork.kernel.org/patch/2226991/
---
arch/arm/common/edma.c | 59 ++++++++++++++++++++++++++++++++++++
include/linux/platform_data/edma.h | 1 +
2 files changed, 60 insertions(+)
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index 9823b79..1c2fb15 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -1410,6 +1410,52 @@ static int edma_of_read_u32_to_s16_array(const struct device_node *np,
return 0;
}
+static int edma_xbar_event_map(struct device *dev,
+ struct device_node *node,
+ struct edma_soc_info *pdata, int len)
+{
+ int ret = 0;
+ int i;
+ struct resource res;
+ void *xbar;
+ const s16 (*xbar_chans)[2];
+ u32 shift, offset, mux;
+
+ xbar_chans = devm_kzalloc(dev,
+ len/sizeof(s16) + 2*sizeof(s16),
+ GFP_KERNEL);
+ if (!xbar_chans)
+ return -ENOMEM;
+
+ ret = of_address_to_resource(node, 1, &res);
+ if (ret)
+ return -EIO;
+
+ xbar = devm_ioremap(dev, res.start, resource_size(&res));
+ if (!xbar)
+ return -ENOMEM;
+
+ ret = edma_of_read_u32_to_s16_array(node,
+ "ti,edma-xbar-event-map",
+ (s16 *)xbar_chans,
+ len/sizeof(u32));
+ if (ret)
+ return -EIO;
+
+ for (i = 0; xbar_chans[i][0] != -1; i++) {
+ shift = (xbar_chans[i][1] & 0x03) << 3;
+ offset = xbar_chans[i][1] & 0xfffffffc;
+ mux = readl((void *)((u32)xbar + offset));
+ mux &= ~(0xff << shift);
+ mux |= xbar_chans[i][0] << shift;
+ writel(mux, (void *)((u32)xbar + offset));
+ }
+
+ pdata->xbar_chans = xbar_chans;
+
+ return 0;
+}
+
static int edma_of_parse_dt(struct device *dev,
struct device_node *node,
struct edma_soc_info *pdata)
@@ -1470,6 +1516,9 @@ static int edma_of_parse_dt(struct device *dev,
pdata->default_queue = 0;
+ prop = of_find_property(node, "ti,edma-xbar-event-map", &sz);
+ if (prop)
+ ret = edma_xbar_event_map(dev, node, pdata, sz);
return ret;
}
@@ -1489,6 +1538,7 @@ static int edma_probe(struct platform_device *pdev)
int status = -1;
const s16 (*rsv_chans)[2];
const s16 (*rsv_slots)[2];
+ const s16 (*xbar_chans)[2];
int irq[EDMA_MAX_CC] = {0, 0};
int err_irq[EDMA_MAX_CC] = {0, 0};
struct resource *r[EDMA_MAX_CC] = {NULL, NULL};
@@ -1617,6 +1667,15 @@ static int edma_probe(struct platform_device *pdev)
}
}
+ /* Clear the xbar mapped channels in unused list */
+ xbar_chans = info[j]->xbar_chans;
+ if (xbar_chans) {
+ for (i = 0; xbar_chans[i][1] != -1; i++) {
+ off = xbar_chans[i][1];
+ clear_bits(off, 1,
+ edma_cc[j]->edma_unused);
+ }
+ }
if (node)
irq[j] = irq_of_parse_and_map(node, 0);
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h
index 317f2be..57300fd 100644
--- a/include/linux/platform_data/edma.h
+++ b/include/linux/platform_data/edma.h
@@ -177,6 +177,7 @@ struct edma_soc_info {
s8 (*queue_tc_mapping)[2];
s8 (*queue_priority_mapping)[2];
+ const s16 (*xbar_chans)[2];
};
#endif
--
1.7.9.5
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v10 4/8] dmaengine: edma: enable build for AM33XX
[not found] ` <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
2013-06-15 2:32 ` [PATCH v10 2/8] ARM: edma: Add AM33XX EDMA crossbar event mux support Joel A Fernandes
@ 2013-06-15 2:32 ` Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 5/8] dmaengine: edma: Add TI EDMA device tree binding Joel A Fernandes
` (3 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Joel A Fernandes @ 2013-06-15 2:32 UTC (permalink / raw)
To: Tony Lindgren, Sekhar Nori, Matt Porter, Grant Likely,
Rob Herring, Vinod Koul, Mark Brown, Benoit Cousson, Russell King,
Rob Landley, Andrew Morton, Jason Kridner, Koen Kooi
Cc: Joel A Fernandes, Linux DaVinci Kernel List, Arnd Bergmann,
Linux Documentation List, Devicetree Discuss, Linux MMC List,
Linux Kernel Mailing List, Linux SPI Devel List, Linux OMAP List,
Linux ARM Kernel List
From: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Enable TI EDMA option on OMAP.
Signed-off-by: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Signed-off-by: Joel A Fernandes <joelagnel-l0cyMroinI0@public.gmane.org>
---
drivers/dma/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index e992489..3215a3c 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -213,7 +213,7 @@ config SIRF_DMA
config TI_EDMA
tristate "TI EDMA support"
- depends on ARCH_DAVINCI
+ depends on ARCH_DAVINCI || ARCH_OMAP
select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS
default n
--
1.7.9.5
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v10 5/8] dmaengine: edma: Add TI EDMA device tree binding
[not found] ` <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
2013-06-15 2:32 ` [PATCH v10 2/8] ARM: edma: Add AM33XX EDMA crossbar event mux support Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 4/8] dmaengine: edma: enable build for AM33XX Joel A Fernandes
@ 2013-06-15 2:32 ` Joel A Fernandes
[not found] ` <1371263570-9323-5-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
2013-06-15 2:32 ` [PATCH v10 6/8] spi: omap2-mcspi: add generic DMA request support to the DT binding Joel A Fernandes
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Joel A Fernandes @ 2013-06-15 2:32 UTC (permalink / raw)
To: Tony Lindgren, Sekhar Nori, Matt Porter, Grant Likely,
Rob Herring, Vinod Koul, Mark Brown, Benoit Cousson, Russell King,
Rob Landley, Andrew Morton, Jason Kridner, Koen Kooi
Cc: Joel A Fernandes, Linux DaVinci Kernel List, Arnd Bergmann,
Linux Documentation List, Devicetree Discuss, Linux MMC List,
Linux Kernel Mailing List, Linux SPI Devel List, Linux OMAP List,
Linux ARM Kernel List
From: Matt Porter <mdp-l0cyMroinI0@public.gmane.org>
The binding definition is based on the generic DMA controller
binding.
Joel: Droped reserved and queue DT entries from Documentation
for now from the original patch series.
Signed-off-by: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Signed-off-by: Joel A Fernandes <joelagnel-l0cyMroinI0@public.gmane.org>
---
Documentation/devicetree/bindings/dma/ti-edma.txt | 26 +++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 Documentation/devicetree/bindings/dma/ti-edma.txt
diff --git a/Documentation/devicetree/bindings/dma/ti-edma.txt b/Documentation/devicetree/bindings/dma/ti-edma.txt
new file mode 100644
index 0000000..ada0018
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/ti-edma.txt
@@ -0,0 +1,26 @@
+TI EDMA
+
+Required properties:
+- compatible : "ti,edma3"
+- ti,hwmods: Name of the hwmods associated to the EDMA
+- ti,edma-regions: Number of regions
+- ti,edma-slots: Number of slots
+
+Optional properties:
+- ti,edma-xbar-event-map: Crossbar event to channel map
+
+Example:
+
+edma: edma@49000000 {
+ reg = <0x49000000 0x10000>;
+ interrupt-parent = <&intc>;
+ interrupts = <12 13 14>;
+ compatible = "ti,edma3";
+ ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
+ #dma-cells = <1>;
+ dma-channels = <64>;
+ ti,edma-regions = <4>;
+ ti,edma-slots = <256>;
+ ti,edma-xbar-event-map = <1 12
+ 2 13>;
+};
--
1.7.9.5
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v10 6/8] spi: omap2-mcspi: add generic DMA request support to the DT binding
[not found] ` <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
` (2 preceding siblings ...)
2013-06-15 2:32 ` [PATCH v10 5/8] dmaengine: edma: Add TI EDMA device tree binding Joel A Fernandes
@ 2013-06-15 2:32 ` Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 7/8] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 8/8] ARM: dts: add AM33XX SPI DMA support Joel A Fernandes
5 siblings, 0 replies; 15+ messages in thread
From: Joel A Fernandes @ 2013-06-15 2:32 UTC (permalink / raw)
To: Tony Lindgren, Sekhar Nori, Matt Porter, Grant Likely,
Rob Herring, Vinod Koul, Mark Brown, Benoit Cousson, Russell King,
Rob Landley, Andrew Morton, Jason Kridner, Koen Kooi
Cc: Joel A Fernandes, Linux DaVinci Kernel List, Arnd Bergmann,
Linux Documentation List, Devicetree Discuss, Linux MMC List,
Linux Kernel Mailing List, Linux SPI Devel List, Linux OMAP List,
Linux ARM Kernel List
From: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
The binding definition is based on the generic DMA request binding
Signed-off-by: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Signed-off-by: Joel A Fernandes <joelagnel-l0cyMroinI0@public.gmane.org>
---
Documentation/devicetree/bindings/spi/omap-spi.txt | 27 +++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/spi/omap-spi.txt b/Documentation/devicetree/bindings/spi/omap-spi.txt
index 938809c..4c85c4c 100644
--- a/Documentation/devicetree/bindings/spi/omap-spi.txt
+++ b/Documentation/devicetree/bindings/spi/omap-spi.txt
@@ -10,7 +10,18 @@ Required properties:
input. The default is D0 as input and
D1 as output.
-Example:
+Optional properties:
+- dmas: List of DMA specifiers with the controller specific format
+ as described in the generic DMA client binding. A tx and rx
+ specifier is required for each chip select.
+- dma-names: List of DMA request names. These strings correspond
+ 1:1 with the DMA specifiers listed in dmas. The string naming
+ is to be "rxN" and "txN" for RX and TX requests,
+ respectively, where N equals the chip select number.
+
+Examples:
+
+[hwmod populated DMA resources]
mcspi1: mcspi@1 {
#address-cells = <1>;
@@ -20,3 +31,17 @@ mcspi1: mcspi@1 {
ti,spi-num-cs = <4>;
};
+[generic DMA request binding]
+
+mcspi1: mcspi@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "ti,omap4-mcspi";
+ ti,hwmods = "mcspi1";
+ ti,spi-num-cs = <2>;
+ dmas = <&edma 42
+ &edma 43
+ &edma 44
+ &edma 45>;
+ dma-names = "tx0", "rx0", "tx1", "rx1";
+};
--
1.7.9.5
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v10 7/8] spi: omap2-mcspi: convert to dma_request_slave_channel_compat()
[not found] ` <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
` (3 preceding siblings ...)
2013-06-15 2:32 ` [PATCH v10 6/8] spi: omap2-mcspi: add generic DMA request support to the DT binding Joel A Fernandes
@ 2013-06-15 2:32 ` Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 8/8] ARM: dts: add AM33XX SPI DMA support Joel A Fernandes
5 siblings, 0 replies; 15+ messages in thread
From: Joel A Fernandes @ 2013-06-15 2:32 UTC (permalink / raw)
To: Tony Lindgren, Sekhar Nori, Matt Porter, Grant Likely,
Rob Herring, Vinod Koul, Mark Brown, Benoit Cousson, Russell King,
Rob Landley, Andrew Morton, Jason Kridner, Koen Kooi
Cc: Joel A Fernandes, Linux DaVinci Kernel List, Arnd Bergmann,
Linux Documentation List, Devicetree Discuss, Linux MMC List,
Linux Kernel Mailing List, Linux SPI Devel List, Linux OMAP List,
Linux ARM Kernel List
From: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Convert dmaengine channel requests to use
dma_request_slave_channel_compat(). This supports the DT case of
platforms requiring channel selection from either the OMAP DMA or
the EDMA engine. AM33xx only boots from DT and is the only user
implementing EDMA so in the !DT case we can default to the OMAP DMA
filter.
Signed-off-by: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Acked-by: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Signed-off-by: Joel A Fernandes <joelagnel-l0cyMroinI0@public.gmane.org>
---
drivers/spi/spi-omap2-mcspi.c | 64 ++++++++++++++++++++++++++++-------------
1 file changed, 44 insertions(+), 20 deletions(-)
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 86d2158..ca4ab78 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -102,6 +102,9 @@ struct omap2_mcspi_dma {
struct completion dma_tx_completion;
struct completion dma_rx_completion;
+
+ char dma_rx_ch_name[14];
+ char dma_tx_ch_name[14];
};
/* use PIO for small transfers, avoiding DMA setup/teardown overhead and
@@ -830,12 +833,20 @@ static int omap2_mcspi_request_dma(struct spi_device *spi)
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
sig = mcspi_dma->dma_rx_sync_dev;
- mcspi_dma->dma_rx = dma_request_channel(mask, omap_dma_filter_fn, &sig);
+
+ mcspi_dma->dma_rx =
+ dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
+ &sig, &master->dev,
+ mcspi_dma->dma_rx_ch_name);
if (!mcspi_dma->dma_rx)
goto no_dma;
sig = mcspi_dma->dma_tx_sync_dev;
- mcspi_dma->dma_tx = dma_request_channel(mask, omap_dma_filter_fn, &sig);
+ mcspi_dma->dma_tx =
+ dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
+ &sig, &master->dev,
+ mcspi_dma->dma_tx_ch_name);
+
if (!mcspi_dma->dma_tx) {
dma_release_channel(mcspi_dma->dma_rx);
mcspi_dma->dma_rx = NULL;
@@ -1256,29 +1267,42 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
goto free_master;
for (i = 0; i < master->num_chipselect; i++) {
- char dma_ch_name[14];
+ char *dma_rx_ch_name = mcspi->dma_channels[i].dma_rx_ch_name;
+ char *dma_tx_ch_name = mcspi->dma_channels[i].dma_tx_ch_name;
struct resource *dma_res;
- sprintf(dma_ch_name, "rx%d", i);
- dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
- dma_ch_name);
- if (!dma_res) {
- dev_dbg(&pdev->dev, "cannot get DMA RX channel\n");
- status = -ENODEV;
- break;
- }
+ sprintf(dma_rx_ch_name, "rx%d", i);
+ if (!pdev->dev.of_node) {
+ dma_res =
+ platform_get_resource_byname(pdev,
+ IORESOURCE_DMA,
+ dma_rx_ch_name);
+ if (!dma_res) {
+ dev_dbg(&pdev->dev,
+ "cannot get DMA RX channel\n");
+ status = -ENODEV;
+ break;
+ }
- mcspi->dma_channels[i].dma_rx_sync_dev = dma_res->start;
- sprintf(dma_ch_name, "tx%d", i);
- dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
- dma_ch_name);
- if (!dma_res) {
- dev_dbg(&pdev->dev, "cannot get DMA TX channel\n");
- status = -ENODEV;
- break;
+ mcspi->dma_channels[i].dma_rx_sync_dev =
+ dma_res->start;
}
+ sprintf(dma_tx_ch_name, "tx%d", i);
+ if (!pdev->dev.of_node) {
+ dma_res =
+ platform_get_resource_byname(pdev,
+ IORESOURCE_DMA,
+ dma_tx_ch_name);
+ if (!dma_res) {
+ dev_dbg(&pdev->dev,
+ "cannot get DMA TX channel\n");
+ status = -ENODEV;
+ break;
+ }
- mcspi->dma_channels[i].dma_tx_sync_dev = dma_res->start;
+ mcspi->dma_channels[i].dma_tx_sync_dev =
+ dma_res->start;
+ }
}
if (status < 0)
--
1.7.9.5
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v10 8/8] ARM: dts: add AM33XX SPI DMA support
[not found] ` <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
` (4 preceding siblings ...)
2013-06-15 2:32 ` [PATCH v10 7/8] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() Joel A Fernandes
@ 2013-06-15 2:32 ` Joel A Fernandes
5 siblings, 0 replies; 15+ messages in thread
From: Joel A Fernandes @ 2013-06-15 2:32 UTC (permalink / raw)
To: Tony Lindgren, Sekhar Nori, Matt Porter, Grant Likely,
Rob Herring, Vinod Koul, Mark Brown, Benoit Cousson, Russell King,
Rob Landley, Andrew Morton, Jason Kridner, Koen Kooi
Cc: Joel A Fernandes, Linux DaVinci Kernel List, Arnd Bergmann,
Linux Documentation List, Devicetree Discuss, Linux MMC List,
Linux Kernel Mailing List, Linux SPI Devel List, Linux OMAP List,
Linux ARM Kernel List
From: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Adds DMA resources to the AM33XX SPI nodes.
Signed-off-by: Matt Porter <mporter-l0cyMroinI0@public.gmane.org>
Signed-off-by: Joel A Fernandes <joelagnel-l0cyMroinI0@public.gmane.org>
---
arch/arm/boot/dts/am33xx.dtsi | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index f8a8f19..119f8a9 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -352,6 +352,11 @@
interrupts = <65>;
ti,spi-num-cs = <2>;
ti,hwmods = "spi0";
+ dmas = <&edma 16
+ &edma 17
+ &edma 18
+ &edma 19>;
+ dma-names = "tx0", "rx0", "tx1", "rx1";
status = "disabled";
};
@@ -363,6 +368,11 @@
interrupts = <125>;
ti,spi-num-cs = <2>;
ti,hwmods = "spi1";
+ dmas = <&edma 42
+ &edma 43
+ &edma 44
+ &edma 45>;
+ dma-names = "tx0", "rx0", "tx1", "rx1";
status = "disabled";
};
--
1.7.9.5
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2013-06-18 4:40 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-15 2:32 [PATCH v10 1/8] ARM: edma: Add AM33XX support to the private EDMA API Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 3/8] ARM: dts: add AM33XX EDMA support Joel A Fernandes
[not found] ` <1371263570-9323-1-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
2013-06-15 2:32 ` [PATCH v10 2/8] ARM: edma: Add AM33XX EDMA crossbar event mux support Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 4/8] dmaengine: edma: enable build for AM33XX Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 5/8] dmaengine: edma: Add TI EDMA device tree binding Joel A Fernandes
[not found] ` <1371263570-9323-5-git-send-email-joelagnel-l0cyMroinI0@public.gmane.org>
2013-06-17 11:01 ` Sekhar Nori
2013-06-17 15:05 ` Fernandes, Joel A
2013-06-17 11:12 ` Arnd Bergmann
2013-06-17 15:40 ` Fernandes, Joel A
[not found] ` <083BC63EECB6FD41B8E81CF7FD87CC0F2E4E9395-YmePFLaaepqIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2013-06-17 16:19 ` Arnd Bergmann
[not found] ` <201306171819.57900.arnd-r2nGTMty4D4@public.gmane.org>
2013-06-17 16:25 ` Fernandes, Joel A
2013-06-18 4:40 ` Sekhar Nori
2013-06-15 2:32 ` [PATCH v10 6/8] spi: omap2-mcspi: add generic DMA request support to the DT binding Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 7/8] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() Joel A Fernandes
2013-06-15 2:32 ` [PATCH v10 8/8] ARM: dts: add AM33XX SPI DMA support Joel A Fernandes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).