All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/2] ARM: dts: Add DT bindings for OMAP SDMA
@ 2013-02-26 18:27 ` Jon Hunter
  0 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-02-26 18:27 UTC (permalink / raw)
  To: Rob Herring, Grant Likely, Tony Lindgren, Benoit Cousson,
	Vinod Koul, Russell King
  Cc: device-tree, linux-omap, linux-arm

Adds device-tree bindings from SDMA on OMAP2+ devices. DMA client
bindings are also added for devices that have SPI and MMC bindings
populated. Client binding data is based upon existing HWMOD data for
OMAP and has been checked against OMAP documentation.

Please note that the underlying (legacy) OMAP SDMA driver has not been
ported over to DT and this still needs to be done. However, this allows
DMA clients to look-up the DMA resource information via device-tree.

Testing includes ...
1. Boot tested on OMAP3430 SDP board and OMAP4430 SDP board with
   without device-tree present.
2. Testing of MMC1 with SD card on OMAP3430 SDP board and OMAP4430
   SDP board with and without device-tree present.

Testing branch available here [1].

Series is based upon v3.8 on top of the following ...
- Vinod's topic/dmaengine_dt branch [3]
- Matt Porter's series "DMA Engine support for AM33XX" [4]
- Matt Porter's series "omap_hsmmc DT DMA Client support" [5]
- Sourav Poddar's series "add omap mcspi device tree data" [6]

V3 changes:
- Updated name of of_dma_filter_info and statically initialised
  filter_fn member of this structure per Arnd's feedback.

V2 changes:
- Updated to Tony's omap-for-v3.9/multiplatform-v2 branch to pull in
  DMA changes for v3.9
- Added comma to omap_dma_driver structure as pointed out by Arnd.
- Updated OMAP SDMA DT binding compatible strings to indicate which
  devices are bit compatible with each other with respect to the SDMA
  controller. Grant had mentioned in the past that he wants the
  compatible string to be based upon a particular device and not
  something generic like "ti,omap-sdma".

[1] https://github.com/jonhunter/linux/commits/dev-dt-dma
[2] git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git omap-for-v3.9/multiplatform-v2
[3] http://git.infradead.org/users/vkoul/slave-dma.git/shortlog/refs/heads/topic/dmaengine_dt
[4] http://permalink.gmane.org/gmane.linux.kernel.spi.devel/12508
[5] http://permalink.gmane.org/gmane.linux.ports.arm.omap/93165
[6] http://permalink.gmane.org/gmane.linux.kernel/1435002

Jon Hunter (2):
  ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
  dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver

 .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++
 arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
 arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
 arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
 arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
 arch/arm/mach-omap2/dma.c                          |    4 ++
 drivers/dma/omap-dma.c                             |   38 ++++++++++++++-
 7 files changed, 225 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 0/2] ARM: dts: Add DT bindings for OMAP SDMA
@ 2013-02-26 18:27 ` Jon Hunter
  0 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-02-26 18:27 UTC (permalink / raw)
  To: linux-arm-kernel

Adds device-tree bindings from SDMA on OMAP2+ devices. DMA client
bindings are also added for devices that have SPI and MMC bindings
populated. Client binding data is based upon existing HWMOD data for
OMAP and has been checked against OMAP documentation.

Please note that the underlying (legacy) OMAP SDMA driver has not been
ported over to DT and this still needs to be done. However, this allows
DMA clients to look-up the DMA resource information via device-tree.

Testing includes ...
1. Boot tested on OMAP3430 SDP board and OMAP4430 SDP board with
   without device-tree present.
2. Testing of MMC1 with SD card on OMAP3430 SDP board and OMAP4430
   SDP board with and without device-tree present.

Testing branch available here [1].

Series is based upon v3.8 on top of the following ...
- Vinod's topic/dmaengine_dt branch [3]
- Matt Porter's series "DMA Engine support for AM33XX" [4]
- Matt Porter's series "omap_hsmmc DT DMA Client support" [5]
- Sourav Poddar's series "add omap mcspi device tree data" [6]

V3 changes:
- Updated name of of_dma_filter_info and statically initialised
  filter_fn member of this structure per Arnd's feedback.

V2 changes:
- Updated to Tony's omap-for-v3.9/multiplatform-v2 branch to pull in
  DMA changes for v3.9
- Added comma to omap_dma_driver structure as pointed out by Arnd.
- Updated OMAP SDMA DT binding compatible strings to indicate which
  devices are bit compatible with each other with respect to the SDMA
  controller. Grant had mentioned in the past that he wants the
  compatible string to be based upon a particular device and not
  something generic like "ti,omap-sdma".

[1] https://github.com/jonhunter/linux/commits/dev-dt-dma
[2] git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git omap-for-v3.9/multiplatform-v2
[3] http://git.infradead.org/users/vkoul/slave-dma.git/shortlog/refs/heads/topic/dmaengine_dt
[4] http://permalink.gmane.org/gmane.linux.kernel.spi.devel/12508
[5] http://permalink.gmane.org/gmane.linux.ports.arm.omap/93165
[6] http://permalink.gmane.org/gmane.linux.kernel/1435002

Jon Hunter (2):
  ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
  dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver

 .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++
 arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
 arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
 arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
 arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
 arch/arm/mach-omap2/dma.c                          |    4 ++
 drivers/dma/omap-dma.c                             |   38 ++++++++++++++-
 7 files changed, 225 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
  2013-02-26 18:27 ` Jon Hunter
@ 2013-02-26 18:27   ` Jon Hunter
  -1 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-02-26 18:27 UTC (permalink / raw)
  To: Rob Herring, Grant Likely, Tony Lindgren, Benoit Cousson,
	Vinod Koul, Russell King
  Cc: device-tree, linux-omap, linux-arm, Jon Hunter

Add SDMA controller binding for OMAP2+ devices and populate DMA client
information for SPI and MMC periperhal on OMAP3+ devices. Please note
that OMAP24xx devices do not have SPI and MMC bindings available yet and
so DMA client information is not populated.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++
 arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
 arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
 arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
 arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
 5 files changed, 185 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt

diff --git a/Documentation/devicetree/bindings/dma/omap-sdma.txt b/Documentation/devicetree/bindings/dma/omap-sdma.txt
new file mode 100644
index 0000000..22aab28
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/omap-sdma.txt
@@ -0,0 +1,51 @@
+* TI OMAP SDMA controller
+
+Required properties:
+- compatible:		Should be set to one of the following:
+
+			ti,omap2420-sdma (omap2420)
+			ti,omap2430-sdma (omap2430)
+			ti,omap3430-sdma (omap3430)
+			ti,omap3630-sdma (omap3630)
+			ti,omap4430-sdma (omap4430 & omap4460 & omap543x)
+
+- reg: 			Contains DMA registers location and length.
+- interrupts: 		Contains DMA interrupt information.
+- #dma-cells: 		Must be 1.
+- #dma-channels:	Contains total number of programmable DMA channels.
+- #dma-requests:	Contains total number of DMA requests.
+
+Example:
+
+	sdma: dma-controller@4A056000 {
+		compatible = "ti,omap-sdma";
+		reg = <0x4A056000 0x1000>;
+		interrupts = <0 12 0x4>,
+			     <0 13 0x4>,
+			     <0 14 0x4>,
+			     <0 15 0x4>;
+		#dma-cells = <1>;
+		#dma-channels = <32>;
+		#dma-requests = <127>;
+	};
+
+
+* TI OMAP SDMA clients
+
+Required properties:
+- dmas:			List of one or more DMA specifiers, each consisting of
+			- A phandle pointing to DMA controller node
+			- The DMA request number associated with client device
+- dma-names: 		Contains one identifier string for each dma specifier in
+			the dmas property. The specific strings that can be used
+			are defined in the binding of the DMA client device.
+
+Example:
+
+	mmc1: mmc@4809c000 {
+		...
+		dmas = <&sdma 61>,	/* TX channel */
+		       <&sdma 62>;	/* RX channel */
+		dma-names = "tx", "rx";
+		...
+	};
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index 761c4b6..22dffa0 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -49,6 +49,18 @@
 			reg = <0x480FE000 0x1000>;
 		};
 
+		sdma: dma-controller@48056000 {
+			compatible = "ti,omap2430-sdma", "ti,omap2420-sdma";
+			reg = <0x48056000 0x1000>;
+			interrupts = <12>,
+				     <13>,
+				     <14>,
+				     <15>;
+			#dma-cells = <1>;
+			#dma-channels = <32>;
+			#dma-requests = <64>;
+		};
+
 		uart1: serial@4806a000 {
 			compatible = "ti,omap2-uart";
 			ti,hwmods = "uart1";
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 1acc261..4e7acb6 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -75,6 +75,18 @@
 			reg = <0x48200000 0x1000>;
 		};
 
