[PATCH v8 2/9] ARM: edma: remove unused transfer controller handlers

2013-03-05 Thread Matt Porter
Fix build on OMAP, the irqs are undefined on AM33xx.
These error interrupt handlers were hardcoded as disabled
so since they are unused code, simply remove them.

Signed-off-by: Matt Porter 
Acked-by: Sekhar Nori 
---
 arch/arm/common/edma.c |   37 -
 1 file changed, 37 deletions(-)

diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index dcaeb8e..a1db6cd 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -494,26 +494,6 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
return IRQ_HANDLED;
 }
 
-/**
- *
- * Transfer controller error interrupt handlers
- *
- */
-
-#define tc_errs_handledfalse   /* disabled as long as they're NOPs */
-
-static irqreturn_t dma_tc0err_handler(int irq, void *data)
-{
-   dev_dbg(data, "dma_tc0err_handler\n");
-   return IRQ_HANDLED;
-}
-
-static irqreturn_t dma_tc1err_handler(int irq, void *data)
-{
-   dev_dbg(data, "dma_tc1err_handler\n");
-   return IRQ_HANDLED;
-}
-
 static int reserve_contiguous_slots(int ctlr, unsigned int id,
 unsigned int num_slots,
 unsigned int start_slot)
@@ -1541,23 +1521,6 @@ static int __init edma_probe(struct platform_device 
*pdev)
arch_num_cc++;
}
 
-   if (tc_errs_handled) {
-   status = request_irq(IRQ_TCERRINT0, dma_tc0err_handler, 0,
-   "edma_tc0", &pdev->dev);
-   if (status < 0) {
-   dev_dbg(&pdev->dev, "request_irq %d failed --> %d\n",
-   IRQ_TCERRINT0, status);
-   return status;
-   }
-   status = request_irq(IRQ_TCERRINT, dma_tc1err_handler, 0,
-   "edma_tc1", &pdev->dev);
-   if (status < 0) {
-   dev_dbg(&pdev->dev, "request_irq %d --> %d\n",
-   IRQ_TCERRINT, status);
-   return status;
-   }
-   }
-
return 0;
 
 fail:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v8 0/9] DMA Engine support for AM33XX

2013-03-05 Thread Matt Porter
Changes since v7:
- Dropped dmaengine compat() patch. It is upstream.
- Submitted edma_alloc_slot() error checking bug fix separately,
  now a dependency
- Fixed bisect issues due to 3/10 hunks that went into 1/10
- Fixed incorrect IS_ERRVALUE() use in 3/10

Changes since v6:
- Converted edma_of_read_*() to wrappers around of_property_read_*()
- Fixed wording on the omap-spi generic DMA properties
- Added comment/check to clarify that the driver only supports
  a single EDMA instance when booting from DT

Changes since v5:
- Dropped mmc portion and moved it to a separate series
- Incorporate corrected version of dma_request_slave_channel_compat()
- Fix #defines and enablement of TI_PRIV_EDMA option

Changes since v4:
- Fixed debug section mismatch in private edma api [01/14]
- Respun format-patch to catch the platform_data/edma.h rename [01/14]
- Removed address/size-cells from the EDMA binding [05/14]

Changes since v3:
- Rebased on 3.8-rc3
- No longer an RFC
- Fixed bugs in DT/pdata parsing reported by Vaibhav Bedia
- Restored all the Davinci pdata to const
- Removed max_segs hack in favor of using dma_get_channel_caps()
- Fixed extra parens, __raw_* accessors and, ioremap error checks
  in xbar handling
- Removed excess license info in platform_data/edma.h
- Removed unneeded reserved channels data for AM33xx
- Removed test-specific pinmuxing from dts files
- Adjusted mmc1 node to be disabled by default in the dtsi

Changes since v2:
- Rebased on 3.7-rc1
- Fixed bug in DT/pdata parsing first found by Gururaja
  that turned out to be masked by some toolchains
- Dropped unused mach-omap2/devices.c hsmmc patch
- Added AM33XX crossbar DMA event mux support
- Added am335x-evm support

Changes since v1:
- Rebased on top of mainline from 12250d8
- Dropped the feature removal schedule patch
- Implemented dma_request_slave_channel_compat() and
  converted the mmc and spi drivers to use it
- Dropped unneeded #address-cells and #size-cells from
  EDMA DT support
- Moved private EDMA header to linux/platform_data/ and
  removed some unneeded definitions
- Fixed parsing of optional properties

This series adds DMA Engine support for AM33xx, which uses
an EDMA DMAC. The EDMA DMAC has been previously supported by only
a private API implementation (much like the situation with OMAP
DMA) found on the DaVinci family of SoCs.

The series applies on top of 3.9-rc1 and the following patches:

- edma private api error check fix from 
  http://www.spinics.net/lists/arm-kernel/msg227886.html

The approach taken is similar to how OMAP DMA is being converted to
DMA Engine support. With the functional EDMA private API already
existing in mach-davinci/dma.c, we first move that to an ARM common
area so it can be shared. Adding DT and runtime PM support to the
private EDMA API implementation allows it to run on AM33xx. AM33xx
*only* boots using DT so we leverage Jon's generic DT DMA helpers to
register EDMA DMAC with the of_dma framework and then add support
for calling the dma_request_slave_channel() API to both the mmc
and spi drivers.

With this series both BeagleBone and the AM335x EVM have working
SPI DMA support (and MMC support with the separate MMC series).

This is tested on BeagleBone with a SPI framebuffer driver and MMC
rootfs. A trivial gpio DMA event misc driver was used to test the
crossbar DMA event support. It is also tested on the AM335x EVM
with the onboard SPI flash and MMC rootfs. The branch at
https://github.com/ohporter/linux/tree/edma-dmaengine-am33xx-v7
has the complete series, dependencies, and some test
drivers/defconfigs. Note that MMC can only be tested with a
separate MMC dmaengine/DT series applied.

Regression testing was done on AM180x-EVM (which also makes use
of the EDMA dmaengine driver and the EDMA private API) using SD,
SPI flash, and the onboard audio supported by the ASoC Davinci
driver. Regression testing was also done on a BeagleBoard xM
booting from the legacy board file using MMC rootfs.

Matt Porter (9):
  ARM: davinci: move private EDMA API to arm/common
  ARM: edma: remove unused transfer controller handlers
  ARM: edma: add AM33XX support to the private EDMA API
  dmaengine: edma: enable build for AM33XX
  dmaengine: edma: Add TI EDMA device tree binding
  ARM: dts: add AM33XX EDMA support
  spi: omap2-mcspi: convert to dma_request_slave_channel_compat()
  spi: omap2-mcspi: add generic DMA request support to the DT binding
  ARM: dts: add AM33XX SPI DMA support

 Documentation/devicetree/bindings/dma/ti-edma.txt  |   49 +++
 Documentation/devicetree/bindings/spi/omap-spi.txt |   27 +-
 arch/arm/Kconfig   |

[PATCH v8 3/9] ARM: edma: add AM33XX support to the private EDMA API

2013-03-05 Thread Matt Porter
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. Adds AM33XX EDMA
crossbar event mux support. Enables build on OMAP.

Signed-off-by: Matt Porter 
Acked-by: Sekhar Nori 
---
 arch/arm/common/edma.c |  300 ++--
 arch/arm/mach-omap2/Kconfig|1 +
 include/linux/platform_data/edma.h |1 +
 3 files changed, 292 insertions(+), 10 deletions(-)

diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index a1db6cd..e68ac38 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -24,6 +24,13 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -1369,31 +1376,278 @@ 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 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] % 4) * 8;
+   offset = xbar_chans[i][1] >> 2;
+   offset <<= 2;
+   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)
+{
+   int ret = 0;
+   u32 value;
+   struct property *prop;
+   size_t sz;
+   struct edma_rsv_info *rsv_info;
+   const s16 (*rsv_chans)[2], (*rsv_slots)[2];
+   const 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;
+
+   /* Build the reserved channel/slots arrays */
+   prop = of_find_property(node, "ti,edma-reserved-channels", &sz);
+   if (prop) {
+   rsv_chans = devm_kzalloc(dev,
+sz/sizeof(s16) + 2*sizeof(s16),
+  

[PATCH v8 1/9] ARM: davinci: move private EDMA API to arm/common

2013-03-05 Thread Matt Porter
Move mach-davinci/dma.c to common/edma.c so it can be used
by OMAP (specifically AM33xx) as well.

Signed-off-by: Matt Porter 
Acked-by: Sekhar Nori 
---
 arch/arm/Kconfig   |1 +
 arch/arm/common/Kconfig|3 +
 arch/arm/common/Makefile   |1 +
 arch/arm/{mach-davinci/dma.c => common/edma.c} |2 +-
 arch/arm/mach-davinci/Makefile |2 +-
 arch/arm/mach-davinci/board-tnetv107x-evm.c|2 +-
 arch/arm/mach-davinci/davinci.h|2 +-
 arch/arm/mach-davinci/devices-tnetv107x.c  |2 +-
 arch/arm/mach-davinci/devices.c|6 +-
 arch/arm/mach-davinci/dm355.c  |2 +-
 arch/arm/mach-davinci/dm365.c  |2 +-
 arch/arm/mach-davinci/dm644x.c |2 +-
 arch/arm/mach-davinci/dm646x.c |2 +-
 arch/arm/mach-davinci/include/mach/da8xx.h |2 +-
 drivers/dma/edma.c |2 +-
 drivers/mmc/host/davinci_mmc.c |1 +
 include/linux/mfd/davinci_voicecodec.h |3 +-
 .../mach => include/linux/platform_data}/edma.h|   89 +---
 include/linux/platform_data/spi-davinci.h  |2 +-
 sound/soc/davinci/davinci-evm.c|1 +
 sound/soc/davinci/davinci-pcm.c|1 +
 sound/soc/davinci/davinci-pcm.h|2 +-
 sound/soc/davinci/davinci-sffsdr.c |5 +-
 23 files changed, 33 insertions(+), 104 deletions(-)
 rename arch/arm/{mach-davinci/dma.c => common/edma.c} (99%)
 rename {arch/arm/mach-davinci/include/mach => 
include/linux/platform_data}/edma.h (59%)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5b71469..cb80a4d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -956,6 +956,7 @@ config ARCH_DAVINCI
select GENERIC_IRQ_CHIP
select HAVE_IDE
select NEED_MACH_GPIO_H
+   select TI_PRIV_EDMA
select USE_OF
select ZONE_DMA
help
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 9353184..c3a4e9c 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -17,3 +17,6 @@ config SHARP_PARAM
 
 config SHARP_SCOOP
bool
+
+config TI_PRIV_EDMA
+   bool
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index dc8dd0d..9643c50 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
 obj-$(CONFIG_SHARP_SCOOP)  += scoop.o
 obj-$(CONFIG_PCI_HOST_ITE8152)  += it8152.o
 obj-$(CONFIG_ARM_TIMER_SP804)  += timer-sp.o
+obj-$(CONFIG_TI_PRIV_EDMA) += edma.o
diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/common/edma.c
similarity index 99%
rename from arch/arm/mach-davinci/dma.c
rename to arch/arm/common/edma.c
index 45b7c71..dcaeb8e 100644
--- a/arch/arm/mach-davinci/dma.c
+++ b/arch/arm/common/edma.c
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 /* Offsets matching "struct edmacc_param" */
 #define PARM_OPT   0x00
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index fb5c1aa..493a36b 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -5,7 +5,7 @@
 
 # Common objects
 obj-y  := time.o clock.o serial.o psc.o \
-  dma.o usb.o common.o sram.o aemif.o
+  usb.o common.o sram.o aemif.o
 
 obj-$(CONFIG_DAVINCI_MUX)  += mux.o
 
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c 
b/arch/arm/mach-davinci/board-tnetv107x-evm.c
index 4f41602..10c9efd 100644
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c
@@ -26,12 +26,12 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 12d544b..d26a6bc 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -23,9 +23,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c 
b/arch/arm/mach-davinci/devices-tnetv107x.c
index 773ab07..ba37760 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -18,10 +18,10 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
-#include 
 #include 
 
 #include "clock.h"
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 4c48a36..ca0c7b3 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -19,9 +19,10 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#i

[PATCH v2 0/3] omap_hsmmc DT DMA Client support

2013-03-05 Thread 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.

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(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2013-03-05 Thread Matt Porter
Convert dmaengine channel requests to use
dma_request_slave_channel_compat(). This supports platforms booting
with or without DT populated.

Signed-off-by: Matt Porter 
Acked-by: Tony Lindgren 
---
 drivers/mmc/host/omap_hsmmc.c |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index bc58078..e79b12d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -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;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2013-03-05 Thread Matt Porter
The binding definition is based on the generic DMA request binding.

Signed-off-by: Matt Porter 
Acked-by: Tony Lindgren 
---
 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt  |   26 +++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt 
b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
index ed271fc..8c8908a 100644
--- a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
+++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
@@ -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";
};
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2013-03-05 Thread Matt Porter
From: Santosh Shilimkar 

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.

Signed-off-by: Santosh Shilimkar 
---
 drivers/mmc/host/omap_hsmmc.c |   28 +++-
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e79b12d..8ae1225 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -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);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/3] omap_hsmmc DT DMA Client support

2013-03-06 Thread Matt Porter
On Tue, Mar 05, 2013 at 09:26:01PM +, Arnd Bergmann wrote:
> On Tuesday 05 March 2013, Matt Porter wrote:
> > 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.
> 
> Acked-by: Arnd Bergmann 

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

-Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2013-03-06 Thread Matt Porter
On Wed, Mar 06, 2013 at 07:12:29PM +0530, Balaji T K wrote:
> On Wednesday 06 March 2013 02:43 AM, Matt Porter wrote:
> >From: Santosh Shilimkar 
> >
> >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.

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

-Matt

> >Signed-off-by: Santosh Shilimkar 
> >---
> >  drivers/mmc/host/omap_hsmmc.c |   28 +++-
> >  1 file changed, 15 insertions(+), 13 deletions(-)
> >
> >diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> >index e79b12d..8ae1225 100644
> >--- a/drivers/mmc/host/omap_hsmmc.c
> >+++ b/drivers/mmc/host/omap_hsmmc.c
> >@@ -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);
> >
> 
> ___
> devicetree-discuss mailing list
> devicetree-disc...@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 6/9] ARM: dts: add AM33XX EDMA support

2013-03-06 Thread Matt Porter
On Wed, Mar 06, 2013 at 04:19:58AM +, Kumar, Anil wrote:
> Hi,
> 
> On Wed, Mar 06, 2013 at 02:23:12, Porter, Matt wrote:
> > Adds AM33XX EDMA support to the am33xx.dtsi as documented in
> > Documentation/devicetree/bindings/dma/ti-edma.txt
> > 
> > Signed-off-by: Matt Porter 
> > ---
> >  arch/arm/boot/dts/am33xx.dtsi |   20 
> >  1 file changed, 20 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
> > index 0957645..aaf44122 100644
> > --- a/arch/arm/boot/dts/am33xx.dtsi
> > +++ b/arch/arm/boot/dts/am33xx.dtsi
> > @@ -87,6 +87,26 @@
> > reg = <0x4820 0x1000>;
> > };
> >  
> > +   edma: edma@4900 {
> > +   compatible = "ti,edma3";
> > +   ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
> > +   reg =   <0x4900 0x1>,
> > +   <0x44e10f90 0x10>;
> > +   interrupt-parent = <&intc>;
> 
> Is it really need of "interrupt-parent = <&intc>" here ?
> as this property is already with root node.  
> I am taking reference of 3.9-rc1

You're correct. It's inherited from the parent node so I'll drop it out.
I also noted that the cpsw node has this wrong so I'll send a patch to
address that separately.

-Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 0/2] omap_hsmmc DT DMA Client support

2013-03-06 Thread Matt Porter
Changes since v2:
- dropped skip platform_get_resource_byname() patch
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 and the
dma_request_slave_channel_compat() wrapper 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

 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt  |   26 +++-
 drivers/mmc/host/omap_hsmmc.c  |   10 ++--
 2 files changed, 33 insertions(+), 3 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 1/2] mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()

2013-03-06 Thread Matt Porter
Convert dmaengine channel requests to use
dma_request_slave_channel_compat(). This supports platforms booting
with or without DT populated.

Signed-off-by: Matt Porter 
Acked-by: Tony Lindgren 
Acked-by: Arnd Bergmann 
---
 drivers/mmc/host/omap_hsmmc.c |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index bc58078..e79b12d 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -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;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/2] mmc: omap_hsmmc: add generic DMA request support to the DT binding

2013-03-06 Thread Matt Porter
The binding definition is based on the generic DMA request binding.

Signed-off-by: Matt Porter 
Acked-by: Tony Lindgren 
Acked-by: Arnd Bergmann 
---
 .../devicetree/bindings/mmc/ti-omap-hsmmc.txt  |   26 +++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt 
b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
index ed271fc..8c8908a 100644
--- a/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
+++ b/Documentation/devicetree/bindings/mmc/ti-omap-hsmmc.txt
@@ -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";
};
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v9 0/9] DMA Engine support for AM33XX

2013-03-06 Thread Matt Porter
Changes since v8:
- Removed edma node interrupt-parent property, it is inherited

Changes since v7:
- Dropped dmaengine compat() patch. It is upstream.
- Submitted edma_alloc_slot() error checking bug fix separately,
  now a dependency
- Fixed bisect issues due to 3/10 hunks that went into 1/10
- Fixed incorrect IS_ERRVALUE() use in 3/10

Changes since v6:
- Converted edma_of_read_*() to wrappers around of_property_read_*()
- Fixed wording on the omap-spi generic DMA properties
- Added comment/check to clarify that the driver only supports
  a single EDMA instance when booting from DT

Changes since v5:
- Dropped mmc portion and moved it to a separate series
- Incorporate corrected version of dma_request_slave_channel_compat()
- Fix #defines and enablement of TI_PRIV_EDMA option

Changes since v4:
- Fixed debug section mismatch in private edma api [01/14]
- Respun format-patch to catch the platform_data/edma.h rename [01/14]
- Removed address/size-cells from the EDMA binding [05/14]

Changes since v3:
- Rebased on 3.8-rc3
- No longer an RFC
- Fixed bugs in DT/pdata parsing reported by Vaibhav Bedia
- Restored all the Davinci pdata to const
- Removed max_segs hack in favor of using dma_get_channel_caps()
- Fixed extra parens, __raw_* accessors and, ioremap error checks
  in xbar handling
- Removed excess license info in platform_data/edma.h
- Removed unneeded reserved channels data for AM33xx
- Removed test-specific pinmuxing from dts files
- Adjusted mmc1 node to be disabled by default in the dtsi

