Skip to contentSkip to conversation

omap_hsmmc DT DMA Client support

PATCH Superseded Matt Porter 5 participants 12 messages Mar 5, 2013 – Jun 17, 2013

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover omap_hsmmc DT DMA Client support

Changes since v1:
- rebase to 3.9-rc1, previous dependencies upstream

This series adds DT DMA Engine Client support to the omap_hsmmc. It leverages the generic DMA OF helpers in -next and the dma_request_slave_channel_compat() wrapper introduced in the AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.

These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific omap_hsmmc changes.

Matt Porter (2):
mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
mmc: omap_hsmmc: add generic DMA request support to the DT binding

Santosh Shilimkar (1):
mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |   26 +++++++++++++-
 drivers/mmc/host/omap_hsmmc.c                      |   38 ++++++++++++--------
 2 files changed, 48 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH v2 3/3 mmc: omap_hsmmc: add generic DMA request support to the DT binding

The binding definition is based on the generic DMA request binding.

---
 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt      |   26 +++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt +25 -1
index ed271fc..8c8908a 100644
@@ -20,8 +20,29 @@ ti,dual-volt: boolean, supports dual voltage cards
 ti,non-removable: non-removable slot (like eMMC)
 ti,needs-special-reset: Requires a special softreset sequence
 ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed
+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.
+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 "rx" and "tx" for RX and TX DMA requests, respectively.
+
+Examples:
+
+[hwmod populated DMA resources]
+
+	mmc1: mmc@0x4809c000 {
+		compatible = "ti,omap4-hsmmc";
+		reg = <0x4809c000 0x400>;
+		ti,hwmods = "mmc1";
+		ti,dual-volt;
+		bus-width = <4>;
+		vmmc-supply = <&vmmc>; /* phandle to regulator node */
+		ti,non-removable;
+	};
+
+[generic DMA request binding]
 
-Example:
 	mmc1: mmc@0x4809c000 {
 		compatible = "ti,omap4-hsmmc";
 		reg = <0x4809c000 0x400>;
@@ -30,4 +51,7 @@ Example:
 		bus-width = <4>;
 		vmmc-supply = <&vmmc>; /* phandle to regulator node */
 		ti,non-removable;
+		dmas = <&edma 24
+			&edma 25>;
+		dma-names = "tx", "rx";
 	};
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/3 mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()

In reply to Matt Porter

Convert dmaengine channel requests to use dma_request_slave_channel_compat(). This supports platforms booting with or without DT populated.

---
 drivers/mmc/host/omap_hsmmc.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/mmc/host/omap_hsmmc.c +8 -2
index bc58078..e79b12d 100644
@@ -1915,14 +1915,20 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_SLAVE, mask);
 
-	host->rx_chan = dma_request_channel(mask, omap_dma_filter_fn, &rx_req);
+	host->rx_chan =
+		dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
+						 &rx_req, &pdev->dev, "rx");
+
 	if (!host->rx_chan) {
 		dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req);
 		ret = -ENXIO;
 		goto err_irq;
 	}
 
-	host->tx_chan = dma_request_channel(mask, omap_dma_filter_fn, &tx_req);
+	host->tx_chan =
+		dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
+						 &tx_req, &pdev->dev, "tx");
+
 	if (!host->tx_chan) {
 		dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req);
 		ret = -ENXIO;
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 2/3 mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

In reply to Matt Porter

From: Santosh Shilimkar <[email protected]>

MMC driver probe will abort for DT case because of failed platform_get_resource_byname() lookup. Fix it by skipping resource byname lookup for device tree build.

Issue is hidden because hwmod popullates the IO resources which helps to succeed platform_get_resource_byname() and probe.

---
 drivers/mmc/host/omap_hsmmc.c |   28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/mmc/host/omap_hsmmc.c +15 -13
index e79b12d..8ae1225 100644
@@ -1896,21 +1896,23 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 
 	omap_hsmmc_conf_bus_power(host);
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
-	if (!res) {
-		dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
-		ret = -ENXIO;
-		goto err_irq;
-	}
-	tx_req = res->start;
+	if (!pdev->dev.of_node) {
+		res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
+		if (!res) {
+			dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
+			ret = -ENXIO;
+			goto err_irq;
+		}
+		tx_req = res->start;
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
-	if (!res) {
-		dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
-		ret = -ENXIO;
-		goto err_irq;
+		res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
+		if (!res) {
+			dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
+			ret = -ENXIO;
+			goto err_irq;
+		}
+		rx_req = res->start;
 	}
-	rx_req = res->start;
 
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_SLAVE, mask);
Signature · 1 line
1.7.9.5
Acked-by on the v2 series
#7 lore raw
In reply to Matt Porter
Quoted 12 lines · Matt Porter

