Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1232286 > unrolled thread

[PATCH v3 0/3] powerpc/512x: add LocalPlus Bus FIFO device driver

Started byAlexander Popov <alex.popov@linux.com>
First post2015-09-24 19:30 +0200
Last post2015-09-29 08:40 +0200
Articles 6 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 0/3] powerpc/512x: add LocalPlus Bus FIFO device driver Alexander Popov <alex.popov@linux.com> - 2015-09-24 19:30 +0200
    [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO Alexander Popov <alex.popov@linux.com> - 2015-09-24 19:30 +0200
      Re: [PATCH v3 2/3] powerpc/512x: add a device tree binding for  LocalPlus Bus FIFO Timur Tabi <timur@tabi.org> - 2015-09-25 02:20 +0200
        Re: [PATCH v3 2/3] powerpc/512x: add a device tree binding for  LocalPlus Bus FIFO Alexander Popov <alex.popov@linux.com> - 2015-09-28 15:40 +0200
          Re: [PATCH v3 2/3] powerpc/512x: add a device tree binding for  LocalPlus Bus FIFO Timur Tabi <timur@tabi.org> - 2015-09-28 15:40 +0200
            Re: [PATCH v3 2/3] powerpc/512x: add a device tree binding for  LocalPlus Bus FIFO Alexander Popov <alex.popov@linux.com> - 2015-09-29 08:40 +0200

#1232286 — [PATCH v3 0/3] powerpc/512x: add LocalPlus Bus FIFO device driver

FromAlexander Popov <alex.popov@linux.com>
Date2015-09-24 19:30 +0200
Subject[PATCH v3 0/3] powerpc/512x: add LocalPlus Bus FIFO device driver
Message-ID<qcivg-1fu-21@gated-at.bofh.it>
This driver for Freescale MPC512x LocalPlus Bus FIFO (called SCLPC
in the Reference Manual) allows Direct Memory Access transfers
between RAM and peripheral devices on LocalPlus Bus.

Changes in v3:
 - resource usage in probe() is fixed;
 - driver methods are made safe against remove();
 - dma_request_slave_channel() is used to get DMA channel number from
    the device tree;
 - chip select number concerned with the DMA transaction is determined
    from 'localbus' device tree node information;
 - register set is described as a structure;
 - symbolic names are given to shift counts to keep magic numbers
    out of the code;
 - choosing values for LPBFIFO BPT (bytes per transfer) and DMA maxburst
    is improved, so DMA transfer size has increased for some cases;
 - device tree binding for LPBFIFO is documented;
 - Kconfig and Makefile are improved;
 - email address "a13xp0p0v88@gmail.com" is changed to a more pleasant
    alias "alex.popov@linux.com";

Alexander Popov (3):
  powerpc/512x: add LocalPlus Bus FIFO device driver
  powerpc/512x: add a device tree binding for LocalPlus Bus FIFO
  dmaengine: mpc512x: initialize with subsys_initcall()

 .../bindings/powerpc/fsl/mpc512x_lpbfifo.txt       |  21 +
 arch/powerpc/boot/dts/mpc5121.dtsi                 |  11 +-
 arch/powerpc/boot/dts/mpc5125twr.dts               |  11 +-
 arch/powerpc/configs/mpc512x_defconfig             |   1 +
 arch/powerpc/include/asm/mpc5121.h                 |  59 +++
 arch/powerpc/platforms/512x/Kconfig                |   6 +
 arch/powerpc/platforms/512x/Makefile               |   1 +
 arch/powerpc/platforms/512x/mpc512x_lpbfifo.c      | 560 +++++++++++++++++++++
 drivers/dma/mpc512x_dma.c                          |  12 +-
 9 files changed, 678 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/mpc512x_lpbfifo.txt
 create mode 100644 arch/powerpc/platforms/512x/mpc512x_lpbfifo.c

-- 
1.9.1

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

[toc] | [next] | [standalone]


#1232290 — [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO

FromAlexander Popov <alex.popov@linux.com>
Date2015-09-24 19:30 +0200
Subject[PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO
Message-ID<qcivh-1fu-37@gated-at.bofh.it>
In reply to#1232286
Add a device tree binding for Freescale MPC512x LocalPlus Bus FIFO and
introduce the document describing that binding.

Signed-off-by: Alexander Popov <alex.popov@linux.com>
---
 .../bindings/powerpc/fsl/mpc512x_lpbfifo.txt        | 21 +++++++++++++++++++++
 arch/powerpc/boot/dts/mpc5121.dtsi                  | 11 +++++++++--
 arch/powerpc/boot/dts/mpc5125twr.dts                | 11 ++++++++++-
 3 files changed, 40 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/mpc512x_lpbfifo.txt

diff --git a/Documentation/devicetree/bindings/powerpc/fsl/mpc512x_lpbfifo.txt b/Documentation/devicetree/bindings/powerpc/fsl/mpc512x_lpbfifo.txt
new file mode 100644
index 0000000..b3b392f
--- /dev/null
+++ b/Documentation/devicetree/bindings/powerpc/fsl/mpc512x_lpbfifo.txt
@@ -0,0 +1,21 @@
+Freescale MPC512x LocalPlus Bus FIFO (called SCLPC in the Reference Manual)
+
+Required properties:
+- compatible: should be "fsl,mpc512x-lpbfifo";
+- reg: should contain the offset and length of SCLPC register set;
+- interrupts: should contain the interrupt specifier for SCLPC; syntax of an
+    interrupt client node is described in interrupt-controller/interrupts.txt;
+- dmas: should contain the DMA specifier for SCLPC as described at
+    dma/dma.txt and dma/mpc512x-dma.txt;
+- dma-names: should be "rx-tx";
+
+Example:
+
+	sclpc@10100 {
+		compatible = "fsl,mpc512x-lpbfifo";
+		reg = <0x10100 0x50>;
+		interrupts = <7 0x8>;
+		dmas = <&dma0 26>;
+		dma-names = "rx-tx";
+	};
+
diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi b/arch/powerpc/boot/dts/mpc5121.dtsi
index 7f9d14f..a015e45 100644
--- a/arch/powerpc/boot/dts/mpc5121.dtsi
+++ b/arch/powerpc/boot/dts/mpc5121.dtsi
@@ -77,7 +77,6 @@
 		#address-cells = <2>;
 		#size-cells = <1>;
 		reg = <0x80000020 0x40>;
-		interrupts = <7 0x8>;
 		ranges = <0x0 0x0 0xfc000000 0x04000000>;
 	};
 
@@ -329,7 +328,15 @@
 		/* LocalPlus controller */
 		lpc@10000 {
 			compatible = "fsl,mpc5121-lpc";
-			reg = <0x10000 0x200>;
+			reg = <0x10000 0x100>;
+		};
+
+		sclpc@10100 {
+			compatible = "fsl,mpc512x-lpbfifo";
+			reg = <0x10100 0x50>;
+			interrupts = <7 0x8>;
+			dmas = <&dma0 26>;
+			dma-names = "rx-tx";
 		};
 
 		pata@10200 {
diff --git a/arch/powerpc/boot/dts/mpc5125twr.dts b/arch/powerpc/boot/dts/mpc5125twr.dts
index e4f2974..898eb58 100644
--- a/arch/powerpc/boot/dts/mpc5125twr.dts
+++ b/arch/powerpc/boot/dts/mpc5125twr.dts
@@ -246,6 +246,14 @@
 			status = "disabled";
 		};
 
+		sclpc@10100 {
+			compatible = "fsl,mpc512x-lpbfifo";
+			reg = <0x10100 0x50>;
+			interrupts = <7 0x8>;
+			dmas = <&dma0 26>;
+			dma-names = "rx-tx";
+		};
+
 		// 5125 PSCs are not 52xx or 5121 PSC compatible
 		// PSC1 uart0 aka ttyPSC0
 		serial@11100 {
@@ -279,10 +287,11 @@
 			clock-names = "ipg";
 		};
 
-		dma@14000 {
+		dma0: dma@14000 {
 			compatible = "fsl,mpc5121-dma"; // BSP name: "mpc512x-dma2"
 			reg = <0x14000 0x1800>;
 			interrupts = <65 0x8>;
+			#dma-cells = <1>;
 		};
 	};
 };
