Skip to contentSkip to conversation

DMA engine driver for Freescale MPC85xx processors.

PATCH Superseded Zhang Wei 5 participants 21 messages Sep 7, 2007 – Sep 13, 2007

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Zhang Wei

author
#0 lore raw

cover DMA engine driver for Freescale MPC85xx processors.

Hi,

These patches are DMA engine driver for Freescale MPC85xx processors which the update for supporting new DMA engine API.

[PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file. [PATCH 2/5] Add Freescale DMA engine driver maintainer.
[PATCH 3/5] Add DMA of-node to mpc8641hpcn board dts
[PATCH 4/5] Add of-device and DMA bus support to MPC8641HPCN board.
[PATCH 5/5] Add DMA engine driver for Freescale MPC85xx processors.

Best Regards,
Zhang Wei

author
#1 lore raw

PATCH 1/5 Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

This patch adds Freescale DMA and DMA channel definition to Documentation/powerpc/booting-without-of.txt file.

---
 Documentation/powerpc/booting-without-of.txt |   67 ++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)
Documentation/powerpc/booting-without-of.txt +67 -0
index 76733a3..d114edf 100644
@@ -52,6 +52,8 @@ Table of Contents
       i) Freescale QUICC Engine module (QE)
       j) Flash chip nodes
       k) Global Utilities Block
+      l) Freescale DMA
+      m) Freescale DMA channel
 
   VII - Specifying interrupt information for devices
     1) interrupts property
@@ -1824,6 +1826,71 @@ platforms are moved over to use the flattened-device-tree model.
 		fsl,has-rstcr;
 	};
 
+   l) Freescale DMA
+
+   The DMA for dma-engine driver of Freescale MPC8540 silicon DMA
+   controller which also fit for MPC8560, MPC8555,
+   MPC8548, MPC8641 and MPC8349 silicon DMA controller,
+
+   For each DMA node, you should define channels included.
+   Please see below 'm) Freescale DMA channel' for DMA channel's definition.
+
+   Required properties:
+
+    - compatible : Should be "fsl,dma".
+    - reg : Offset and length of DMA general status register.
+    - ranges : Should be defined as specified in 1) to describe the
+               DMA controller channels.
+
+  Example:
+	dma@21000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "fsl,dma";
+		reg = <21300 4>;
+		ranges = <0 21100 200>;
+		dma-channel@0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,mpc8540-dma-channel";
+			reg = <0 80>;
+			interrupt-parent = <&mpic>;
+			interrupts = <14 2>;
+		};
+		dma-channel@80 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,mpc8540-dma-channel";
+			reg = <80 80>;
+			interrupt-parent = <&mpic>;
+			interrupts = <15 2>;
+		};
+		dma-channel@100 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,mpc8540-dma-channel";
+			reg = <100 80>;
+			interrupt-parent = <&mpic>;
+			interrupts = <16 2>;
+		};
+		dma-channel@180 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,mpc8540-dma-channel";
+			reg = <180 80>;
+			interrupt-parent = <&mpic>;
+			interrupts = <17 2>;
+		};
+	};
+
+   m) Freescale DMA channel
+
+   Required properties:
+
+    - compatible : Should be "fsl,mpc8540-dma-channel"
+                   or "fsl,mpc8349-dma-channel"
+    - reg : Offset and length of the register set for the DMA channel.
+
    More devices will be defined as this spec matures.
 
 VII - Specifying interrupt information for devices
Signature · 1 line
1.5.2
author
#2 lore raw

PATCH 2/5 Add Freescale DMA engine driver maintainer.

This patch adds Freescale DMA engine driver maintainer.

---
 MAINTAINERS |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
MAINTAINERS +7 -0
index 01f222e..1be4f23 100644
@@ -1527,6 +1527,13 @@ L:	[email protected] (subscribers-only)
 W:	http://linux-fbdev.sourceforge.net/
 S:	Maintained
 
+FREESCALE DMA DRIVER
+P;	Zhang Wei
+M:	[email protected]
+L:	[email protected]
+L:	[email protected]
+S:	Maintained
+
 FREESCALE SOC FS_ENET DRIVER
 P:	Pantelis Antoniou
 M:	[email protected]
Signature · 1 line
1.5.2
author
#3 lore raw

PATCH 3/5 Add DMA of-node to mpc8641hpcn board dts

This patch adds DMA of-node to MPC8641HPCN board dts.

---
 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   40 ++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/mpc8641_hpcn.dts +40 -0
index 5d82709..e0175a4 100644
@@ -433,5 +433,45 @@
 			device_type = "open-pic";
 			big-endian;
 		};
