Re: [PATCH v16] dmaengine: Add MOXA ART DMA engine driver

2014-01-20 Thread Vinod Koul
On Fri, Jan 17, 2014 at 09:46:05AM +0100, Jonas Jensen wrote:
> The MOXA ART SoC has a DMA controller capable of offloading expensive
> memory operations, such as large copies. This patch adds support for
> the controller including four channels. Two of these are used to
> handle MMC copy on the UC-7112-LX hardware. The remaining two can be
> used in a future audio driver or client application.
> 
> Signed-off-by: Jonas Jensen 

Applied thanks.

Though I wasnt able to find the ARCH_MOXART in my next, it resolved after using
the linux-next as test tree and was able to compile test

--
~Vinod
> ---
> 
> Notes:
> Changes since v15:
> 1. rebase drivers/dma/Kconfig to next-20140117
> 
> Applies to next-20140117
> 
>  .../devicetree/bindings/dma/moxa,moxart-dma.txt|  45 ++
>  drivers/dma/Kconfig|   8 +
>  drivers/dma/Makefile   |   1 +
>  drivers/dma/moxart-dma.c   | 699 
> +
>  4 files changed, 753 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
>  create mode 100644 drivers/dma/moxart-dma.c
> 
> diff --git a/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt 
> b/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
> new file mode 100644
> index 000..8a9f355
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
> @@ -0,0 +1,45 @@
> +MOXA ART DMA Controller
> +
> +See dma.txt first
> +
> +Required properties:
> +
> +- compatible :   Must be "moxa,moxart-dma"
> +- reg :  Should contain registers location and length
> +- interrupts :   Should contain an interrupt-specifier for the sole
> + interrupt generated by the device
> +- #dma-cells :   Should be 1, a single cell holding a line request number
> +
> +Example:
> +
> + dma: dma@9050 {
> + compatible = "moxa,moxart-dma";
> + reg = <0x90500080 0x40>;
> + interrupts = <24 0>;
> + #dma-cells = <1>;
> + };
> +
> +
> +Clients:
> +
> +DMA clients connected to the MOXA ART DMA controller must use the format
> +described in the dma.txt file, using a two-cell specifier for each channel:
> +a phandle plus one integer cells.
> +The two cells in order are:
> +
> +1. A phandle pointing to the DMA controller.
> +2. Peripheral identifier for the hardware handshaking interface.
> +
> +Example:
> +Use specific request line passing from dma
> +For example, MMC request line is 5
> +
> + sdhci: sdhci@98e0 {
> + compatible = "moxa,moxart-sdhci";
> + reg = <0x98e0 0x5C>;
> + interrupts = <5 0>;
> + clocks = <_apb>;
> + dmas =  < 5>,
> + < 5>;
> + dma-names = "tx", "rx";
> + };
> diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
> index 9ae6f54..9bed1a2 100644
> --- a/drivers/dma/Kconfig
> +++ b/drivers/dma/Kconfig
> @@ -342,6 +342,14 @@ config K3_DMA
> Support the DMA engine for Hisilicon K3 platform
> devices.
>  
> +config MOXART_DMA
> + tristate "MOXART DMA support"
> + depends on ARCH_MOXART
> + select DMA_ENGINE
> + select DMA_VIRTUAL_CHANNELS
> + help
> +   Enable support for the MOXA ART SoC DMA controller.
> +
>  config DMA_ENGINE
>   bool
>  
> diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
> index 0a6f08e..a029d0f4 100644
> --- a/drivers/dma/Makefile
> +++ b/drivers/dma/Makefile
> @@ -43,3 +43,4 @@ obj-$(CONFIG_MMP_PDMA) += mmp_pdma.o
>  obj-$(CONFIG_DMA_JZ4740) += dma-jz4740.o
>  obj-$(CONFIG_TI_CPPI41) += cppi41.o
>  obj-$(CONFIG_K3_DMA) += k3dma.o
> +obj-$(CONFIG_MOXART_DMA) += moxart-dma.o
> diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c
> new file mode 100644
> index 000..3258e48
> --- /dev/null
> +++ b/drivers/dma/moxart-dma.c
> @@ -0,0 +1,699 @@
> +/*
> + * MOXA ART SoCs DMA Engine support.
> + *
> + * Copyright (C) 2013 Jonas Jensen
> + *
> + * Jonas Jensen 
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2.  This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include "dmaengine.h"
> +#include "virt-dma.h"
> +
> +#define APB_DMA_MAX_CHANNEL  4
> +
> +#define REG_OFF_ADDRESS_SOURCE   0
> +#define REG_OFF_ADDRESS_DEST 4
> +#define REG_OFF_CYCLES   8
> +#define REG_OFF_CTRL 12
> +#define REG_OFF_CHAN_SIZE16
> +
> +#define APB_DMA_ENABLE   BIT(0)
> +#define APB_DMA_FIN_INT_STS  BIT(1)
> +#define 

Re: [PATCH v16] dmaengine: Add MOXA ART DMA engine driver

2014-01-20 Thread Vinod Koul
On Fri, Jan 17, 2014 at 09:46:05AM +0100, Jonas Jensen wrote:
 The MOXA ART SoC has a DMA controller capable of offloading expensive
 memory operations, such as large copies. This patch adds support for
 the controller including four channels. Two of these are used to
 handle MMC copy on the UC-7112-LX hardware. The remaining two can be
 used in a future audio driver or client application.
 
 Signed-off-by: Jonas Jensen jonas.jen...@gmail.com

Applied thanks.

Though I wasnt able to find the ARCH_MOXART in my next, it resolved after using
the linux-next as test tree and was able to compile test

--
~Vinod
 ---
 
 Notes:
 Changes since v15:
 1. rebase drivers/dma/Kconfig to next-20140117
 
 Applies to next-20140117
 
  .../devicetree/bindings/dma/moxa,moxart-dma.txt|  45 ++
  drivers/dma/Kconfig|   8 +
  drivers/dma/Makefile   |   1 +
  drivers/dma/moxart-dma.c   | 699 
 +
  4 files changed, 753 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
  create mode 100644 drivers/dma/moxart-dma.c
 
 diff --git a/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt 
 b/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
 new file mode 100644
 index 000..8a9f355
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
 @@ -0,0 +1,45 @@
 +MOXA ART DMA Controller
 +
 +See dma.txt first
 +
 +Required properties:
 +
 +- compatible :   Must be moxa,moxart-dma
 +- reg :  Should contain registers location and length
 +- interrupts :   Should contain an interrupt-specifier for the sole
 + interrupt generated by the device
 +- #dma-cells :   Should be 1, a single cell holding a line request number
 +
 +Example:
 +
 + dma: dma@9050 {
 + compatible = moxa,moxart-dma;
 + reg = 0x90500080 0x40;
 + interrupts = 24 0;
 + #dma-cells = 1;
 + };
 +
 +
 +Clients:
 +
 +DMA clients connected to the MOXA ART DMA controller must use the format
 +described in the dma.txt file, using a two-cell specifier for each channel:
 +a phandle plus one integer cells.
 +The two cells in order are:
 +
 +1. A phandle pointing to the DMA controller.
 +2. Peripheral identifier for the hardware handshaking interface.
 +
 +Example:
 +Use specific request line passing from dma
 +For example, MMC request line is 5
 +
 + sdhci: sdhci@98e0 {
 + compatible = moxa,moxart-sdhci;
 + reg = 0x98e0 0x5C;
 + interrupts = 5 0;
 + clocks = clk_apb;
 + dmas =  dma 5,
 + dma 5;
 + dma-names = tx, rx;
 + };
 diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
 index 9ae6f54..9bed1a2 100644
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
 @@ -342,6 +342,14 @@ config K3_DMA
 Support the DMA engine for Hisilicon K3 platform
 devices.
  
 +config MOXART_DMA
 + tristate MOXART DMA support
 + depends on ARCH_MOXART
 + select DMA_ENGINE
 + select DMA_VIRTUAL_CHANNELS
 + help
 +   Enable support for the MOXA ART SoC DMA controller.
 +
  config DMA_ENGINE
   bool
  
 diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
 index 0a6f08e..a029d0f4 100644
 --- a/drivers/dma/Makefile
 +++ b/drivers/dma/Makefile
 @@ -43,3 +43,4 @@ obj-$(CONFIG_MMP_PDMA) += mmp_pdma.o
  obj-$(CONFIG_DMA_JZ4740) += dma-jz4740.o
  obj-$(CONFIG_TI_CPPI41) += cppi41.o
  obj-$(CONFIG_K3_DMA) += k3dma.o
 +obj-$(CONFIG_MOXART_DMA) += moxart-dma.o
 diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c
 new file mode 100644
 index 000..3258e48
 --- /dev/null
 +++ b/drivers/dma/moxart-dma.c
 @@ -0,0 +1,699 @@
 +/*
 + * MOXA ART SoCs DMA Engine support.
 + *
 + * Copyright (C) 2013 Jonas Jensen
 + *
 + * Jonas Jensen jonas.jen...@gmail.com
 + *
 + * This file is licensed under the terms of the GNU General Public
 + * License version 2.  This program is licensed as is without any
 + * warranty of any kind, whether express or implied.
 + */
 +
 +#include linux/dmaengine.h
 +#include linux/dma-mapping.h
 +#include linux/err.h
 +#include linux/init.h
 +#include linux/interrupt.h
 +#include linux/list.h
 +#include linux/module.h
 +#include linux/platform_device.h
 +#include linux/slab.h
 +#include linux/spinlock.h
 +#include linux/of_address.h
 +#include linux/of_irq.h
 +#include linux/of_dma.h
 +#include linux/bitops.h
 +
 +#include asm/cacheflush.h
 +
 +#include dmaengine.h
 +#include virt-dma.h
 +
 +#define APB_DMA_MAX_CHANNEL  4
 +
 +#define REG_OFF_ADDRESS_SOURCE   0
 +#define REG_OFF_ADDRESS_DEST 4
 +#define REG_OFF_CYCLES   8
 +#define REG_OFF_CTRL 12
 +#define REG_OFF_CHAN_SIZE16
 +
 +#define APB_DMA_ENABLE   