Changes since v2:
- Rebased on 3.7-rc1
- Fixed bug in DT/pdata parsing first found by Gururaja
  that turned out to be masked by some toolchains
- Dropped unused mach-omap2/devices.c hsmmc patch
- Added AM33XX crossbar DMA event mux support
- Added am335x-evm support

Changes since v1:
- Rebased on top of mainline from 12250d8
- Dropped the feature removal schedule patch
- Implemented dma_request_slave_channel_compat() and
  converted the mmc and spi drivers to use it
- Dropped unneeded #address-cells and #size-cells from
  EDMA DT support
- Moved private EDMA header to linux/platform_data/ and
  removed some unneeded definitions
- Fixed parsing of optional properties

This series adds DMA Engine support for AM33xx, which uses
an EDMA DMAC. The EDMA DMAC has been previously supported by only
a private API implementation (much like the situation with OMAP
DMA) found on the DaVinci family of SoCs.

The series applies on top of 3.9-rc1 and the following patches:

- edma private api error check fix from 
  http://www.spinics.net/lists/arm-kernel/msg227886.html

The approach taken is similar to how OMAP DMA is being converted to
DMA Engine support. With the functional EDMA private API already
existing in mach-davinci/dma.c, we first move that to an ARM common
area so it can be shared. Adding DT and runtime PM support to the
private EDMA API implementation allows it to run on AM33xx. AM33xx
*only* boots using DT so the upstream generic DT DMA helpers are
leveraged to register EDMA DMAC with the of_dma framework. SPI (and
MMC in a separate series) are supported using the upstream
dma_request_slave_channel_compat() dmaengine call that allows
compatibility with !DT platforms.

With this series both BeagleBone and the AM335x EVM have working
SPI DMA support (and MMC support with the separate MMC series).

This is tested on BeagleBone with a SPI framebuffer driver and MMC
rootfs. A trivial gpio DMA event misc driver was used to test the
crossbar DMA event support. It is also tested on the AM335x EVM
with the onboard SPI flash and MMC rootfs. Note that MMC can only
be tested with a separate MMC dmaengine/DT series applied.

Regression testing was done on AM180x-EVM (which also makes use
of the EDMA dmaengine driver and the EDMA private API) using SD,
SPI flash, and the onboard audio supported by the ASoC Davinci
driver. Regression testing was also done on a BeagleBoard xM
booting from the legacy board file using MMC rootfs.

Matt Porter (9):
  ARM: davinci: move private EDMA API to arm/common
  ARM: edma: remove unused transfer controller handlers
  ARM: edma: add AM33XX support to the private EDMA API
  dmaengine: edma: enable build for AM33XX
  dmaengine: edma: Add TI EDMA device tree binding
  ARM: dts: add AM33XX EDMA support
  spi: omap2-mcspi: convert to dma_request_slave_channel_compat()
  spi: omap2-mcspi: add generic DMA request support to the DT binding
  ARM: dts: add AM33XX SPI DMA support

 Documentation/devicetree/bindings/dma/ti-edma.txt  |   49 +++
 Documentation/devicetree/bindings/spi/omap-spi.txt |   27 +-
 arch/arm/Kconfig

[PATCH v9 3/9] ARM: edma: add AM33XX support to the private EDMA API

2013-03-06 Thread Matt Porter
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. Adds AM33XX EDMA
crossbar event mux support. Enables build on OMAP.

Signed-off-by: Matt Porter 
Acked-by: Sekhar Nori 
---
 arch/arm/common/edma.c |  300 ++--
 arch/arm/mach-omap2/Kconfig|1 +
 include/linux/platform_data/edma.h |1 +
 3 files changed, 292 insertions(+), 10 deletions(-)

diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index a1db6cd..e68ac38 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -24,6 +24,13 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -1369,31 +1376,278 @@ 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 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] % 4) * 8;
+   offset = xbar_chans[i][1] >> 2;
+   offset <<= 2;
+   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)
+{
+   int ret = 0;
+   u32 value;
+   struct property *prop;
+   size_t sz;
+   struct edma_rsv_info *rsv_info;
+   const s16 (*rsv_chans)[2], (*rsv_slots)[2];
+   const 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;
+
+   /* Build the reserved channel/slots arrays */
+   prop = of_find_property(node, "ti,edma-reserved-channels", &sz);
+   if (prop) {
+   rsv_chans = devm_kzalloc(dev,
+sz/sizeof(s16) + 2*sizeof(s16),
+  

[PATCH v9 2/9] ARM: edma: remove unused transfer controller handlers

2013-03-06 Thread Matt Porter
Fix build on OMAP, the irqs are undefined on AM33xx.
These error interrupt handlers were hardcoded as disabled
so since they are unused code, simply remove them.

Signed-off-by: Matt Porter 
Acked-by: Sekhar Nori 
---
 arch/arm/common/edma.c |   37 -
 1 file changed, 37 deletions(-)

diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
index dcaeb8e..a1db6cd 100644
--- a/arch/arm/common/edma.c
+++ b/arch/arm/common/edma.c
@@ -494,26 +494,6 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
return IRQ_HANDLED;
 }
 
-/**
- *
- * Transfer controller error interrupt handlers
- *
- */
-
-#define tc_errs_handledfalse   /* disabled as long as they're NOPs */
-
-static irqreturn_t dma_tc0err_handler(int irq, void *data)
-{
-   dev_dbg(data, "dma_tc0err_handler\n");
-   return IRQ_HANDLED;
-}
-
-static irqreturn_t dma_tc1err_handler(int irq, void *data)
-{
-   dev_dbg(data, "dma_tc1err_handler\n");
-   return IRQ_HANDLED;
-}
-
 static int reserve_contiguous_slots(int ctlr, unsigned int id,
 unsigned int num_slots,
 unsigned int start_slot)
@@ -1541,23 +1521,6 @@ static int __init edma_probe(struct platform_device 
*pdev)
arch_num_cc++;
}
 
-   if (tc_errs_handled) {
-   status = request_irq(IRQ_TCERRINT0, dma_tc0err_handler, 0,
-   "edma_tc0", &pdev->dev);
-   if (status < 0) {
-   dev_dbg(&pdev->dev, "request_irq %d failed --> %d\n",
-   IRQ_TCERRINT0, status);
-   return status;
-   }
-   status = request_irq(IRQ_TCERRINT, dma_tc1err_handler, 0,
-   "edma_tc1", &pdev->dev);
-   if (status < 0) {
-   dev_dbg(&pdev->dev, "request_irq %d --> %d\n",
-   IRQ_TCERRINT, status);
-   return status;
-   }
-   }
-
return 0;
 
 fail:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v9 4/9] dmaengine: edma: enable build for AM33XX

2013-03-06 Thread Matt Porter
Enable TI EDMA option on OMAP.

Signed-off-by: Matt Porter 
---
 drivers/dma/Kconfig |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 80b6997..3b7ea20 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -222,7 +222,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

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v9 5/9] dmaengine: edma: Add TI EDMA device tree binding

2013-03-06 Thread Matt Porter
The binding definition is based on the generic DMA controller
binding.

Signed-off-by: Matt Porter 
---
 Documentation/devicetree/bindings/dma/ti-edma.txt |   49 +
 1 file changed, 49 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 000..075a60e3
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/ti-edma.txt
@@ -0,0 +1,49 @@
+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
+- ti,edma-queue-tc-map: List of transfer control to queue mappings
+- ti,edma-queue-priority-map: List of queue priority mappings
+- ti,edma-default-queue: Default queue value
+
+Optional properties:
+- ti,edma-reserved-channels: List of reserved channel regions
+- ti,edma-reserved-slots: List of reserved slot regions
+- ti,edma-xbar-event-map: Crossbar event to channel map
+
+Example:
+
+edma: edma@4900 {
+   reg = <0x4900 0x1>;
+   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-reserved-channels = <0  2
+14 2
+26 6
+48 4
+56 8>;
+   ti,edma-reserved-slots = <0  2
+ 14 2
+ 26 6
+ 48 4
+ 56 8
+ 64 127>;
+   ti,edma-queue-tc-map = <0 0
+   1 1
+   2 2>;
+   ti,edma-queue-priority-map = <0 0
+ 1 1
+ 2 2>;
+   ti,edma-default-queue = <0>;
+   ti,edma-xbar-event-map = <1 12
+ 2 13>;
+};
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v9 9/9] ARM: dts: add AM33XX SPI DMA support

2013-03-06 Thread Matt Porter
Adds DMA resources to the AM33XX SPI nodes.

Signed-off-by: Matt Porter 
---
 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 cbea5ab..c3c781a 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -327,6 +327,11 @@
interrupt = <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";
};
 
@@ -338,6 +343,11 @@
interrupt = <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

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v9 8/9] spi: omap2-mcspi: add generic DMA request support to the DT binding

2013-03-06 Thread Matt Porter
The binding definition is based on the generic DMA request binding

Signed-off-by: Matt Porter 
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v9 7/9] spi: omap2-mcspi: convert to dma_request_slave_channel_compat()