+
+		dma@21000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,dma";
+			reg = <21300 4>;
+			ranges = <0 21100 200>;
+			dma-channel@0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "fsl,mpc8540-dma-channel";
+				reg = <0 80>;
+				interrupt-parent = <&mpic>;
+				interrupts = <14 2>;
+			};
+			dma-channel@80 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "fsl,mpc8540-dma-channel";
+				reg = <80 80>;
+				interrupt-parent = <&mpic>;
+				interrupts = <15 2>;
+			};
+			dma-channel@100 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "fsl,mpc8540-dma-channel";
+				reg = <100 80>;
+				interrupt-parent = <&mpic>;
+				interrupts = <16 2>;
+			};
+			dma-channel@180 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "fsl,mpc8540-dma-channel";
+				reg = <180 80>;
+				interrupt-parent = <&mpic>;
+				interrupts = <17 2>;
+			};
+		};
 	};
 };
Signature · 1 line
1.5.2
author
#4 lore raw

PATCH 4/5 Add of-device and DMA bus support to MPC8641HPCN board.

This patch adds of-device and DMA device bus support to MPC8641HPCN board.

---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +17 -0
index e9eaa07..e141259 100644
@@ -18,6 +18,7 @@
 #include <linux/kdev_t.h>
 #include <linux/delay.h>
 #include <linux/seq_file.h>
+#include <linux/of_platform.h>
 
 #include <asm/system.h>
 #include <asm/time.h>
@@ -444,3 +445,19 @@ define_machine(mpc86xx_hpcn) {
 	.progress		= udbg_progress,
 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
 };
+
+static struct of_device_id mpc86xx_of_ids[] = {
+	{ .type = "soc", },
+	{ .compatible = "fsl,dma", },
+	{},
+};
+
+static __init int mpc86xx_of_device_init(void)
+{
+	if (!machine_is(mpc86xx_hpcn))
+		return 0;
+
+	return of_platform_bus_probe(NULL, mpc86xx_of_ids, NULL);
+}
+
+device_initcall(mpc86xx_of_device_init);
Signature · 1 line
1.5.2
#5 lore raw

Re: [PATCH 3/5] Add DMA of-node to mpc8641hpcn board dts

In reply to Zhang Wei
Quoted 16 lines · Zhang Wei

This patch adds DMA of-node to MPC8641HPCN board dts.

---
 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   40 ++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)
arch/powerpc/boot/dts/mpc8641_hpcn.dts +0 -0
index 5d82709..e0175a4 100644
@@ -433,5 +433,45 @@
 			device_type = "open-pic";
 			big-endian;
 		};

arch/powerpc/boot/dts/mpc8641_hpcn.dts line 445

Quoted 10 lines
arch/powerpc/boot/dts/mpc8641_hpcn.dts +10 -0
+
+		dma@21000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,dma";
+			reg = <21300 4>;
+			ranges = <0 21100 200>;
+			dma-channel@0 {
+				#address-cells = <1>;
+				#size-cells = <1>;

The channels aren't buses; only the parent dma node needs #address-cells and #size-cells.

-Scott

#6 lore raw

Re: [PATCH 2/5] Add Freescale DMA engine driver maintainer.

In reply to Zhang Wei
Quoted 1 line · Zhang Wei

This patch adds Freescale DMA engine driver maintainer.

This is meaningless without the actual driver, so it shouldn't be a separate patch. Fold it into the patch that actually adds the driver support.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#7 lore raw

RE: [PATCH 2/5] Add Freescale DMA engine driver maintainer.

I'll merge them.

Thanks!=20
- zw

Quoted 22 lines

-----Original Message-----
From: David Gibson [mailto:[email protected]]=20
Sent: Monday, September 10, 2007 11:28 AM
To: Zhang Wei-r63237
Cc: [email protected]; [email protected]
Subject: Re: [PATCH 2/5] Add Freescale DMA engine driver maintainer. =20

Quoted 1 line · Zhang Wei

This patch adds Freescale DMA engine driver maintainer.

=20
This is meaningless without the actual driver, so it shouldn't be a separate patch. Fold it into the patch that actually adds the driver support.
=20
--=20
David Gibson | I'll have my music baroque,=20
and my code
david AT gibson.dropbear.id.au | minimalist, thank=20
you. NOT _the_ _other_

				| _way_ _around_!

http://www.ozlabs.org/~dgibson
=20

#8 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

In reply to Zhang Wei

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1840

Quoted 3 lines
Documentation/powerpc/booting-without-of.txt +2 -0
+   l) Freescale DMA
 