Re: [PATCH v16] dmaengine: Add MOXA ART DMA engine driver

2014-01-17 Thread Arnd Bergmann
On Friday 17 January 2014, Jonas Jensen wrote:
> The MOXA ART SoC has a DMA controller capable of offloading expensive
> memory operations, such as large copies. This patch adds support for
> the controller including four channels. Two of these are used to
> handle MMC copy on the UC-7112-LX hardware. The remaining two can be
> used in a future audio driver or client application.
> 
> Signed-off-by: Jonas Jensen 
> ---

Acked-by: Arnd Bergmann 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v16] dmaengine: Add MOXA ART DMA engine driver

2014-01-17 Thread Jonas Jensen
The MOXA ART SoC has a DMA controller capable of offloading expensive
memory operations, such as large copies. This patch adds support for
the controller including four channels. Two of these are used to
handle MMC copy on the UC-7112-LX hardware. The remaining two can be
used in a future audio driver or client application.

Signed-off-by: Jonas Jensen 
---

Notes:
Changes since v15:
1. rebase drivers/dma/Kconfig to next-20140117

Applies to next-20140117

 .../devicetree/bindings/dma/moxa,moxart-dma.txt|  45 ++
 drivers/dma/Kconfig|   8 +
 drivers/dma/Makefile   |   1 +
 drivers/dma/moxart-dma.c   | 699 +
 4 files changed, 753 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
 create mode 100644 drivers/dma/moxart-dma.c