+		sdma: dma-controller@48056000 {
+			compatible = "ti,omap3630-sdma", "ti,omap3430-sdma";
+			reg = <0x48056000 0x1000>;
+			interrupts = <12>,
+				     <13>,
+				     <14>,
+				     <15>;
+			#dma-cells = <1>;
+			#dma-channels = <32>;
+			#dma-requests = <96>;
+		};
+
 		omap3_pmx_core: pinmux@48002030 {
 			compatible = "ti,omap3-padconf", "pinctrl-single";
 			reg = <0x48002030 0x05cc>;
@@ -192,6 +204,16 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi1";
 			ti,spi-num-cs = <4>;
+			dmas = <&sdma 35>,
+			       <&sdma 36>,
+			       <&sdma 37>,
+			       <&sdma 38>,
+			       <&sdma 39>,
+			       <&sdma 40>,
+			       <&sdma 41>,
+			       <&sdma 42>;
+			dma-names = "tx0", "rx0", "tx1", "rx1",
+				    "tx2", "rx2", "tx3", "rx3";
 		};
 
 		mcspi2: spi@4809a000 {
@@ -200,6 +222,11 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi2";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 43>,
+			       <&sdma 44>,
+			       <&sdma 45>,
+			       <&sdma 46>;
+			dma-names = "tx0", "rx0", "tx1", "rx1";
 		};
 
 		mcspi3: spi@480b8000 {
@@ -208,6 +235,11 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi3";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 15>,
+			       <&sdma 16>,
+			       <&sdma 23>,
+			       <&sdma 24>;
+			dma-names = "tx0", "rx0", "tx1", "rx1";
 		};
 
 		mcspi4: spi@480ba000 {
@@ -216,22 +248,30 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi4";
 			ti,spi-num-cs = <1>;
+			dmas = <&sdma 70>, <&sdma 71>;
+			dma-names = "tx0", "rx0";
 		};
 
 		mmc1: mmc@4809c000 {
 			compatible = "ti,omap3-hsmmc";
 			ti,hwmods = "mmc1";
 			ti,dual-volt;
+			dmas = <&sdma 61>, <&sdma 62>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc2: mmc@480b4000 {
 			compatible = "ti,omap3-hsmmc";
 			ti,hwmods = "mmc2";
+			dmas = <&sdma 47>, <&sdma 48>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc3: mmc@480ad000 {
 			compatible = "ti,omap3-hsmmc";
 			ti,hwmods = "mmc3";
+			dmas = <&sdma 77>, <&sdma 78>;
+			dma-names = "tx", "rx";
 		};
 
 		wdt2: wdt@48314000 {
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 739bb79..827f6f3 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -118,6 +118,18 @@
 			pinctrl-single,function-mask = <0x7fff>;
 		};
 
+		sdma: dma-controller@4A056000 {
+			compatible = "ti,omap4430-sdma";
+			reg = <0x4A056000 0x1000>;
+			interrupts = <0 12 0x4>,
+				     <0 13 0x4>,
+				     <0 14 0x4>,
+				     <0 15 0x4>;
+			#dma-cells = <1>;
+			#dma-channels = <32>;
+			#dma-requests = <127>;
+		};
+
 		gpio1: gpio@4a310000 {
 			compatible = "ti,omap4-gpio";
 			reg = <0x4a310000 0x200>;
@@ -260,6 +272,16 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi1";
 			ti,spi-num-cs = <4>;
+			dmas = <&sdma 35>,
+			       <&sdma 36>,
+			       <&sdma 37>,
+			       <&sdma 38>,
+			       <&sdma 39>,
+			       <&sdma 40>,
+			       <&sdma 41>,
+			       <&sdma 42>;
+			dma-names = "tx0", "rx0", "tx1", "rx1",
+				    "tx2", "rx2", "tx3", "rx3";
 		};
 
 		mcspi2: spi@4809a000 {
@@ -270,6 +292,11 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi2";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 43>,
+			       <&sdma 44>,
+			       <&sdma 45>,
+			       <&sdma 46>;
+			dma-names = "tx0", "rx0", "tx1", "rx1";
 		};
 
 		mcspi3: spi@480b8000 {
@@ -280,6 +307,8 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi3";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 15>, <&sdma 16>;
+			dma-names = "tx0", "rx0";
 		};
 
 		mcspi4: spi@480ba000 {
@@ -290,6 +319,8 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi4";
 			ti,spi-num-cs = <1>;
+			dmas = <&sdma 70>, <&sdma 71>;
+			dma-names = "tx0", "rx0";
 		};
 
 		mmc1: mmc@4809c000 {
@@ -299,6 +330,8 @@
 			ti,hwmods = "mmc1";
 			ti,dual-volt;
 			ti,needs-special-reset;
+			dmas = <&sdma 61>, <&sdma 62>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc2: mmc@480b4000 {
@@ -307,6 +340,8 @@
 			interrupts = <0 86 0x4>;
 			ti,hwmods = "mmc2";
 			ti,needs-special-reset;
+			dmas = <&sdma 47>, <&sdma 48>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc3: mmc@480ad000 {
@@ -315,6 +350,8 @@
 			interrupts = <0 94 0x4>;
 			ti,hwmods = "mmc3";
 			ti,needs-special-reset;
+			dmas = <&sdma 77>, <&sdma 78>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc4: mmc@480d1000 {
@@ -323,6 +360,8 @@
 			interrupts = <0 96 0x4>;
 			ti,hwmods = "mmc4";
 			ti,needs-special-reset;
+			dmas = <&sdma 57>, <&sdma 58>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc5: mmc@480d5000 {
@@ -331,6 +370,8 @@
 			interrupts = <0 59 0x4>;
 			ti,hwmods = "mmc5";
 			ti,needs-special-reset;
+			dmas = <&sdma 59>, <&sdma 60>;
+			dma-names = "tx", "rx";
 		};
 
 		wdt2: wdt@4a314000 {
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 9e182a9..06d21d6 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -108,6 +108,18 @@
 			      <0x48212000 0x1000>;
 		};
 
+		sdma: dma-controller@4A056000 {
+			compatible = "ti,omap4430-sdma";
+			reg = <0x4A056000 0x1000>;
+			interrupts = <0 12 0x4>,
+				     <0 13 0x4>,
+				     <0 14 0x4>,
+				     <0 15 0x4>;
+			#dma-cells = <1>;
+			#dma-channels = <32>;
+			#dma-requests = <127>;
+		};
+
 		gpio1: gpio@4ae10000 {
 			compatible = "ti,omap4-gpio";
 			reg = <0x4ae10000 0x200>;
@@ -249,6 +261,16 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi1";
 			ti,spi-num-cs = <4>;
+			dmas = <&sdma 35>,
+			       <&sdma 36>,
+			       <&sdma 37>,
+			       <&sdma 38>,
+			       <&sdma 39>,
+			       <&sdma 40>,
+			       <&sdma 41>,
+			       <&sdma 42>;
+			dma-names = "tx0", "rx0", "tx1", "rx1",
+				    "tx2", "rx2", "tx3", "rx3";
 		};
 
 		mcspi2: spi@4809a000 {
@@ -259,6 +281,11 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi2";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 43>,
+			       <&sdma 44>,
+			       <&sdma 45>,
+			       <&sdma 46>;
+			dma-names = "tx0", "rx0", "tx1", "rx1";
 		};
 
 		mcspi3: spi@480b8000 {
@@ -269,6 +296,8 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi3";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 15>, <&sdma 16>;
+			dma-names = "tx0", "rx0";
 		};
 
 		mcspi4: spi@480ba000 {
@@ -279,6 +308,8 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi4";
 			ti,spi-num-cs = <1>;
+			dmas = <&sdma 70>, <&sdma 71>;
+			dma-names = "tx0", "rx0";
 		};
 
 		uart1: serial@4806a000 {
@@ -336,6 +367,8 @@
 			ti,hwmods = "mmc1";
 			ti,dual-volt;
 			ti,needs-special-reset;
+			dmas = <&sdma 61>, <&sdma 62>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc2: mmc@480b4000 {
@@ -344,6 +377,8 @@
 			interrupts = <0 86 0x4>;
 			ti,hwmods = "mmc2";
 			ti,needs-special-reset;
+			dmas = <&sdma 47>, <&sdma 48>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc3: mmc@480ad000 {
@@ -352,6 +387,8 @@
 			interrupts = <0 94 0x4>;
 			ti,hwmods = "mmc3";
 			ti,needs-special-reset;
+			dmas = <&sdma 77>, <&sdma 78>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc4: mmc@480d1000 {
@@ -360,6 +397,8 @@
 			interrupts = <0 96 0x4>;
 			ti,hwmods = "mmc4";
 			ti,needs-special-reset;
+			dmas = <&sdma 57>, <&sdma 58>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc5: mmc@480d5000 {
@@ -368,6 +407,8 @@
 			interrupts = <0 59 0x4>;
 			ti,hwmods = "mmc5";
 			ti,needs-special-reset;
+			dmas = <&sdma 59>, <&sdma 60>;
+			dma-names = "tx", "rx";
 		};
 
 		keypad: keypad@4ae1c000 {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
@ 2013-02-26 18:27   ` Jon Hunter
  0 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-02-26 18:27 UTC (permalink / raw)
  To: linux-arm-kernel

Add SDMA controller binding for OMAP2+ devices and populate DMA client
information for SPI and MMC periperhal on OMAP3+ devices. Please note
that OMAP24xx devices do not have SPI and MMC bindings available yet and
so DMA client information is not populated.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++
 arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
 arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
 arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
 arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
 5 files changed, 185 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt

diff --git a/Documentation/devicetree/bindings/dma/omap-sdma.txt b/Documentation/devicetree/bindings/dma/omap-sdma.txt
new file mode 100644
index 0000000..22aab28
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/omap-sdma.txt
@@ -0,0 +1,51 @@
+* TI OMAP SDMA controller
+
+Required properties:
+- compatible:		Should be set to one of the following:
+
+			ti,omap2420-sdma (omap2420)
+			ti,omap2430-sdma (omap2430)
+			ti,omap3430-sdma (omap3430)
+			ti,omap3630-sdma (omap3630)
+			ti,omap4430-sdma (omap4430 & omap4460 & omap543x)
+
+- reg: 			Contains DMA registers location and length.
+- interrupts: 		Contains DMA interrupt information.
+- #dma-cells: 		Must be 1.
+- #dma-channels:	Contains total number of programmable DMA channels.
+- #dma-requests:	Contains total number of DMA requests.
+
+Example:
+
+	sdma: dma-controller at 4A056000 {
+		compatible = "ti,omap-sdma";
+		reg = <0x4A056000 0x1000>;
+		interrupts = <0 12 0x4>,
+			     <0 13 0x4>,
+			     <0 14 0x4>,
+			     <0 15 0x4>;
+		#dma-cells = <1>;
+		#dma-channels = <32>;
+		#dma-requests = <127>;
+	};
+
+
+* TI OMAP SDMA clients
+
+Required properties:
+- dmas:			List of one or more DMA specifiers, each consisting of
+			- A phandle pointing to DMA controller node
+			- The DMA request number associated with client device
+- dma-names: 		Contains one identifier string for each dma specifier in
+			the dmas property. The specific strings that can be used
+			are defined in the binding of the DMA client device.
+
+Example:
+
+	mmc1: mmc at 4809c000 {
+		...
+		dmas = <&sdma 61>,	/* TX channel */
+		       <&sdma 62>;	/* RX channel */
+		dma-names = "tx", "rx";
+		...
+	};
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
index 761c4b6..22dffa0 100644
--- a/arch/arm/boot/dts/omap2.dtsi
+++ b/arch/arm/boot/dts/omap2.dtsi
@@ -49,6 +49,18 @@
 			reg = <0x480FE000 0x1000>;
 		};
 
+		sdma: dma-controller at 48056000 {
+			compatible = "ti,omap2430-sdma", "ti,omap2420-sdma";
+			reg = <0x48056000 0x1000>;
+			interrupts = <12>,
+				     <13>,
+				     <14>,
+				     <15>;
+			#dma-cells = <1>;
+			#dma-channels = <32>;
+			#dma-requests = <64>;
+		};
+
 		uart1: serial at 4806a000 {
 			compatible = "ti,omap2-uart";
 			ti,hwmods = "uart1";
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 1acc261..4e7acb6 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -75,6 +75,18 @@
 			reg = <0x48200000 0x1000>;
 		};
 
+		sdma: dma-controller at 48056000 {
+			compatible = "ti,omap3630-sdma", "ti,omap3430-sdma";
+			reg = <0x48056000 0x1000>;
+			interrupts = <12>,
+				     <13>,
+				     <14>,
+				     <15>;
+			#dma-cells = <1>;
+			#dma-channels = <32>;
+			#dma-requests = <96>;
+		};
+
 		omap3_pmx_core: pinmux at 48002030 {
 			compatible = "ti,omap3-padconf", "pinctrl-single";
 			reg = <0x48002030 0x05cc>;
@@ -192,6 +204,16 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi1";
 			ti,spi-num-cs = <4>;
+			dmas = <&sdma 35>,
+			       <&sdma 36>,
+			       <&sdma 37>,
+			       <&sdma 38>,
+			       <&sdma 39>,
+			       <&sdma 40>,
+			       <&sdma 41>,
+			       <&sdma 42>;
+			dma-names = "tx0", "rx0", "tx1", "rx1",
+				    "tx2", "rx2", "tx3", "rx3";
 		};
 
 		mcspi2: spi at 4809a000 {
@@ -200,6 +222,11 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi2";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 43>,
+			       <&sdma 44>,
+			       <&sdma 45>,
+			       <&sdma 46>;
+			dma-names = "tx0", "rx0", "tx1", "rx1";
 		};
 
 		mcspi3: spi at 480b8000 {
@@ -208,6 +235,11 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi3";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 15>,
+			       <&sdma 16>,
+			       <&sdma 23>,
+			       <&sdma 24>;
+			dma-names = "tx0", "rx0", "tx1", "rx1";
 		};
 
 		mcspi4: spi at 480ba000 {
@@ -216,22 +248,30 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi4";
 			ti,spi-num-cs = <1>;
+			dmas = <&sdma 70>, <&sdma 71>;
+			dma-names = "tx0", "rx0";
 		};
 
 		mmc1: mmc at 4809c000 {
 			compatible = "ti,omap3-hsmmc";
 			ti,hwmods = "mmc1";
 			ti,dual-volt;
+			dmas = <&sdma 61>, <&sdma 62>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc2: mmc at 480b4000 {
 			compatible = "ti,omap3-hsmmc";
 			ti,hwmods = "mmc2";
+			dmas = <&sdma 47>, <&sdma 48>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc3: mmc at 480ad000 {
 			compatible = "ti,omap3-hsmmc";
 			ti,hwmods = "mmc3";
+			dmas = <&sdma 77>, <&sdma 78>;
+			dma-names = "tx", "rx";
 		};
 
 		wdt2: wdt at 48314000 {
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 739bb79..827f6f3 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -118,6 +118,18 @@
 			pinctrl-single,function-mask = <0x7fff>;
 		};
 
+		sdma: dma-controller at 4A056000 {
+			compatible = "ti,omap4430-sdma";
+			reg = <0x4A056000 0x1000>;
+			interrupts = <0 12 0x4>,
+				     <0 13 0x4>,
+				     <0 14 0x4>,
+				     <0 15 0x4>;
+			#dma-cells = <1>;
+			#dma-channels = <32>;
+			#dma-requests = <127>;
+		};
+
 		gpio1: gpio at 4a310000 {
 			compatible = "ti,omap4-gpio";
 			reg = <0x4a310000 0x200>;
@@ -260,6 +272,16 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi1";
 			ti,spi-num-cs = <4>;
+			dmas = <&sdma 35>,
+			       <&sdma 36>,
+			       <&sdma 37>,
+			       <&sdma 38>,
+			       <&sdma 39>,
+			       <&sdma 40>,
+			       <&sdma 41>,
+			       <&sdma 42>;
+			dma-names = "tx0", "rx0", "tx1", "rx1",
+				    "tx2", "rx2", "tx3", "rx3";
 		};
 
 		mcspi2: spi at 4809a000 {
@@ -270,6 +292,11 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi2";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 43>,
+			       <&sdma 44>,
+			       <&sdma 45>,
+			       <&sdma 46>;
+			dma-names = "tx0", "rx0", "tx1", "rx1";
 		};
 
 		mcspi3: spi at 480b8000 {
@@ -280,6 +307,8 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi3";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 15>, <&sdma 16>;
+			dma-names = "tx0", "rx0";
 		};
 
 		mcspi4: spi at 480ba000 {
@@ -290,6 +319,8 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi4";
 			ti,spi-num-cs = <1>;
+			dmas = <&sdma 70>, <&sdma 71>;
+			dma-names = "tx0", "rx0";
 		};
 
 		mmc1: mmc at 4809c000 {
@@ -299,6 +330,8 @@
 			ti,hwmods = "mmc1";
 			ti,dual-volt;
 			ti,needs-special-reset;
+			dmas = <&sdma 61>, <&sdma 62>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc2: mmc at 480b4000 {
@@ -307,6 +340,8 @@
 			interrupts = <0 86 0x4>;
 			ti,hwmods = "mmc2";
 			ti,needs-special-reset;
+			dmas = <&sdma 47>, <&sdma 48>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc3: mmc at 480ad000 {
@@ -315,6 +350,8 @@
 			interrupts = <0 94 0x4>;
 			ti,hwmods = "mmc3";
 			ti,needs-special-reset;
+			dmas = <&sdma 77>, <&sdma 78>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc4: mmc at 480d1000 {
@@ -323,6 +360,8 @@
 			interrupts = <0 96 0x4>;
 			ti,hwmods = "mmc4";
 			ti,needs-special-reset;
+			dmas = <&sdma 57>, <&sdma 58>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc5: mmc at 480d5000 {
@@ -331,6 +370,8 @@
 			interrupts = <0 59 0x4>;
 			ti,hwmods = "mmc5";
 			ti,needs-special-reset;
+			dmas = <&sdma 59>, <&sdma 60>;
+			dma-names = "tx", "rx";
 		};
 
 		wdt2: wdt at 4a314000 {
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 9e182a9..06d21d6 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -108,6 +108,18 @@
 			      <0x48212000 0x1000>;
 		};
 
+		sdma: dma-controller at 4A056000 {
+			compatible = "ti,omap4430-sdma";
+			reg = <0x4A056000 0x1000>;
+			interrupts = <0 12 0x4>,
+				     <0 13 0x4>,
+				     <0 14 0x4>,
+				     <0 15 0x4>;
+			#dma-cells = <1>;
+			#dma-channels = <32>;
+			#dma-requests = <127>;
+		};
+
 		gpio1: gpio at 4ae10000 {
 			compatible = "ti,omap4-gpio";
 			reg = <0x4ae10000 0x200>;
@@ -249,6 +261,16 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi1";
 			ti,spi-num-cs = <4>;
+			dmas = <&sdma 35>,
+			       <&sdma 36>,
+			       <&sdma 37>,
+			       <&sdma 38>,
+			       <&sdma 39>,
+			       <&sdma 40>,
+			       <&sdma 41>,
+			       <&sdma 42>;
+			dma-names = "tx0", "rx0", "tx1", "rx1",
+				    "tx2", "rx2", "tx3", "rx3";
 		};
 
 		mcspi2: spi at 4809a000 {
@@ -259,6 +281,11 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi2";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 43>,
+			       <&sdma 44>,
+			       <&sdma 45>,
+			       <&sdma 46>;
+			dma-names = "tx0", "rx0", "tx1", "rx1";
 		};
 
 		mcspi3: spi at 480b8000 {
@@ -269,6 +296,8 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi3";
 			ti,spi-num-cs = <2>;
+			dmas = <&sdma 15>, <&sdma 16>;
+			dma-names = "tx0", "rx0";
 		};
 
 		mcspi4: spi at 480ba000 {
@@ -279,6 +308,8 @@
 			#size-cells = <0>;
 			ti,hwmods = "mcspi4";
 			ti,spi-num-cs = <1>;
+			dmas = <&sdma 70>, <&sdma 71>;
+			dma-names = "tx0", "rx0";
 		};
 
 		uart1: serial at 4806a000 {
@@ -336,6 +367,8 @@
 			ti,hwmods = "mmc1";
 			ti,dual-volt;
 			ti,needs-special-reset;
+			dmas = <&sdma 61>, <&sdma 62>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc2: mmc at 480b4000 {
@@ -344,6 +377,8 @@
 			interrupts = <0 86 0x4>;
 			ti,hwmods = "mmc2";
 			ti,needs-special-reset;
+			dmas = <&sdma 47>, <&sdma 48>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc3: mmc at 480ad000 {
@@ -352,6 +387,8 @@
 			interrupts = <0 94 0x4>;
 			ti,hwmods = "mmc3";
 			ti,needs-special-reset;
+			dmas = <&sdma 77>, <&sdma 78>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc4: mmc at 480d1000 {
@@ -360,6 +397,8 @@
 			interrupts = <0 96 0x4>;
 			ti,hwmods = "mmc4";
 			ti,needs-special-reset;
+			dmas = <&sdma 57>, <&sdma 58>;
+			dma-names = "tx", "rx";
 		};
 
 		mmc5: mmc at 480d5000 {
@@ -368,6 +407,8 @@
 			interrupts = <0 59 0x4>;
 			ti,hwmods = "mmc5";
 			ti,needs-special-reset;
+			dmas = <&sdma 59>, <&sdma 60>;
+			dma-names = "tx", "rx";
 		};
 
 		keypad: keypad at 4ae1c000 {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
  2013-02-26 18:27 ` Jon Hunter
@ 2013-02-26 18:27   ` Jon Hunter
  -1 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-02-26 18:27 UTC (permalink / raw)
  To: Rob Herring, Grant Likely, Tony Lindgren, Benoit Cousson,
	Vinod Koul, Russell King
  Cc: device-tree, linux-omap, linux-arm, Jon Hunter

If the device-tree blob is present during boot, then register the SDMA
controller with the device-tree DMA driver so that we can use device-tree
to look-up DMA client information.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap2/dma.c |    4 ++++
 drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index dab9fc0..49fd0d5 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -28,6 +28,7 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
+#include <linux/of.h>
 #include <linux/omap-dma.h>
 
 #include "soc.h"
@@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
 	if (res)
 		return res;
 
+	if (of_have_populated_dt())
+		return res;
+
 	pdev = platform_device_register_full(&omap_dma_dev_info);
 	if (IS_ERR(pdev))
 		return PTR_ERR(pdev);
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index c4b4fd2..2ea3d7e 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -16,6 +16,8 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/of_dma.h>
+#include <linux/of_device.h>
 
 #include "virt-dma.h"
 
@@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
 	[OMAP_DMA_DATA_TYPE_S32] = 4,
 };
 
+static struct of_dma_filter_info omap_dma_info = {
+	.filter_fn = omap_dma_filter_fn,
+};
+
 static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
 {
 	return container_of(d, struct omap_dmadev, ddev);
@@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
 		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
 			rc);
 		omap_dma_free(od);
-	} else {
-		platform_set_drvdata(pdev, od);
+		return rc;
+	}
+
+	platform_set_drvdata(pdev, od);
+
+	if (pdev->dev.of_node) {
+		omap_dma_info.dma_cap = od->ddev.cap_mask;
+
+		/* Device-tree DMA controller registration */
+		rc = of_dma_controller_register(pdev->dev.of_node,
+				of_dma_simple_xlate, &omap_dma_info);
+		if (rc) {
+			pr_warn("OMAP-DMA: failed to register DMA controller\n");
+			dma_async_device_unregister(&od->ddev);
+			omap_dma_free(od);
+		}
 	}
 
 	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
@@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
 {
 	struct omap_dmadev *od = platform_get_drvdata(pdev);
 
+	if (pdev->dev.of_node)
+		of_dma_controller_free(pdev->dev.of_node);
+
 	dma_async_device_unregister(&od->ddev);
 	omap_dma_free(od);
 
 	return 0;
 }
 
+static const struct of_device_id omap_dma_match[] = {
+	{ .compatible = "ti,omap2420-sdma", },
+	{ .compatible = "ti,omap2430-sdma", },
+	{ .compatible = "ti,omap3430-sdma", },
+	{ .compatible = "ti,omap3630-sdma", },
+	{ .compatible = "ti,omap4430-sdma", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, omap_dma_match);
+
 static struct platform_driver omap_dma_driver = {
 	.probe	= omap_dma_probe,
 	.remove	= omap_dma_remove,
 	.driver = {
 		.name = "omap-dma-engine",
 		.owner = THIS_MODULE,
+		.of_match_table = of_match_ptr(omap_dma_match),
 	},
 };
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
@ 2013-02-26 18:27   ` Jon Hunter
  0 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-02-26 18:27 UTC (permalink / raw)
  To: linux-arm-kernel

If the device-tree blob is present during boot, then register the SDMA
controller with the device-tree DMA driver so that we can use device-tree
to look-up DMA client information.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap2/dma.c |    4 ++++
 drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
index dab9fc0..49fd0d5 100644
--- a/arch/arm/mach-omap2/dma.c
+++ b/arch/arm/mach-omap2/dma.c
@@ -28,6 +28,7 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
+#include <linux/of.h>
 #include <linux/omap-dma.h>
 
 #include "soc.h"
@@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
 	if (res)
 		return res;
 
+	if (of_have_populated_dt())
+		return res;
+
 	pdev = platform_device_register_full(&omap_dma_dev_info);
 	if (IS_ERR(pdev))
 		return PTR_ERR(pdev);
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index c4b4fd2..2ea3d7e 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -16,6 +16,8 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <linux/of_dma.h>
+#include <linux/of_device.h>
 
 #include "virt-dma.h"
 
@@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
 	[OMAP_DMA_DATA_TYPE_S32] = 4,
 };
 
+static struct of_dma_filter_info omap_dma_info = {
+	.filter_fn = omap_dma_filter_fn,
+};
+
 static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
 {
 	return container_of(d, struct omap_dmadev, ddev);
@@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
 		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
 			rc);
 		omap_dma_free(od);
-	} else {
-		platform_set_drvdata(pdev, od);
+		return rc;
+	}
+
+	platform_set_drvdata(pdev, od);
+
+	if (pdev->dev.of_node) {
+		omap_dma_info.dma_cap = od->ddev.cap_mask;
+
+		/* Device-tree DMA controller registration */
+		rc = of_dma_controller_register(pdev->dev.of_node,
+				of_dma_simple_xlate, &omap_dma_info);
+		if (rc) {
+			pr_warn("OMAP-DMA: failed to register DMA controller\n");
+			dma_async_device_unregister(&od->ddev);
+			omap_dma_free(od);
+		}
 	}
 
 	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
@@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
 {
 	struct omap_dmadev *od = platform_get_drvdata(pdev);
 
+	if (pdev->dev.of_node)
+		of_dma_controller_free(pdev->dev.of_node);
+
 	dma_async_device_unregister(&od->ddev);
 	omap_dma_free(od);
 
 	return 0;
 }
 
+static const struct of_device_id omap_dma_match[] = {
+	{ .compatible = "ti,omap2420-sdma", },
+	{ .compatible = "ti,omap2430-sdma", },
+	{ .compatible = "ti,omap3430-sdma", },
+	{ .compatible = "ti,omap3630-sdma", },
+	{ .compatible = "ti,omap4430-sdma", },
+	{},
+};
+MODULE_DEVICE_TABLE(of, omap_dma_match);
+
 static struct platform_driver omap_dma_driver = {
 	.probe	= omap_dma_probe,
 	.remove	= omap_dma_remove,
 	.driver = {
 		.name = "omap-dma-engine",
 		.owner = THIS_MODULE,
+		.of_match_table = of_match_ptr(omap_dma_match),
 	},
 };
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
  2013-02-26 18:27   ` Jon Hunter
@ 2013-03-12 11:00     ` Benoit Cousson
  -1 siblings, 0 replies; 24+ messages in thread
From: Benoit Cousson @ 2013-03-12 11:00 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Rob Herring, Grant Likely, Tony Lindgren, Vinod Koul,
	Russell King, device-tree, linux-omap, linux-arm,
	Sebastien Guiriec

+ Seb G.

Hi Jon,

How to you plan to merge that series?
Seb's just posted a McBSP adaptation to SDMA binding, so I'll have to
take this one before being able to merge any other SDMA driver
adaptation patches.

I'm fine to take that one, if you are OK, to avoid merge conflict in DTS
later.

On 02/26/2013 07:27 PM, Jon Hunter wrote:
> Add SDMA controller binding for OMAP2+ devices and populate DMA client
> information for SPI and MMC periperhal on OMAP3+ devices. Please note

typo-------------------------------^

> that OMAP24xx devices do not have SPI and MMC bindings available yet and
> so DMA client information is not populated.
> 
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> Reviewed-by: Felipe Balbi <balbi@ti.com>
> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++

That's a detail, but the bindings should be introduced along with the
driver DT adaptation since it does represent its "interface".

>  arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
>  arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
>  arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
>  arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
>  5 files changed, 185 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt
> 
> diff --git a/Documentation/devicetree/bindings/dma/omap-sdma.txt b/Documentation/devicetree/bindings/dma/omap-sdma.txt
> new file mode 100644
> index 0000000..22aab28
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dma/omap-sdma.txt
> @@ -0,0 +1,51 @@
> +* TI OMAP SDMA controller
> +
> +Required properties:
> +- compatible:		Should be set to one of the following:
> +
> +			ti,omap2420-sdma (omap2420)
> +			ti,omap2430-sdma (omap2430)
> +			ti,omap3430-sdma (omap3430)
> +			ti,omap3630-sdma (omap3630)
> +			ti,omap4430-sdma (omap4430 & omap4460 & omap543x)
> +
> +- reg: 			Contains DMA registers location and length.
> +- interrupts: 		Contains DMA interrupt information.
> +- #dma-cells: 		Must be 1.
> +- #dma-channels:	Contains total number of programmable DMA channels.
> +- #dma-requests:	Contains total number of DMA requests.
> +
> +Example:
> +
> +	sdma: dma-controller@4A056000 {
> +		compatible = "ti,omap-sdma";
> +		reg = <0x4A056000 0x1000>;


Nit: you do have several hexa values in upper case, here and in some dts
as well.

Regards,
Benoit


> +		interrupts = <0 12 0x4>,
> +			     <0 13 0x4>,
> +			     <0 14 0x4>,
> +			     <0 15 0x4>;
> +		#dma-cells = <1>;
> +		#dma-channels = <32>;
> +		#dma-requests = <127>;
> +	};
> +
> +
> +* TI OMAP SDMA clients
> +
> +Required properties:
> +- dmas:			List of one or more DMA specifiers, each consisting of
> +			- A phandle pointing to DMA controller node
> +			- The DMA request number associated with client device
> +- dma-names: 		Contains one identifier string for each dma specifier in
> +			the dmas property. The specific strings that can be used
> +			are defined in the binding of the DMA client device.
> +
> +Example:
> +
> +	mmc1: mmc@4809c000 {
> +		...
> +		dmas = <&sdma 61>,	/* TX channel */
> +		       <&sdma 62>;	/* RX channel */
> +		dma-names = "tx", "rx";
> +		...
> +	};
> diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
> index 761c4b6..22dffa0 100644
> --- a/arch/arm/boot/dts/omap2.dtsi
> +++ b/arch/arm/boot/dts/omap2.dtsi
> @@ -49,6 +49,18 @@
>  			reg = <0x480FE000 0x1000>;
>  		};
>  
> +		sdma: dma-controller@48056000 {
> +			compatible = "ti,omap2430-sdma", "ti,omap2420-sdma";
> +			reg = <0x48056000 0x1000>;
> +			interrupts = <12>,
> +				     <13>,
> +				     <14>,
> +				     <15>;
> +			#dma-cells = <1>;
> +			#dma-channels = <32>;
> +			#dma-requests = <64>;
> +		};
> +
>  		uart1: serial@4806a000 {
>  			compatible = "ti,omap2-uart";
>  			ti,hwmods = "uart1";
> diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
> index 1acc261..4e7acb6 100644
> --- a/arch/arm/boot/dts/omap3.dtsi
> +++ b/arch/arm/boot/dts/omap3.dtsi
> @@ -75,6 +75,18 @@
>  			reg = <0x48200000 0x1000>;
>  		};
>  
> +		sdma: dma-controller@48056000 {
> +			compatible = "ti,omap3630-sdma", "ti,omap3430-sdma";
> +			reg = <0x48056000 0x1000>;
> +			interrupts = <12>,
> +				     <13>,
> +				     <14>,
> +				     <15>;
> +			#dma-cells = <1>;
> +			#dma-channels = <32>;
> +			#dma-requests = <96>;
> +		};
> +
>  		omap3_pmx_core: pinmux@48002030 {
>  			compatible = "ti,omap3-padconf", "pinctrl-single";
>  			reg = <0x48002030 0x05cc>;
> @@ -192,6 +204,16 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi1";
>  			ti,spi-num-cs = <4>;
> +			dmas = <&sdma 35>,
> +			       <&sdma 36>,
> +			       <&sdma 37>,
> +			       <&sdma 38>,
> +			       <&sdma 39>,
> +			       <&sdma 40>,
> +			       <&sdma 41>,
> +			       <&sdma 42>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1",
> +				    "tx2", "rx2", "tx3", "rx3";
>  		};
>  
>  		mcspi2: spi@4809a000 {
> @@ -200,6 +222,11 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi2";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 43>,
> +			       <&sdma 44>,
> +			       <&sdma 45>,
> +			       <&sdma 46>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1";
>  		};
>  
>  		mcspi3: spi@480b8000 {
> @@ -208,6 +235,11 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi3";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 15>,
> +			       <&sdma 16>,
> +			       <&sdma 23>,
> +			       <&sdma 24>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1";
>  		};
>  
>  		mcspi4: spi@480ba000 {
> @@ -216,22 +248,30 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi4";
>  			ti,spi-num-cs = <1>;
> +			dmas = <&sdma 70>, <&sdma 71>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		mmc1: mmc@4809c000 {
>  			compatible = "ti,omap3-hsmmc";
>  			ti,hwmods = "mmc1";
>  			ti,dual-volt;
> +			dmas = <&sdma 61>, <&sdma 62>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc2: mmc@480b4000 {
>  			compatible = "ti,omap3-hsmmc";
>  			ti,hwmods = "mmc2";
> +			dmas = <&sdma 47>, <&sdma 48>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc3: mmc@480ad000 {
>  			compatible = "ti,omap3-hsmmc";
>  			ti,hwmods = "mmc3";
> +			dmas = <&sdma 77>, <&sdma 78>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		wdt2: wdt@48314000 {
> diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
> index 739bb79..827f6f3 100644
> --- a/arch/arm/boot/dts/omap4.dtsi
> +++ b/arch/arm/boot/dts/omap4.dtsi
> @@ -118,6 +118,18 @@
>  			pinctrl-single,function-mask = <0x7fff>;
>  		};
>  
> +		sdma: dma-controller@4A056000 {
> +			compatible = "ti,omap4430-sdma";
> +			reg = <0x4A056000 0x1000>;
> +			interrupts = <0 12 0x4>,
> +				     <0 13 0x4>,
> +				     <0 14 0x4>,
> +				     <0 15 0x4>;
> +			#dma-cells = <1>;
> +			#dma-channels = <32>;
> +			#dma-requests = <127>;
> +		};
> +
>  		gpio1: gpio@4a310000 {
>  			compatible = "ti,omap4-gpio";
>  			reg = <0x4a310000 0x200>;
> @@ -260,6 +272,16 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi1";
>  			ti,spi-num-cs = <4>;
> +			dmas = <&sdma 35>,
> +			       <&sdma 36>,
> +			       <&sdma 37>,
> +			       <&sdma 38>,
> +			       <&sdma 39>,
> +			       <&sdma 40>,
> +			       <&sdma 41>,
> +			       <&sdma 42>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1",
> +				    "tx2", "rx2", "tx3", "rx3";
>  		};
>  
>  		mcspi2: spi@4809a000 {
> @@ -270,6 +292,11 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi2";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 43>,
> +			       <&sdma 44>,
> +			       <&sdma 45>,
> +			       <&sdma 46>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1";
>  		};
>  
>  		mcspi3: spi@480b8000 {
> @@ -280,6 +307,8 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi3";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 15>, <&sdma 16>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		mcspi4: spi@480ba000 {
> @@ -290,6 +319,8 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi4";
>  			ti,spi-num-cs = <1>;
> +			dmas = <&sdma 70>, <&sdma 71>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		mmc1: mmc@4809c000 {
> @@ -299,6 +330,8 @@
>  			ti,hwmods = "mmc1";
>  			ti,dual-volt;
>  			ti,needs-special-reset;
> +			dmas = <&sdma 61>, <&sdma 62>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc2: mmc@480b4000 {
> @@ -307,6 +340,8 @@
>  			interrupts = <0 86 0x4>;
>  			ti,hwmods = "mmc2";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 47>, <&sdma 48>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc3: mmc@480ad000 {
> @@ -315,6 +350,8 @@
>  			interrupts = <0 94 0x4>;
>  			ti,hwmods = "mmc3";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 77>, <&sdma 78>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc4: mmc@480d1000 {
> @@ -323,6 +360,8 @@
>  			interrupts = <0 96 0x4>;
>  			ti,hwmods = "mmc4";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 57>, <&sdma 58>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc5: mmc@480d5000 {
> @@ -331,6 +370,8 @@
>  			interrupts = <0 59 0x4>;
>  			ti,hwmods = "mmc5";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 59>, <&sdma 60>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		wdt2: wdt@4a314000 {
> diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
> index 9e182a9..06d21d6 100644
> --- a/arch/arm/boot/dts/omap5.dtsi
> +++ b/arch/arm/boot/dts/omap5.dtsi
> @@ -108,6 +108,18 @@
>  			      <0x48212000 0x1000>;
>  		};
>  
> +		sdma: dma-controller@4A056000 {
> +			compatible = "ti,omap4430-sdma";
> +			reg = <0x4A056000 0x1000>;
> +			interrupts = <0 12 0x4>,
> +				     <0 13 0x4>,
> +				     <0 14 0x4>,
> +				     <0 15 0x4>;
> +			#dma-cells = <1>;
> +			#dma-channels = <32>;
> +			#dma-requests = <127>;
> +		};
> +
>  		gpio1: gpio@4ae10000 {
>  			compatible = "ti,omap4-gpio";
>  			reg = <0x4ae10000 0x200>;
> @@ -249,6 +261,16 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi1";
>  			ti,spi-num-cs = <4>;
> +			dmas = <&sdma 35>,
> +			       <&sdma 36>,
> +			       <&sdma 37>,
> +			       <&sdma 38>,
> +			       <&sdma 39>,
> +			       <&sdma 40>,
> +			       <&sdma 41>,
> +			       <&sdma 42>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1",
> +				    "tx2", "rx2", "tx3", "rx3";
>  		};
>  
>  		mcspi2: spi@4809a000 {
> @@ -259,6 +281,11 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi2";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 43>,
> +			       <&sdma 44>,
> +			       <&sdma 45>,
> +			       <&sdma 46>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1";
>  		};
>  
>  		mcspi3: spi@480b8000 {
> @@ -269,6 +296,8 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi3";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 15>, <&sdma 16>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		mcspi4: spi@480ba000 {
> @@ -279,6 +308,8 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi4";
>  			ti,spi-num-cs = <1>;
> +			dmas = <&sdma 70>, <&sdma 71>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		uart1: serial@4806a000 {
> @@ -336,6 +367,8 @@
>  			ti,hwmods = "mmc1";
>  			ti,dual-volt;
>  			ti,needs-special-reset;
> +			dmas = <&sdma 61>, <&sdma 62>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc2: mmc@480b4000 {
> @@ -344,6 +377,8 @@
>  			interrupts = <0 86 0x4>;
>  			ti,hwmods = "mmc2";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 47>, <&sdma 48>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc3: mmc@480ad000 {
> @@ -352,6 +387,8 @@
>  			interrupts = <0 94 0x4>;
>  			ti,hwmods = "mmc3";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 77>, <&sdma 78>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc4: mmc@480d1000 {
> @@ -360,6 +397,8 @@
>  			interrupts = <0 96 0x4>;
>  			ti,hwmods = "mmc4";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 57>, <&sdma 58>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc5: mmc@480d5000 {
> @@ -368,6 +407,8 @@
>  			interrupts = <0 59 0x4>;
>  			ti,hwmods = "mmc5";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 59>, <&sdma 60>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		keypad: keypad@4ae1c000 {
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
@ 2013-03-12 11:00     ` Benoit Cousson
  0 siblings, 0 replies; 24+ messages in thread
From: Benoit Cousson @ 2013-03-12 11:00 UTC (permalink / raw)
  To: linux-arm-kernel

+ Seb G.

Hi Jon,

How to you plan to merge that series?
Seb's just posted a McBSP adaptation to SDMA binding, so I'll have to
take this one before being able to merge any other SDMA driver
adaptation patches.

I'm fine to take that one, if you are OK, to avoid merge conflict in DTS
later.

On 02/26/2013 07:27 PM, Jon Hunter wrote:
> Add SDMA controller binding for OMAP2+ devices and populate DMA client
> information for SPI and MMC periperhal on OMAP3+ devices. Please note

typo-------------------------------^

> that OMAP24xx devices do not have SPI and MMC bindings available yet and
> so DMA client information is not populated.
> 
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> Reviewed-by: Felipe Balbi <balbi@ti.com>
> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++

That's a detail, but the bindings should be introduced along with the
driver DT adaptation since it does represent its "interface".

>  arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
>  arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
>  arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
>  arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
>  5 files changed, 185 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt
> 
> diff --git a/Documentation/devicetree/bindings/dma/omap-sdma.txt b/Documentation/devicetree/bindings/dma/omap-sdma.txt
> new file mode 100644
> index 0000000..22aab28
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/dma/omap-sdma.txt
> @@ -0,0 +1,51 @@
> +* TI OMAP SDMA controller
> +
> +Required properties:
> +- compatible:		Should be set to one of the following:
> +
> +			ti,omap2420-sdma (omap2420)
> +			ti,omap2430-sdma (omap2430)
> +			ti,omap3430-sdma (omap3430)
> +			ti,omap3630-sdma (omap3630)
> +			ti,omap4430-sdma (omap4430 & omap4460 & omap543x)
> +
> +- reg: 			Contains DMA registers location and length.
> +- interrupts: 		Contains DMA interrupt information.
> +- #dma-cells: 		Must be 1.
> +- #dma-channels:	Contains total number of programmable DMA channels.
> +- #dma-requests:	Contains total number of DMA requests.
> +
> +Example:
> +
> +	sdma: dma-controller at 4A056000 {
> +		compatible = "ti,omap-sdma";
> +		reg = <0x4A056000 0x1000>;


Nit: you do have several hexa values in upper case, here and in some dts
as well.

Regards,
Benoit


> +		interrupts = <0 12 0x4>,
> +			     <0 13 0x4>,
> +			     <0 14 0x4>,
> +			     <0 15 0x4>;
> +		#dma-cells = <1>;
> +		#dma-channels = <32>;
> +		#dma-requests = <127>;
> +	};
> +
> +
> +* TI OMAP SDMA clients
> +
> +Required properties:
> +- dmas:			List of one or more DMA specifiers, each consisting of
> +			- A phandle pointing to DMA controller node
> +			- The DMA request number associated with client device
> +- dma-names: 		Contains one identifier string for each dma specifier in
> +			the dmas property. The specific strings that can be used
> +			are defined in the binding of the DMA client device.
> +
> +Example:
> +
> +	mmc1: mmc at 4809c000 {
> +		...
> +		dmas = <&sdma 61>,	/* TX channel */
> +		       <&sdma 62>;	/* RX channel */
> +		dma-names = "tx", "rx";
> +		...
> +	};
> diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi
> index 761c4b6..22dffa0 100644
> --- a/arch/arm/boot/dts/omap2.dtsi
> +++ b/arch/arm/boot/dts/omap2.dtsi
> @@ -49,6 +49,18 @@
>  			reg = <0x480FE000 0x1000>;
>  		};
>  
> +		sdma: dma-controller at 48056000 {
> +			compatible = "ti,omap2430-sdma", "ti,omap2420-sdma";
> +			reg = <0x48056000 0x1000>;
> +			interrupts = <12>,
> +				     <13>,
> +				     <14>,
> +				     <15>;
> +			#dma-cells = <1>;
> +			#dma-channels = <32>;
> +			#dma-requests = <64>;
> +		};
> +
>  		uart1: serial at 4806a000 {
>  			compatible = "ti,omap2-uart";
>  			ti,hwmods = "uart1";
> diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
> index 1acc261..4e7acb6 100644
> --- a/arch/arm/boot/dts/omap3.dtsi
> +++ b/arch/arm/boot/dts/omap3.dtsi
> @@ -75,6 +75,18 @@
>  			reg = <0x48200000 0x1000>;
>  		};
>  
> +		sdma: dma-controller at 48056000 {
> +			compatible = "ti,omap3630-sdma", "ti,omap3430-sdma";
> +			reg = <0x48056000 0x1000>;
> +			interrupts = <12>,
> +				     <13>,
> +				     <14>,
> +				     <15>;
> +			#dma-cells = <1>;
> +			#dma-channels = <32>;
> +			#dma-requests = <96>;
> +		};
> +
>  		omap3_pmx_core: pinmux at 48002030 {
>  			compatible = "ti,omap3-padconf", "pinctrl-single";
>  			reg = <0x48002030 0x05cc>;
> @@ -192,6 +204,16 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi1";
>  			ti,spi-num-cs = <4>;
> +			dmas = <&sdma 35>,
> +			       <&sdma 36>,
> +			       <&sdma 37>,
> +			       <&sdma 38>,
> +			       <&sdma 39>,
> +			       <&sdma 40>,
> +			       <&sdma 41>,
> +			       <&sdma 42>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1",
> +				    "tx2", "rx2", "tx3", "rx3";
>  		};
>  
>  		mcspi2: spi at 4809a000 {
> @@ -200,6 +222,11 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi2";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 43>,
> +			       <&sdma 44>,
> +			       <&sdma 45>,
> +			       <&sdma 46>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1";
>  		};
>  
>  		mcspi3: spi at 480b8000 {
> @@ -208,6 +235,11 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi3";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 15>,
> +			       <&sdma 16>,
> +			       <&sdma 23>,
> +			       <&sdma 24>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1";
>  		};
>  
>  		mcspi4: spi at 480ba000 {
> @@ -216,22 +248,30 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi4";
>  			ti,spi-num-cs = <1>;
> +			dmas = <&sdma 70>, <&sdma 71>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		mmc1: mmc at 4809c000 {
>  			compatible = "ti,omap3-hsmmc";
>  			ti,hwmods = "mmc1";
>  			ti,dual-volt;
> +			dmas = <&sdma 61>, <&sdma 62>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc2: mmc at 480b4000 {
>  			compatible = "ti,omap3-hsmmc";
>  			ti,hwmods = "mmc2";
> +			dmas = <&sdma 47>, <&sdma 48>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc3: mmc at 480ad000 {
>  			compatible = "ti,omap3-hsmmc";
>  			ti,hwmods = "mmc3";
> +			dmas = <&sdma 77>, <&sdma 78>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		wdt2: wdt at 48314000 {
> diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
> index 739bb79..827f6f3 100644
> --- a/arch/arm/boot/dts/omap4.dtsi
> +++ b/arch/arm/boot/dts/omap4.dtsi
> @@ -118,6 +118,18 @@
>  			pinctrl-single,function-mask = <0x7fff>;
>  		};
>  
> +		sdma: dma-controller at 4A056000 {
> +			compatible = "ti,omap4430-sdma";
> +			reg = <0x4A056000 0x1000>;
> +			interrupts = <0 12 0x4>,
> +				     <0 13 0x4>,
> +				     <0 14 0x4>,
> +				     <0 15 0x4>;
> +			#dma-cells = <1>;
> +			#dma-channels = <32>;
> +			#dma-requests = <127>;
> +		};
> +
>  		gpio1: gpio at 4a310000 {
>  			compatible = "ti,omap4-gpio";
>  			reg = <0x4a310000 0x200>;
> @@ -260,6 +272,16 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi1";
>  			ti,spi-num-cs = <4>;
> +			dmas = <&sdma 35>,
> +			       <&sdma 36>,
> +			       <&sdma 37>,
> +			       <&sdma 38>,
> +			       <&sdma 39>,
> +			       <&sdma 40>,
> +			       <&sdma 41>,
> +			       <&sdma 42>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1",
> +				    "tx2", "rx2", "tx3", "rx3";
>  		};
>  
>  		mcspi2: spi at 4809a000 {
> @@ -270,6 +292,11 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi2";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 43>,
> +			       <&sdma 44>,
> +			       <&sdma 45>,
> +			       <&sdma 46>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1";
>  		};
>  
>  		mcspi3: spi at 480b8000 {
> @@ -280,6 +307,8 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi3";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 15>, <&sdma 16>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		mcspi4: spi at 480ba000 {
> @@ -290,6 +319,8 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi4";
>  			ti,spi-num-cs = <1>;
> +			dmas = <&sdma 70>, <&sdma 71>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		mmc1: mmc at 4809c000 {
> @@ -299,6 +330,8 @@
>  			ti,hwmods = "mmc1";
>  			ti,dual-volt;
>  			ti,needs-special-reset;
> +			dmas = <&sdma 61>, <&sdma 62>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc2: mmc at 480b4000 {
> @@ -307,6 +340,8 @@
>  			interrupts = <0 86 0x4>;
>  			ti,hwmods = "mmc2";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 47>, <&sdma 48>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc3: mmc at 480ad000 {
> @@ -315,6 +350,8 @@
>  			interrupts = <0 94 0x4>;
>  			ti,hwmods = "mmc3";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 77>, <&sdma 78>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc4: mmc at 480d1000 {
> @@ -323,6 +360,8 @@
>  			interrupts = <0 96 0x4>;
>  			ti,hwmods = "mmc4";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 57>, <&sdma 58>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc5: mmc at 480d5000 {
> @@ -331,6 +370,8 @@
>  			interrupts = <0 59 0x4>;
>  			ti,hwmods = "mmc5";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 59>, <&sdma 60>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		wdt2: wdt at 4a314000 {
> diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
> index 9e182a9..06d21d6 100644
> --- a/arch/arm/boot/dts/omap5.dtsi
> +++ b/arch/arm/boot/dts/omap5.dtsi
> @@ -108,6 +108,18 @@
>  			      <0x48212000 0x1000>;
>  		};
>  
> +		sdma: dma-controller at 4A056000 {
> +			compatible = "ti,omap4430-sdma";
> +			reg = <0x4A056000 0x1000>;
> +			interrupts = <0 12 0x4>,
> +				     <0 13 0x4>,
> +				     <0 14 0x4>,
> +				     <0 15 0x4>;
> +			#dma-cells = <1>;
> +			#dma-channels = <32>;
> +			#dma-requests = <127>;
> +		};
> +
>  		gpio1: gpio at 4ae10000 {
>  			compatible = "ti,omap4-gpio";
>  			reg = <0x4ae10000 0x200>;
> @@ -249,6 +261,16 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi1";
>  			ti,spi-num-cs = <4>;
> +			dmas = <&sdma 35>,
> +			       <&sdma 36>,
> +			       <&sdma 37>,
> +			       <&sdma 38>,
> +			       <&sdma 39>,
> +			       <&sdma 40>,
> +			       <&sdma 41>,
> +			       <&sdma 42>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1",
> +				    "tx2", "rx2", "tx3", "rx3";
>  		};
>  
>  		mcspi2: spi at 4809a000 {
> @@ -259,6 +281,11 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi2";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 43>,
> +			       <&sdma 44>,
> +			       <&sdma 45>,
> +			       <&sdma 46>;
> +			dma-names = "tx0", "rx0", "tx1", "rx1";
>  		};
>  
>  		mcspi3: spi at 480b8000 {
> @@ -269,6 +296,8 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi3";
>  			ti,spi-num-cs = <2>;
> +			dmas = <&sdma 15>, <&sdma 16>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		mcspi4: spi at 480ba000 {
> @@ -279,6 +308,8 @@
>  			#size-cells = <0>;
>  			ti,hwmods = "mcspi4";
>  			ti,spi-num-cs = <1>;
> +			dmas = <&sdma 70>, <&sdma 71>;
> +			dma-names = "tx0", "rx0";
>  		};
>  
>  		uart1: serial at 4806a000 {
> @@ -336,6 +367,8 @@
>  			ti,hwmods = "mmc1";
>  			ti,dual-volt;
>  			ti,needs-special-reset;
> +			dmas = <&sdma 61>, <&sdma 62>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc2: mmc at 480b4000 {
> @@ -344,6 +377,8 @@
>  			interrupts = <0 86 0x4>;
>  			ti,hwmods = "mmc2";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 47>, <&sdma 48>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc3: mmc at 480ad000 {
> @@ -352,6 +387,8 @@
>  			interrupts = <0 94 0x4>;
>  			ti,hwmods = "mmc3";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 77>, <&sdma 78>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc4: mmc at 480d1000 {
> @@ -360,6 +397,8 @@
>  			interrupts = <0 96 0x4>;
>  			ti,hwmods = "mmc4";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 57>, <&sdma 58>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		mmc5: mmc at 480d5000 {
> @@ -368,6 +407,8 @@
>  			interrupts = <0 59 0x4>;
>  			ti,hwmods = "mmc5";
>  			ti,needs-special-reset;
> +			dmas = <&sdma 59>, <&sdma 60>;
> +			dma-names = "tx", "rx";
>  		};
>  
>  		keypad: keypad at 4ae1c000 {
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
  2013-03-12 11:00     ` Benoit Cousson
@ 2013-03-12 21:43       ` Jon Hunter
  -1 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-03-12 21:43 UTC (permalink / raw)
  To: Benoit Cousson
  Cc: Rob Herring, Grant Likely, Tony Lindgren, Vinod Koul,
	Russell King, device-tree, linux-omap, linux-arm,
	Sebastien Guiriec

Salut Benoit!

On 03/12/2013 06:00 AM, Benoit Cousson wrote:
> + Seb G.
> 
> Hi Jon,
> 
> How to you plan to merge that series?

Good question ... my thinking was that you or Tony would take 1/2 and
once that is queued then I would ask Tony to ack 2/2 and Vinod take that
patch.

By the way, I have accumulated several DT patches which I sent out
altogether [1] (at least for my own sanity if no one elses ;-) and I
have included the below patch with it. I was hoping that may be I could
create a branch for you to pull. If you would rather cherry-pick the
various patches and merge yourself then I can separate them too.

> Seb's just posted a McBSP adaptation to SDMA binding, so I'll have to
> take this one before being able to merge any other SDMA driver
> adaptation patches.
> 
> I'm fine to take that one, if you are OK, to avoid merge conflict in DTS
> later.

Fine with me and that would be preferred. I don't see any downside in
taking this one and then having Vinod take the other later.

> On 02/26/2013 07:27 PM, Jon Hunter wrote:
>> Add SDMA controller binding for OMAP2+ devices and populate DMA client
>> information for SPI and MMC periperhal on OMAP3+ devices. Please note
> 
> typo-------------------------------^

Thanks! Will fix.

>> that OMAP24xx devices do not have SPI and MMC bindings available yet and
>> so DMA client information is not populated.
>>
>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>> Reviewed-by: Felipe Balbi <balbi@ti.com>
>> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>> ---
>>  .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++
> 
> That's a detail, but the bindings should be introduced along with the
> driver DT adaptation since it does represent its "interface".

Ok, I can add that to patch 2/2 instead.

>>  arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
>>  arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
>>  arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
>>  arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
>>  5 files changed, 185 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt
>>
>> diff --git a/Documentation/devicetree/bindings/dma/omap-sdma.txt b/Documentation/devicetree/bindings/dma/omap-sdma.txt
>> new file mode 100644
>> index 0000000..22aab28
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/dma/omap-sdma.txt
>> @@ -0,0 +1,51 @@
>> +* TI OMAP SDMA controller
>> +
>> +Required properties:
>> +- compatible:		Should be set to one of the following:
>> +
>> +			ti,omap2420-sdma (omap2420)
>> +			ti,omap2430-sdma (omap2430)
>> +			ti,omap3430-sdma (omap3430)
>> +			ti,omap3630-sdma (omap3630)
>> +			ti,omap4430-sdma (omap4430 & omap4460 & omap543x)
>> +
>> +- reg: 			Contains DMA registers location and length.
>> +- interrupts: 		Contains DMA interrupt information.
>> +- #dma-cells: 		Must be 1.
>> +- #dma-channels:	Contains total number of programmable DMA channels.
>> +- #dma-requests:	Contains total number of DMA requests.
>> +
>> +Example:
>> +
>> +	sdma: dma-controller@4A056000 {
>> +		compatible = "ti,omap-sdma";
>> +		reg = <0x4A056000 0x1000>;
> 
> 
> Nit: you do have several hexa values in upper case, here and in some dts
> as well.

Yes will fix that too.

Cheers
Jon

[1]
http://www.mail-archive.com/devicetree-discuss@lists.ozlabs.org/msg28050.html


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
@ 2013-03-12 21:43       ` Jon Hunter
  0 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-03-12 21:43 UTC (permalink / raw)
  To: linux-arm-kernel

Salut Benoit!

On 03/12/2013 06:00 AM, Benoit Cousson wrote:
> + Seb G.
> 
> Hi Jon,
> 
> How to you plan to merge that series?

Good question ... my thinking was that you or Tony would take 1/2 and
once that is queued then I would ask Tony to ack 2/2 and Vinod take that
patch.

By the way, I have accumulated several DT patches which I sent out
altogether [1] (at least for my own sanity if no one elses ;-) and I
have included the below patch with it. I was hoping that may be I could
create a branch for you to pull. If you would rather cherry-pick the
various patches and merge yourself then I can separate them too.

> Seb's just posted a McBSP adaptation to SDMA binding, so I'll have to
> take this one before being able to merge any other SDMA driver
> adaptation patches.
> 
> I'm fine to take that one, if you are OK, to avoid merge conflict in DTS
> later.

Fine with me and that would be preferred. I don't see any downside in
taking this one and then having Vinod take the other later.

> On 02/26/2013 07:27 PM, Jon Hunter wrote:
>> Add SDMA controller binding for OMAP2+ devices and populate DMA client
>> information for SPI and MMC periperhal on OMAP3+ devices. Please note
> 
> typo-------------------------------^

Thanks! Will fix.

>> that OMAP24xx devices do not have SPI and MMC bindings available yet and
>> so DMA client information is not populated.
>>
>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>> Reviewed-by: Felipe Balbi <balbi@ti.com>
>> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>> ---
>>  .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++
> 
> That's a detail, but the bindings should be introduced along with the
> driver DT adaptation since it does represent its "interface".

Ok, I can add that to patch 2/2 instead.

>>  arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
>>  arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
>>  arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
>>  arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
>>  5 files changed, 185 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt
>>
>> diff --git a/Documentation/devicetree/bindings/dma/omap-sdma.txt b/Documentation/devicetree/bindings/dma/omap-sdma.txt
>> new file mode 100644
>> index 0000000..22aab28
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/dma/omap-sdma.txt
>> @@ -0,0 +1,51 @@
>> +* TI OMAP SDMA controller
>> +
>> +Required properties:
>> +- compatible:		Should be set to one of the following:
>> +
>> +			ti,omap2420-sdma (omap2420)
>> +			ti,omap2430-sdma (omap2430)
>> +			ti,omap3430-sdma (omap3430)
>> +			ti,omap3630-sdma (omap3630)
>> +			ti,omap4430-sdma (omap4430 & omap4460 & omap543x)
>> +
>> +- reg: 			Contains DMA registers location and length.
>> +- interrupts: 		Contains DMA interrupt information.
>> +- #dma-cells: 		Must be 1.
>> +- #dma-channels:	Contains total number of programmable DMA channels.
>> +- #dma-requests:	Contains total number of DMA requests.
>> +
>> +Example:
>> +
>> +	sdma: dma-controller at 4A056000 {
>> +		compatible = "ti,omap-sdma";
>> +		reg = <0x4A056000 0x1000>;
> 
> 
> Nit: you do have several hexa values in upper case, here and in some dts
> as well.

Yes will fix that too.

Cheers
Jon

[1]
http://www.mail-archive.com/devicetree-discuss at lists.ozlabs.org/msg28050.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
  2013-03-12 21:43       ` Jon Hunter
@ 2013-03-13 15:35         ` Benoit Cousson
  -1 siblings, 0 replies; 24+ messages in thread
From: Benoit Cousson @ 2013-03-13 15:35 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Rob Herring, Grant Likely, Tony Lindgren, Vinod Koul,
	Russell King, device-tree, linux-omap, linux-arm,
	Sebastien Guiriec

Salut Jon,

On 03/12/2013 10:43 PM, Jon Hunter wrote:
> Salut Benoit!
> 
> On 03/12/2013 06:00 AM, Benoit Cousson wrote:
>> + Seb G.
>>
>> Hi Jon,
>>
>> How to you plan to merge that series?
> 
> Good question ... my thinking was that you or Tony would take 1/2 and
> once that is queued then I would ask Tony to ack 2/2 and Vinod take that
> patch.

Yep, this is what I was thinking too.

> By the way, I have accumulated several DT patches which I sent out
> altogether [1] (at least for my own sanity if no one elses ;-) and I
> have included the below patch with it. I was hoping that may be I could
> create a branch for you to pull. If you would rather cherry-pick the
> various patches and merge yourself then I can separate them too.

Merging your branch is indeed even better for me. So go ahead.

Thanks,
Benoit

> 
>> Seb's just posted a McBSP adaptation to SDMA binding, so I'll have to
>> take this one before being able to merge any other SDMA driver
>> adaptation patches.
>>
>> I'm fine to take that one, if you are OK, to avoid merge conflict in DTS
>> later.
> 
> Fine with me and that would be preferred. I don't see any downside in
> taking this one and then having Vinod take the other later.


> 
>> On 02/26/2013 07:27 PM, Jon Hunter wrote:
>>> Add SDMA controller binding for OMAP2+ devices and populate DMA client
>>> information for SPI and MMC periperhal on OMAP3+ devices. Please note
>>
>> typo-------------------------------^
> 
> Thanks! Will fix.
> 
>>> that OMAP24xx devices do not have SPI and MMC bindings available yet and
>>> so DMA client information is not populated.
>>>
>>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>>> Reviewed-by: Felipe Balbi <balbi@ti.com>
>>> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> ---
>>>  .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++
>>
>> That's a detail, but the bindings should be introduced along with the
>> driver DT adaptation since it does represent its "interface".
> 
> Ok, I can add that to patch 2/2 instead.
> 
>>>  arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
>>>  arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
>>>  arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
>>>  arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
>>>  5 files changed, 185 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/dma/omap-sdma.txt b/Documentation/devicetree/bindings/dma/omap-sdma.txt
>>> new file mode 100644
>>> index 0000000..22aab28
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/dma/omap-sdma.txt
>>> @@ -0,0 +1,51 @@
>>> +* TI OMAP SDMA controller
>>> +
>>> +Required properties:
>>> +- compatible:		Should be set to one of the following:
>>> +
>>> +			ti,omap2420-sdma (omap2420)
>>> +			ti,omap2430-sdma (omap2430)
>>> +			ti,omap3430-sdma (omap3430)
>>> +			ti,omap3630-sdma (omap3630)
>>> +			ti,omap4430-sdma (omap4430 & omap4460 & omap543x)
>>> +
>>> +- reg: 			Contains DMA registers location and length.
>>> +- interrupts: 		Contains DMA interrupt information.
>>> +- #dma-cells: 		Must be 1.
>>> +- #dma-channels:	Contains total number of programmable DMA channels.
>>> +- #dma-requests:	Contains total number of DMA requests.
>>> +
>>> +Example:
>>> +
>>> +	sdma: dma-controller@4A056000 {
>>> +		compatible = "ti,omap-sdma";
>>> +		reg = <0x4A056000 0x1000>;
>>
>>
>> Nit: you do have several hexa values in upper case, here and in some dts
>> as well.
> 
> Yes will fix that too.
> 
> Cheers
> Jon
> 
> [1]
> http://www.mail-archive.com/devicetree-discuss@lists.ozlabs.org/msg28050.html
> 


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
@ 2013-03-13 15:35         ` Benoit Cousson
  0 siblings, 0 replies; 24+ messages in thread
From: Benoit Cousson @ 2013-03-13 15:35 UTC (permalink / raw)
  To: linux-arm-kernel

Salut Jon,

On 03/12/2013 10:43 PM, Jon Hunter wrote:
> Salut Benoit!
> 
> On 03/12/2013 06:00 AM, Benoit Cousson wrote:
>> + Seb G.
>>
>> Hi Jon,
>>
>> How to you plan to merge that series?
> 
> Good question ... my thinking was that you or Tony would take 1/2 and
> once that is queued then I would ask Tony to ack 2/2 and Vinod take that
> patch.

Yep, this is what I was thinking too.

> By the way, I have accumulated several DT patches which I sent out
> altogether [1] (at least for my own sanity if no one elses ;-) and I
> have included the below patch with it. I was hoping that may be I could
> create a branch for you to pull. If you would rather cherry-pick the
> various patches and merge yourself then I can separate them too.

Merging your branch is indeed even better for me. So go ahead.

Thanks,
Benoit

> 
>> Seb's just posted a McBSP adaptation to SDMA binding, so I'll have to
>> take this one before being able to merge any other SDMA driver
>> adaptation patches.
>>
>> I'm fine to take that one, if you are OK, to avoid merge conflict in DTS
>> later.
> 
> Fine with me and that would be preferred. I don't see any downside in
> taking this one and then having Vinod take the other later.


> 
>> On 02/26/2013 07:27 PM, Jon Hunter wrote:
>>> Add SDMA controller binding for OMAP2+ devices and populate DMA client
>>> information for SPI and MMC periperhal on OMAP3+ devices. Please note
>>
>> typo-------------------------------^
> 
> Thanks! Will fix.
> 
>>> that OMAP24xx devices do not have SPI and MMC bindings available yet and
>>> so DMA client information is not populated.
>>>
>>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>>> Reviewed-by: Felipe Balbi <balbi@ti.com>
>>> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> ---
>>>  .../devicetree/bindings/dma/omap-sdma.txt          |   51 ++++++++++++++++++++
>>
>> That's a detail, but the bindings should be introduced along with the
>> driver DT adaptation since it does represent its "interface".
> 
> Ok, I can add that to patch 2/2 instead.
> 
>>>  arch/arm/boot/dts/omap2.dtsi                       |   12 +++++
>>>  arch/arm/boot/dts/omap3.dtsi                       |   40 +++++++++++++++
>>>  arch/arm/boot/dts/omap4.dtsi                       |   41 ++++++++++++++++
>>>  arch/arm/boot/dts/omap5.dtsi                       |   41 ++++++++++++++++
>>>  5 files changed, 185 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/dma/omap-sdma.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/dma/omap-sdma.txt b/Documentation/devicetree/bindings/dma/omap-sdma.txt
>>> new file mode 100644
>>> index 0000000..22aab28
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/dma/omap-sdma.txt
>>> @@ -0,0 +1,51 @@
>>> +* TI OMAP SDMA controller
>>> +
>>> +Required properties:
>>> +- compatible:		Should be set to one of the following:
>>> +
>>> +			ti,omap2420-sdma (omap2420)
>>> +			ti,omap2430-sdma (omap2430)
>>> +			ti,omap3430-sdma (omap3430)
>>> +			ti,omap3630-sdma (omap3630)
>>> +			ti,omap4430-sdma (omap4430 & omap4460 & omap543x)
>>> +
>>> +- reg: 			Contains DMA registers location and length.
>>> +- interrupts: 		Contains DMA interrupt information.
>>> +- #dma-cells: 		Must be 1.
>>> +- #dma-channels:	Contains total number of programmable DMA channels.
>>> +- #dma-requests:	Contains total number of DMA requests.
>>> +
>>> +Example:
>>> +
>>> +	sdma: dma-controller at 4A056000 {
>>> +		compatible = "ti,omap-sdma";
>>> +		reg = <0x4A056000 0x1000>;
>>
>>
>> Nit: you do have several hexa values in upper case, here and in some dts
>> as well.
> 
> Yes will fix that too.
> 
> Cheers
> Jon
> 
> [1]
> http://www.mail-archive.com/devicetree-discuss at lists.ozlabs.org/msg28050.html
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
  2013-03-13 15:35         ` Benoit Cousson
@ 2013-03-13 15:50           ` Jon Hunter
  -1 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-03-13 15:50 UTC (permalink / raw)
  To: Benoit Cousson
  Cc: Rob Herring, Grant Likely, Tony Lindgren, Vinod Koul,
	Russell King, device-tree, linux-omap, linux-arm,
	Sebastien Guiriec


On 03/13/2013 10:35 AM, Benoit Cousson wrote:
> Salut Jon,
> 
> On 03/12/2013 10:43 PM, Jon Hunter wrote:
>> Salut Benoit!
>>
>> On 03/12/2013 06:00 AM, Benoit Cousson wrote:
>>> + Seb G.
>>>
>>> Hi Jon,
>>>
>>> How to you plan to merge that series?
>>
>> Good question ... my thinking was that you or Tony would take 1/2 and
>> once that is queued then I would ask Tony to ack 2/2 and Vinod take that
>> patch.
> 
> Yep, this is what I was thinking too.
> 
>> By the way, I have accumulated several DT patches which I sent out
>> altogether [1] (at least for my own sanity if no one elses ;-) and I
>> have included the below patch with it. I was hoping that may be I could
>> create a branch for you to pull. If you would rather cherry-pick the
>> various patches and merge yourself then I can separate them too.
> 
> Merging your branch is indeed even better for me. So go ahead.

Ok. Care to take a quick review to see if there is anything else you
feel needs fixing before I re-submit fixing the commments posted so far?

Do you have an updated branch for v3.10 that I should base on?

Cheers
Jon

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
@ 2013-03-13 15:50           ` Jon Hunter
  0 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-03-13 15:50 UTC (permalink / raw)
  To: linux-arm-kernel


On 03/13/2013 10:35 AM, Benoit Cousson wrote:
> Salut Jon,
> 
> On 03/12/2013 10:43 PM, Jon Hunter wrote:
>> Salut Benoit!
>>
>> On 03/12/2013 06:00 AM, Benoit Cousson wrote:
>>> + Seb G.
>>>
>>> Hi Jon,
>>>
>>> How to you plan to merge that series?
>>
>> Good question ... my thinking was that you or Tony would take 1/2 and
>> once that is queued then I would ask Tony to ack 2/2 and Vinod take that
>> patch.
> 
> Yep, this is what I was thinking too.
> 
>> By the way, I have accumulated several DT patches which I sent out
>> altogether [1] (at least for my own sanity if no one elses ;-) and I
>> have included the below patch with it. I was hoping that may be I could
>> create a branch for you to pull. If you would rather cherry-pick the
>> various patches and merge yourself then I can separate them too.
> 
> Merging your branch is indeed even better for me. So go ahead.

Ok. Care to take a quick review to see if there is anything else you
feel needs fixing before I re-submit fixing the commments posted so far?

Do you have an updated branch for v3.10 that I should base on?

Cheers
Jon

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
  2013-03-13 15:50           ` Jon Hunter
@ 2013-03-13 16:11             ` Benoit Cousson
  -1 siblings, 0 replies; 24+ messages in thread
From: Benoit Cousson @ 2013-03-13 16:11 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Rob Herring, Grant Likely, Tony Lindgren, Vinod Koul,
	Russell King, device-tree, linux-omap, linux-arm,
	Sebastien Guiriec

On 03/13/2013 04:50 PM, Jon Hunter wrote:
> 
> On 03/13/2013 10:35 AM, Benoit Cousson wrote:
>> Salut Jon,
>>
>> On 03/12/2013 10:43 PM, Jon Hunter wrote:
>>> Salut Benoit!
>>>
>>> On 03/12/2013 06:00 AM, Benoit Cousson wrote:
>>>> + Seb G.
>>>>
>>>> Hi Jon,
>>>>
>>>> How to you plan to merge that series?
>>>
>>> Good question ... my thinking was that you or Tony would take 1/2 and
>>> once that is queued then I would ask Tony to ack 2/2 and Vinod take that
>>> patch.
>>
>> Yep, this is what I was thinking too.
>>
>>> By the way, I have accumulated several DT patches which I sent out
>>> altogether [1] (at least for my own sanity if no one elses ;-) and I
>>> have included the below patch with it. I was hoping that may be I could
>>> create a branch for you to pull. If you would rather cherry-pick the
>>> various patches and merge yourself then I can separate them too.
>>
>> Merging your branch is indeed even better for me. So go ahead.
> 
> Ok. Care to take a quick review to see if there is anything else you
> feel needs fixing before I re-submit fixing the commments posted so far?

OK, I will.

> Do you have an updated branch for v3.10 that I should base on?

Yep, I've just pushed the old one rebased on top of 3.9-rc2.

git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt.git for_3.10/dts


Regards,
Benoit



^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes
@ 2013-03-13 16:11             ` Benoit Cousson
  0 siblings, 0 replies; 24+ messages in thread
From: Benoit Cousson @ 2013-03-13 16:11 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/13/2013 04:50 PM, Jon Hunter wrote:
> 
> On 03/13/2013 10:35 AM, Benoit Cousson wrote:
>> Salut Jon,
>>
>> On 03/12/2013 10:43 PM, Jon Hunter wrote:
>>> Salut Benoit!
>>>
>>> On 03/12/2013 06:00 AM, Benoit Cousson wrote:
>>>> + Seb G.
>>>>
>>>> Hi Jon,
>>>>
>>>> How to you plan to merge that series?
>>>
>>> Good question ... my thinking was that you or Tony would take 1/2 and
>>> once that is queued then I would ask Tony to ack 2/2 and Vinod take that
>>> patch.
>>
>> Yep, this is what I was thinking too.
>>
>>> By the way, I have accumulated several DT patches which I sent out
>>> altogether [1] (at least for my own sanity if no one elses ;-) and I
>>> have included the below patch with it. I was hoping that may be I could
>>> create a branch for you to pull. If you would rather cherry-pick the
>>> various patches and merge yourself then I can separate them too.
>>
>> Merging your branch is indeed even better for me. So go ahead.
> 
> Ok. Care to take a quick review to see if there is anything else you
> feel needs fixing before I re-submit fixing the commments posted so far?

OK, I will.

> Do you have an updated branch for v3.10 that I should base on?

Yep, I've just pushed the old one rebased on top of 3.9-rc2.

git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt.git for_3.10/dts


Regards,
Benoit

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
  2013-02-26 18:27   ` Jon Hunter
@ 2013-03-19 16:04     ` Jon Hunter
  -1 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-03-19 16:04 UTC (permalink / raw)
  To: Jon Hunter, Tony Lindgren, Vinod Koul
  Cc: Rob Herring, Grant Likely, Benoit Cousson, Russell King,
	device-tree, linux-omap, linux-arm

Vinod, Tony, Benoit,

On 02/26/2013 12:27 PM, Jon Hunter wrote:
> If the device-tree blob is present during boot, then register the SDMA
> controller with the device-tree DMA driver so that we can use device-tree
> to look-up DMA client information.
> 
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> Reviewed-by: Felipe Balbi <balbi@ti.com>
> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  arch/arm/mach-omap2/dma.c |    4 ++++
>  drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
>  2 files changed, 40 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
> index dab9fc0..49fd0d5 100644
> --- a/arch/arm/mach-omap2/dma.c
> +++ b/arch/arm/mach-omap2/dma.c
> @@ -28,6 +28,7 @@
>  #include <linux/init.h>
>  #include <linux/device.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/of.h>
>  #include <linux/omap-dma.h>
>  
>  #include "soc.h"
> @@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
>  	if (res)
>  		return res;
>  
> +	if (of_have_populated_dt())
> +		return res;
> +
>  	pdev = platform_device_register_full(&omap_dma_dev_info);
>  	if (IS_ERR(pdev))
>  		return PTR_ERR(pdev);
> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
> index c4b4fd2..2ea3d7e 100644
> --- a/drivers/dma/omap-dma.c
> +++ b/drivers/dma/omap-dma.c
> @@ -16,6 +16,8 @@
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
>  #include <linux/spinlock.h>
> +#include <linux/of_dma.h>
> +#include <linux/of_device.h>
>  
>  #include "virt-dma.h"
>  
> @@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
>  	[OMAP_DMA_DATA_TYPE_S32] = 4,
>  };
>  
> +static struct of_dma_filter_info omap_dma_info = {
> +	.filter_fn = omap_dma_filter_fn,
> +};
> +
>  static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
>  {
>  	return container_of(d, struct omap_dmadev, ddev);
> @@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
>  		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
>  			rc);
>  		omap_dma_free(od);
> -	} else {
> -		platform_set_drvdata(pdev, od);
> +		return rc;
> +	}
> +
> +	platform_set_drvdata(pdev, od);
> +
> +	if (pdev->dev.of_node) {
> +		omap_dma_info.dma_cap = od->ddev.cap_mask;
> +
> +		/* Device-tree DMA controller registration */
> +		rc = of_dma_controller_register(pdev->dev.of_node,
> +				of_dma_simple_xlate, &omap_dma_info);
> +		if (rc) {
> +			pr_warn("OMAP-DMA: failed to register DMA controller\n");
> +			dma_async_device_unregister(&od->ddev);
> +			omap_dma_free(od);
> +		}
>  	}
>  
>  	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
> @@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
>  {
>  	struct omap_dmadev *od = platform_get_drvdata(pdev);
>  
> +	if (pdev->dev.of_node)
> +		of_dma_controller_free(pdev->dev.of_node);
> +
>  	dma_async_device_unregister(&od->ddev);
>  	omap_dma_free(od);
>  
>  	return 0;
>  }
>  
> +static const struct of_device_id omap_dma_match[] = {
> +	{ .compatible = "ti,omap2420-sdma", },
> +	{ .compatible = "ti,omap2430-sdma", },
> +	{ .compatible = "ti,omap3430-sdma", },
> +	{ .compatible = "ti,omap3630-sdma", },
> +	{ .compatible = "ti,omap4430-sdma", },
> +	{},
> +};
> +MODULE_DEVICE_TABLE(of, omap_dma_match);
> +
>  static struct platform_driver omap_dma_driver = {
>  	.probe	= omap_dma_probe,
>  	.remove	= omap_dma_remove,
>  	.driver = {
>  		.name = "omap-dma-engine",
>  		.owner = THIS_MODULE,
> +		.of_match_table = of_match_ptr(omap_dma_match),
>  	},
>  };

Who's tree does it make most sense for this patch to go through?

Benoit has queued up patch 1/2 and so I am not sure if this should go
via Benoit tree to Tony or directly via Vinod's tree. What are your
thoughts?

It would be great if this could make v3.10.

Cheers
Jon


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
@ 2013-03-19 16:04     ` Jon Hunter
  0 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-03-19 16:04 UTC (permalink / raw)
  To: linux-arm-kernel

Vinod, Tony, Benoit,

On 02/26/2013 12:27 PM, Jon Hunter wrote:
> If the device-tree blob is present during boot, then register the SDMA
> controller with the device-tree DMA driver so that we can use device-tree
> to look-up DMA client information.
> 
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> Reviewed-by: Felipe Balbi <balbi@ti.com>
> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  arch/arm/mach-omap2/dma.c |    4 ++++
>  drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
>  2 files changed, 40 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
> index dab9fc0..49fd0d5 100644
> --- a/arch/arm/mach-omap2/dma.c
> +++ b/arch/arm/mach-omap2/dma.c
> @@ -28,6 +28,7 @@
>  #include <linux/init.h>
>  #include <linux/device.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/of.h>
>  #include <linux/omap-dma.h>
>  
>  #include "soc.h"
> @@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
>  	if (res)
>  		return res;
>  
> +	if (of_have_populated_dt())
> +		return res;
> +
>  	pdev = platform_device_register_full(&omap_dma_dev_info);
>  	if (IS_ERR(pdev))
>  		return PTR_ERR(pdev);
> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
> index c4b4fd2..2ea3d7e 100644
> --- a/drivers/dma/omap-dma.c
> +++ b/drivers/dma/omap-dma.c
> @@ -16,6 +16,8 @@
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
>  #include <linux/spinlock.h>
> +#include <linux/of_dma.h>
> +#include <linux/of_device.h>
>  
>  #include "virt-dma.h"
>  
> @@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
>  	[OMAP_DMA_DATA_TYPE_S32] = 4,
>  };
>  
> +static struct of_dma_filter_info omap_dma_info = {
> +	.filter_fn = omap_dma_filter_fn,
> +};
> +
>  static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
>  {
>  	return container_of(d, struct omap_dmadev, ddev);
> @@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
>  		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
>  			rc);
>  		omap_dma_free(od);
> -	} else {
> -		platform_set_drvdata(pdev, od);
> +		return rc;
> +	}
> +
> +	platform_set_drvdata(pdev, od);
> +
> +	if (pdev->dev.of_node) {
> +		omap_dma_info.dma_cap = od->ddev.cap_mask;
> +
> +		/* Device-tree DMA controller registration */
> +		rc = of_dma_controller_register(pdev->dev.of_node,
> +				of_dma_simple_xlate, &omap_dma_info);
> +		if (rc) {
> +			pr_warn("OMAP-DMA: failed to register DMA controller\n");
> +			dma_async_device_unregister(&od->ddev);
> +			omap_dma_free(od);
> +		}
>  	}
>  
>  	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
> @@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
>  {
>  	struct omap_dmadev *od = platform_get_drvdata(pdev);
>  
> +	if (pdev->dev.of_node)
> +		of_dma_controller_free(pdev->dev.of_node);
> +
>  	dma_async_device_unregister(&od->ddev);
>  	omap_dma_free(od);
>  
>  	return 0;
>  }
>  
> +static const struct of_device_id omap_dma_match[] = {
> +	{ .compatible = "ti,omap2420-sdma", },
> +	{ .compatible = "ti,omap2430-sdma", },
> +	{ .compatible = "ti,omap3430-sdma", },
> +	{ .compatible = "ti,omap3630-sdma", },
> +	{ .compatible = "ti,omap4430-sdma", },
> +	{},
> +};
> +MODULE_DEVICE_TABLE(of, omap_dma_match);
> +
>  static struct platform_driver omap_dma_driver = {
>  	.probe	= omap_dma_probe,
>  	.remove	= omap_dma_remove,
>  	.driver = {
>  		.name = "omap-dma-engine",
>  		.owner = THIS_MODULE,
> +		.of_match_table = of_match_ptr(omap_dma_match),
>  	},
>  };

Who's tree does it make most sense for this patch to go through?

Benoit has queued up patch 1/2 and so I am not sure if this should go
via Benoit tree to Tony or directly via Vinod's tree. What are your
thoughts?

It would be great if this could make v3.10.

Cheers
Jon

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
  2013-03-19 16:04     ` Jon Hunter
@ 2013-03-20 16:36       ` Tony Lindgren
  -1 siblings, 0 replies; 24+ messages in thread
From: Tony Lindgren @ 2013-03-20 16:36 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Vinod Koul, Cousson, Benoit, Rob Herring, Grant Likely,
	Russell King, device-tree, linux-omap, linux-arm

* Jon Hunter <jon-hunter@ti.com> [130319 09:08]:
> Vinod, Tony, Benoit,
> 
> On 02/26/2013 12:27 PM, Jon Hunter wrote:
> > If the device-tree blob is present during boot, then register the SDMA
> > controller with the device-tree DMA driver so that we can use device-tree
> > to look-up DMA client information.
> > 
> > Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> > Reviewed-by: Felipe Balbi <balbi@ti.com>
> > Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > ---
> >  arch/arm/mach-omap2/dma.c |    4 ++++
> >  drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
> >  2 files changed, 40 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
> > index dab9fc0..49fd0d5 100644
> > --- a/arch/arm/mach-omap2/dma.c
> > +++ b/arch/arm/mach-omap2/dma.c
> > @@ -28,6 +28,7 @@
> >  #include <linux/init.h>
> >  #include <linux/device.h>
> >  #include <linux/dma-mapping.h>
> > +#include <linux/of.h>
> >  #include <linux/omap-dma.h>
> >  
> >  #include "soc.h"
> > @@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
> >  	if (res)
> >  		return res;
> >  
> > +	if (of_have_populated_dt())
> > +		return res;
> > +
> >  	pdev = platform_device_register_full(&omap_dma_dev_info);
> >  	if (IS_ERR(pdev))
> >  		return PTR_ERR(pdev);

AFAIK we don't currently have anything else touching this file..

> > diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
> > index c4b4fd2..2ea3d7e 100644
> > --- a/drivers/dma/omap-dma.c
> > +++ b/drivers/dma/omap-dma.c
> > @@ -16,6 +16,8 @@
> >  #include <linux/platform_device.h>
> >  #include <linux/slab.h>
> >  #include <linux/spinlock.h>
> > +#include <linux/of_dma.h>
> > +#include <linux/of_device.h>
> >  
> >  #include "virt-dma.h"
> >  
> > @@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
> >  	[OMAP_DMA_DATA_TYPE_S32] = 4,
> >  };
> >  
> > +static struct of_dma_filter_info omap_dma_info = {
> > +	.filter_fn = omap_dma_filter_fn,
> > +};
> > +
> >  static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
> >  {
> >  	return container_of(d, struct omap_dmadev, ddev);
> > @@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
> >  		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
> >  			rc);
> >  		omap_dma_free(od);
> > -	} else {
> > -		platform_set_drvdata(pdev, od);
> > +		return rc;
> > +	}
> > +
> > +	platform_set_drvdata(pdev, od);
> > +
> > +	if (pdev->dev.of_node) {
> > +		omap_dma_info.dma_cap = od->ddev.cap_mask;
> > +
> > +		/* Device-tree DMA controller registration */
> > +		rc = of_dma_controller_register(pdev->dev.of_node,
> > +				of_dma_simple_xlate, &omap_dma_info);
> > +		if (rc) {
> > +			pr_warn("OMAP-DMA: failed to register DMA controller\n");
> > +			dma_async_device_unregister(&od->ddev);
> > +			omap_dma_free(od);
> > +		}
> >  	}
> >  
> >  	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
> > @@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
> >  {
> >  	struct omap_dmadev *od = platform_get_drvdata(pdev);
> >  
> > +	if (pdev->dev.of_node)
> > +		of_dma_controller_free(pdev->dev.of_node);
> > +
> >  	dma_async_device_unregister(&od->ddev);
> >  	omap_dma_free(od);
> >  
> >  	return 0;
> >  }
> >  
> > +static const struct of_device_id omap_dma_match[] = {
> > +	{ .compatible = "ti,omap2420-sdma", },
> > +	{ .compatible = "ti,omap2430-sdma", },
> > +	{ .compatible = "ti,omap3430-sdma", },
> > +	{ .compatible = "ti,omap3630-sdma", },
> > +	{ .compatible = "ti,omap4430-sdma", },
> > +	{},
> > +};
> > +MODULE_DEVICE_TABLE(of, omap_dma_match);
> > +
> >  static struct platform_driver omap_dma_driver = {
> >  	.probe	= omap_dma_probe,
> >  	.remove	= omap_dma_remove,
> >  	.driver = {
> >  		.name = "omap-dma-engine",
> >  		.owner = THIS_MODULE,
> > +		.of_match_table = of_match_ptr(omap_dma_match),
> >  	},
> >  };
> 
> Who's tree does it make most sense for this patch to go through?
> 
> Benoit has queued up patch 1/2 and so I am not sure if this should go
> via Benoit tree to Tony or directly via Vinod's tree. What are your
> thoughts?

OK
 
> It would be great if this could make v3.10.

I suggest Vinod/Grant/Linus W queue this patch:

Acked-by: Tony Lindgren <tony@atomide.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
@ 2013-03-20 16:36       ` Tony Lindgren
  0 siblings, 0 replies; 24+ messages in thread
From: Tony Lindgren @ 2013-03-20 16:36 UTC (permalink / raw)
  To: linux-arm-kernel

* Jon Hunter <jon-hunter@ti.com> [130319 09:08]:
> Vinod, Tony, Benoit,
> 
> On 02/26/2013 12:27 PM, Jon Hunter wrote:
> > If the device-tree blob is present during boot, then register the SDMA
> > controller with the device-tree DMA driver so that we can use device-tree
> > to look-up DMA client information.
> > 
> > Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> > Reviewed-by: Felipe Balbi <balbi@ti.com>
> > Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > ---
> >  arch/arm/mach-omap2/dma.c |    4 ++++
> >  drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
> >  2 files changed, 40 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
> > index dab9fc0..49fd0d5 100644
> > --- a/arch/arm/mach-omap2/dma.c
> > +++ b/arch/arm/mach-omap2/dma.c
> > @@ -28,6 +28,7 @@
> >  #include <linux/init.h>
> >  #include <linux/device.h>
> >  #include <linux/dma-mapping.h>
> > +#include <linux/of.h>
> >  #include <linux/omap-dma.h>
> >  
> >  #include "soc.h"
> > @@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
> >  	if (res)
> >  		return res;
> >  
> > +	if (of_have_populated_dt())
> > +		return res;
> > +
> >  	pdev = platform_device_register_full(&omap_dma_dev_info);
> >  	if (IS_ERR(pdev))
> >  		return PTR_ERR(pdev);

AFAIK we don't currently have anything else touching this file..

> > diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
> > index c4b4fd2..2ea3d7e 100644
> > --- a/drivers/dma/omap-dma.c
> > +++ b/drivers/dma/omap-dma.c
> > @@ -16,6 +16,8 @@
> >  #include <linux/platform_device.h>
> >  #include <linux/slab.h>
> >  #include <linux/spinlock.h>
> > +#include <linux/of_dma.h>
> > +#include <linux/of_device.h>
> >  
> >  #include "virt-dma.h"
> >  
> > @@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
> >  	[OMAP_DMA_DATA_TYPE_S32] = 4,
> >  };
> >  
> > +static struct of_dma_filter_info omap_dma_info = {
> > +	.filter_fn = omap_dma_filter_fn,
> > +};
> > +
> >  static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
> >  {
> >  	return container_of(d, struct omap_dmadev, ddev);
> > @@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
> >  		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
> >  			rc);
> >  		omap_dma_free(od);
> > -	} else {
> > -		platform_set_drvdata(pdev, od);
> > +		return rc;
> > +	}
> > +
> > +	platform_set_drvdata(pdev, od);
> > +
> > +	if (pdev->dev.of_node) {
> > +		omap_dma_info.dma_cap = od->ddev.cap_mask;
> > +
> > +		/* Device-tree DMA controller registration */
> > +		rc = of_dma_controller_register(pdev->dev.of_node,
> > +				of_dma_simple_xlate, &omap_dma_info);
> > +		if (rc) {
> > +			pr_warn("OMAP-DMA: failed to register DMA controller\n");
> > +			dma_async_device_unregister(&od->ddev);
> > +			omap_dma_free(od);
> > +		}
> >  	}
> >  
> >  	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
> > @@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
> >  {
> >  	struct omap_dmadev *od = platform_get_drvdata(pdev);
> >  
> > +	if (pdev->dev.of_node)
> > +		of_dma_controller_free(pdev->dev.of_node);
> > +
> >  	dma_async_device_unregister(&od->ddev);
> >  	omap_dma_free(od);
> >  
> >  	return 0;
> >  }
> >  
> > +static const struct of_device_id omap_dma_match[] = {
> > +	{ .compatible = "ti,omap2420-sdma", },
> > +	{ .compatible = "ti,omap2430-sdma", },
> > +	{ .compatible = "ti,omap3430-sdma", },
> > +	{ .compatible = "ti,omap3630-sdma", },
> > +	{ .compatible = "ti,omap4430-sdma", },
> > +	{},
> > +};
> > +MODULE_DEVICE_TABLE(of, omap_dma_match);
> > +
> >  static struct platform_driver omap_dma_driver = {
> >  	.probe	= omap_dma_probe,
> >  	.remove	= omap_dma_remove,
> >  	.driver = {
> >  		.name = "omap-dma-engine",
> >  		.owner = THIS_MODULE,
> > +		.of_match_table = of_match_ptr(omap_dma_match),
> >  	},
> >  };
> 
> Who's tree does it make most sense for this patch to go through?
> 
> Benoit has queued up patch 1/2 and so I am not sure if this should go
> via Benoit tree to Tony or directly via Vinod's tree. What are your
> thoughts?

OK
 
> It would be great if this could make v3.10.

I suggest Vinod/Grant/Linus W queue this patch:

Acked-by: Tony Lindgren <tony@atomide.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
  2013-03-20 16:36       ` Tony Lindgren
@ 2013-04-01 17:48         ` Jon Hunter
  -1 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-04-01 17:48 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Tony Lindgren, Cousson, Benoit, Rob Herring, Grant Likely,
	Russell King, device-tree, linux-omap, linux-arm

Vinod,

On 03/20/2013 11:36 AM, Tony Lindgren wrote:
> * Jon Hunter <jon-hunter@ti.com> [130319 09:08]:
>> Vinod, Tony, Benoit,
>>
>> On 02/26/2013 12:27 PM, Jon Hunter wrote:
>>> If the device-tree blob is present during boot, then register the SDMA
>>> controller with the device-tree DMA driver so that we can use device-tree
>>> to look-up DMA client information.
>>>
>>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>>> Reviewed-by: Felipe Balbi <balbi@ti.com>
>>> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> ---
>>>  arch/arm/mach-omap2/dma.c |    4 ++++
>>>  drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
>>>  2 files changed, 40 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
>>> index dab9fc0..49fd0d5 100644
>>> --- a/arch/arm/mach-omap2/dma.c
>>> +++ b/arch/arm/mach-omap2/dma.c
>>> @@ -28,6 +28,7 @@
>>>  #include <linux/init.h>
>>>  #include <linux/device.h>
>>>  #include <linux/dma-mapping.h>
>>> +#include <linux/of.h>
>>>  #include <linux/omap-dma.h>
>>>  
>>>  #include "soc.h"
>>> @@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
>>>  	if (res)
>>>  		return res;
>>>  
>>> +	if (of_have_populated_dt())
>>> +		return res;
>>> +
>>>  	pdev = platform_device_register_full(&omap_dma_dev_info);
>>>  	if (IS_ERR(pdev))
>>>  		return PTR_ERR(pdev);
> 
> AFAIK we don't currently have anything else touching this file..
> 
>>> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
>>> index c4b4fd2..2ea3d7e 100644
>>> --- a/drivers/dma/omap-dma.c
>>> +++ b/drivers/dma/omap-dma.c
>>> @@ -16,6 +16,8 @@
>>>  #include <linux/platform_device.h>
>>>  #include <linux/slab.h>
>>>  #include <linux/spinlock.h>
>>> +#include <linux/of_dma.h>
>>> +#include <linux/of_device.h>
>>>  
>>>  #include "virt-dma.h"
>>>  
>>> @@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
>>>  	[OMAP_DMA_DATA_TYPE_S32] = 4,
>>>  };
>>>  
>>> +static struct of_dma_filter_info omap_dma_info = {
>>> +	.filter_fn = omap_dma_filter_fn,
>>> +};
>>> +
>>>  static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
>>>  {
>>>  	return container_of(d, struct omap_dmadev, ddev);
>>> @@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
>>>  		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
>>>  			rc);
>>>  		omap_dma_free(od);
>>> -	} else {
>>> -		platform_set_drvdata(pdev, od);
>>> +		return rc;
>>> +	}
>>> +
>>> +	platform_set_drvdata(pdev, od);
>>> +
>>> +	if (pdev->dev.of_node) {
>>> +		omap_dma_info.dma_cap = od->ddev.cap_mask;
>>> +
>>> +		/* Device-tree DMA controller registration */
>>> +		rc = of_dma_controller_register(pdev->dev.of_node,
>>> +				of_dma_simple_xlate, &omap_dma_info);
>>> +		if (rc) {
>>> +			pr_warn("OMAP-DMA: failed to register DMA controller\n");
>>> +			dma_async_device_unregister(&od->ddev);
>>> +			omap_dma_free(od);
>>> +		}
>>>  	}
>>>  
>>>  	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
>>> @@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
>>>  {
>>>  	struct omap_dmadev *od = platform_get_drvdata(pdev);
>>>  
>>> +	if (pdev->dev.of_node)
>>> +		of_dma_controller_free(pdev->dev.of_node);
>>> +
>>>  	dma_async_device_unregister(&od->ddev);
>>>  	omap_dma_free(od);
>>>  
>>>  	return 0;
>>>  }
>>>  
>>> +static const struct of_device_id omap_dma_match[] = {
>>> +	{ .compatible = "ti,omap2420-sdma", },
>>> +	{ .compatible = "ti,omap2430-sdma", },
>>> +	{ .compatible = "ti,omap3430-sdma", },
>>> +	{ .compatible = "ti,omap3630-sdma", },
>>> +	{ .compatible = "ti,omap4430-sdma", },
>>> +	{},
>>> +};
>>> +MODULE_DEVICE_TABLE(of, omap_dma_match);
>>> +
>>>  static struct platform_driver omap_dma_driver = {
>>>  	.probe	= omap_dma_probe,
>>>  	.remove	= omap_dma_remove,
>>>  	.driver = {
>>>  		.name = "omap-dma-engine",
>>>  		.owner = THIS_MODULE,
>>> +		.of_match_table = of_match_ptr(omap_dma_match),
>>>  	},
>>>  };
>>
>> Who's tree does it make most sense for this patch to go through?
>>
>> Benoit has queued up patch 1/2 and so I am not sure if this should go
>> via Benoit tree to Tony or directly via Vinod's tree. What are your
>> thoughts?
> 
> OK
>  
>> It would be great if this could make v3.10.
> 
> I suggest Vinod/Grant/Linus W queue this patch:
> 
> Acked-by: Tony Lindgren <tony@atomide.com>

Can you take this patch with Tony's ACK? Let me know if you want me to
resend with the ACK.

Cheers
Jon


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
@ 2013-04-01 17:48         ` Jon Hunter
  0 siblings, 0 replies; 24+ messages in thread
From: Jon Hunter @ 2013-04-01 17:48 UTC (permalink / raw)
  To: linux-arm-kernel

Vinod,

On 03/20/2013 11:36 AM, Tony Lindgren wrote:
> * Jon Hunter <jon-hunter@ti.com> [130319 09:08]:
>> Vinod, Tony, Benoit,
>>
>> On 02/26/2013 12:27 PM, Jon Hunter wrote:
>>> If the device-tree blob is present during boot, then register the SDMA
>>> controller with the device-tree DMA driver so that we can use device-tree
>>> to look-up DMA client information.
>>>
>>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>>> Reviewed-by: Felipe Balbi <balbi@ti.com>
>>> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>>> ---
>>>  arch/arm/mach-omap2/dma.c |    4 ++++
>>>  drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
>>>  2 files changed, 40 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
>>> index dab9fc0..49fd0d5 100644
>>> --- a/arch/arm/mach-omap2/dma.c
>>> +++ b/arch/arm/mach-omap2/dma.c
>>> @@ -28,6 +28,7 @@
>>>  #include <linux/init.h>
>>>  #include <linux/device.h>
>>>  #include <linux/dma-mapping.h>
>>> +#include <linux/of.h>
>>>  #include <linux/omap-dma.h>
>>>  
>>>  #include "soc.h"
>>> @@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
>>>  	if (res)
>>>  		return res;
>>>  
>>> +	if (of_have_populated_dt())
>>> +		return res;
>>> +
>>>  	pdev = platform_device_register_full(&omap_dma_dev_info);
>>>  	if (IS_ERR(pdev))
>>>  		return PTR_ERR(pdev);
> 
> AFAIK we don't currently have anything else touching this file..
> 
>>> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
>>> index c4b4fd2..2ea3d7e 100644
>>> --- a/drivers/dma/omap-dma.c
>>> +++ b/drivers/dma/omap-dma.c
>>> @@ -16,6 +16,8 @@
>>>  #include <linux/platform_device.h>
>>>  #include <linux/slab.h>
>>>  #include <linux/spinlock.h>
>>> +#include <linux/of_dma.h>
>>> +#include <linux/of_device.h>
>>>  
>>>  #include "virt-dma.h"
>>>  
>>> @@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
>>>  	[OMAP_DMA_DATA_TYPE_S32] = 4,
>>>  };
>>>  
>>> +static struct of_dma_filter_info omap_dma_info = {
>>> +	.filter_fn = omap_dma_filter_fn,
>>> +};
>>> +
>>>  static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
>>>  {
>>>  	return container_of(d, struct omap_dmadev, ddev);
>>> @@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
>>>  		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
>>>  			rc);
>>>  		omap_dma_free(od);
>>> -	} else {
>>> -		platform_set_drvdata(pdev, od);
>>> +		return rc;
>>> +	}
>>> +
>>> +	platform_set_drvdata(pdev, od);
>>> +
>>> +	if (pdev->dev.of_node) {
>>> +		omap_dma_info.dma_cap = od->ddev.cap_mask;
>>> +
>>> +		/* Device-tree DMA controller registration */
>>> +		rc = of_dma_controller_register(pdev->dev.of_node,
>>> +				of_dma_simple_xlate, &omap_dma_info);
>>> +		if (rc) {
>>> +			pr_warn("OMAP-DMA: failed to register DMA controller\n");
>>> +			dma_async_device_unregister(&od->ddev);
>>> +			omap_dma_free(od);
>>> +		}
>>>  	}
>>>  
>>>  	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
>>> @@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
>>>  {
>>>  	struct omap_dmadev *od = platform_get_drvdata(pdev);
>>>  
>>> +	if (pdev->dev.of_node)
>>> +		of_dma_controller_free(pdev->dev.of_node);
>>> +
>>>  	dma_async_device_unregister(&od->ddev);
>>>  	omap_dma_free(od);
>>>  
>>>  	return 0;
>>>  }
>>>  
>>> +static const struct of_device_id omap_dma_match[] = {
>>> +	{ .compatible = "ti,omap2420-sdma", },
>>> +	{ .compatible = "ti,omap2430-sdma", },
>>> +	{ .compatible = "ti,omap3430-sdma", },
>>> +	{ .compatible = "ti,omap3630-sdma", },
>>> +	{ .compatible = "ti,omap4430-sdma", },
>>> +	{},
>>> +};
>>> +MODULE_DEVICE_TABLE(of, omap_dma_match);
>>> +
>>>  static struct platform_driver omap_dma_driver = {
>>>  	.probe	= omap_dma_probe,
>>>  	.remove	= omap_dma_remove,
>>>  	.driver = {
>>>  		.name = "omap-dma-engine",
>>>  		.owner = THIS_MODULE,
>>> +		.of_match_table = of_match_ptr(omap_dma_match),
>>>  	},
>>>  };
>>
>> Who's tree does it make most sense for this patch to go through?
>>
>> Benoit has queued up patch 1/2 and so I am not sure if this should go
>> via Benoit tree to Tony or directly via Vinod's tree. What are your
>> thoughts?
> 
> OK
>  
>> It would be great if this could make v3.10.
> 
> I suggest Vinod/Grant/Linus W queue this patch:
> 
> Acked-by: Tony Lindgren <tony@atomide.com>

Can you take this patch with Tony's ACK? Let me know if you want me to
resend with the ACK.

Cheers
Jon

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
  2013-04-01 17:48         ` Jon Hunter
@ 2013-04-01 18:26           ` Vinod Koul
  -1 siblings, 0 replies; 24+ messages in thread
From: Vinod Koul @ 2013-04-01 18:26 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Tony Lindgren, Cousson, Benoit, Rob Herring, Grant Likely,
	Russell King, device-tree, linux-omap, linux-arm

On Mon, Apr 01, 2013 at 12:48:26PM -0500, Jon Hunter wrote:
> Vinod,
> 
> On 03/20/2013 11:36 AM, Tony Lindgren wrote:
> > * Jon Hunter <jon-hunter@ti.com> [130319 09:08]:
> >> Vinod, Tony, Benoit,
> >>
> >> On 02/26/2013 12:27 PM, Jon Hunter wrote:
> >>> If the device-tree blob is present during boot, then register the SDMA
> >>> controller with the device-tree DMA driver so that we can use device-tree
> >>> to look-up DMA client information.
> >>>
> >>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> >>> Reviewed-by: Felipe Balbi <balbi@ti.com>
> >>> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> >>> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> >>> ---
> >>>  arch/arm/mach-omap2/dma.c |    4 ++++
> >>>  drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
> >>>  2 files changed, 40 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
> >>> index dab9fc0..49fd0d5 100644
> >>> --- a/arch/arm/mach-omap2/dma.c
> >>> +++ b/arch/arm/mach-omap2/dma.c
> >>> @@ -28,6 +28,7 @@
> >>>  #include <linux/init.h>
> >>>  #include <linux/device.h>
> >>>  #include <linux/dma-mapping.h>
> >>> +#include <linux/of.h>
> >>>  #include <linux/omap-dma.h>
> >>>  
> >>>  #include "soc.h"
> >>> @@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
> >>>  	if (res)
> >>>  		return res;
> >>>  
> >>> +	if (of_have_populated_dt())
> >>> +		return res;
> >>> +
> >>>  	pdev = platform_device_register_full(&omap_dma_dev_info);
> >>>  	if (IS_ERR(pdev))
> >>>  		return PTR_ERR(pdev);
> > 
> > AFAIK we don't currently have anything else touching this file..
> > 
> >>> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
> >>> index c4b4fd2..2ea3d7e 100644
> >>> --- a/drivers/dma/omap-dma.c
> >>> +++ b/drivers/dma/omap-dma.c
> >>> @@ -16,6 +16,8 @@
> >>>  #include <linux/platform_device.h>
> >>>  #include <linux/slab.h>
> >>>  #include <linux/spinlock.h>
> >>> +#include <linux/of_dma.h>
> >>> +#include <linux/of_device.h>
> >>>  
> >>>  #include "virt-dma.h"
> >>>  
> >>> @@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
> >>>  	[OMAP_DMA_DATA_TYPE_S32] = 4,
> >>>  };
> >>>  
> >>> +static struct of_dma_filter_info omap_dma_info = {
> >>> +	.filter_fn = omap_dma_filter_fn,
> >>> +};
> >>> +
> >>>  static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
> >>>  {
> >>>  	return container_of(d, struct omap_dmadev, ddev);
> >>> @@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
> >>>  		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
> >>>  			rc);
> >>>  		omap_dma_free(od);
> >>> -	} else {
> >>> -		platform_set_drvdata(pdev, od);
> >>> +		return rc;
> >>> +	}
> >>> +
> >>> +	platform_set_drvdata(pdev, od);
> >>> +
> >>> +	if (pdev->dev.of_node) {
> >>> +		omap_dma_info.dma_cap = od->ddev.cap_mask;
> >>> +
> >>> +		/* Device-tree DMA controller registration */
> >>> +		rc = of_dma_controller_register(pdev->dev.of_node,
> >>> +				of_dma_simple_xlate, &omap_dma_info);
> >>> +		if (rc) {
> >>> +			pr_warn("OMAP-DMA: failed to register DMA controller\n");
> >>> +			dma_async_device_unregister(&od->ddev);
> >>> +			omap_dma_free(od);
> >>> +		}
> >>>  	}
> >>>  
> >>>  	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
> >>> @@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
> >>>  {
> >>>  	struct omap_dmadev *od = platform_get_drvdata(pdev);
> >>>  
> >>> +	if (pdev->dev.of_node)
> >>> +		of_dma_controller_free(pdev->dev.of_node);
> >>> +
> >>>  	dma_async_device_unregister(&od->ddev);
> >>>  	omap_dma_free(od);
> >>>  
> >>>  	return 0;
> >>>  }
> >>>  
> >>> +static const struct of_device_id omap_dma_match[] = {
> >>> +	{ .compatible = "ti,omap2420-sdma", },
> >>> +	{ .compatible = "ti,omap2430-sdma", },
> >>> +	{ .compatible = "ti,omap3430-sdma", },
> >>> +	{ .compatible = "ti,omap3630-sdma", },
> >>> +	{ .compatible = "ti,omap4430-sdma", },
> >>> +	{},
> >>> +};
> >>> +MODULE_DEVICE_TABLE(of, omap_dma_match);
> >>> +
> >>>  static struct platform_driver omap_dma_driver = {
> >>>  	.probe	= omap_dma_probe,
> >>>  	.remove	= omap_dma_remove,
> >>>  	.driver = {
> >>>  		.name = "omap-dma-engine",
> >>>  		.owner = THIS_MODULE,
> >>> +		.of_match_table = of_match_ptr(omap_dma_match),
> >>>  	},
> >>>  };
> >>
> >> Who's tree does it make most sense for this patch to go through?
> >>
> >> Benoit has queued up patch 1/2 and so I am not sure if this should go
> >> via Benoit tree to Tony or directly via Vinod's tree. What are your
> >> thoughts?
> > 
> > OK
> >  
> >> It would be great if this could make v3.10.
> > 
> > I suggest Vinod/Grant/Linus W queue this patch:
> > 
> > Acked-by: Tony Lindgren <tony@atomide.com>
> 
> Can you take this patch with Tony's ACK? Let me know if you want me to
> resend with the ACK.
ahhh due to my vcation/travel looks like this one was skipped, I have
applied it now should show up in linus's tree during next merg window

Sorry for delay

~Vinod
> 
> Cheers
> Jon
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver
@ 2013-04-01 18:26           ` Vinod Koul
  0 siblings, 0 replies; 24+ messages in thread
From: Vinod Koul @ 2013-04-01 18:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 01, 2013 at 12:48:26PM -0500, Jon Hunter wrote:
> Vinod,
> 
> On 03/20/2013 11:36 AM, Tony Lindgren wrote:
> > * Jon Hunter <jon-hunter@ti.com> [130319 09:08]:
> >> Vinod, Tony, Benoit,
> >>
> >> On 02/26/2013 12:27 PM, Jon Hunter wrote:
> >>> If the device-tree blob is present during boot, then register the SDMA
> >>> controller with the device-tree DMA driver so that we can use device-tree
> >>> to look-up DMA client information.
> >>>
> >>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> >>> Reviewed-by: Felipe Balbi <balbi@ti.com>
> >>> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> >>> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> >>> ---
> >>>  arch/arm/mach-omap2/dma.c |    4 ++++
> >>>  drivers/dma/omap-dma.c    |   38 ++++++++++++++++++++++++++++++++++++--
> >>>  2 files changed, 40 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/arch/arm/mach-omap2/dma.c b/arch/arm/mach-omap2/dma.c
> >>> index dab9fc0..49fd0d5 100644
> >>> --- a/arch/arm/mach-omap2/dma.c
> >>> +++ b/arch/arm/mach-omap2/dma.c
> >>> @@ -28,6 +28,7 @@
> >>>  #include <linux/init.h>
> >>>  #include <linux/device.h>
> >>>  #include <linux/dma-mapping.h>
> >>> +#include <linux/of.h>
> >>>  #include <linux/omap-dma.h>
> >>>  
> >>>  #include "soc.h"
> >>> @@ -304,6 +305,9 @@ static int __init omap2_system_dma_init(void)
> >>>  	if (res)
> >>>  		return res;
> >>>  
> >>> +	if (of_have_populated_dt())
> >>> +		return res;
> >>> +
> >>>  	pdev = platform_device_register_full(&omap_dma_dev_info);
> >>>  	if (IS_ERR(pdev))
> >>>  		return PTR_ERR(pdev);
> > 
> > AFAIK we don't currently have anything else touching this file..
> > 
> >>> diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
> >>> index c4b4fd2..2ea3d7e 100644
> >>> --- a/drivers/dma/omap-dma.c
> >>> +++ b/drivers/dma/omap-dma.c
> >>> @@ -16,6 +16,8 @@
> >>>  #include <linux/platform_device.h>
> >>>  #include <linux/slab.h>
> >>>  #include <linux/spinlock.h>
> >>> +#include <linux/of_dma.h>
> >>> +#include <linux/of_device.h>
> >>>  
> >>>  #include "virt-dma.h"
> >>>  
> >>> @@ -67,6 +69,10 @@ static const unsigned es_bytes[] = {
> >>>  	[OMAP_DMA_DATA_TYPE_S32] = 4,
> >>>  };
> >>>  
> >>> +static struct of_dma_filter_info omap_dma_info = {
> >>> +	.filter_fn = omap_dma_filter_fn,
> >>> +};
> >>> +
> >>>  static inline struct omap_dmadev *to_omap_dma_dev(struct dma_device *d)
> >>>  {
> >>>  	return container_of(d, struct omap_dmadev, ddev);
> >>> @@ -621,8 +627,22 @@ static int omap_dma_probe(struct platform_device *pdev)
> >>>  		pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
> >>>  			rc);
> >>>  		omap_dma_free(od);
> >>> -	} else {
> >>> -		platform_set_drvdata(pdev, od);
> >>> +		return rc;
> >>> +	}
> >>> +
> >>> +	platform_set_drvdata(pdev, od);
> >>> +
> >>> +	if (pdev->dev.of_node) {
> >>> +		omap_dma_info.dma_cap = od->ddev.cap_mask;
> >>> +
> >>> +		/* Device-tree DMA controller registration */
> >>> +		rc = of_dma_controller_register(pdev->dev.of_node,
> >>> +				of_dma_simple_xlate, &omap_dma_info);
> >>> +		if (rc) {
> >>> +			pr_warn("OMAP-DMA: failed to register DMA controller\n");
> >>> +			dma_async_device_unregister(&od->ddev);
> >>> +			omap_dma_free(od);
> >>> +		}
> >>>  	}
> >>>  
> >>>  	dev_info(&pdev->dev, "OMAP DMA engine driver\n");
> >>> @@ -634,18 +654,32 @@ static int omap_dma_remove(struct platform_device *pdev)
> >>>  {
> >>>  	struct omap_dmadev *od = platform_get_drvdata(pdev);
> >>>  
> >>> +	if (pdev->dev.of_node)
> >>> +		of_dma_controller_free(pdev->dev.of_node);
> >>> +
> >>>  	dma_async_device_unregister(&od->ddev);
> >>>  	omap_dma_free(od);
> >>>  
> >>>  	return 0;
> >>>  }
> >>>  
> >>> +static const struct of_device_id omap_dma_match[] = {
> >>> +	{ .compatible = "ti,omap2420-sdma", },
> >>> +	{ .compatible = "ti,omap2430-sdma", },
> >>> +	{ .compatible = "ti,omap3430-sdma", },
> >>> +	{ .compatible = "ti,omap3630-sdma", },
> >>> +	{ .compatible = "ti,omap4430-sdma", },
> >>> +	{},
> >>> +};
> >>> +MODULE_DEVICE_TABLE(of, omap_dma_match);
> >>> +
> >>>  static struct platform_driver omap_dma_driver = {
> >>>  	.probe	= omap_dma_probe,
> >>>  	.remove	= omap_dma_remove,
> >>>  	.driver = {
> >>>  		.name = "omap-dma-engine",
> >>>  		.owner = THIS_MODULE,
> >>> +		.of_match_table = of_match_ptr(omap_dma_match),
> >>>  	},
> >>>  };
> >>
> >> Who's tree does it make most sense for this patch to go through?
> >>
> >> Benoit has queued up patch 1/2 and so I am not sure if this should go
> >> via Benoit tree to Tony or directly via Vinod's tree. What are your
> >> thoughts?
> > 
> > OK
> >  
> >> It would be great if this could make v3.10.
> > 
> > I suggest Vinod/Grant/Linus W queue this patch:
> > 
> > Acked-by: Tony Lindgren <tony@atomide.com>
> 
> Can you take this patch with Tony's ACK? Let me know if you want me to
> resend with the ACK.
ahhh due to my vcation/travel looks like this one was skipped, I have
applied it now should show up in linus's tree during next merg window

Sorry for delay

~Vinod
> 
> Cheers
> Jon
> 

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-04-01 18:26 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-26 18:27 [PATCH V3 0/2] ARM: dts: Add DT bindings for OMAP SDMA Jon Hunter
2013-02-26 18:27 ` Jon Hunter
2013-02-26 18:27 ` [PATCH V3 1/2] ARM: dts: OMAP2+: Add SDMA controller bindings and nodes Jon Hunter
2013-02-26 18:27   ` Jon Hunter
2013-03-12 11:00   ` Benoit Cousson
2013-03-12 11:00     ` Benoit Cousson
2013-03-12 21:43     ` Jon Hunter
2013-03-12 21:43       ` Jon Hunter
2013-03-13 15:35       ` Benoit Cousson
2013-03-13 15:35         ` Benoit Cousson
2013-03-13 15:50         ` Jon Hunter
2013-03-13 15:50           ` Jon Hunter
2013-03-13 16:11           ` Benoit Cousson
2013-03-13 16:11             ` Benoit Cousson
2013-02-26 18:27 ` [PATCH V3 2/2] dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver Jon Hunter
2013-02-26 18:27   ` Jon Hunter
2013-03-19 16:04   ` Jon Hunter
2013-03-19 16:04     ` Jon Hunter
2013-03-20 16:36     ` Tony Lindgren
2013-03-20 16:36       ` Tony Lindgren
2013-04-01 17:48       ` Jon Hunter
2013-04-01 17:48         ` Jon Hunter
2013-04-01 18:26         ` Vinod Koul
2013-04-01 18:26           ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.