2013-03-06 Thread Matt Porter
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 
Acked-by: Mark Brown 
---
 drivers/spi/spi-omap2-mcspi.c |   27 ---
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 893c3d7..38d0915 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
@@ -822,14 +825,23 @@ 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) {
dev_err(&spi->dev, "no RX DMA engine channel for McSPI\n");
return -EAGAIN;
}
 
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) {
dev_err(&spi->dev, "no TX DMA engine channel for McSPI\n");
dma_release_channel(mcspi_dma->dma_rx);
@@ -1240,12 +1252,13 @@ 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);
+   sprintf(dma_rx_ch_name, "rx%d", i);
dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
-   dma_ch_name);
+   dma_rx_ch_name);
if (!dma_res) {
dev_dbg(&pdev->dev, "cannot get DMA RX channel\n");
status = -ENODEV;
@@ -1253,9 +1266,9 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
}
 
mcspi->dma_channels[i].dma_rx_sync_dev = dma_res->start;
-   sprintf(dma_ch_name, "tx%d", i);
+   sprintf(dma_tx_ch_name, "tx%d", i);
dma_res = platform_get_resource_byname(pdev, IORESOURCE_DMA,
-   dma_ch_name);
+   dma_tx_ch_name);
if (!dma_res) {
dev_dbg(&pdev->dev, "cannot get DMA TX channel\n");
status = -ENODEV;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v9 6/9] ARM: dts: add AM33XX EDMA support

2013-03-06 Thread Matt Porter
Adds AM33XX EDMA support to the am33xx.dtsi as documented in
Documentation/devicetree/bindings/dma/ti-edma.txt

Signed-off-by: Matt Porter 
---
 arch/arm/boot/dts/am33xx.dtsi |   19 +++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 0957645..cbea5ab 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -87,6 +87,25 @@
reg = <0x4820 0x1000>;
};
 
+   edma: edma@4900 {
+   compatible = "ti,edma3";
+   ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
+   reg =   <0x4900 0x1>,
+   <0x44e10f90 0x10>;
+   interrupts = <12 13 14>;
+   #dma-cells = <1>;
+   dma-channels = <64>;
+   ti,edma-regions = <4>;
+   ti,edma-slots = <256>;
+   ti,edma-queue-tc-map = <0 0
+   1 1
+   2 2>;
+   ti,edma-queue-priority-map = <0 0
+ 1 1
+ 2 2>;
+   ti,edma-default-queue = <0>;
+   };
+
gpio1: gpio@44e07000 {
compatible = "ti,omap4-gpio";
ti,hwmods = "gpio1";
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v9 1/9] ARM: davinci: move private EDMA API to arm/common

2013-03-06 Thread Matt Porter
Move mach-davinci/dma.c to common/edma.c so it can be used
by OMAP (specifically AM33xx) as well.

Signed-off-by: Matt Porter 
Acked-by: Sekhar Nori 
---
 arch/arm/Kconfig   |1 +
 arch/arm/common/Kconfig|3 +
 arch/arm/common/Makefile   |1 +
 arch/arm/{mach-davinci/dma.c => common/edma.c} |2 +-
 arch/arm/mach-davinci/Makefile |2 +-
 arch/arm/mach-davinci/board-tnetv107x-evm.c|2 +-
 arch/arm/mach-davinci/davinci.h|2 +-
 arch/arm/mach-davinci/devices-tnetv107x.c  |2 +-
 arch/arm/mach-davinci/devices.c|6 +-
 arch/arm/mach-davinci/dm355.c  |2 +-
 arch/arm/mach-davinci/dm365.c  |2 +-
 arch/arm/mach-davinci/dm644x.c |2 +-
 arch/arm/mach-davinci/dm646x.c |2 +-
 arch/arm/mach-davinci/include/mach/da8xx.h |2 +-
 drivers/dma/edma.c |2 +-
 drivers/mmc/host/davinci_mmc.c |1 +
 include/linux/mfd/davinci_voicecodec.h |3 +-
 .../mach => include/linux/platform_data}/edma.h|   89 +---
 include/linux/platform_data/spi-davinci.h  |2 +-
 sound/soc/davinci/davinci-evm.c|1 +
 sound/soc/davinci/davinci-pcm.c|1 +
 sound/soc/davinci/davinci-pcm.h|2 +-
 sound/soc/davinci/davinci-sffsdr.c |5 +-
 23 files changed, 33 insertions(+), 104 deletions(-)
 rename arch/arm/{mach-davinci/dma.c => common/edma.c} (99%)
 rename {arch/arm/mach-davinci/include/mach => 
include/linux/platform_data}/edma.h (59%)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5b71469..cb80a4d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -956,6 +956,7 @@ config ARCH_DAVINCI
select GENERIC_IRQ_CHIP
select HAVE_IDE
select NEED_MACH_GPIO_H
+   select TI_PRIV_EDMA
select USE_OF
select ZONE_DMA
help
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig
index 9353184..c3a4e9c 100644
--- a/arch/arm/common/Kconfig
+++ b/arch/arm/common/Kconfig
@@ -17,3 +17,6 @@ config SHARP_PARAM
 
 config SHARP_SCOOP
bool
+
+config TI_PRIV_EDMA
+   bool
diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile
index dc8dd0d..9643c50 100644
--- a/arch/arm/common/Makefile
+++ b/arch/arm/common/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
 obj-$(CONFIG_SHARP_SCOOP)  += scoop.o
 obj-$(CONFIG_PCI_HOST_ITE8152)  += it8152.o
 obj-$(CONFIG_ARM_TIMER_SP804)  += timer-sp.o
+obj-$(CONFIG_TI_PRIV_EDMA) += edma.o
diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/common/edma.c
similarity index 99%
rename from arch/arm/mach-davinci/dma.c
rename to arch/arm/common/edma.c
index 45b7c71..dcaeb8e 100644
--- a/arch/arm/mach-davinci/dma.c
+++ b/arch/arm/common/edma.c
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 /* Offsets matching "struct edmacc_param" */
 #define PARM_OPT   0x00
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile
index fb5c1aa..493a36b 100644
--- a/arch/arm/mach-davinci/Makefile
+++ b/arch/arm/mach-davinci/Makefile
@@ -5,7 +5,7 @@
 
 # Common objects
 obj-y  := time.o clock.o serial.o psc.o \
-  dma.o usb.o common.o sram.o aemif.o
+  usb.o common.o sram.o aemif.o
 
 obj-$(CONFIG_DAVINCI_MUX)  += mux.o
 
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c 
b/arch/arm/mach-davinci/board-tnetv107x-evm.c
index 4f41602..10c9efd 100644
--- a/arch/arm/mach-davinci/board-tnetv107x-evm.c
+++ b/arch/arm/mach-davinci/board-tnetv107x-evm.c
@@ -26,12 +26,12 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
index 12d544b..d26a6bc 100644
--- a/arch/arm/mach-davinci/davinci.h
+++ b/arch/arm/mach-davinci/davinci.h
@@ -23,9 +23,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c 
b/arch/arm/mach-davinci/devices-tnetv107x.c
index 773ab07..ba37760 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -18,10 +18,10 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
-#include 
 #include 
 
 #include "clock.h"
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 4c48a36..ca0c7b3 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -19,9 +19,10 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
+#i

Re: [PATCH v9 5/9] dmaengine: edma: Add TI EDMA device tree binding

2013-03-06 Thread Matt Porter
On Wed, Mar 06, 2013 at 08:24:06PM +, Peter Korsgaard wrote:
> >>>>> "Matt" == Matt Porter  writes:
> 
>  Matt> The binding definition is based on the generic DMA controller
>  Matt> binding.
> 
>  Matt> Signed-off-by: Matt Porter 
>  Matt> ---
>  Matt>  Documentation/devicetree/bindings/dma/ti-edma.txt |   49 
> +
>  Matt>  1 file changed, 49 insertions(+)
>  Matt>  create mode 100644 Documentation/devicetree/bindings/dma/ti-edma.txt
> 
>  Matt> diff --git a/Documentation/devicetree/bindings/dma/ti-edma.txt 
> b/Documentation/devicetree/bindings/dma/ti-edma.txt
>  Matt> new file mode 100644
>  Matt> index 000..075a60e3
>  Matt> --- /dev/null
>  Matt> +++ b/Documentation/devicetree/bindings/dma/ti-edma.txt
>  Matt> @@ -0,0 +1,49 @@
>  Matt> +TI EDMA
>  Matt> +
>  Matt> +Required properties:
>  Matt> +- compatible : "ti,edma3"
>  Matt> +- ti,hwmods: Name of the hwmods associated to the EDMA
>  Matt> +- ti,edma-regions: Number of regions
>  Matt> +- ti,edma-slots: Number of slots
>  Matt> +- ti,edma-queue-tc-map: List of transfer control to queue mappings
>  Matt> +- ti,edma-queue-priority-map: List of queue priority mappings
>  Matt> +- ti,edma-default-queue: Default queue value
>  Matt> +
>  Matt> +Optional properties:
>  Matt> +- ti,edma-reserved-channels: List of reserved channel regions
>  Matt> +- ti,edma-reserved-slots: List of reserved slot regions
>  Matt> +- ti,edma-xbar-event-map: Crossbar event to channel map
>  Matt> +
>  Matt> +Example:
>  Matt> +
>  Matt> +edma: edma@4900 {
>  Matt> +  reg = <0x4900 0x1>;
>  Matt> +  interrupt-parent = <&intc>;
>  Matt> +  interrupts = <12 13 14>;
> 
> Probably interrupt-parent should be removed from the example as well to
> match am33xx.dtsi

I'm not sure what the DT maintainers want here. Full context within the
example or the actual real usage where it's typically inherited.

Grant or Rob, any thoughts?

-Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] AM33xx mmc support