diff --git a/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt 
b/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
new file mode 100644
index 000..8a9f355
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
@@ -0,0 +1,45 @@
+MOXA ART DMA Controller
+
+See dma.txt first
+
+Required properties:
+
+- compatible : Must be "moxa,moxart-dma"
+- reg :Should contain registers location and length
+- interrupts : Should contain an interrupt-specifier for the sole
+   interrupt generated by the device
+- #dma-cells : Should be 1, a single cell holding a line request number
+
+Example:
+
+   dma: dma@9050 {
+   compatible = "moxa,moxart-dma";
+   reg = <0x90500080 0x40>;
+   interrupts = <24 0>;
+   #dma-cells = <1>;
+   };
+
+
+Clients:
+
+DMA clients connected to the MOXA ART DMA controller must use the format
+described in the dma.txt file, using a two-cell specifier for each channel:
+a phandle plus one integer cells.
+The two cells in order are:
+
+1. A phandle pointing to the DMA controller.
+2. Peripheral identifier for the hardware handshaking interface.
+
+Example:
+Use specific request line passing from dma
+For example, MMC request line is 5
+
+   sdhci: sdhci@98e0 {
+   compatible = "moxa,moxart-sdhci";
+   reg = <0x98e0 0x5C>;
+   interrupts = <5 0>;
+   clocks = <_apb>;
+   dmas =  < 5>,
+   < 5>;
+   dma-names = "tx", "rx";
+   };
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 9ae6f54..9bed1a2 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -342,6 +342,14 @@ config K3_DMA
  Support the DMA engine for Hisilicon K3 platform
  devices.
 