-- 
1.9.1

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

[toc] | [prev] | [next] | [standalone]


#1232504 — Re: [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO

FromTimur Tabi <timur@tabi.org>
Date2015-09-25 02:20 +0200
SubjectRe: [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO
Message-ID<qcoU2-22j-7@gated-at.bofh.it>
In reply to#1232290
Alexander Popov wrote:
> +- dma-names: should be "rx-tx";

Why bother, if it can only be one value?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1234157 — Re: [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO

FromAlexander Popov <alex.popov@linux.com>
Date2015-09-28 15:40 +0200
SubjectRe: [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO
Message-ID<qdGOU-Rc-37@gated-at.bofh.it>
In reply to#1232504
On 25.09.2015 03:18, Timur Tabi wrote:
> Alexander Popov wrote:
>> +- dma-names: should be "rx-tx";
> 
> Why bother, if it can only be one value?

I've just followed devicetree/bindings/dma/dma.txt...
This "rx-tx" doesn't mean much but it could show that LocalPlus Bus FIFO
uses a single DMA read-write channel. Should I really drop it?

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

[toc] | [prev] | [next] | [standalone]


#1234160 — Re: [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO

FromTimur Tabi <timur@tabi.org>
Date2015-09-28 15:40 +0200
SubjectRe: [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO
Message-ID<qdGOU-Rc-39@gated-at.bofh.it>
In reply to#1234157
Alexander Popov wrote:
> I've just followed devicetree/bindings/dma/dma.txt...
> This "rx-tx" doesn't mean much but it could show that LocalPlus Bus FIFO
> uses a single DMA read-write channel. Should I really drop it?

Hmmm, I'm not sure.  Is there anything else (besides your driver) that 
parses this device tree node?

dma.txt says this:

	"The specific strings that can be used are defined in the binding of 
the DMA client device."

So this looks like it's driver-specific, but it is a required property.
I guess you should keep it, but I think you should get a second opinion.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1234744 — Re: [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO

FromAlexander Popov <alex.popov@linux.com>
Date2015-09-29 08:40 +0200
SubjectRe: [PATCH v3 2/3] powerpc/512x: add a device tree binding for LocalPlus Bus FIFO
Message-ID<qdWJY-6XG-19@gated-at.bofh.it>
In reply to#1234160
On 28.09.2015 16:26, Timur Tabi wrote:
> Alexander Popov wrote:
>> I've just followed devicetree/bindings/dma/dma.txt...
>> This "rx-tx" doesn't mean much but it could show that LocalPlus Bus FIFO
>> uses a single DMA read-write channel. Should I really drop it?
> 
> Hmmm, I'm not sure.  Is there anything else (besides your driver) that
> parses this device tree node?

No, mpc512x_lpbfifo.c is the only piece of code which is going to use this
device tree node.

> dma.txt says this:
> 
>     "The specific strings that can be used are defined in the binding of the
> DMA client device."
> 
> So this looks like it's driver-specific,

Yes.
MPC512x LocalPlus Bus FIFO uses the channel #26 of the DMA controller
both for reading and writing, and other DMA clients use other specific
DMA channels. This channel assignment is fixed in hardware and described
in the Reference Manual.

> but it is a required property.
> I guess you should keep it, but I think you should get a second opinion.

Ok, thanks.

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web