2013-03-06 Thread Matt Porter
This series enable MMC support on AM33xx platforms. Support for
platforms incorporating the EDMA DMAC is added using the
dma_get_slave_sg_limits() api. AM33xx DTS supported is added for
Beaglebone, AM335x-EVM, and AM335x-EVMSK.

These patches were split out from the v5 version of the AM33xx
DMA series and split from the generic DT/dmanegine omap_hsmmc
changes.

The series has the following dependencies:
- edma private api error check fix
  http://www.spinics.net/lists/arm-kernel/msg227886.html
- DMA Engine support for AM33XX
  http://www.spinics.net/lists/linux-omap/msg87634.html
- omap_hsmmc DT DMA Client support
  http://www.spinics.net/lists/linux-omap/msg87623.html
- dmaengine: add slave sg transfer limits api
  https://lkml.org/lkml/2013/3/6/462

Matt Porter (2):
  mmc: omap_hsmmc: set max_segs based on dma engine limits
  ARM: dts: add AM33XX MMC support

 arch/arm/boot/dts/am335x-bone.dts  |7 +++
 arch/arm/boot/dts/am335x-evm.dts   |7 +++
 arch/arm/boot/dts/am335x-evmsk.dts |7 +++
 arch/arm/boot/dts/am33xx.dtsi  |   28 
 drivers/mmc/host/omap_hsmmc.c  |8 
 5 files changed, 57 insertions(+)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ARM: dts: add AM33XX MMC support

2013-03-06 Thread Matt Porter
Adds AM33XX MMC support for am335x-bone, am335x-evm, and
am335x-evmsk.

Signed-off-by: Matt Porter 
Acked-by: Tony Lindgren 
---
 arch/arm/boot/dts/am335x-bone.dts  |7 +++
 arch/arm/boot/dts/am335x-evm.dts   |7 +++
 arch/arm/boot/dts/am335x-evmsk.dts |7 +++
 arch/arm/boot/dts/am33xx.dtsi  |   28 
 4 files changed, 49 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone.dts 
b/arch/arm/boot/dts/am335x-bone.dts
index 11b240c..a154ce0 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -120,6 +120,8 @@
};
 
ldo3_reg: regulator@5 {
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <330>;
regulator-always-on;
};
 
@@ -136,3 +138,8 @@
 &cpsw_emac1 {
phy_id = <&davinci_mdio>, <1>;
 };
+
+&mmc1 {
+   status = "okay";
+   vmmc-supply = <&ldo3_reg>;
+};
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index d649644..2907da6 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -232,6 +232,8 @@
};
 
vmmc_reg: regulator@12 {
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <330>;
regulator-always-on;
};
};
@@ -244,3 +246,8 @@
 &cpsw_emac1 {
phy_id = <&davinci_mdio>, <1>;
 };
+
+&mmc1 {
+   status = "okay";
+   vmmc-supply = <&vmmc_reg>;
+};
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts 
b/arch/arm/boot/dts/am335x-evmsk.dts
index f5a6162..f050c46 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -244,7 +244,14 @@
};
 
vmmc_reg: regulator@12 {
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <330>;
regulator-always-on;
};
};
 };
+
+&mmc1 {
+   status = "okay";
+   vmmc-supply = <&vmmc_reg>;
+};
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index c3c781a..e029eea 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -234,6 +234,34 @@
status = "disabled";
};
 
+   mmc1: mmc@4806 {
+   compatible = "ti,omap3-hsmmc";
+   ti,hwmods = "mmc1";
+   ti,dual-volt;
+   ti,needs-special-reset;
+   dmas = <&edma 24
+   &edma 25>;
+   dma-names = "tx", "rx";
+   status = "disabled";
+   };
+
+   mmc2: mmc@481d8000 {
+   compatible = "ti,omap3-hsmmc";
+   ti,hwmods = "mmc2";
+   ti,needs-special-reset;
+   dmas = <&edma 2
+   &edma 3>;
+   dma-names = "tx", "rx";
+   status = "disabled";
+   };
+
+   mmc3: mmc@4781 {
+   compatible = "ti,omap3-hsmmc";
+   ti,hwmods = "mmc3";
+   ti,needs-special-reset;
+   status = "disabled";
+   };
+
wdt2: wdt@44e35000 {
compatible = "ti,omap3-wdt";
ti,hwmods = "wd_timer2";
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] mmc: omap_hsmmc: set max_segs based on dma engine limits

2013-03-06 Thread Matt Porter
The EDMA DMAC has a hardware limitation that prevents supporting
scatter gather lists with any number of segments. The DMA Engine
API reports the maximum number of segments a channel can support
via the optional dma_get_slave_sg_limits() API. If the max_nr_segs
limit is present, the value is used to configure mmc->max_segs
appropriately.

Signed-off-by: Matt Porter 
Acked-by: Tony Lindgren 
---
 drivers/mmc/host/omap_hsmmc.c |8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index e79b12d..f74d2ef 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1769,6 +1769,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
const struct of_device_id *match;
dma_cap_mask_t mask;
unsigned tx_req, rx_req;
+   struct dma_slave_sg_limits *dma_sg_limits;
struct pinctrl *pinctrl;
 
match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
@@ -1935,6 +1936,13 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
goto err_irq;
}
 
+   /* Some DMA Engines only handle a limited number of SG segments */
+   dma_sg_limits = dma_get_slave_sg_limits(host->rx_chan,
+   DMA_SLAVE_BUSWIDTH_4_BYTES,
+   mmc->max_blk_size / 4);
+   if (dma_sg_limits && dma_sg_limits->max_seg_nr)
+   mmc->max_segs = dma_sg_limits->max_seg_nr;
+
/* Request IRQ for MMC operations */
ret = request_irq(host->irq, omap_hsmmc_irq, 0,
mmc_hostname(mmc), host);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support

2013-03-07 Thread Matt Porter
On Thu, Mar 07, 2013 at 05:29:24AM +, Vaibhav Hiremath wrote:
> > -Original Message-
> > From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> > ow...@vger.kernel.org] On Behalf Of Porter, Matt
> > Sent: Thursday, March 07, 2013 9:47 AM
> > To: Krishnamoorthy, Balaji T; Chris Ball; Cousson, Benoit; Tony
> > Lindgren; Russell King
> > Cc: Devicetree Discuss; Linux ARM Kernel List; Linux OMAP List; Linux
> > Kernel Mailing List; Linux MMC List
> > Subject: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > 
> > Adds AM33XX MMC support for am335x-bone, am335x-evm, and
> > am335x-evmsk.
> > 
> > Signed-off-by: Matt Porter 
> > Acked-by: Tony Lindgren 
> > ---
> >  arch/arm/boot/dts/am335x-bone.dts  |7 +++
> >  arch/arm/boot/dts/am335x-evm.dts   |7 +++
> >  arch/arm/boot/dts/am335x-evmsk.dts |7 +++
> >  arch/arm/boot/dts/am33xx.dtsi  |   28 
> >  4 files changed, 49 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/am335x-bone.dts
> > b/arch/arm/boot/dts/am335x-bone.dts
> > index 11b240c..a154ce0 100644
> > --- a/arch/arm/boot/dts/am335x-bone.dts
> > +++ b/arch/arm/boot/dts/am335x-bone.dts
> > @@ -120,6 +120,8 @@
> > };
> > 
> > ldo3_reg: regulator@5 {
> > +   regulator-min-microvolt = <180>;
> > +   regulator-max-microvolt = <330>;
> > regulator-always-on;
> > };
> > 
> > @@ -136,3 +138,8 @@
> >  &cpsw_emac1 {
> > phy_id = <&davinci_mdio>, <1>;
> >  };
> > +
> > +&mmc1 {
> > +   status = "okay";
> > +   vmmc-supply = <&ldo3_reg>;
> > +};
> > diff --git a/arch/arm/boot/dts/am335x-evm.dts
> > b/arch/arm/boot/dts/am335x-evm.dts
> > index d649644..2907da6 100644
> > --- a/arch/arm/boot/dts/am335x-evm.dts
> > +++ b/arch/arm/boot/dts/am335x-evm.dts
> > @@ -232,6 +232,8 @@
> > };
> > 
> > vmmc_reg: regulator@12 {
> > +   regulator-min-microvolt = <180>;
> > +   regulator-max-microvolt = <330>;
> > regulator-always-on;
> > };
> > };
> > @@ -244,3 +246,8 @@
> >  &cpsw_emac1 {
> > phy_id = <&davinci_mdio>, <1>;
> >  };
> > +
> > +&mmc1 {
> > +   status = "okay";
> > +   vmmc-supply = <&vmmc_reg>;
> > +};
> > diff --git a/arch/arm/boot/dts/am335x-evmsk.dts
> > b/arch/arm/boot/dts/am335x-evmsk.dts
> > index f5a6162..f050c46 100644
> > --- a/arch/arm/boot/dts/am335x-evmsk.dts
> > +++ b/arch/arm/boot/dts/am335x-evmsk.dts
> > @@ -244,7 +244,14 @@
> > };
> > 
> > vmmc_reg: regulator@12 {
> > +   regulator-min-microvolt = <180>;
> > +   regulator-max-microvolt = <330>;
> > regulator-always-on;
> > };
> > };
> >  };
> > +
> > +&mmc1 {
> > +   status = "okay";
> > +   vmmc-supply = <&vmmc_reg>;
> > +};
> > diff --git a/arch/arm/boot/dts/am33xx.dtsi
> > b/arch/arm/boot/dts/am33xx.dtsi
> > index c3c781a..e029eea 100644
> > --- a/arch/arm/boot/dts/am33xx.dtsi
> > +++ b/arch/arm/boot/dts/am33xx.dtsi
> > @@ -234,6 +234,34 @@
> > status = "disabled";
> > };
> > 
> > +   mmc1: mmc@4806 {
> > +   compatible = "ti,omap3-hsmmc";
> > +   ti,hwmods = "mmc1";
> > +   ti,dual-volt;
> > +   ti,needs-special-reset;
> > +   dmas = <&edma 24
> > +   &edma 25>;
> > +   dma-names = "tx", "rx";
> > +   status = "disabled";
> > +   };
> > +
> > +   mmc2: mmc@481d8000 {
> > +   compatible = "ti,omap3-hsmmc";
> > +   ti,hwmods = "mmc2";
> > +   ti,needs-special-reset;
> > +   dmas = <&edma 2
> > +   &edma 3>;
> > +   dma-names = "tx", "rx";
> > +   status = "disabled";
> > +   };
> &g

Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support