+config MOXART_DMA
+   tristate "MOXART DMA support"
+   depends on ARCH_MOXART
+   select DMA_ENGINE
+   select DMA_VIRTUAL_CHANNELS
+   help
+ Enable support for the MOXA ART SoC DMA controller.
+
 config DMA_ENGINE
bool
 
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index 0a6f08e..a029d0f4 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -43,3 +43,4 @@ obj-$(CONFIG_MMP_PDMA) += mmp_pdma.o
 obj-$(CONFIG_DMA_JZ4740) += dma-jz4740.o
 obj-$(CONFIG_TI_CPPI41) += cppi41.o
 obj-$(CONFIG_K3_DMA) += k3dma.o
+obj-$(CONFIG_MOXART_DMA) += moxart-dma.o
diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c
new file mode 100644
index 000..3258e48
--- /dev/null
+++ b/drivers/dma/moxart-dma.c
@@ -0,0 +1,699 @@
+/*
+ * MOXA ART SoCs DMA Engine support.
+ *
+ * Copyright (C) 2013 Jonas Jensen
+ *
+ * Jonas Jensen 
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "dmaengine.h"
+#include "virt-dma.h"
+
+#define APB_DMA_MAX_CHANNEL4
+
+#define REG_OFF_ADDRESS_SOURCE 0
+#define REG_OFF_ADDRESS_DEST   4
+#define REG_OFF_CYCLES 8
+#define REG_OFF_CTRL   12
+#define REG_OFF_CHAN_SIZE  16
+
+#define APB_DMA_ENABLE BIT(0)
+#define APB_DMA_FIN_INT_STSBIT(1)
+#define APB_DMA_FIN_INT_EN BIT(2)
+#define APB_DMA_BURST_MODE BIT(3)
+#define APB_DMA_ERR_INT_STSBIT(4)
+#define APB_DMA_ERR_INT_EN BIT(5)
+
+/*
+ * Unset: APB
+ * Set:   AHB
+ */
+#define APB_DMA_SOURCE_SELECT  0x40
+#define APB_DMA_DEST_SELECT0x80
+
+#define APB_DMA_SOURCE 0x100
+#define APB_DMA_DEST   0x1000
+
+#define APB_DMA_SOURCE_MASK  

[PATCH v16] dmaengine: Add MOXA ART DMA engine driver

2014-01-17 Thread Jonas Jensen
The MOXA ART SoC has a DMA controller capable of offloading expensive
memory operations, such as large copies. This patch adds support for
the controller including four channels. Two of these are used to
handle MMC copy on the UC-7112-LX hardware. The remaining two can be
used in a future audio driver or client application.

Signed-off-by: Jonas Jensen jonas.jen...@gmail.com
---

Notes:
Changes since v15:
1. rebase drivers/dma/Kconfig to next-20140117

Applies to next-20140117

 .../devicetree/bindings/dma/moxa,moxart-dma.txt|  45 ++
 drivers/dma/Kconfig|   8 +
 drivers/dma/Makefile   |   1 +
 drivers/dma/moxart-dma.c   | 699 +
 4 files changed, 753 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
 create mode 100644 drivers/dma/moxart-dma.c

