ARM: sunxi: DT: Convert the DTs to use a header for the DMA arguments
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 16 Dec 2014 21:59:56 +0000 (22:59 +0100)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 21 Jan 2015 08:58:56 +0000 (09:58 +0100)
The DMA engine for the A10/A20 and derivatives require an opaque extra
argument.

Add a dt-bindings header, and convert the device trees to it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
arch/arm/boot/dts/sun4i-a10.dtsi
arch/arm/boot/dts/sun5i-a10s.dtsi
arch/arm/boot/dts/sun5i-a13.dtsi
arch/arm/boot/dts/sun7i-a20.dtsi
include/dt-bindings/dma/sun4i-a10.h [new file with mode: 0644]

index 94283a5..fb413e4 100644 (file)
@@ -12,6 +12,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/dma/sun4i-a10.h>
+
 / {
        interrupt-parent = <&intc>;
 
                        interrupts = <10>;
                        clocks = <&ahb_gates 20>, <&spi0_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 27>, <&dma 1 26>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 27>,
+                              <&dma SUN4I_DMA_DEDICATED 26>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <11>;
                        clocks = <&ahb_gates 21>, <&spi1_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 9>, <&dma 1 8>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 9>,
+                              <&dma SUN4I_DMA_DEDICATED 8>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <12>;
                        clocks = <&ahb_gates 22>, <&spi2_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 29>, <&dma 1 28>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 29>,
+                              <&dma SUN4I_DMA_DEDICATED 28>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <50>;
                        clocks = <&ahb_gates 23>, <&spi3_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 31>, <&dma 1 30>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 31>,
+                              <&dma SUN4I_DMA_DEDICATED 30>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
index 452b774..d0b7182 100644 (file)
@@ -13,6 +13,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/dma/sun4i-a10.h>
+
 / {
        interrupt-parent = <&intc>;
 
                        interrupts = <10>;
                        clocks = <&ahb_gates 20>, <&spi0_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 27>, <&dma 1 26>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 27>,
+                              <&dma SUN4I_DMA_DEDICATED 26>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <11>;
                        clocks = <&ahb_gates 21>, <&spi1_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 9>, <&dma 1 8>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 9>,
+                              <&dma SUN4I_DMA_DEDICATED 8>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <12>;
                        clocks = <&ahb_gates 22>, <&spi2_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 29>, <&dma 1 28>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 29>,
+                              <&dma SUN4I_DMA_DEDICATED 28>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
index 93f1c84..43441fc 100644 (file)
@@ -13,6 +13,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/dma/sun4i-a10.h>
+
 / {
        interrupt-parent = <&intc>;
 
                        interrupts = <10>;
                        clocks = <&ahb_gates 20>, <&spi0_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 27>, <&dma 1 26>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 27>,
+                              <&dma SUN4I_DMA_DEDICATED 26>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <11>;
                        clocks = <&ahb_gates 21>, <&spi1_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 9>, <&dma 1 8>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 9>,
+                              <&dma SUN4I_DMA_DEDICATED 8>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <12>;
                        clocks = <&ahb_gates 22>, <&spi2_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 29>, <&dma 1 28>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 29>,
+                              <&dma SUN4I_DMA_DEDICATED 28>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
index 8c05070..cd492ac 100644 (file)
@@ -49,6 +49,8 @@
 
 #include "skeleton.dtsi"
 
+#include <dt-bindings/dma/sun4i-a10.h>
+
 / {
        interrupt-parent = <&gic>;
 
                        interrupts = <0 10 4>;
                        clocks = <&ahb_gates 20>, <&spi0_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 27>, <&dma 1 26>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 27>,
+                              <&dma SUN4I_DMA_DEDICATED 26>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <0 11 4>;
                        clocks = <&ahb_gates 21>, <&spi1_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 9>, <&dma 1 8>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 9>,
+                              <&dma SUN4I_DMA_DEDICATED 8>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <0 12 4>;
                        clocks = <&ahb_gates 22>, <&spi2_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 29>, <&dma 1 28>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 29>,
+                              <&dma SUN4I_DMA_DEDICATED 28>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
                        interrupts = <0 50 4>;
                        clocks = <&ahb_gates 23>, <&spi3_clk>;
                        clock-names = "ahb", "mod";
-                       dmas = <&dma 1 31>, <&dma 1 30>;
+                       dmas = <&dma SUN4I_DMA_DEDICATED 31>,
+                              <&dma SUN4I_DMA_DEDICATED 30>;
                        dma-names = "rx", "tx";
                        status = "disabled";
                        #address-cells = <1>;
diff --git a/include/dt-bindings/dma/sun4i-a10.h b/include/dt-bindings/dma/sun4i-a10.h
new file mode 100644 (file)
index 0000000..8caba9e
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2014 Maxime Ripard
+ *
+ * Maxime Ripard <maxime.ripard@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this file; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __DT_BINDINGS_DMA_SUN4I_A10_H_
+#define __DT_BINDINGS_DMA_SUN4I_A10_H_
+
+#define SUN4I_DMA_NORMAL       0
+#define SUN4I_DMA_DEDICATED    1
+
+#endif /* __DT_BINDINGS_DMA_SUN4I_A10_H_ */