+    - compatible : Should be "fsl,dma".

Please choose some more specific name. "fsl,mpc8540-dma" would be a reasonable choice perhaps.

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1850

Quoted 7 lines
Documentation/powerpc/booting-without-of.txt +7 -0
+    - reg : Offset and length of DMA general status register.
+    - ranges : Should be defined as specified in 1) to describe the
+               DMA controller channels.
+
+  Example:
+	dma@21000 {
+		reg = <21300 4>;

Those don't agree. It's probably best to describe the whole DMA controller register block in this node. Why do you need subnodes for the channels at all?

Segher

#9 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

Quoted 3 lines · Segher Boessenkool

Those don't agree. It's probably best to describe the whole DMA controller register block in this node. Why do you need subnodes for the channels at all?

The channels have separate registers and sometimes separate interrupts -- it's simpler to bind to a channel at a time than to parse a list of reg blocks and interrupts. It's also more flexible in case a new chip comes out with more/fewer channels, or if certain channels are not general purpose.

-Scott

#10 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

Quoted 10 lines
Quoted 3 lines

Those don't agree. It's probably best to describe the whole DMA controller register block in this node. Why do you need subnodes for the channels at all?

The channels have separate registers and sometimes separate interrupts --
it's simpler to bind to a channel at a time than to parse a list of reg blocks and interrupts. It's also more flexible in case a new chip comes out with more/fewer channels, or if certain channels are not general purpose.

I don't see this as more flexible, but no problem, it will work for sure.

The "reg" vs. textual unit address issue needs to be solved though.

Segher

#11 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

In reply to Segher Boessenkool
Quoted 6 lines · Segher Boessenkool

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1840

Quoted 3 lines
Documentation/powerpc/booting-without-of.txt +2 -0
+   l) Freescale DMA
 
+    - compatible : Should be "fsl,dma".

Please choose some more specific name. "fsl,mpc8540-dma" would be a reasonable choice perhaps.

More precisely, the compatible property should always have an specific entry based on the exact chip the DMA engine resides in, as well as a more general entry for any fsl dma engine of this type.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#12 lore raw

RE: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

=20

Quoted 5 lines

=20

Quoted 3 lines · Segher Boessenkool
Quoted 1 line

+ l) Freescale DMA

=20

Quoted 1 line

+ - compatible : Should be "fsl,dma".

Quoted 8 lines
Quoted 3 lines

=20
Please choose some more specific name. "fsl,mpc8540-dma" would be a reasonable choice perhaps.

=20
More precisely, the compatible property should always have an specific entry based on the exact chip the DMA engine resides in, as well as a more general entry for any fsl dma engine of this type.
=20

There is only difference in DMA channel and not in DMA node now. Does it need add the precise compatible property name?

Thanks!
- zw

#13 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

Quoted 11 lines · On Tue, Sep 11, 2007 at 06:01:39PM +0800, Zhang Wei-r63237 wrote:
Quoted 11 lines · Segher Boessenkool
Quoted 6 lines

Documentation/powerpc/booting-without-of.txt platforms are moved over to use the flattened-device-tree model. · line 1840

Quoted 3 lines
Documentation/powerpc/booting-without-of.txt +2 -0
+   l) Freescale DMA
 
+    - compatible : Should be "fsl,dma".

Please choose some more specific name. "fsl,mpc8540-dma" would be a reasonable choice perhaps.

Quoted 6 lines
Quoted 4 lines

More precisely, the compatible property should always have an specific entry based on the exact chip the DMA engine resides in, as well as a more general entry for any fsl dma engine of this type.

There is only difference in DMA channel and not in DMA node now. Does it need add the precise compatible property name?

Yes. First of all, there most likely is a difference -- the endianness of the shared status summary register. Secondly, the device tree should not make assumptions as far as whether the user is going to bind to individual channels or the whole controller.

-Scott

#14 lore raw

RE: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

Quoted 18 lines
Quoted 2 lines
Quoted 2 lines

=20
On Fri, Sep 07, 2007 at 04:43:35PM +0200, Segher=20

Quoted 8 lines · Boessenkool
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

+ l) Freescale DMA

=20

Quoted 1 line

+ - compatible : Should be "fsl,dma".

=20
Please choose some more specific name. "fsl,mpc8540-dma" would be a reasonable choice perhaps.

=20
More precisely, the compatible property should always=20

have an specific

Quoted 1 line
Quoted 1 line

entry based on the exact chip the DMA engine resides in,=20

as well as a

Quoted 3 lines
Quoted 2 lines