2013-03-07 Thread Matt Porter
On Thu, Mar 07, 2013 at 02:39:55PM +, Vaibhav Hiremath wrote:
> 
> > -Original Message-
> > From: Matt Porter [mailto:ohio...@gmail.com] On Behalf Of Porter, Matt
> > Sent: Thursday, March 07, 2013 7:43 PM
> > To: Hiremath, Vaibhav
> > Cc: Krishnamoorthy, Balaji T; Chris Ball; Cousson, Benoit; Tony
> > Lindgren; Russell King; Devicetree Discuss; Linux ARM Kernel List;
> > Linux OMAP List; Linux Kernel Mailing List; Linux MMC List
> > Subject: Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > 
> > On Thu, Mar 07, 2013 at 05:29:24AM +, Vaibhav Hiremath wrote:
> > > > -Original Message-
> > > > From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> > > > ow...@vger.kernel.org] On Behalf Of Porter, Matt
> > > > Sent: Thursday, March 07, 2013 9:47 AM
> > > > To: Krishnamoorthy, Balaji T; Chris Ball; Cousson, Benoit; Tony
> > > > Lindgren; Russell King
> > > > Cc: Devicetree Discuss; Linux ARM Kernel List; Linux OMAP List;
> > Linux
> > > > Kernel Mailing List; Linux MMC List
> > > > Subject: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > > >
> > > > Adds AM33XX MMC support for am335x-bone, am335x-evm, and
> > > > am335x-evmsk.
> > > >
> > > > Signed-off-by: Matt Porter 
> > > > Acked-by: Tony Lindgren 
> > > > ---
> > > >  arch/arm/boot/dts/am335x-bone.dts  |7 +++
> > > >  arch/arm/boot/dts/am335x-evm.dts   |7 +++
> > > >  arch/arm/boot/dts/am335x-evmsk.dts |7 +++
> > > >  arch/arm/boot/dts/am33xx.dtsi  |   28
> > 
> > > >  4 files changed, 49 insertions(+)
> > > >
> > > > diff --git a/arch/arm/boot/dts/am335x-bone.dts
> > > > b/arch/arm/boot/dts/am335x-bone.dts
> > > > index 11b240c..a154ce0 100644
> > > > --- a/arch/arm/boot/dts/am335x-bone.dts
> > > > +++ b/arch/arm/boot/dts/am335x-bone.dts
> > > > @@ -120,6 +120,8 @@
> > > > };
> > > >
> > > > ldo3_reg: regulator@5 {
> > > > +   regulator-min-microvolt = <180>;
> > > > +   regulator-max-microvolt = <330>;
> > > > regulator-always-on;
> > > > };
> > > >
> > > > @@ -136,3 +138,8 @@
> > > >  &cpsw_emac1 {
> > > > phy_id = <&davinci_mdio>, <1>;
> > > >  };
> > > > +
> > > > +&mmc1 {
> > > > +   status = "okay";
> > > > +   vmmc-supply = <&ldo3_reg>;
> > > > +};
> > > > diff --git a/arch/arm/boot/dts/am335x-evm.dts
> > > > b/arch/arm/boot/dts/am335x-evm.dts
> > > > index d649644..2907da6 100644
> > > > --- a/arch/arm/boot/dts/am335x-evm.dts
> > > > +++ b/arch/arm/boot/dts/am335x-evm.dts
> > > > @@ -232,6 +232,8 @@
> > > > };
> > > >
> > > > vmmc_reg: regulator@12 {
> > > > +   regulator-min-microvolt = <180>;
> > > > +   regulator-max-microvolt = <330>;
> > > > regulator-always-on;
> > > > };
> > > > };
> > > > @@ -244,3 +246,8 @@
> > > >  &cpsw_emac1 {
> > > > phy_id = <&davinci_mdio>, <1>;
> > > >  };
> > > > +
> > > > +&mmc1 {
> > > > +   status = "okay";
> > > > +   vmmc-supply = <&vmmc_reg>;
> > > > +};
> > > > diff --git a/arch/arm/boot/dts/am335x-evmsk.dts
> > > > b/arch/arm/boot/dts/am335x-evmsk.dts
> > > > index f5a6162..f050c46 100644
> > > > --- a/arch/arm/boot/dts/am335x-evmsk.dts
> > > > +++ b/arch/arm/boot/dts/am335x-evmsk.dts
> > > > @@ -244,7 +244,14 @@
> > > > };
> > > >
> > > > vmmc_reg: regulator@12 {
> > > > +   regulator-min-microvolt = <180>;
> > > > +   regulator-max-microvolt = <330>;
> > > > regulator-always-on;
> > > > };
> > > > };
> > > >  };
> > > > +
>

Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support

2013-03-07 Thread Matt Porter
On Thu, Mar 07, 2013 at 09:46:56AM -0500, Matt Porter wrote:
> On Thu, Mar 07, 2013 at 02:39:55PM +, Vaibhav Hiremath wrote:
> > 2. And MMC rootFS mount is __not__ working for me.
> > 
> > 3. I get following error message - 
> > 
> > [2.118207] omap_hsmmc mmc.3: unable to obtain RX DMA engine channel 25
> 
> See below, you don't have CONFIG_EDMA on most likely.

That's CONFIG_TI_EDMA, of course.

-Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support

2013-03-07 Thread Matt Porter
On Thu, Mar 07, 2013 at 02:53:51PM +, Vaibhav Hiremath wrote:
> > -Original Message-
> > From: Matt Porter [mailto:ohio...@gmail.com] On Behalf Of Porter, Matt
> > Sent: Thursday, March 07, 2013 8:17 PM
> > To: Hiremath, Vaibhav
> > Cc: Linux OMAP List; Russell King; Krishnamoorthy, Balaji T; Devicetree
> > Discuss; Linux MMC List; Linux Kernel Mailing List; Chris Ball; Linux
> > ARM Kernel List
> > Subject: Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > 
> > On Thu, Mar 07, 2013 at 02:39:55PM +, Vaibhav Hiremath wrote:
> > >
> > > > -Original Message-
> > > > From: Matt Porter [mailto:ohio...@gmail.com] On Behalf Of Porter,
> > Matt
> > > > Sent: Thursday, March 07, 2013 7:43 PM
> > > > To: Hiremath, Vaibhav
> > > > Cc: Krishnamoorthy, Balaji T; Chris Ball; Cousson, Benoit; Tony
> > > > Lindgren; Russell King; Devicetree Discuss; Linux ARM Kernel List;
> > > > Linux OMAP List; Linux Kernel Mailing List; Linux MMC List
> > > > Subject: Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > > >
> > > > On Thu, Mar 07, 2013 at 05:29:24AM +, Vaibhav Hiremath wrote:
> > > > > > -Original Message-
> > > > > > From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> > > > > > ow...@vger.kernel.org] On Behalf Of Porter, Matt
> > > > > > Sent: Thursday, March 07, 2013 9:47 AM
> > > > > > To: Krishnamoorthy, Balaji T; Chris Ball; Cousson, Benoit; Tony
> > > > > > Lindgren; Russell King
> > > > > > Cc: Devicetree Discuss; Linux ARM Kernel List; Linux OMAP List;
> > > > Linux
> > > > > > Kernel Mailing List; Linux MMC List
> > > > > > Subject: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > > > > >
> > > > > > Adds AM33XX MMC support for am335x-bone, am335x-evm, and
> > > > > > am335x-evmsk.
> > > > > >
> > > > > > Signed-off-by: Matt Porter 
> > > > > > Acked-by: Tony Lindgren 
> > > > > > ---
> > > > > >  arch/arm/boot/dts/am335x-bone.dts  |7 +++
> > > > > >  arch/arm/boot/dts/am335x-evm.dts   |7 +++
> > > > > >  arch/arm/boot/dts/am335x-evmsk.dts |7 +++
> > > > > >  arch/arm/boot/dts/am33xx.dtsi  |   28
> > > > 
> > > > > >  4 files changed, 49 insertions(+)
> > > > > >
> > > > > > diff --git a/arch/arm/boot/dts/am335x-bone.dts
> > > > > > b/arch/arm/boot/dts/am335x-bone.dts
> > > > > > index 11b240c..a154ce0 100644
> > > > > > --- a/arch/arm/boot/dts/am335x-bone.dts
> > > > > > +++ b/arch/arm/boot/dts/am335x-bone.dts
> > > > > > @@ -120,6 +120,8 @@
> > > > > > };
> > > > > >
> > > > > > ldo3_reg: regulator@5 {
> > > > > > +   regulator-min-microvolt = <180>;
> > > > > > +   regulator-max-microvolt = <330>;
> > > > > > regulator-always-on;
> > > > > > };
> > > > > >
> > > > > > @@ -136,3 +138,8 @@
> > > > > >  &cpsw_emac1 {
> > > > > > phy_id = <&davinci_mdio>, <1>;
> > > > > >  };
> > > > > > +
> > > > > > +&mmc1 {
> > > > > > +   status = "okay";
> > > > > > +   vmmc-supply = <&ldo3_reg>;
> > > > > > +};
> > > > > > diff --git a/arch/arm/boot/dts/am335x-evm.dts
> > > > > > b/arch/arm/boot/dts/am335x-evm.dts
> > > > > > index d649644..2907da6 100644
> > > > > > --- a/arch/arm/boot/dts/am335x-evm.dts
> > > > > > +++ b/arch/arm/boot/dts/am335x-evm.dts
> > > > > > @@ -232,6 +232,8 @@
> > > > > > };
> > > > > >
> > > > > > vmmc_reg: regulator@12 {
> > > > > > +   regulator-min-microvolt = <180>;
> > > > > > +   regulator-max-microvolt = <330>;
> > > > > > regulator-always-on;
> > > > > > };
> > > 

Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support