Changes since v1:
- rebase to 3.9-rc1, previous dependencies upstream

This series adds DT DMA Engine Client support to the omap_hsmmc. It leverages the generic DMA OF helpers in -next and the dma_request_slave_channel_compat() wrapper introduced in the AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.

These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific omap_hsmmc changes.

The description seems stale, but the patches all look good to me.

I guess they can now get merged in any order.

#8 lore raw
Quoted 14 lines · Arnd Bergmann
Quoted 12 lines · Matt Porter

Changes since v1:
- rebase to 3.9-rc1, previous dependencies upstream

This series adds DT DMA Engine Client support to the omap_hsmmc. It leverages the generic DMA OF helpers in -next and the dma_request_slave_channel_compat() wrapper introduced in the AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.

These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific omap_hsmmc changes.

Quoted 5 lines

The description seems stale, but the patches all look good to me.

I guess they can now get merged in any order.

Yes, missed updating that to indicating that those are now in 3.9-rc1.

-Matt

#3 lore raw

Re: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

In reply to Matt Porter
Quoted 9 lines · Matt Porter

From: Santosh Shilimkar <[email protected]>

MMC driver probe will abort for DT case because of failed platform_get_resource_byname() lookup. Fix it by skipping resource byname lookup for device tree build.

Issue is hidden because hwmod popullates the IO resources which helps to succeed platform_get_resource_byname() and probe.

Hi Matt,
Could you please drop this patch from the current series, since this patch causes regression on omap3,4 platform which are not yet dma dt adapted.
It is best to send this patch along with Jon Hunter dma dt series, which adds dt dma support and mmc dma data. DMA dt series is needed any way before hwmod cleanup can happen.

Quoted 47 lines
---
  drivers/mmc/host/omap_hsmmc.c |   28 +++++++++++++++-------------
  1 file changed, 15 insertions(+), 13 deletions(-)