diff --git a/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt 
b/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
new file mode 100644
index 000..8a9f355
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/moxa,moxart-dma.txt
@@ -0,0 +1,45 @@
+MOXA ART DMA Controller
+
+See dma.txt first
+
+Required properties:
+
+- compatible : Must be moxa,moxart-dma
+- reg :Should contain registers location and length
+- interrupts : Should contain an interrupt-specifier for the sole
+   interrupt generated by the device
+- #dma-cells : Should be 1, a single cell holding a line request number
+
+Example:
+
+   dma: dma@9050 {
+   compatible = moxa,moxart-dma;
+   reg = 0x90500080 0x40;
+   interrupts = 24 0;
+   #dma-cells = 1;
+   };
+
+
+Clients:
+
+DMA clients connected to the MOXA ART DMA controller must use the format
+described in the dma.txt file, using a two-cell specifier for each channel:
+a phandle plus one integer cells.
+The two cells in order are:
+
+1. A phandle pointing to the DMA controller.
+2. Peripheral identifier for the hardware handshaking interface.
+
+Example:
+Use specific request line passing from dma
+For example, MMC request line is 5
+
+   sdhci: sdhci@98e0 {
+   compatible = moxa,moxart-sdhci;
+   reg = 0x98e0 0x5C;
+   interrupts = 5 0;
+   clocks = clk_apb;
+   dmas =  dma 5,
+   dma 5;
+   dma-names = tx, rx;
+   };
diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 9ae6f54..9bed1a2 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -342,6 +342,14 @@ config K3_DMA
  Support the DMA engine for Hisilicon K3 platform
  devices.
 
+config MOXART_DMA
+   tristate MOXART DMA support
+   depends on ARCH_MOXART
+   select DMA_ENGINE
+   select DMA_VIRTUAL_CHANNELS
+   help
+ Enable support for the MOXA ART SoC DMA controller.
+
 config DMA_ENGINE
bool
 
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
index 0a6f08e..a029d0f4 100644
--- a/drivers/dma/Makefile
+++ b/drivers/dma/Makefile
@@ -43,3 +43,4 @@ obj-$(CONFIG_MMP_PDMA) += mmp_pdma.o
 obj-$(CONFIG_DMA_JZ4740) += dma-jz4740.o
 obj-$(CONFIG_TI_CPPI41) += cppi41.o
 obj-$(CONFIG_K3_DMA) += k3dma.o
+obj-$(CONFIG_MOXART_DMA) += moxart-dma.o
diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c
new file mode 100644
index 000..3258e48
--- /dev/null
+++ b/drivers/dma/moxart-dma.c
@@ -0,0 +1,699 @@
+/*
+ * MOXA ART SoCs DMA Engine support.
+ *
+ * Copyright (C) 2013 Jonas Jensen
+ *
+ * Jonas Jensen jonas.jen...@gmail.com
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed as is without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include linux/dmaengine.h
+#include linux/dma-mapping.h
+#include linux/err.h
+#include linux/init.h
+#include linux/interrupt.h
+#include linux/list.h
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/slab.h
+#include linux/spinlock.h
+#include linux/of_address.h
+#include linux/of_irq.h
+#include linux/of_dma.h
+#include linux/bitops.h
+
+#include asm/cacheflush.h
+
+#include dmaengine.h
+#include virt-dma.h
+
+#define APB_DMA_MAX_CHANNEL4
+
+#define REG_OFF_ADDRESS_SOURCE 0
+#define REG_OFF_ADDRESS_DEST   4
+#define REG_OFF_CYCLES 8
+#define REG_OFF_CTRL   12
+#define REG_OFF_CHAN_SIZE  16
+
+#define APB_DMA_ENABLE BIT(0)
+#define APB_DMA_FIN_INT_STSBIT(1)
+#define APB_DMA_FIN_INT_EN BIT(2)
+#define APB_DMA_BURST_MODE BIT(3)
+#define APB_DMA_ERR_INT_STSBIT(4)
+#define APB_DMA_ERR_INT_EN BIT(5)
+
+/*
+ * Unset: APB
+ * Set:   AHB
+ */
+#define 

Re: [PATCH v16] dmaengine: Add MOXA ART DMA engine driver

2014-01-17 Thread Arnd Bergmann
On Friday 17 January 2014, Jonas Jensen wrote:
 The MOXA ART SoC has a DMA controller capable of offloading expensive
 memory operations, such as large copies. This patch adds support for
 the controller including four channels. Two of these are used to
 handle MMC copy on the UC-7112-LX hardware. The remaining two can be
 used in a future audio driver or client application.
 
 Signed-off-by: Jonas Jensen jonas.jen...@gmail.com
 ---

Acked-by: Arnd Bergmann a...@arndb.de
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/