2013-03-07 Thread Matt Porter
On Thu, Mar 07, 2013 at 02:59:42PM +, Vaibhav Hiremath wrote:
> 
> > -Original Message-
> > From: Hiremath, Vaibhav
> > Sent: Thursday, March 07, 2013 8:24 PM
> > To: Porter, Matt
> > Cc: Linux OMAP List; Russell King; Krishnamoorthy, Balaji T; Devicetree
> > Discuss; Linux MMC List; Linux Kernel Mailing List; Chris Ball; Linux
> > ARM Kernel List
> > Subject: RE: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > 
> > > -Original Message-
> > > From: Matt Porter [mailto:ohio...@gmail.com] On Behalf Of Porter,
> > Matt
> > > Sent: Thursday, March 07, 2013 8:17 PM
> > > To: Hiremath, Vaibhav
> > > Cc: Linux OMAP List; Russell King; Krishnamoorthy, Balaji T;
> > Devicetree
> > > Discuss; Linux MMC List; Linux Kernel Mailing List; Chris Ball; Linux
> > > ARM Kernel List
> > > Subject: Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > >
> > > On Thu, Mar 07, 2013 at 02:39:55PM +, Vaibhav Hiremath wrote:
> > > >
> > > > > -Original Message-
> > > > > From: Matt Porter [mailto:ohio...@gmail.com] On Behalf Of Porter,
> > > Matt
> > > > > Sent: Thursday, March 07, 2013 7:43 PM
> > > > > To: Hiremath, Vaibhav
> > > > > Cc: Krishnamoorthy, Balaji T; Chris Ball; Cousson, Benoit; Tony
> > > > > Lindgren; Russell King; Devicetree Discuss; Linux ARM Kernel
> > List;
> > > > > Linux OMAP List; Linux Kernel Mailing List; Linux MMC List
> > > > > Subject: Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > > > >
> > > > > On Thu, Mar 07, 2013 at 05:29:24AM +, Vaibhav Hiremath wrote:
> > > > > > > -Original Message-
> > > > > > > From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-
> > > > > > > ow...@vger.kernel.org] On Behalf Of Porter, Matt
> > > > > > > Sent: Thursday, March 07, 2013 9:47 AM
> > > > > > > To: Krishnamoorthy, Balaji T; Chris Ball; Cousson, Benoit;
> > Tony
> > > > > > > Lindgren; Russell King
> > > > > > > Cc: Devicetree Discuss; Linux ARM Kernel List; Linux OMAP
> > List;
> > > > > Linux
> > > > > > > Kernel Mailing List; Linux MMC List
> > > > > > > Subject: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > > > > > >
> 
> > 
> > I believe you meant "CONFIG_TI_EDMA" right?
> > 
> > Yes, I just enabled it and the result is still same.
> > 
> > 
> > 
> > [root@arago /]# dmesg | grep -ir mmc
> > [0.506844] vmmc: 1800 <--> 3300 mV at 3300 mV
> > [0.506970] vmmc: supplied by vbat
> > [root@arago /]#
> > [root@arago /]#
> > [root@arago /]# dmesg | grep -ir dma
> > [0.217063] DMA: preallocated 256 KiB pool for atomic coherent
> > allocations
> > [0.236321] platform 4900.edma: alias fck already exists
> > [0.236360] platform 4900.edma: alias fck already exists
> > [0.236381] platform 4900.edma: alias fck already exists
> > [0.370705] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine
> > driver
> > [0.445156] omap-dma-engine omap-dma-engine: OMAP DMA engine driver
> > [root@arago /]#
> > [root@arago /]#
> > 
> > 
> I have applied below patches from your recent post
> 
> 
> [2/2] ARM: dts: add AM33XX MMC support
> [1/2] mmc: omap_hsmmc: set max_segs based on dma engine limits
> [v4,3/3] mmc: davinci: get SG segment limits with dma_get_slave_sg_limits()
> [v4,2/3] dma: edma: add device_slave_sg_limits() support 
> [v4,1/3] dmaengine: add dma_get_slave_sg_limits()
> [v9,9/9] ARM: dts: add AM33XX SPI DMA support
> [v9,8/9] spi: omap2-mcspi: add generic DMA request support to the DT binding
> [v9,7/9] spi: omap2-mcspi: convert to dma_request_slave_channel_compat() 
> [v9,6/9] ARM: dts: add AM33XX EDMA support 
> [v9,5/9] dmaengine: edma: Add TI EDMA device tree binding
> [v9,4/9] dmaengine: edma: enable build for AM33XX
> [v9,3/9] ARM: edma: add AM33XX support to the private EDMA API
> [v9,2/9] ARM: edma: remove unused transfer controller handlers
> [v9,1/9] ARM: davinci: move private EDMA API to arm/common
> [v3,2/2] mmc: omap_hsmmc: add generic DMA request support to the DT binding
> [v3,1/2] mmc: omap_hsmmc: convert to dma_request_slave_channel_compat()
> 
> 
> 
> Am I missing anything here?

Yes, you missed the
http://www.spinics.net/lists/arm-kernel/msg227886.html dependency
mentioned first in the cover letter.

-Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support

2013-03-07 Thread Matt Porter
On Thu, Mar 07, 2013 at 03:50:01PM +, Vaibhav Hiremath wrote:
> 
> > -Original Message-
> > From: Matt Porter [mailto:ohio...@gmail.com] On Behalf Of Porter, Matt
> > Sent: Thursday, March 07, 2013 8:34 PM
> > To: Hiremath, Vaibhav
> > Cc: Chris Ball; Russell King; Krishnamoorthy, Balaji T; Devicetree
> > Discuss; Linux MMC List; Linux Kernel Mailing List; Linux OMAP List;
> > Linux ARM Kernel List
> > Subject: Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > 
> > On Thu, Mar 07, 2013 at 02:59:42PM +, Vaibhav Hiremath wrote:
> > >
> > > > -Original Message-
> > > > From: Hiremath, Vaibhav
> > > > Sent: Thursday, March 07, 2013 8:24 PM
> > > > To: Porter, Matt
> > > > Cc: Linux OMAP List; Russell King; Krishnamoorthy, Balaji T;
> > Devicetree
> > > > Discuss; Linux MMC List; Linux Kernel Mailing List; Chris Ball;
> > Linux
> > > > ARM Kernel List
> > > > Subject: RE: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > > >
> > > > > -Original Message-
> > > > > From: Matt Porter [mailto:ohio...@gmail.com] On Behalf Of Porter,
> > > > Matt
> > > > > Sent: Thursday, March 07, 2013 8:17 PM
> > > > > To: Hiremath, Vaibhav
> > > > > Cc: Linux OMAP List; Russell King; Krishnamoorthy, Balaji T;
> > > > Devicetree
> > > > > Discuss; Linux MMC List; Linux Kernel Mailing List; Chris Ball;
> > Linux
> > > > > ARM Kernel List
> > > > > Subject: Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > > > >
> > > > > On Thu, Mar 07, 2013 at 02:39:55PM +, Vaibhav Hiremath wrote:
> > > > > >
> > > > > > > -Original Message-
> > > > > > > From: Matt Porter [mailto:ohio...@gmail.com] On Behalf Of
> > Porter,
> > > > > Matt
> > > > > > > Sent: Thursday, March 07, 2013 7:43 PM
> > > > > > > To: Hiremath, Vaibhav
> > > > > > > Cc: Krishnamoorthy, Balaji T; Chris Ball; Cousson, Benoit;
> > Tony
> > > > > > > Lindgren; Russell King; Devicetree Discuss; Linux ARM Kernel
> > > > List;
> > > > > > > Linux OMAP List; Linux Kernel Mailing List; Linux MMC List
> > > > > > > Subject: Re: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > > > > > >
> > > > > > > On Thu, Mar 07, 2013 at 05:29:24AM +, Vaibhav Hiremath
> > wrote:
> > > > > > > > > -Original Message-
> > > > > > > > > From: linux-omap-ow...@vger.kernel.org [mailto:linux-
> > omap-
> > > > > > > > > ow...@vger.kernel.org] On Behalf Of Porter, Matt
> > > > > > > > > Sent: Thursday, March 07, 2013 9:47 AM
> > > > > > > > > To: Krishnamoorthy, Balaji T; Chris Ball; Cousson,
> > Benoit;
> > > > Tony
> > > > > > > > > Lindgren; Russell King
> > > > > > > > > Cc: Devicetree Discuss; Linux ARM Kernel List; Linux OMAP
> > > > List;
> > > > > > > Linux
> > > > > > > > > Kernel Mailing List; Linux MMC List
> > > > > > > > > Subject: [PATCH 2/2] ARM: dts: add AM33XX MMC support
> > > > > > > > >
> > > 
> > > >
> > > > I believe you meant "CONFIG_TI_EDMA" right?
> > > >
> > > > Yes, I just enabled it and the result is still same.
> > > >
> > > >
> > > >
> > > > [root@arago /]# dmesg | grep -ir mmc
> > > > [0.506844] vmmc: 1800 <--> 3300 mV at 3300 mV
> > > > [0.506970] vmmc: supplied by vbat
> > > > [root@arago /]#
> > > > [root@arago /]#
> > > > [root@arago /]# dmesg | grep -ir dma
> > > > [0.217063] DMA: preallocated 256 KiB pool for atomic coherent
> > > > allocations
> > > > [0.236321] platform 4900.edma: alias fck already exists
> > > > [0.236360] platform 4900.edma: alias fck already exists
> > > > [0.236381] platform 4900.edma: alias fck already exists
> > > > [0.370705] edma-dma-engine edma-dma-engine.0: TI EDMA DMA
> > engine
> > > > driver
> > > > [0.445156] omap-dma-engine omap-dma-engine: OMAP DMA engine
> > driver
> > > > [root@ara

Re: [PATCH v9 3/9] ARM: edma: add AM33XX support to the private EDMA API

2013-03-12 Thread Matt Porter
On Thu, Mar 07, 2013 at 08:42:18AM +0200, Andy Shevchenko wrote:
> On Wed, Mar 6, 2013 at 6:15 PM, Matt Porter  wrote:
> > 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. Adds AM33XX EDMA
> > crossbar event mux support. Enables build on OMAP.
> 
> > --- a/arch/arm/common/edma.c
> > +++ b/arch/arm/common/edma.c
> 
> > +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] % 4) * 8;
> 
> Looks like shift = (xbar_chans[i][1] & 0x03) << 3;