more general entry for any fsl dma engine of this type. =20

There is only difference in DMA channel and not in DMA node=20

now. Does it

Quoted 8 lines
Quoted 1 line

need add the precise compatible property name?

=20
Yes. First of all, there most likely is a difference -- the=20 endianness
of the shared status summary register. Secondly, the device=20 tree should
not make assumptions as far as whether the user is going to bind to individual channels or the whole controller.

I have a strange issue here. If I rename 'fsl,dma' to 'fsl,mpc8540-dma', the 'fsl,mpc8540-dma-channel' will be also regarded as DMA device not DMA channel.

Thanks!
- zw

#15 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

Quoted 3 lines · On Wed, Sep 12, 2007 at 03:13:09AM -0700, Zhang Wei-r63237 wrote:

I have a strange issue here. If I rename 'fsl,dma' to 'fsl,mpc8540-dma', the 'fsl,mpc8540-dma-channel' will be also regarded as DMA device not DMA channel.

What tree are you using? Commit 804ace8881d211ac448082e871dd312132393049 in Paul's git tree should have fixed that.

-Scott

#16 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

Quoted 6 lines
Quoted 3 lines

I have a strange issue here. If I rename 'fsl,dma' to 'fsl,mpc8540-dma', the 'fsl,mpc8540-dma-channel' will be also regarded as DMA device not DMA channel.

What tree are you using? Commit 804ace8881d211ac448082e871dd312132393049 in Paul's git tree should have fixed that.

Strange, I don't see that commit -- maybe gitweb is broken, or maybe the patch was superseded, or maybe it just disappeared? It's still shown in patchworks with this commit id fwiw.

Segher

#17 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

Quoted 5 lines · Segher Boessenkool
Quoted 5 lines
Quoted 4 lines

I have a strange issue here. If I rename 'fsl,dma' to 'fsl,mpc8540-dma',
the 'fsl,mpc8540-dma-channel' will be also regarded as DMA device not DMA channel.

Quoted 7 lines
Quoted 3 lines

What tree are you using? Commit
804ace8881d211ac448082e871dd312132393049
in Paul's git tree should have fixed that.

Strange, I don't see that commit -- maybe gitweb is broken, or maybe the patch was superseded, or maybe it just disappeared? It's still shown in patchworks with this commit id fwiw.

I see it here:
http://git.kernel.org/?p=linux/kernel/git/paulus/powerpc.git;a=commit;h=804ace8881d211ac448082e871dd312132393049

-Scott

#18 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

Quoted 5 lines · Scott Wood
Quoted 4 lines · Segher Boessenkool
Quoted 4 lines
Quoted 4 lines

I have a strange issue here. If I rename 'fsl,dma' to 'fsl,mpc8540-dma',
the 'fsl,mpc8540-dma-channel' will be also regarded as DMA device not DMA channel.

Have we closed on what the device-tree parts for this should look like? I'd like to at least get those parts of this patch into my tree if possible for 2.6.24.

- k

#19 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

In reply to Scott Wood
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

What tree are you using? Commit
804ace8881d211ac448082e871dd312132393049
in Paul's git tree should have fixed that.

Strange, I don't see that commit -- maybe gitweb is broken, or maybe the patch was superseded, or maybe it just disappeared? It's still shown in patchworks with this commit id fwiw.

I see it here:
http://git.kernel.org/?p=linux/kernel/git/paulus/powerpc.git;a=commit;h=804ace8881d211ac448082e871dd312132393049

Ah okay. The gitweb search functionality is broken.

Shouldn't this patch have gone to .23? It's a pretty important bugfix I think.

Segher

#20 lore raw

Re: [PATCH 1/5] Add Freescale DMA and DMA channel to Documentation/powerpc/booting-without-of.txt file.

Quoted 8 lines · Segher Boessenkool
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

What tree are you using? Commit
804ace8881d211ac448082e871dd312132393049
in Paul's git tree should have fixed that.

Strange, I don't see that commit -- maybe gitweb is broken, or maybe the patch was superseded, or maybe it just disappeared? It's still shown in patchworks with this commit id fwiw.

Quoted 8 lines
Quoted 3 lines

I see it here:
http://git.kernel.org/?p=linux/kernel/git/paulus/powerpc.git;a=commit;h=804ace8881d211ac448082e871dd312132393049

Ah okay. The gitweb search functionality is broken.

Shouldn't this patch have gone to .23? It's a pretty important bugfix I think.

Probably not, in the absence of a specific failing match that's already in .23. It has the potential to break things that were working by chance.

-Scott