drivers/mmc/host/omap_hsmmc.c +15 -13
index e79b12d..8ae1225 100644
@@ -1896,21 +1896,23 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 
  	omap_hsmmc_conf_bus_power(host);
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
-	if (!res) {
-		dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
-		ret = -ENXIO;
-		goto err_irq;
-	}
-	tx_req = res->start;
+	if (!pdev->dev.of_node) {
+		res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
+		if (!res) {
+			dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
+			ret = -ENXIO;
+			goto err_irq;
+		}
+		tx_req = res->start;
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
-	if (!res) {
-		dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
-		ret = -ENXIO;
-		goto err_irq;
+		res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
+		if (!res) {
+			dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
+			ret = -ENXIO;
+			goto err_irq;
+		}
+		rx_req = res->start;
  	}
-	rx_req = res->start;
 
  	dma_cap_zero(mask);
  	dma_cap_set(DMA_SLAVE, mask);
#4 lore raw

Re: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

Quoted 11 lines · Balaji T K
Quoted 9 lines · Matt Porter

From: Santosh Shilimkar <[email protected]>

MMC driver probe will abort for DT case because of failed platform_get_resource_byname() lookup. Fix it by skipping resource byname lookup for device tree build.

Issue is hidden because hwmod popullates the IO resources which helps to succeed platform_get_resource_byname() and probe.

Quoted 7 lines

Hi Matt,
Could you please drop this patch from the current series, since this patch causes regression on omap3,4 platform which are not yet dma dt adapted.
It is best to send this patch along with Jon Hunter dma dt series, which adds dt dma support and mmc dma data. DMA dt series is needed any way before hwmod cleanup can happen.

*sigh* ok, I should have never split this stuff out from the am33xx series. Will do.

-Matt

Quoted 52 lines
Quoted 37 lines
---
 drivers/mmc/host/omap_hsmmc.c |   28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/mmc/host/omap_hsmmc.c +10 -12
index e79b12d..8ae1225 100644
@@ -1896,21 +1896,23 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 
 	omap_hsmmc_conf_bus_power(host);
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
-	if (!res) {
-		dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
-		ret = -ENXIO;
-		goto err_irq;
-	}
-	tx_req = res->start;
+	if (!pdev->dev.of_node) {
+		res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
+		if (!res) {
+			dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
+			ret = -ENXIO;
+			goto err_irq;
+		}
+		tx_req = res->start;
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
-	if (!res) {
-		dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
-		ret = -ENXIO;
-		goto err_irq;
+		res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
+		if (!res) {

drivers/mmc/host/omap_hsmmc.c static int omap_hsmmc_probe(struct platform_device *pdev) · line 1918

Quoted 10 lines
drivers/mmc/host/omap_hsmmc.c +5 -1
+			dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
+			ret = -ENXIO;
+			goto err_irq;
+		}
+		rx_req = res->start;
 	}
-	rx_req = res->start;
 
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_SLAVE, mask);

_______________________________________________
devicetree-discuss mailing list
[email protected]
https://lists.ozlabs.org/listinfo/devicetree-discuss

#5 lore raw

Re: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case

Quoted 20 lines · Matt Porter
Quoted 11 lines · Balaji T K
Quoted 9 lines · Matt Porter

From: Santosh Shilimkar <[email protected]>

MMC driver probe will abort for DT case because of failed platform_get_resource_byname() lookup. Fix it by skipping resource byname lookup for device tree build.

Issue is hidden because hwmod popullates the IO resources which helps to succeed platform_get_resource_byname() and probe.

Quoted 7 lines

Hi Matt,
Could you please drop this patch from the current series, since this patch causes regression on omap3,4 platform which are not yet dma dt adapted.
It is best to send this patch along with Jon Hunter dma dt series, which adds dt dma support and mmc dma data. DMA dt series is needed any way before hwmod cleanup can happen.

Quoted 2 lines

*sigh* ok, I should have never split this stuff out from the am33xx series. Will do.

There will not be any regression if all of these make the same merge window. I am hoping that the omap dma patches will make 3.10 as well. I think that it is best for Matt to keep his patches together although now I see he has already posted a V3 dropping this :-(

Jon

#9 lore raw
In reply to Matt Porter

Hi,

Quoted 15 lines · Matt Porter
Quoted 14 lines · Arnd Bergmann
Quoted 12 lines · Matt Porter

Changes since v1:
- rebase to 3.9-rc1, previous dependencies upstream

This series adds DT DMA Engine Client support to the omap_hsmmc. It leverages the generic DMA OF helpers in -next and the dma_request_slave_channel_compat() wrapper introduced in the AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.

These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific omap_hsmmc changes.

Quoted 8 lines
Quoted 5 lines

The description seems stale, but the patches all look good to me.

I guess they can now get merged in any order.

Yes, missed updating that to indicating that those are now in 3.9-rc1.

If there are no more changes, could this patch please be merged in for 3.10 or if not, could Matt please update the description as requested and repost?

Thanks,
Joel

#10 lore raw

Resending on Matt's new email, thanks.

Quoted 33 lines · Joel A Fernandes

Hi,

Quoted 15 lines · Matt Porter
Quoted 14 lines · Arnd Bergmann
Quoted 12 lines · Matt Porter

Changes since v1:
- rebase to 3.9-rc1, previous dependencies upstream

This series adds DT DMA Engine Client support to the omap_hsmmc. It leverages the generic DMA OF helpers in -next and the dma_request_slave_channel_compat() wrapper introduced in the AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.

These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific omap_hsmmc changes.

Quoted 8 lines
Quoted 5 lines

The description seems stale, but the patches all look good to me.

I guess they can now get merged in any order.

Yes, missed updating that to indicating that those are now in 3.9-rc1.

If there are no more changes, could this patch please be merged in for 3.10 or if not, could Matt please update the description as requested and repost?

Thanks,
Joel

#11 lore raw
Quoted 34 lines · Joel A Fernandes

Resending on Matt's new email, thanks.

Quoted 31 lines · Joel A Fernandes

Hi,

Quoted 15 lines · Matt Porter
Quoted 14 lines · Arnd Bergmann
Quoted 12 lines · Matt Porter

Changes since v1:
- rebase to 3.9-rc1, previous dependencies upstream

This series adds DT DMA Engine Client support to the omap_hsmmc. It leverages the generic DMA OF helpers in -next and the dma_request_slave_channel_compat() wrapper introduced in the AM33XX DMA Engine series to support DMA in omap_hsmmc on platforms booting via DT. These platforms include omap2/3/4/5 and am33xx.

These patches were split out from the v5 version of the AM33XX DMA series and split from the EDMA-specific omap_hsmmc changes.

Quoted 8 lines
Quoted 5 lines

The description seems stale, but the patches all look good to me.

I guess they can now get merged in any order.

Yes, missed updating that to indicating that those are now in 3.9-rc1.

If there are no more changes, could this patch please be merged in for 3.10 or if not, could Matt please update the description as requested and repost?

Hi Joel,

mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case
mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
got merged in 3.10 rc5

mmc: omap_hsmmc: add generic DMA request support to the DT binding
should go along with edma dts patch series

Quoted 2 lines
Quoted 2 lines

Thanks,
Joel