* [PATCH v3 0/6] ARM: at91: move to generic DMA device tree binding
@ 2013-04-19 9:11 ludovic.desroches at atmel.com
2013-04-19 9:11 ` [PATCH v3 1/6] at_hdmac: move to generic DMA binding ludovic.desroches at atmel.com
` (5 more replies)
0 siblings, 6 replies; 17+ messages in thread
From: ludovic.desroches at atmel.com @ 2013-04-19 9:11 UTC (permalink / raw)
To: linux-arm-kernel
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Hi,
I resend the set of patches due to minor fixes. I think patches will go through
different subsytems.
Patch 1/6: dma subsystem
Patch 2/6, 4/6, 6/6: arm-soc
Patch 3/6: i2c subsystem, already taken by Wolfram, thx.
Patch 5/6: mmc subsystem
v3 changes:
- compile at_dma_filter function only if CONFIG_OF is set since it is only used
in at_dma_xlate
- remove trailing whitespaces in patch 5/6
v2 changes:
- update documentation about dma bindings according to Nicolas' comments
- put dtsi changes in a separate patch
- add dtb update for i2c and mci nodes
Ludovic Desroches (6):
at_hdmac: move to generic DMA binding
ARM: at91: dts: set #dma-cells to the correct value
i2c: at91: convert to dma_request_slave_channel_compat()
ARM: at91: dts: add i2c dma support
mci: at91: convert to dma_request_slave_channel_compat()
ARM: at91: dts: add MCI DMA support
.../devicetree/bindings/dma/atmel-dma.txt | 35 ++++++--
arch/arm/boot/dts/at91sam9g45.dtsi | 5 ++
arch/arm/boot/dts/at91sam9n12.dtsi | 9 +++
arch/arm/boot/dts/at91sam9x5.dtsi | 15 ++++
arch/arm/boot/dts/sama5d3.dtsi | 19 ++++-
drivers/dma/at_hdmac.c | 93 ++++++++++++++++++++--
drivers/dma/at_hdmac_regs.h | 4 +
drivers/i2c/busses/i2c-at91.c | 49 ++++++------
drivers/mmc/host/atmel-mci.c | 25 +++---
9 files changed, 204 insertions(+), 50 deletions(-)
--
1.7.11.3
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 1/6] at_hdmac: move to generic DMA binding
2013-04-19 9:11 [PATCH v3 0/6] ARM: at91: move to generic DMA device tree binding ludovic.desroches at atmel.com
@ 2013-04-19 9:11 ` ludovic.desroches at atmel.com
2013-04-22 10:22 ` Nicolas Ferre
2013-04-19 9:11 ` [PATCH v3 2/6] ARM: at91: dts: set #dma-cells to the correct value ludovic.desroches at atmel.com
` (4 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: ludovic.desroches at atmel.com @ 2013-04-19 9:11 UTC (permalink / raw)
To: linux-arm-kernel
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Update at_hdmac driver to support generic DMA device tree binding. Devices
can still request channel with dma_request_channel() then it doesn't break
DMA for non DT boards.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
.../devicetree/bindings/dma/atmel-dma.txt | 35 ++++++--
drivers/dma/at_hdmac.c | 93 ++++++++++++++++++++--
drivers/dma/at_hdmac_regs.h | 4 +
3 files changed, 121 insertions(+), 11 deletions(-)
diff --git a/Documentation/devicetree/bindings/dma/atmel-dma.txt b/Documentation/devicetree/bindings/dma/atmel-dma.txt
index 3c046ee..c80e8a3 100644
--- a/Documentation/devicetree/bindings/dma/atmel-dma.txt
+++ b/Documentation/devicetree/bindings/dma/atmel-dma.txt
@@ -1,14 +1,39 @@
* Atmel Direct Memory Access Controller (DMA)
Required properties:
-- compatible: Should be "atmel,<chip>-dma"
-- reg: Should contain DMA registers location and length
-- interrupts: Should contain DMA interrupt
+- compatible: Should be "atmel,<chip>-dma".
+- reg: Should contain DMA registers location and length.
+- interrupts: Should contain DMA interrupt.
+- #dma-cells: Must be <2>, used to represent the number of integer cells in
+the dmas property of client devices.
-Examples:
+Example:
-dma at ffffec00 {
+dma0: dma at ffffec00 {
compatible = "atmel,at91sam9g45-dma";
reg = <0xffffec00 0x200>;
interrupts = <21>;
+ #dma-cells = <2>;
+};
+
+DMA clients connected to the Atmel DMA controller must use the format
+described in the dma.txt file, using a three-cell specifier for each channel:
+a phandle plus two interger cells.
+The three cells in order are:
+
+1. A phandle pointing to the DMA controller.
+2. The memory interface (16 most significant bits), the peripheral interface
+(16 less significant bits).
+3. The peripheral identifier for the hardware handshaking interface. The
+identifier can be different for tx and rx.
+
+Example:
+
+i2c0 at i2c@f8010000 {
+ compatible = "atmel,at91sam9x5-i2c";
+ reg = <0xf8010000 0x100>;
+ interrupts = <9 4 6>;
+ dmas = <&dma0 1 7>,
+ <&dma0 1 8>;
+ dma-names = "tx", "rx";
};
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index de4e930..fda2661 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -24,6 +24,7 @@
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_device.h>
+#include <linux/of_dma.h>
#include "at_hdmac_regs.h"
#include "dmaengine.h"
@@ -677,7 +678,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
ctrlb |= ATC_DST_ADDR_MODE_FIXED
| ATC_SRC_ADDR_MODE_INCR
| ATC_FC_MEM2PER
- | ATC_SIF(AT_DMA_MEM_IF) | ATC_DIF(AT_DMA_PER_IF);
+ | ATC_SIF(atchan->mem_if) | ATC_DIF(atchan->per_if);
reg = sconfig->dst_addr;
for_each_sg(sgl, sg, sg_len, i) {
struct at_desc *desc;
@@ -716,7 +717,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
ctrlb |= ATC_DST_ADDR_MODE_INCR
| ATC_SRC_ADDR_MODE_FIXED
| ATC_FC_PER2MEM
- | ATC_SIF(AT_DMA_PER_IF) | ATC_DIF(AT_DMA_MEM_IF);
+ | ATC_SIF(atchan->per_if) | ATC_DIF(atchan->mem_if);
reg = sconfig->src_addr;
for_each_sg(sgl, sg, sg_len, i) {
@@ -822,8 +823,8 @@ atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc,
desc->lli.ctrlb = ATC_DST_ADDR_MODE_FIXED
| ATC_SRC_ADDR_MODE_INCR
| ATC_FC_MEM2PER
- | ATC_SIF(AT_DMA_MEM_IF)
- | ATC_DIF(AT_DMA_PER_IF);
+ | ATC_SIF(atchan->mem_if)
+ | ATC_DIF(atchan->per_if);
break;
case DMA_DEV_TO_MEM:
@@ -833,8 +834,8 @@ atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc,
desc->lli.ctrlb = ATC_DST_ADDR_MODE_INCR
| ATC_SRC_ADDR_MODE_FIXED
| ATC_FC_PER2MEM
- | ATC_SIF(AT_DMA_PER_IF)
- | ATC_DIF(AT_DMA_MEM_IF);
+ | ATC_SIF(atchan->per_if)
+ | ATC_DIF(atchan->mem_if);
break;
default:
@@ -1190,6 +1191,67 @@ static void atc_free_chan_resources(struct dma_chan *chan)
dev_vdbg(chan2dev(chan), "free_chan_resources: done\n");
}
+#ifdef CONFIG_OF
+static bool at_dma_filter(struct dma_chan *chan, void *slave)
+{
+ struct at_dma_slave *atslave = slave;
+
+ if (atslave->dma_dev == chan->device->dev) {
+ chan->private = atslave;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,
+ struct of_dma *of_dma)
+{
+ struct dma_chan *chan;
+ struct at_dma_chan *atchan;
+ struct at_dma_slave *atslave;
+ dma_cap_mask_t mask;
+ unsigned int per_id;
+ struct platform_device *dmac_pdev;
+
+ if (dma_spec->args_count != 2)
+ return NULL;
+
+ dmac_pdev = of_find_device_by_node(dma_spec->np);
+
+ dma_cap_zero(mask);
+ dma_cap_set(DMA_SLAVE, mask);
+
+ atslave = devm_kzalloc(&dmac_pdev->dev, sizeof(*atslave), GFP_KERNEL);
+ if (!atslave)
+ return NULL;
+ /*
+ * We can fill both SRC_PER and DST_PER, one of these fields will be
+ * ignored depending on DMA transfer direction.
+ */
+ per_id = dma_spec->args[1];
+ atslave->cfg = ATC_FIFOCFG_HALFFIFO | ATC_DST_H2SEL_HW
+ | ATC_SRC_H2SEL_HW | ATC_DST_PER(per_id)
+ | ATC_SRC_PER(per_id);
+ atslave->dma_dev = &dmac_pdev->dev;
+
+ chan = dma_request_channel(mask, at_dma_filter, atslave);
+ if (!chan)
+ return NULL;
+
+ atchan = to_at_dma_chan(chan);
+ atchan->per_if = dma_spec->args[0] & 0xff;
+ atchan->mem_if = (dma_spec->args[0] >> 16) & 0xff;
+
+ return chan;
+}
+#else
+static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,
+ struct of_dma *of_dma)
+{
+ return NULL;
+}
+#endif
/*-- Module Management -----------------------------------------------*/
@@ -1344,6 +1406,8 @@ static int __init at_dma_probe(struct platform_device *pdev)
for (i = 0; i < plat_dat->nr_channels; i++) {
struct at_dma_chan *atchan = &atdma->chan[i];
+ atchan->mem_if = AT_DMA_MEM_IF;
+ atchan->per_if = AT_DMA_PER_IF;
atchan->chan_common.device = &atdma->dma_common;
dma_cookie_init(&atchan->chan_common);
list_add_tail(&atchan->chan_common.device_node,
@@ -1390,8 +1454,25 @@ static int __init at_dma_probe(struct platform_device *pdev)
dma_async_device_register(&atdma->dma_common);
+ /*
+ * Do not return an error if the dmac node is not present in order to
+ * not break the existing way of requesting channel with
+ * dma_request_channel().
+ */
+ if (pdev->dev.of_node) {
+ err = of_dma_controller_register(pdev->dev.of_node,
+ at_dma_xlate, atdma);
+ if (err) {
+ dev_err(&pdev->dev, "could not register of_dma_controller\n");
+ goto err_of_dma_controller_register;
+ }
+ }
+
return 0;
+err_of_dma_controller_register:
+ dma_async_device_unregister(&atdma->dma_common);
+ dma_pool_destroy(atdma->dma_desc_pool);
err_pool_create:
platform_set_drvdata(pdev, NULL);
free_irq(platform_get_irq(pdev, 0), atdma);
diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
index 0eb3c13..c604d26 100644
--- a/drivers/dma/at_hdmac_regs.h
+++ b/drivers/dma/at_hdmac_regs.h
@@ -220,6 +220,8 @@ enum atc_status {
* @device: parent device
* @ch_regs: memory mapped register base
* @mask: channel index in a mask
+ * @per_if: peripheral interface
+ * @mem_if: memory interface
* @status: transmit status information from irq/prep* functions
* to tasklet (use atomic operations)
* @tasklet: bottom half to finish transaction work
@@ -238,6 +240,8 @@ struct at_dma_chan {
struct at_dma *device;
void __iomem *ch_regs;
u8 mask;
+ u8 per_if;
+ u8 mem_if;
unsigned long status;
struct tasklet_struct tasklet;
u32 save_cfg;
--
1.7.11.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 2/6] ARM: at91: dts: set #dma-cells to the correct value
2013-04-19 9:11 [PATCH v3 0/6] ARM: at91: move to generic DMA device tree binding ludovic.desroches at atmel.com
2013-04-19 9:11 ` [PATCH v3 1/6] at_hdmac: move to generic DMA binding ludovic.desroches at atmel.com
@ 2013-04-19 9:11 ` ludovic.desroches at atmel.com
2013-04-19 9:39 ` Nicolas Ferre
2013-04-19 9:11 ` [PATCH v3 3/6] i2c: at91: convert to dma_request_slave_channel_compat() ludovic.desroches at atmel.com
` (3 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: ludovic.desroches at atmel.com @ 2013-04-19 9:11 UTC (permalink / raw)
To: linux-arm-kernel
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Moving to generic DMA DT binding involves to set #dma-cells to 2.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
arch/arm/boot/dts/at91sam9g45.dtsi | 1 +
arch/arm/boot/dts/at91sam9n12.dtsi | 1 +
arch/arm/boot/dts/at91sam9x5.dtsi | 2 ++
arch/arm/boot/dts/sama5d3.dtsi | 4 ++--
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 6b1d4ca..275e768 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -108,6 +108,7 @@
compatible = "atmel,at91sam9g45-dma";
reg = <0xffffec00 0x200>;
interrupts = <21 4 0>;
+ #dma-cells = <2>;
};
pinctrl at fffff200 {
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index 7750f98..acc4526 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -110,6 +110,7 @@
compatible = "atmel,at91sam9g45-dma";
reg = <0xffffec00 0x200>;
interrupts = <20 4 0>;
+ #dma-cells = <2>;
};
pinctrl at fffff400 {
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 3870322..8e83d87 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -104,12 +104,14 @@
compatible = "atmel,at91sam9g45-dma";
reg = <0xffffec00 0x200>;
interrupts = <20 4 0>;
+ #dma-cells = <2>;
};
dma1: dma-controller at ffffee00 {
compatible = "atmel,at91sam9g45-dma";
reg = <0xffffee00 0x200>;
interrupts = <21 4 0>;
+ #dma-cells = <2>;
};
pinctrl at fffff400 {
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index 39b0458..95c00a3 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -348,14 +348,14 @@
compatible = "atmel,at91sam9g45-dma";
reg = <0xffffe600 0x200>;
interrupts = <30 4 0>;
- #dma-cells = <1>;
+ #dma-cells = <2>;
};
dma1: dma-controller at ffffe800 {
compatible = "atmel,at91sam9g45-dma";
reg = <0xffffe800 0x200>;
interrupts = <31 4 0>;
- #dma-cells = <1>;
+ #dma-cells = <2>;
};
ramc0: ramc at ffffea00 {
--
1.7.11.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 3/6] i2c: at91: convert to dma_request_slave_channel_compat()
2013-04-19 9:11 [PATCH v3 0/6] ARM: at91: move to generic DMA device tree binding ludovic.desroches at atmel.com
2013-04-19 9:11 ` [PATCH v3 1/6] at_hdmac: move to generic DMA binding ludovic.desroches at atmel.com
2013-04-19 9:11 ` [PATCH v3 2/6] ARM: at91: dts: set #dma-cells to the correct value ludovic.desroches at atmel.com
@ 2013-04-19 9:11 ` ludovic.desroches at atmel.com
2013-04-19 9:11 ` [PATCH v3 4/6] ARM: at91: dts: add i2c dma support ludovic.desroches at atmel.com
` (2 subsequent siblings)
5 siblings, 0 replies; 17+ messages in thread
From: ludovic.desroches at atmel.com @ 2013-04-19 9:11 UTC (permalink / raw)
To: linux-arm-kernel
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Use generic DMA DT helper. Platforms booting with or without DT populated are
both supported.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
drivers/i2c/busses/i2c-at91.c | 49 ++++++++++++++++++++++---------------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index 75195e3..7ffd544 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -607,11 +607,16 @@ MODULE_DEVICE_TABLE(of, atmel_twi_dt_ids);
#define atmel_twi_dt_ids NULL
#endif
-static bool filter(struct dma_chan *chan, void *slave)
+static bool filter(struct dma_chan *chan, void *pdata)
{
- struct at_dma_slave *sl = slave;
+ struct at91_twi_pdata *sl_pdata = pdata;
+ struct at_dma_slave *sl;
- if (sl->dma_dev == chan->device->dev) {
+ if (!sl_pdata)
+ return false;
+
+ sl = &sl_pdata->dma_slave;
+ if (sl && (sl->dma_dev == chan->device->dev)) {
chan->private = sl;
return true;
} else {
@@ -622,11 +627,10 @@ static bool filter(struct dma_chan *chan, void *slave)
static int at91_twi_configure_dma(struct at91_twi_dev *dev, u32 phy_addr)
{
int ret = 0;
- struct at_dma_slave *sdata;
+ struct at91_twi_pdata *pdata = dev->pdata;
struct dma_slave_config slave_config;
struct at91_twi_dma *dma = &dev->dma;
-
- sdata = &dev->pdata->dma_slave;
+ dma_cap_mask_t mask;
memset(&slave_config, 0, sizeof(slave_config));
slave_config.src_addr = (dma_addr_t)phy_addr + AT91_TWI_RHR;
@@ -637,25 +641,22 @@ static int at91_twi_configure_dma(struct at91_twi_dev *dev, u32 phy_addr)
slave_config.dst_maxburst = 1;
slave_config.device_fc = false;
- if (sdata && sdata->dma_dev) {
- dma_cap_mask_t mask;
+ dma_cap_zero(mask);
+ dma_cap_set(DMA_SLAVE, mask);
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
- dma->chan_tx = dma_request_channel(mask, filter, sdata);
- if (!dma->chan_tx) {
- dev_err(dev->dev, "no DMA channel available for tx\n");
- ret = -EBUSY;
- goto error;
- }
- dma->chan_rx = dma_request_channel(mask, filter, sdata);
- if (!dma->chan_rx) {
- dev_err(dev->dev, "no DMA channel available for rx\n");
- ret = -EBUSY;
- goto error;
- }
- } else {
- ret = -EINVAL;
+ dma->chan_tx = dma_request_slave_channel_compat(mask, filter, pdata,
+ dev->dev, "tx");
+ if (!dma->chan_tx) {
+ dev_err(dev->dev, "can't get a DMA channel for tx\n");
+ ret = -EBUSY;
+ goto error;
+ }
+
+ dma->chan_rx = dma_request_slave_channel_compat(mask, filter, pdata,
+ dev->dev, "rx");
+ if (!dma->chan_rx) {
+ dev_err(dev->dev, "can't get a DMA channel for rx\n");
+ ret = -EBUSY;
goto error;
}
--
1.7.11.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 4/6] ARM: at91: dts: add i2c dma support
2013-04-19 9:11 [PATCH v3 0/6] ARM: at91: move to generic DMA device tree binding ludovic.desroches at atmel.com
` (2 preceding siblings ...)
2013-04-19 9:11 ` [PATCH v3 3/6] i2c: at91: convert to dma_request_slave_channel_compat() ludovic.desroches at atmel.com
@ 2013-04-19 9:11 ` ludovic.desroches at atmel.com
2013-04-19 9:43 ` Nicolas Ferre
2013-04-19 9:11 ` [PATCH v3 5/6] mci: at91: convert to dma_request_slave_channel_compat() ludovic.desroches at atmel.com
2013-04-19 9:11 ` [PATCH v3 6/6] ARM: at91: dts: add MCI DMA support ludovic.desroches at atmel.com
5 siblings, 1 reply; 17+ messages in thread
From: ludovic.desroches at atmel.com @ 2013-04-19 9:11 UTC (permalink / raw)
To: linux-arm-kernel
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Add DMA resources to i2c nodes.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
arch/arm/boot/dts/at91sam9n12.dtsi | 6 ++++++
arch/arm/boot/dts/at91sam9x5.dtsi | 9 +++++++++
arch/arm/boot/dts/sama5d3.dtsi | 9 +++++++++
3 files changed, 24 insertions(+)
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index acc4526..f912124 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -361,6 +361,9 @@
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8010000 0x100>;
interrupts = <9 4 6>;
+ dmas = <&dma0 1 13>,
+ <&dma0 1 14>;
+ dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -370,6 +373,9 @@
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8014000 0x100>;
interrupts = <10 4 6>;
+ dmas = <&dma0 1 15>,
+ <&dma0 1 16>;
+ dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 8e83d87..16c9b81 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -519,6 +519,9 @@
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8010000 0x100>;
interrupts = <9 4 6>;
+ dmas = <&dma0 1 7>,
+ <&dma0 1 8>;
+ dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
@@ -530,6 +533,9 @@
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8014000 0x100>;
interrupts = <10 4 6>;
+ dmas = <&dma1 1 5>,
+ <&dma1 1 6>;
+ dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
@@ -541,6 +547,9 @@
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8018000 0x100>;
interrupts = <11 4 6>;
+ dmas = <&dma0 1 9>,
+ <&dma0 1 10>;
+ dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index 95c00a3..8e87277 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -111,6 +111,9 @@
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf0014000 0x4000>;
interrupts = <18 4 6>;
+ dmas = <&dma0 2 7>,
+ <&dma0 2 8>;
+ dma-names = "tx", "rx";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c0>;
#address-cells = <1>;
@@ -122,6 +125,9 @@
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf0018000 0x4000>;
interrupts = <19 4 6>;
+ dmas = <&dma0 2 9>,
+ <&dma0 2 10>;
+ dma-names = "tx", "rx";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;
#address-cells = <1>;
@@ -294,6 +300,9 @@
compatible = "atmel,at91sam9x5-i2c";
reg = <0xf801c000 0x4000>;
interrupts = <20 4 6>;
+ dmas = <&dma1 2 11>,
+ <&dma1 2 12>;
+ dma-names = "tx", "rx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
--
1.7.11.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 5/6] mci: at91: convert to dma_request_slave_channel_compat()
2013-04-19 9:11 [PATCH v3 0/6] ARM: at91: move to generic DMA device tree binding ludovic.desroches at atmel.com
` (3 preceding siblings ...)
2013-04-19 9:11 ` [PATCH v3 4/6] ARM: at91: dts: add i2c dma support ludovic.desroches at atmel.com
@ 2013-04-19 9:11 ` ludovic.desroches at atmel.com
2013-04-30 8:06 ` Nicolas Ferre
2013-04-19 9:11 ` [PATCH v3 6/6] ARM: at91: dts: add MCI DMA support ludovic.desroches at atmel.com
5 siblings, 1 reply; 17+ messages in thread
From: ludovic.desroches at atmel.com @ 2013-04-19 9:11 UTC (permalink / raw)
To: linux-arm-kernel
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Use generic DMA DT helper. Platforms booting with or without DT populated are
both supported.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
drivers/mmc/host/atmel-mci.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 10f8b73..ffbd0d3 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -2224,10 +2224,15 @@ static void __exit atmci_cleanup_slot(struct atmel_mci_slot *slot,
mmc_free_host(slot->mmc);
}
-static bool atmci_filter(struct dma_chan *chan, void *slave)
+static bool atmci_filter(struct dma_chan *chan, void *pdata)
{
- struct mci_dma_data *sl = slave;
+ struct mci_platform_data *sl_pdata = pdata;
+ struct mci_dma_data *sl;
+ if (!sl_pdata)
+ return false;
+
+ sl = sl_pdata->dma_slave;
if (sl && find_slave_dev(sl) == chan->device->dev) {
chan->private = slave_data_ptr(sl);
return true;
@@ -2239,24 +2244,18 @@ static bool atmci_filter(struct dma_chan *chan, void *slave)
static bool atmci_configure_dma(struct atmel_mci *host)
{
struct mci_platform_data *pdata;
+ dma_cap_mask_t mask;
if (host == NULL)
return false;
pdata = host->pdev->dev.platform_data;
- if (!pdata)
- return false;
+ dma_cap_zero(mask);
+ dma_cap_set(DMA_SLAVE, mask);
- if (pdata->dma_slave && find_slave_dev(pdata->dma_slave)) {
- dma_cap_mask_t mask;
-
- /* Try to grab a DMA channel */
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
- host->dma.chan =
- dma_request_channel(mask, atmci_filter, pdata->dma_slave);
- }
+ host->dma.chan = dma_request_slave_channel_compat(mask, atmci_filter, pdata,
+ &host->pdev->dev, "rxtx");
if (!host->dma.chan) {
dev_warn(&host->pdev->dev, "no DMA channel available\n");
return false;
--
1.7.11.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 6/6] ARM: at91: dts: add MCI DMA support
2013-04-19 9:11 [PATCH v3 0/6] ARM: at91: move to generic DMA device tree binding ludovic.desroches at atmel.com
` (4 preceding siblings ...)
2013-04-19 9:11 ` [PATCH v3 5/6] mci: at91: convert to dma_request_slave_channel_compat() ludovic.desroches at atmel.com
@ 2013-04-19 9:11 ` ludovic.desroches at atmel.com
2013-04-19 9:43 ` Nicolas Ferre
5 siblings, 1 reply; 17+ messages in thread
From: ludovic.desroches at atmel.com @ 2013-04-19 9:11 UTC (permalink / raw)
To: linux-arm-kernel
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Add DMA resources to MCI nodes.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
arch/arm/boot/dts/at91sam9g45.dtsi | 4 ++++
arch/arm/boot/dts/at91sam9n12.dtsi | 2 ++
arch/arm/boot/dts/at91sam9x5.dtsi | 4 ++++
arch/arm/boot/dts/sama5d3.dtsi | 6 ++++++
4 files changed, 16 insertions(+)
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 275e768..de2abc0 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -513,6 +513,8 @@
compatible = "atmel,hsmci";
reg = <0xfff80000 0x600>;
interrupts = <11 4 0>;
+ dmas = <&dma0 1 0>;
+ dma-names = "rxtx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -522,6 +524,8 @@
compatible = "atmel,hsmci";
reg = <0xfffd0000 0x600>;
interrupts = <29 4 0>;
+ dmas = <&dma0 1 13>;
+ dma-names = "rxtx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index f912124..0b61c41 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -89,6 +89,8 @@
compatible = "atmel,hsmci";
reg = <0xf0008000 0x600>;
interrupts = <12 4 0>;
+ dmas = <&dma0 1 0>
+ dma-names = "rxtx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 16c9b81..5f42e7a 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -449,6 +449,8 @@
compatible = "atmel,hsmci";
reg = <0xf0008000 0x600>;
interrupts = <12 4 0>;
+ dmas = <&dma0 1 0>;
+ dma-names = "rxtx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
@@ -458,6 +460,8 @@
compatible = "atmel,hsmci";
reg = <0xf000c000 0x600>;
interrupts = <26 4 0>;
+ dmas = <&dma1 1 0>;
+ dma-names = "rxtx";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index 8e87277..2e643ea 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -60,6 +60,8 @@
compatible = "atmel,hsmci";
reg = <0xf0000000 0x600>;
interrupts = <21 4 0>;
+ dmas = <&dma0 2 0>;
+ dma-names = "rxtx";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7>;
status = "disabled";
@@ -173,6 +175,8 @@
compatible = "atmel,hsmci";
reg = <0xf8000000 0x600>;
interrupts = <22 4 0>;
+ dmas = <&dma1 2 0>;
+ dma-names = "rxtx";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
status = "disabled";
@@ -184,6 +188,8 @@
compatible = "atmel,hsmci";
reg = <0xf8004000 0x600>;
interrupts = <23 4 0>;
+ dmas = <&dma1 2 1>;
+ dma-names = "rxtx";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mmc2_clk_cmd_dat0 &pinctrl_mmc2_dat1_3>;
status = "disabled";
--
1.7.11.3
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 2/6] ARM: at91: dts: set #dma-cells to the correct value
2013-04-19 9:11 ` [PATCH v3 2/6] ARM: at91: dts: set #dma-cells to the correct value ludovic.desroches at atmel.com
@ 2013-04-19 9:39 ` Nicolas Ferre
0 siblings, 0 replies; 17+ messages in thread
From: Nicolas Ferre @ 2013-04-19 9:39 UTC (permalink / raw)
To: linux-arm-kernel
On 04/19/2013 11:11 AM, ludovic.desroches at atmel.com :
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> Moving to generic DMA DT binding involves to set #dma-cells to 2.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
And stacked in at91-3.10-soc.
thanks,
> ---
> arch/arm/boot/dts/at91sam9g45.dtsi | 1 +
> arch/arm/boot/dts/at91sam9n12.dtsi | 1 +
> arch/arm/boot/dts/at91sam9x5.dtsi | 2 ++
> arch/arm/boot/dts/sama5d3.dtsi | 4 ++--
> 4 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
> index 6b1d4ca..275e768 100644
> --- a/arch/arm/boot/dts/at91sam9g45.dtsi
> +++ b/arch/arm/boot/dts/at91sam9g45.dtsi
> @@ -108,6 +108,7 @@
> compatible = "atmel,at91sam9g45-dma";
> reg = <0xffffec00 0x200>;
> interrupts = <21 4 0>;
> + #dma-cells = <2>;
> };
>
> pinctrl at fffff200 {
> diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
> index 7750f98..acc4526 100644
> --- a/arch/arm/boot/dts/at91sam9n12.dtsi
> +++ b/arch/arm/boot/dts/at91sam9n12.dtsi
> @@ -110,6 +110,7 @@
> compatible = "atmel,at91sam9g45-dma";
> reg = <0xffffec00 0x200>;
> interrupts = <20 4 0>;
> + #dma-cells = <2>;
> };
>
> pinctrl at fffff400 {
> diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
> index 3870322..8e83d87 100644
> --- a/arch/arm/boot/dts/at91sam9x5.dtsi
> +++ b/arch/arm/boot/dts/at91sam9x5.dtsi
> @@ -104,12 +104,14 @@
> compatible = "atmel,at91sam9g45-dma";
> reg = <0xffffec00 0x200>;
> interrupts = <20 4 0>;
> + #dma-cells = <2>;
> };
>
> dma1: dma-controller at ffffee00 {
> compatible = "atmel,at91sam9g45-dma";
> reg = <0xffffee00 0x200>;
> interrupts = <21 4 0>;
> + #dma-cells = <2>;
> };
>
> pinctrl at fffff400 {
> diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
> index 39b0458..95c00a3 100644
> --- a/arch/arm/boot/dts/sama5d3.dtsi
> +++ b/arch/arm/boot/dts/sama5d3.dtsi
> @@ -348,14 +348,14 @@
> compatible = "atmel,at91sam9g45-dma";
> reg = <0xffffe600 0x200>;
> interrupts = <30 4 0>;
> - #dma-cells = <1>;
> + #dma-cells = <2>;
> };
>
> dma1: dma-controller at ffffe800 {
> compatible = "atmel,at91sam9g45-dma";
> reg = <0xffffe800 0x200>;
> interrupts = <31 4 0>;
> - #dma-cells = <1>;
> + #dma-cells = <2>;
> };
>
> ramc0: ramc at ffffea00 {
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 6/6] ARM: at91: dts: add MCI DMA support
2013-04-19 9:11 ` [PATCH v3 6/6] ARM: at91: dts: add MCI DMA support ludovic.desroches at atmel.com
@ 2013-04-19 9:43 ` Nicolas Ferre
0 siblings, 0 replies; 17+ messages in thread
From: Nicolas Ferre @ 2013-04-19 9:43 UTC (permalink / raw)
To: linux-arm-kernel
On 04/19/2013 11:11 AM, ludovic.desroches at atmel.com :
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> Add DMA resources to MCI nodes.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
I have made little corrections, but do not bother, it is already in my tree:
[nicolas.ferre at atmel.com: correct 9g45, 9n12 dma phandle name]
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
And stacked in at91-3.10-soc.
thanks,
> ---
> arch/arm/boot/dts/at91sam9g45.dtsi | 4 ++++
> arch/arm/boot/dts/at91sam9n12.dtsi | 2 ++
> arch/arm/boot/dts/at91sam9x5.dtsi | 4 ++++
> arch/arm/boot/dts/sama5d3.dtsi | 6 ++++++
> 4 files changed, 16 insertions(+)
>
> diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
> index 275e768..de2abc0 100644
> --- a/arch/arm/boot/dts/at91sam9g45.dtsi
> +++ b/arch/arm/boot/dts/at91sam9g45.dtsi
> @@ -513,6 +513,8 @@
> compatible = "atmel,hsmci";
> reg = <0xfff80000 0x600>;
> interrupts = <11 4 0>;
> + dmas = <&dma0 1 0>;
single dma controller in 9g45:
s/dma0/dma/
> + dma-names = "rxtx";
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
> @@ -522,6 +524,8 @@
> compatible = "atmel,hsmci";
> reg = <0xfffd0000 0x600>;
> interrupts = <29 4 0>;
> + dmas = <&dma0 1 13>;
Ditto
> + dma-names = "rxtx";
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
> diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
> index f912124..0b61c41 100644
> --- a/arch/arm/boot/dts/at91sam9n12.dtsi
> +++ b/arch/arm/boot/dts/at91sam9n12.dtsi
> @@ -89,6 +89,8 @@
> compatible = "atmel,hsmci";
> reg = <0xf0008000 0x600>;
> interrupts = <12 4 0>;
> + dmas = <&dma0 1 0>
single dma controller in 9n12:
s/dma0/dma/
+ do not forget the tailing ";"
> + dma-names = "rxtx";
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
> diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
> index 16c9b81..5f42e7a 100644
> --- a/arch/arm/boot/dts/at91sam9x5.dtsi
> +++ b/arch/arm/boot/dts/at91sam9x5.dtsi
> @@ -449,6 +449,8 @@
> compatible = "atmel,hsmci";
> reg = <0xf0008000 0x600>;
> interrupts = <12 4 0>;
> + dmas = <&dma0 1 0>;
> + dma-names = "rxtx";
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
> @@ -458,6 +460,8 @@
> compatible = "atmel,hsmci";
> reg = <0xf000c000 0x600>;
> interrupts = <26 4 0>;
> + dmas = <&dma1 1 0>;
> + dma-names = "rxtx";
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
> diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
> index 8e87277..2e643ea 100644
> --- a/arch/arm/boot/dts/sama5d3.dtsi
> +++ b/arch/arm/boot/dts/sama5d3.dtsi
> @@ -60,6 +60,8 @@
> compatible = "atmel,hsmci";
> reg = <0xf0000000 0x600>;
> interrupts = <21 4 0>;
> + dmas = <&dma0 2 0>;
> + dma-names = "rxtx";
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7>;
> status = "disabled";
> @@ -173,6 +175,8 @@
> compatible = "atmel,hsmci";
> reg = <0xf8000000 0x600>;
> interrupts = <22 4 0>;
> + dmas = <&dma1 2 0>;
> + dma-names = "rxtx";
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
> status = "disabled";
> @@ -184,6 +188,8 @@
> compatible = "atmel,hsmci";
> reg = <0xf8004000 0x600>;
> interrupts = <23 4 0>;
> + dmas = <&dma1 2 1>;
> + dma-names = "rxtx";
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_mmc2_clk_cmd_dat0 &pinctrl_mmc2_dat1_3>;
> status = "disabled";
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 4/6] ARM: at91: dts: add i2c dma support
2013-04-19 9:11 ` [PATCH v3 4/6] ARM: at91: dts: add i2c dma support ludovic.desroches at atmel.com
@ 2013-04-19 9:43 ` Nicolas Ferre
0 siblings, 0 replies; 17+ messages in thread
From: Nicolas Ferre @ 2013-04-19 9:43 UTC (permalink / raw)
To: linux-arm-kernel
On 04/19/2013 11:11 AM, ludovic.desroches at atmel.com :
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> Add DMA resources to i2c nodes.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
I have made little corrections, but do not bother, it is already in my tree:
[nicolas.ferre at atmel.com: correct 9n12 dma phandle name]
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
And stacked in at91-3.10-soc.
thanks,
> ---
> arch/arm/boot/dts/at91sam9n12.dtsi | 6 ++++++
> arch/arm/boot/dts/at91sam9x5.dtsi | 9 +++++++++
> arch/arm/boot/dts/sama5d3.dtsi | 9 +++++++++
> 3 files changed, 24 insertions(+)
>
> diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
> index acc4526..f912124 100644
> --- a/arch/arm/boot/dts/at91sam9n12.dtsi
> +++ b/arch/arm/boot/dts/at91sam9n12.dtsi
> @@ -361,6 +361,9 @@
> compatible = "atmel,at91sam9x5-i2c";
> reg = <0xf8010000 0x100>;
> interrupts = <9 4 6>;
> + dmas = <&dma0 1 13>,
> + <&dma0 1 14>;
single dma controller in 9n12:
s/dma0/dma/
> + dma-names = "tx", "rx";
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
> @@ -370,6 +373,9 @@
> compatible = "atmel,at91sam9x5-i2c";
> reg = <0xf8014000 0x100>;
> interrupts = <10 4 6>;
> + dmas = <&dma0 1 15>,
> + <&dma0 1 16>;
Ditto
> + dma-names = "tx", "rx";
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
> diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
> index 8e83d87..16c9b81 100644
> --- a/arch/arm/boot/dts/at91sam9x5.dtsi
> +++ b/arch/arm/boot/dts/at91sam9x5.dtsi
> @@ -519,6 +519,9 @@
> compatible = "atmel,at91sam9x5-i2c";
> reg = <0xf8010000 0x100>;
> interrupts = <9 4 6>;
> + dmas = <&dma0 1 7>,
> + <&dma0 1 8>;
> + dma-names = "tx", "rx";
> #address-cells = <1>;
> #size-cells = <0>;
> pinctrl-names = "default";
> @@ -530,6 +533,9 @@
> compatible = "atmel,at91sam9x5-i2c";
> reg = <0xf8014000 0x100>;
> interrupts = <10 4 6>;
> + dmas = <&dma1 1 5>,
> + <&dma1 1 6>;
> + dma-names = "tx", "rx";
> #address-cells = <1>;
> #size-cells = <0>;
> pinctrl-names = "default";
> @@ -541,6 +547,9 @@
> compatible = "atmel,at91sam9x5-i2c";
> reg = <0xf8018000 0x100>;
> interrupts = <11 4 6>;
> + dmas = <&dma0 1 9>,
> + <&dma0 1 10>;
> + dma-names = "tx", "rx";
> #address-cells = <1>;
> #size-cells = <0>;
> pinctrl-names = "default";
> diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
> index 95c00a3..8e87277 100644
> --- a/arch/arm/boot/dts/sama5d3.dtsi
> +++ b/arch/arm/boot/dts/sama5d3.dtsi
> @@ -111,6 +111,9 @@
> compatible = "atmel,at91sam9x5-i2c";
> reg = <0xf0014000 0x4000>;
> interrupts = <18 4 6>;
> + dmas = <&dma0 2 7>,
> + <&dma0 2 8>;
> + dma-names = "tx", "rx";
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_i2c0>;
> #address-cells = <1>;
> @@ -122,6 +125,9 @@
> compatible = "atmel,at91sam9x5-i2c";
> reg = <0xf0018000 0x4000>;
> interrupts = <19 4 6>;
> + dmas = <&dma0 2 9>,
> + <&dma0 2 10>;
> + dma-names = "tx", "rx";
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_i2c1>;
> #address-cells = <1>;
> @@ -294,6 +300,9 @@
> compatible = "atmel,at91sam9x5-i2c";
> reg = <0xf801c000 0x4000>;
> interrupts = <20 4 6>;
> + dmas = <&dma1 2 11>,
> + <&dma1 2 12>;
> + dma-names = "tx", "rx";
> #address-cells = <1>;
> #size-cells = <0>;
> status = "disabled";
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 1/6] at_hdmac: move to generic DMA binding
2013-04-19 9:11 ` [PATCH v3 1/6] at_hdmac: move to generic DMA binding ludovic.desroches at atmel.com
@ 2013-04-22 10:22 ` Nicolas Ferre
2013-04-23 3:44 ` Vinod Koul
2013-04-30 8:48 ` Vinod Koul
0 siblings, 2 replies; 17+ messages in thread
From: Nicolas Ferre @ 2013-04-22 10:22 UTC (permalink / raw)
To: linux-arm-kernel
On 04/19/2013 11:11 AM, ludovic.desroches at atmel.com :
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> Update at_hdmac driver to support generic DMA device tree binding. Devices
> can still request channel with dma_request_channel() then it doesn't break
> DMA for non DT boards.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Hi Vinod,
As you were not in copy of the patch, I send you a little reminder for
it. It is part of a series by Ludovic and is adding the generic slave
DMA device tree binding for our at_hdmac dmaengine driver.
Here is the only patch of the series that should go through your tree.
Other maintainers and ourselves have taken the other patches (no strong
synchronization needed between them).
Here is the Linux arm kernel patchwork reference:
https://patchwork.kernel.org/patch/2463601/
But for sure, Ludovic or myself can send it again to you if you need.
Thanks, best regards,
> ---
> .../devicetree/bindings/dma/atmel-dma.txt | 35 ++++++--
> drivers/dma/at_hdmac.c | 93 ++++++++++++++++++++--
> drivers/dma/at_hdmac_regs.h | 4 +
> 3 files changed, 121 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/dma/atmel-dma.txt b/Documentation/devicetree/bindings/dma/atmel-dma.txt
> index 3c046ee..c80e8a3 100644
> --- a/Documentation/devicetree/bindings/dma/atmel-dma.txt
> +++ b/Documentation/devicetree/bindings/dma/atmel-dma.txt
> @@ -1,14 +1,39 @@
> * Atmel Direct Memory Access Controller (DMA)
>
> Required properties:
> -- compatible: Should be "atmel,<chip>-dma"
> -- reg: Should contain DMA registers location and length
> -- interrupts: Should contain DMA interrupt
> +- compatible: Should be "atmel,<chip>-dma".
> +- reg: Should contain DMA registers location and length.
> +- interrupts: Should contain DMA interrupt.
> +- #dma-cells: Must be <2>, used to represent the number of integer cells in
> +the dmas property of client devices.
>
> -Examples:
> +Example:
>
> -dma at ffffec00 {
> +dma0: dma at ffffec00 {
> compatible = "atmel,at91sam9g45-dma";
> reg = <0xffffec00 0x200>;
> interrupts = <21>;
> + #dma-cells = <2>;
> +};
> +
> +DMA clients connected to the Atmel DMA controller must use the format
> +described in the dma.txt file, using a three-cell specifier for each channel:
> +a phandle plus two interger cells.
> +The three cells in order are:
> +
> +1. A phandle pointing to the DMA controller.
> +2. The memory interface (16 most significant bits), the peripheral interface
> +(16 less significant bits).
> +3. The peripheral identifier for the hardware handshaking interface. The
> +identifier can be different for tx and rx.
> +
> +Example:
> +
> +i2c0 at i2c@f8010000 {
> + compatible = "atmel,at91sam9x5-i2c";
> + reg = <0xf8010000 0x100>;
> + interrupts = <9 4 6>;
> + dmas = <&dma0 1 7>,
> + <&dma0 1 8>;
> + dma-names = "tx", "rx";
> };
> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
> index de4e930..fda2661 100644
> --- a/drivers/dma/at_hdmac.c
> +++ b/drivers/dma/at_hdmac.c
> @@ -24,6 +24,7 @@
> #include <linux/slab.h>
> #include <linux/of.h>
> #include <linux/of_device.h>
> +#include <linux/of_dma.h>
>
> #include "at_hdmac_regs.h"
> #include "dmaengine.h"
> @@ -677,7 +678,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
> ctrlb |= ATC_DST_ADDR_MODE_FIXED
> | ATC_SRC_ADDR_MODE_INCR
> | ATC_FC_MEM2PER
> - | ATC_SIF(AT_DMA_MEM_IF) | ATC_DIF(AT_DMA_PER_IF);
> + | ATC_SIF(atchan->mem_if) | ATC_DIF(atchan->per_if);
> reg = sconfig->dst_addr;
> for_each_sg(sgl, sg, sg_len, i) {
> struct at_desc *desc;
> @@ -716,7 +717,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
> ctrlb |= ATC_DST_ADDR_MODE_INCR
> | ATC_SRC_ADDR_MODE_FIXED
> | ATC_FC_PER2MEM
> - | ATC_SIF(AT_DMA_PER_IF) | ATC_DIF(AT_DMA_MEM_IF);
> + | ATC_SIF(atchan->per_if) | ATC_DIF(atchan->mem_if);
>
> reg = sconfig->src_addr;
> for_each_sg(sgl, sg, sg_len, i) {
> @@ -822,8 +823,8 @@ atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc,
> desc->lli.ctrlb = ATC_DST_ADDR_MODE_FIXED
> | ATC_SRC_ADDR_MODE_INCR
> | ATC_FC_MEM2PER
> - | ATC_SIF(AT_DMA_MEM_IF)
> - | ATC_DIF(AT_DMA_PER_IF);
> + | ATC_SIF(atchan->mem_if)
> + | ATC_DIF(atchan->per_if);
> break;
>
> case DMA_DEV_TO_MEM:
> @@ -833,8 +834,8 @@ atc_dma_cyclic_fill_desc(struct dma_chan *chan, struct at_desc *desc,
> desc->lli.ctrlb = ATC_DST_ADDR_MODE_INCR
> | ATC_SRC_ADDR_MODE_FIXED
> | ATC_FC_PER2MEM
> - | ATC_SIF(AT_DMA_PER_IF)
> - | ATC_DIF(AT_DMA_MEM_IF);
> + | ATC_SIF(atchan->per_if)
> + | ATC_DIF(atchan->mem_if);
> break;
>
> default:
> @@ -1190,6 +1191,67 @@ static void atc_free_chan_resources(struct dma_chan *chan)
> dev_vdbg(chan2dev(chan), "free_chan_resources: done\n");
> }
>
> +#ifdef CONFIG_OF
> +static bool at_dma_filter(struct dma_chan *chan, void *slave)
> +{
> + struct at_dma_slave *atslave = slave;
> +
> + if (atslave->dma_dev == chan->device->dev) {
> + chan->private = atslave;
> + return true;
> + } else {
> + return false;
> + }
> +}
> +
> +static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,
> + struct of_dma *of_dma)
> +{
> + struct dma_chan *chan;
> + struct at_dma_chan *atchan;
> + struct at_dma_slave *atslave;
> + dma_cap_mask_t mask;
> + unsigned int per_id;
> + struct platform_device *dmac_pdev;
> +
> + if (dma_spec->args_count != 2)
> + return NULL;
> +
> + dmac_pdev = of_find_device_by_node(dma_spec->np);
> +
> + dma_cap_zero(mask);
> + dma_cap_set(DMA_SLAVE, mask);
> +
> + atslave = devm_kzalloc(&dmac_pdev->dev, sizeof(*atslave), GFP_KERNEL);
> + if (!atslave)
> + return NULL;
> + /*
> + * We can fill both SRC_PER and DST_PER, one of these fields will be
> + * ignored depending on DMA transfer direction.
> + */
> + per_id = dma_spec->args[1];
> + atslave->cfg = ATC_FIFOCFG_HALFFIFO | ATC_DST_H2SEL_HW
> + | ATC_SRC_H2SEL_HW | ATC_DST_PER(per_id)
> + | ATC_SRC_PER(per_id);
> + atslave->dma_dev = &dmac_pdev->dev;
> +
> + chan = dma_request_channel(mask, at_dma_filter, atslave);
> + if (!chan)
> + return NULL;
> +
> + atchan = to_at_dma_chan(chan);
> + atchan->per_if = dma_spec->args[0] & 0xff;
> + atchan->mem_if = (dma_spec->args[0] >> 16) & 0xff;
> +
> + return chan;
> +}
> +#else
> +static struct dma_chan *at_dma_xlate(struct of_phandle_args *dma_spec,
> + struct of_dma *of_dma)
> +{
> + return NULL;
> +}
> +#endif
>
> /*-- Module Management -----------------------------------------------*/
>
> @@ -1344,6 +1406,8 @@ static int __init at_dma_probe(struct platform_device *pdev)
> for (i = 0; i < plat_dat->nr_channels; i++) {
> struct at_dma_chan *atchan = &atdma->chan[i];
>
> + atchan->mem_if = AT_DMA_MEM_IF;
> + atchan->per_if = AT_DMA_PER_IF;
> atchan->chan_common.device = &atdma->dma_common;
> dma_cookie_init(&atchan->chan_common);
> list_add_tail(&atchan->chan_common.device_node,
> @@ -1390,8 +1454,25 @@ static int __init at_dma_probe(struct platform_device *pdev)
>
> dma_async_device_register(&atdma->dma_common);
>
> + /*
> + * Do not return an error if the dmac node is not present in order to
> + * not break the existing way of requesting channel with
> + * dma_request_channel().
> + */
> + if (pdev->dev.of_node) {
> + err = of_dma_controller_register(pdev->dev.of_node,
> + at_dma_xlate, atdma);
> + if (err) {
> + dev_err(&pdev->dev, "could not register of_dma_controller\n");
> + goto err_of_dma_controller_register;
> + }
> + }
> +
> return 0;
>
> +err_of_dma_controller_register:
> + dma_async_device_unregister(&atdma->dma_common);
> + dma_pool_destroy(atdma->dma_desc_pool);
> err_pool_create:
> platform_set_drvdata(pdev, NULL);
> free_irq(platform_get_irq(pdev, 0), atdma);
> diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
> index 0eb3c13..c604d26 100644
> --- a/drivers/dma/at_hdmac_regs.h
> +++ b/drivers/dma/at_hdmac_regs.h
> @@ -220,6 +220,8 @@ enum atc_status {
> * @device: parent device
> * @ch_regs: memory mapped register base
> * @mask: channel index in a mask
> + * @per_if: peripheral interface
> + * @mem_if: memory interface
> * @status: transmit status information from irq/prep* functions
> * to tasklet (use atomic operations)
> * @tasklet: bottom half to finish transaction work
> @@ -238,6 +240,8 @@ struct at_dma_chan {
> struct at_dma *device;
> void __iomem *ch_regs;
> u8 mask;
> + u8 per_if;
> + u8 mem_if;
> unsigned long status;
> struct tasklet_struct tasklet;
> u32 save_cfg;
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 1/6] at_hdmac: move to generic DMA binding
2013-04-22 10:22 ` Nicolas Ferre
@ 2013-04-23 3:44 ` Vinod Koul
2013-04-29 13:28 ` Nicolas Ferre
2013-04-30 8:48 ` Vinod Koul
1 sibling, 1 reply; 17+ messages in thread
From: Vinod Koul @ 2013-04-23 3:44 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 22, 2013 at 12:22:32PM +0200, Nicolas Ferre wrote:
> On 04/19/2013 11:11 AM, ludovic.desroches at atmel.com :
> > From: Ludovic Desroches <ludovic.desroches@atmel.com>
> > +#ifdef CONFIG_OF
> > +static bool at_dma_filter(struct dma_chan *chan, void *slave)
this is not defined for else case here. Also this could be CONFIG_DMA_OF...?
> > +{
> > + struct at_dma_slave *atslave = slave;
> > +
> > + if (atslave->dma_dev == chan->device->dev) {
> > + chan->private = atslave;
> > + return true;
> > + } else {
> > + return false;
> > + }
> > +}
--
~Vinod
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 1/6] at_hdmac: move to generic DMA binding
2013-04-23 3:44 ` Vinod Koul
@ 2013-04-29 13:28 ` Nicolas Ferre
0 siblings, 0 replies; 17+ messages in thread
From: Nicolas Ferre @ 2013-04-29 13:28 UTC (permalink / raw)
To: linux-arm-kernel
On 04/23/2013 05:44 AM, Vinod Koul :
> On Mon, Apr 22, 2013 at 12:22:32PM +0200, Nicolas Ferre wrote:
>> On 04/19/2013 11:11 AM, ludovic.desroches at atmel.com :
>>> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
>>> +#ifdef CONFIG_OF
>>> +static bool at_dma_filter(struct dma_chan *chan, void *slave)
> this is not defined for else case here. Also this could be CONFIG_DMA_OF...?
in fact, at_dma_filter() is only used in corresponding
dma_request_channel() in at_dma_xlate() function just below and only in
case of CONFIG_OF.
As the at_dma_xlate() is an empty function in !CONFIG_OF case, the
at_dma_filter() is not needed.
For the use of CONFIG_OF and not CONFIG_OF_DMA, it is simply because it
it the directive that we currently use in drivers when we have to put
the device tree condition around a piece of code. It is quite a common
pattern I think.
Moreover, it is what is used in dw_dmac.c and mv_xor.c...
>>> +{
>>> + struct at_dma_slave *atslave = slave;
>>> +
>>> + if (atslave->dma_dev == chan->device->dev) {
>>> + chan->private = atslave;
>>> + return true;
>>> + } else {
>>> + return false;
>>> + }
>>> +}
>
> --
> ~Vinod
Best regards,
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 5/6] mci: at91: convert to dma_request_slave_channel_compat()
2013-04-19 9:11 ` [PATCH v3 5/6] mci: at91: convert to dma_request_slave_channel_compat() ludovic.desroches at atmel.com
@ 2013-04-30 8:06 ` Nicolas Ferre
2013-05-10 10:05 ` [PATCH] mmc: atmel-mci: " Nicolas Ferre
0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Ferre @ 2013-04-30 8:06 UTC (permalink / raw)
To: linux-arm-kernel
On 04/19/2013 11:11 AM, ludovic.desroches at atmel.com :
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> Use generic DMA DT helper. Platforms booting with or without DT populated are
> both supported.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Hi Chris,
As you were not in copy of the patch, I send you a little reminder for
it. It is part of a series by Ludovic and is adding the generic slave
DMA request channel function, as we now have the support for DMA bindings.
Here is the only patch of the series that should go through your tree.
Other maintainers and ourselves have taken the other patches (no strong
synchronization needed between them).
Here is the Linux arm kernel patchwork reference:
https://patchwork.kernel.org/patch/2463641/
But for sure, Ludovic or myself can send it again to you if you need.
Thanks, best regards,
> ---
> drivers/mmc/host/atmel-mci.c | 25 ++++++++++++-------------
> 1 file changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 10f8b73..ffbd0d3 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -2224,10 +2224,15 @@ static void __exit atmci_cleanup_slot(struct atmel_mci_slot *slot,
> mmc_free_host(slot->mmc);
> }
>
> -static bool atmci_filter(struct dma_chan *chan, void *slave)
> +static bool atmci_filter(struct dma_chan *chan, void *pdata)
> {
> - struct mci_dma_data *sl = slave;
> + struct mci_platform_data *sl_pdata = pdata;
> + struct mci_dma_data *sl;
>
> + if (!sl_pdata)
> + return false;
> +
> + sl = sl_pdata->dma_slave;
> if (sl && find_slave_dev(sl) == chan->device->dev) {
> chan->private = slave_data_ptr(sl);
> return true;
> @@ -2239,24 +2244,18 @@ static bool atmci_filter(struct dma_chan *chan, void *slave)
> static bool atmci_configure_dma(struct atmel_mci *host)
> {
> struct mci_platform_data *pdata;
> + dma_cap_mask_t mask;
>
> if (host == NULL)
> return false;
>
> pdata = host->pdev->dev.platform_data;
>
> - if (!pdata)
> - return false;
> + dma_cap_zero(mask);
> + dma_cap_set(DMA_SLAVE, mask);
>
> - if (pdata->dma_slave && find_slave_dev(pdata->dma_slave)) {
> - dma_cap_mask_t mask;
> -
> - /* Try to grab a DMA channel */
> - dma_cap_zero(mask);
> - dma_cap_set(DMA_SLAVE, mask);
> - host->dma.chan =
> - dma_request_channel(mask, atmci_filter, pdata->dma_slave);
> - }
> + host->dma.chan = dma_request_slave_channel_compat(mask, atmci_filter, pdata,
> + &host->pdev->dev, "rxtx");
> if (!host->dma.chan) {
> dev_warn(&host->pdev->dev, "no DMA channel available\n");
> return false;
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 1/6] at_hdmac: move to generic DMA binding
2013-04-22 10:22 ` Nicolas Ferre
2013-04-23 3:44 ` Vinod Koul
@ 2013-04-30 8:48 ` Vinod Koul
1 sibling, 0 replies; 17+ messages in thread
From: Vinod Koul @ 2013-04-30 8:48 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 22, 2013 at 12:22:32PM +0200, Nicolas Ferre wrote:
> On 04/19/2013 11:11 AM, ludovic.desroches at atmel.com :
> > From: Ludovic Desroches <ludovic.desroches@atmel.com>
> >
> > Update at_hdmac driver to support generic DMA device tree binding. Devices
> > can still request channel with dma_request_channel() then it doesn't break
> > DMA for non DT boards.
> >
> > Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> > Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> > Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
Applied now thanks
--
~Vinod
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH] mmc: atmel-mci: convert to dma_request_slave_channel_compat()
2013-04-30 8:06 ` Nicolas Ferre
@ 2013-05-10 10:05 ` Nicolas Ferre
2013-05-26 17:34 ` Chris Ball
0 siblings, 1 reply; 17+ messages in thread
From: Nicolas Ferre @ 2013-05-10 10:05 UTC (permalink / raw)
To: linux-arm-kernel
From: Ludovic Desroches <ludovic.desroches@atmel.com>
Use generic DMA DT helper. Platforms booting with or without DT populated are
both supported.
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
Hi Chris,
This patch is part of a series by Ludovic and is adding the generic slave
DMA request channel function, as we now have the support for DMA bindings.
This is the only patch of the series that should go through your tree. And it
seems that my little reminder didn't catch your attention in time for 3.10 merge
window but I still hope that we can make it for 3.10-final... It is also true
that we didn't put you in copy of the original message and that the subject
line was somehow malformed ;-)
Here is the Linux arm kernel patchwork reference of previous discussion:
https://patchwork.kernel.org/patch/2463641/
Thanks, best regards,
drivers/mmc/host/atmel-mci.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index e75774f..aca59d9 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -2230,10 +2230,15 @@ static void __exit atmci_cleanup_slot(struct atmel_mci_slot *slot,
mmc_free_host(slot->mmc);
}
-static bool atmci_filter(struct dma_chan *chan, void *slave)
+static bool atmci_filter(struct dma_chan *chan, void *pdata)
{
- struct mci_dma_data *sl = slave;
+ struct mci_platform_data *sl_pdata = pdata;
+ struct mci_dma_data *sl;
+ if (!sl_pdata)
+ return false;
+
+ sl = sl_pdata->dma_slave;
if (sl && find_slave_dev(sl) == chan->device->dev) {
chan->private = slave_data_ptr(sl);
return true;
@@ -2245,24 +2250,18 @@ static bool atmci_filter(struct dma_chan *chan, void *slave)
static bool atmci_configure_dma(struct atmel_mci *host)
{
struct mci_platform_data *pdata;
+ dma_cap_mask_t mask;
if (host == NULL)
return false;
pdata = host->pdev->dev.platform_data;
- if (!pdata)
- return false;
+ dma_cap_zero(mask);
+ dma_cap_set(DMA_SLAVE, mask);
- if (pdata->dma_slave && find_slave_dev(pdata->dma_slave)) {
- dma_cap_mask_t mask;
-
- /* Try to grab a DMA channel */
- dma_cap_zero(mask);
- dma_cap_set(DMA_SLAVE, mask);
- host->dma.chan =
- dma_request_channel(mask, atmci_filter, pdata->dma_slave);
- }
+ host->dma.chan = dma_request_slave_channel_compat(mask, atmci_filter, pdata,
+ &host->pdev->dev, "rxtx");
if (!host->dma.chan) {
dev_warn(&host->pdev->dev, "no DMA channel available\n");
return false;
--
1.8.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH] mmc: atmel-mci: convert to dma_request_slave_channel_compat()
2013-05-10 10:05 ` [PATCH] mmc: atmel-mci: " Nicolas Ferre
@ 2013-05-26 17:34 ` Chris Ball
0 siblings, 0 replies; 17+ messages in thread
From: Chris Ball @ 2013-05-26 17:34 UTC (permalink / raw)
To: linux-arm-kernel
Hi Nicolas,
On Fri, May 10 2013, Nicolas Ferre wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> Use generic DMA DT helper. Platforms booting with or without DT populated are
> both supported.
>
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
> Hi Chris,
>
> This patch is part of a series by Ludovic and is adding the generic slave
> DMA request channel function, as we now have the support for DMA bindings.
>
> This is the only patch of the series that should go through your tree. And it
> seems that my little reminder didn't catch your attention in time for 3.10 merge
> window but I still hope that we can make it for 3.10-final... It is also true
> that we didn't put you in copy of the original message and that the subject
> line was somehow malformed ;-)
>
> Here is the Linux arm kernel patchwork reference of previous discussion:
> https://patchwork.kernel.org/patch/2463641/
Thanks, I'm sorry for the delay. This is in mmc-next now, I'll send
it to Linus for the next -rc.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2013-05-26 17:34 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-19 9:11 [PATCH v3 0/6] ARM: at91: move to generic DMA device tree binding ludovic.desroches at atmel.com
2013-04-19 9:11 ` [PATCH v3 1/6] at_hdmac: move to generic DMA binding ludovic.desroches at atmel.com
2013-04-22 10:22 ` Nicolas Ferre
2013-04-23 3:44 ` Vinod Koul
2013-04-29 13:28 ` Nicolas Ferre
2013-04-30 8:48 ` Vinod Koul
2013-04-19 9:11 ` [PATCH v3 2/6] ARM: at91: dts: set #dma-cells to the correct value ludovic.desroches at atmel.com
2013-04-19 9:39 ` Nicolas Ferre
2013-04-19 9:11 ` [PATCH v3 3/6] i2c: at91: convert to dma_request_slave_channel_compat() ludovic.desroches at atmel.com
2013-04-19 9:11 ` [PATCH v3 4/6] ARM: at91: dts: add i2c dma support ludovic.desroches at atmel.com
2013-04-19 9:43 ` Nicolas Ferre
2013-04-19 9:11 ` [PATCH v3 5/6] mci: at91: convert to dma_request_slave_channel_compat() ludovic.desroches at atmel.com
2013-04-30 8:06 ` Nicolas Ferre
2013-05-10 10:05 ` [PATCH] mmc: atmel-mci: " Nicolas Ferre
2013-05-26 17:34 ` Chris Ball
2013-04-19 9:11 ` [PATCH v3 6/6] ARM: at91: dts: add MCI DMA support ludovic.desroches at atmel.com
2013-04-19 9:43 ` Nicolas Ferre
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).