Yes, will update.

> > +   offset = xbar_chans[i][1] >> 2;
> > +   offset <<= 2;
> 
> Is it offset = xbar_chans[i][1] & 0xfffc; ?

Yes, will update

> > +   mux = readl((void *)((u32)xbar + offset));
> > +   mux &= ~(0xff << shift);
> > +   mux |= xbar_chans[i][0] << shift;
> > +   writel(mux, (void *)((u32)xbar + offset));
> > +   }
> 
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> ___
> devicetree-discuss mailing list
> devicetree-disc...@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v9 5/9] dmaengine: edma: Add TI EDMA device tree binding

2013-03-12 Thread Matt Porter
On Wed, Mar 06, 2013 at 08:24:06PM +, Peter Korsgaard wrote:
> >>>>> "Matt" == Matt Porter  writes:
> 
>  Matt> The binding definition is based on the generic DMA controller
>  Matt> binding.
> 
>  Matt> Signed-off-by: Matt Porter 
>  Matt> ---
>  Matt>  Documentation/devicetree/bindings/dma/ti-edma.txt |   49 
> +
>  Matt>  1 file changed, 49 insertions(+)
>  Matt>  create mode 100644 Documentation/devicetree/bindings/dma/ti-edma.txt
> 
>  Matt> diff --git a/Documentation/devicetree/bindings/dma/ti-edma.txt 
> b/Documentation/devicetree/bindings/dma/ti-edma.txt
>  Matt> new file mode 100644
>  Matt> index 000..075a60e3
>  Matt> --- /dev/null
>  Matt> +++ b/Documentation/devicetree/bindings/dma/ti-edma.txt
>  Matt> @@ -0,0 +1,49 @@
>  Matt> +TI EDMA
>  Matt> +
>  Matt> +Required properties:
>  Matt> +- compatible : "ti,edma3"
>  Matt> +- ti,hwmods: Name of the hwmods associated to the EDMA
>  Matt> +- ti,edma-regions: Number of regions
>  Matt> +- ti,edma-slots: Number of slots
>  Matt> +- ti,edma-queue-tc-map: List of transfer control to queue mappings
>  Matt> +- ti,edma-queue-priority-map: List of queue priority mappings
>  Matt> +- ti,edma-default-queue: Default queue value
>  Matt> +
>  Matt> +Optional properties:
>  Matt> +- ti,edma-reserved-channels: List of reserved channel regions
>  Matt> +- ti,edma-reserved-slots: List of reserved slot regions
>  Matt> +- ti,edma-xbar-event-map: Crossbar event to channel map
>  Matt> +
>  Matt> +Example:
>  Matt> +
>  Matt> +edma: edma@4900 {
>  Matt> +  reg = <0x4900 0x1>;
>  Matt> +  interrupt-parent = <&intc>;
>  Matt> +  interrupts = <12 13 14>;
> 
> Probably interrupt-parent should be removed from the example as well to
> match am33xx.dtsi

On second thought, I'm not sure we're going to get any direction on this
one so let's just do what feels right and make it reflect common usage
like you suggested.

Thanks,
Matt
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v9 3/9] ARM: edma: add AM33XX support to the private EDMA API

2013-03-12 Thread Matt Porter
On Tue, Mar 12, 2013 at 06:45:46AM +, Sekhar Nori wrote:
> 
> 
> On 3/6/2013 9:45 PM, Matt Porter wrote:
> > 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. Adds AM33XX EDMA
> > crossbar event mux support. Enables build on OMAP.
> > 
> > Signed-off-by: Matt Porter 
> > Acked-by: Sekhar Nori 
> > ---
> >  arch/arm/common/edma.c |  300 
> > ++--
> >  arch/arm/mach-omap2/Kconfig|1 +
> >  include/linux/platform_data/edma.h |1 +
> >  3 files changed, 292 insertions(+), 10 deletions(-)
> > 
> > diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
> > index a1db6cd..e68ac38 100644
> > --- a/arch/arm/common/edma.c
> > +++ b/arch/arm/common/edma.c
> > @@ -24,6 +24,13 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> >  
> >  #include 
> >  
> > @@ -1369,31 +1376,278 @@ 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 edma_xbar_event_map(struct device *dev,
> > +  struct device_node *node,
> > +  struct edma_soc_info *pdata, int len)
> > +{
> 
> It will be nice to separate the xbar feature from DT'fication of the
> existing driver. Right now because of the mix the patch has become
> pretty big and its becoming tough to review in isolation.

Sure, I'll do that on v10.

> > +   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] % 4) * 8;
> > +   offset = xbar_chans[i][1] >> 2;
> > +   offset <<= 2;
> > +   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)
> > +{
> > +   int ret = 0;
>

Re: [PATCH v9 5/9] dmaengine: edma: Add TI EDMA device tree binding

2013-03-12 Thread Matt Porter
On Tue, Mar 12, 2013 at 06:53:03AM +, Sekhar Nori wrote:
> On 3/6/2013 9:45 PM, Matt Porter wrote:
> > The binding definition is based on the generic DMA controller
> > binding.
> > 
> > Signed-off-by: Matt Porter 
> 
> Okay the bindings the documented after they are used leading to some
> confusion. This patch should be moved up the series. As I noted in my
> other e-mail, some of these bindings are not really hardware description
> and need to be re-looked.

Sure, I'll reorder it.

-Matt

> > ---
> >  Documentation/devicetree/bindings/dma/ti-edma.txt |   49 
> > +
> >  1 file changed, 49 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 000..075a60e3
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/dma/ti-edma.txt
> > @@ -0,0 +1,49 @@
> > +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
> > +- ti,edma-queue-tc-map: List of transfer control to queue mappings
> > +- ti,edma-queue-priority-map: List of queue priority mappings
> > +- ti,edma-default-queue: Default queue value
> > +
> > +Optional properties:
> > +- ti,edma-reserved-channels: List of reserved channel regions
> > +- ti,edma-reserved-slots: List of reserved slot regions
> > +- ti,edma-xbar-event-map: Crossbar event to channel map
> > +
> > +Example:
> > +
> > +edma: edma@4900 {
> > +   reg = <0x4900 0x1>;
> > +   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-reserved-channels = <0  2
> > +14 2
> > +26 6
> > +48 4
> > +56 8>;
> > +   ti,edma-reserved-slots = <0  2
> > + 14 2
> > + 26 6
> > + 48 4
> > + 56 8
> > + 64 127>;
> > +   ti,edma-queue-tc-map = <0 0
> > +   1 1
> > +   2 2>;
> > +   ti,edma-queue-priority-map = <0 0
> > + 1 1
> > + 2 2>;
> > +   ti,edma-default-queue = <0>;
> > +   ti,edma-xbar-event-map = <1 12
> > + 2 13>;
> > +};
> > 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


<    1   2   3   4