Skip to contentSkip to conversation

MPC8568E-MDS: create localbus node

RFC PATCH Superseded Anton Vorontsov 5 participants 12 messages Oct 15, 2007 – Oct 16, 2007

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/2 MPC8568E-MDS: create localbus node

This patch creates localbus node, moves bcsr into it, and adds localbus to the probe path.

---

Patch is against galak/powerpc.git master branch.

 arch/powerpc/boot/dts/mpc8568mds.dts      |   14 +++++++++++---
 arch/powerpc/platforms/85xx/mpc85xx_mds.c |    1 +
 2 files changed, 12 insertions(+), 3 deletions(-)
arch/powerpc/boot/dts/mpc8568mds.dts +11 -3
index 5439437..296adc3 100644
@@ -42,9 +42,17 @@
 		reg = <00000000 10000000>;
 	};
 
-	bcsr@f8000000 {
-		device_type = "board-control";
-		reg = <f8000000 8000>;
+	localbus@f0000000 {
+		compatible = "fsl,mpc8568mds-localbus";
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <f0000000 10000000>;
+		ranges = <0 0 f8000000 0008000>;
+
+		bcsr@0,0 {
+			device_type = "board-control";
+			reg = <0 0 8000>;
+		};
 	};
 
 	soc8568@e0000000 {
arch/powerpc/platforms/85xx/mpc85xx_mds.c +1 -0
index 61b3eed..0cf994b 100644
@@ -139,6 +139,7 @@ static struct of_device_id mpc85xx_ids[] = {
 	{ .type = "soc", },
 	{ .compatible = "soc", },
 	{ .type = "qe", },
+	{ .compatible = "fsl,mpc8568mds-localbus", },
 	{},
 };
 
Signature · 1 line
1.5.0.6
#1 lore raw
Quoted 10 lines · Anton Vorontsov

This patch creates localbus node, moves bcsr into it, and adds localbus to the probe path.

arch/powerpc/boot/dts/mpc8568mds.dts +0 -0
index 5439437..296adc3 100644

arch/powerpc/boot/dts/mpc8568mds.dts line 46

Quoted 8 lines
arch/powerpc/boot/dts/mpc8568mds.dts +2 -3
@@ -42,9 +42,17 @@
 		reg = <00000000 10000000>;
 	};
 
-	bcsr@f8000000 {
-		device_type = "board-control";
-		reg = <f8000000 8000>;
+	localbus@f0000000 {
+		compatible = "fsl,mpc8568mds-localbus";

Is the entity described as "localbus" indeed so *board* specific?

arch/powerpc/boot/dts/mpc8568mds.dts line 50

Quoted 4 lines
arch/powerpc/boot/dts/mpc8568mds.dts +4 -0
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <f0000000 10000000>;
+		ranges = <0 0 f8000000 0008000>;

Isn't that range a part of "reg"?

arch/powerpc/boot/dts/mpc8568mds.dts line 58

Quoted 8 lines
arch/powerpc/boot/dts/mpc8568mds.dts +5 -0
+
+		bcsr@0,0 {
+			device_type = "board-control";
+			reg = <0 0 8000>;
+		};
 	};
 
 	soc8568@e0000000 {

WBR, Sergei

#2 lore raw
Quoted 7 lines · Sergei Shtylyov
Quoted 4 lines · Anton Vorontsov

This patch creates localbus node, moves bcsr into it, and adds localbus to the probe path.

Quoted 9 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 44

Quoted 9 lines
arch/powerpc/boot/dts/mpc8568mds.dts +0 -0
index 5439437..296adc3 100644
@@ -42,9 +42,17 @@
 		reg = <00000000 10000000>;
 	};
 -	bcsr@f8000000 {

Heh, this is wrong.

Quoted 6 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 46

Quoted 4 lines
arch/powerpc/boot/dts/mpc8568mds.dts +2 -2
-		device_type = "board-control";
-		reg = <f8000000 8000>;
+	localbus@f0000000 {
+		compatible = "fsl,mpc8568mds-localbus";

Is the entity described as "localbus" indeed so *board* specific?

That's what booting-without-of.txt gives as an example.

Quoted 6 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 50

Quoted 4 lines
arch/powerpc/boot/dts/mpc8568mds.dts +4 -0
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <f0000000 10000000>;
+		ranges = <0 0 f8000000 0008000>;

Isn't that range a part of "reg"?

Heh. Right you are.

Quoted 2 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 52

Quoted 2 lines
arch/powerpc/boot/dts/mpc8568mds.dts +2 -0
+
+		bcsr@0,0 {

Hrm, wrong.

Quoted 7 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 58

Quoted 5 lines
arch/powerpc/boot/dts/mpc8568mds.dts +3 -0
+			device_type = "board-control";
+			reg = <0 0 8000>;
+		};
 	};
  	soc8568@e0000000 {

WBR, Sergei

I'll repost fixed version shortly.

Thanks,

Signature · 4 lines
Anton Vorontsov
email: [email protected]
backup email: [email protected]
irc://irc.freenode.net/bd2
#3 lore raw

RFC PATCH v2 1/2 MPC8568E-MDS: create localbus node

This patch creates localbus node, moves bcsr into it, and adds localbus to the probe path.

---

Notice that localbus control registers are in the soc address space, but ranges are not. Just the same situation as with PCI nodes.

Patch is against galak/powerpc.git master branch.

 arch/powerpc/boot/dts/mpc8568mds.dts      |   14 +++++++++++---
 arch/powerpc/platforms/85xx/mpc85xx_mds.c |    1 +
 2 files changed, 12 insertions(+), 3 deletions(-)
arch/powerpc/boot/dts/mpc8568mds.dts +11 -3
index 5439437..8e15dba 100644
@@ -42,9 +42,17 @@
 		reg = <00000000 10000000>;
 	};
 
-	bcsr@f8000000 {
-		device_type = "board-control";
-		reg = <f8000000 8000>;
+	localbus@e0005000 {
+		compatible = "fsl,mpc8568mds-localbus";
+		#address-cells = <2>;
+		#size-cells = <1>;
+		reg = <e0005000 d8>;
+		ranges = <1 0 f8000000 0008000>;
+
+		bcsr@1,0 {
+			device_type = "board-control";
+			reg = <1 0 8000>;
+		};
 	};
 
 	soc8568@e0000000 {
arch/powerpc/platforms/85xx/mpc85xx_mds.c +1 -0
index 61b3eed..0cf994b 100644
@@ -139,6 +139,7 @@ static struct of_device_id mpc85xx_ids[] = {
 	{ .type = "soc", },
 	{ .compatible = "soc", },
 	{ .type = "qe", },
+	{ .compatible = "fsl,mpc8568mds-localbus", },
 	{},
 };
 
Signature · 1 line
1.5.0.6
#4 lore raw

PATCH v2 2/2 MPC8568E-MDS: add support for flash

In reply to Anton Vorontsov

MPC8568E-MDS have 1 32MB Spansion x16 CFI flash chip. Let's use it.

---

Patch is against galak/powerpc.git master branch.

 arch/powerpc/boot/dts/mpc8568mds.dts |   35 +++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)
arch/powerpc/boot/dts/mpc8568mds.dts +34 -1
index 8e15dba..1198363 100644
@@ -47,12 +47,45 @@
 		#address-cells = <2>;
 		#size-cells = <1>;
 		reg = <e0005000 d8>;
-		ranges = <1 0 f8000000 0008000>;
+		ranges = <1 0 f8000000 0008000
+			  0 0 fe000000 2000000>;
 
 		bcsr@1,0 {
 			device_type = "board-control";
 			reg = <1 0 8000>;
 		};
+
+		flash@0,0 {
+			compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash";
+			reg = <0 0 2000000>;
+			probe-type = "CFI";
+			bank-width = <2>;
+			device-width = <1>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			hrcw@0 {
+				label = "hrcw";
+				reg = <0 20001>;
+				read-only;
+			};
+
+			kernel@20000 {
+				label = "kernel";
+				reg = <20000 200000>;
+			};
+
+			rootfs@220000 {
+				label = "rootfs";
+				reg = <220000 1d60000>;
+			};
+
+			uboot@1f80000 {
+				label = "u-boot";
+				reg = <1f80000 80000>;
+				read-only;
+			};
+		};
 	};
 
 	soc8568@e0000000 {
Signature · 1 line
1.5.0.6
#5 lore raw

Re: [PATCH v2 2/2] [POWERPC] MPC8568E-MDS: add support for flash

Quoted 15 lines · Anton Vorontsov

MPC8568E-MDS have 1 32MB Spansion x16 CFI flash chip. Let's use it.

arch/powerpc/boot/dts/mpc8568mds.dts +2 -1
index 8e15dba..1198363 100644
@@ -47,12 +47,45 @@
 		#address-cells = <2>;
 		#size-cells = <1>;
 		reg = <e0005000 d8>;
-		ranges = <1 0 f8000000 0008000>;
+		ranges = <1 0 f8000000 0008000
+			  0 0 fe000000 2000000>;

arch/powerpc/boot/dts/mpc8568mds.dts line 61

Quoted 10 lines
arch/powerpc/boot/dts/mpc8568mds.dts +5 -0
 
 		bcsr@1,0 {
 			device_type = "board-control";
 			reg = <1 0 8000>;
 		};
+
+		flash@0,0 {
+			compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash";
+			reg = <0 0 2000000>;
+			probe-type = "CFI";

I don't get it -- has physmap_of.c rewrite been already committed?
If yes, you don't need probe_type; if no, your "compatible" won't work... Well, I see that the driver rewrite has been committed (when I wasn't looking 8-)...

arch/powerpc/boot/dts/mpc8568mds.dts line 69

Quoted 8 lines
arch/powerpc/boot/dts/mpc8568mds.dts +8 -0
+			bank-width = <2>;
+			device-width = <1>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			hrcw@0 {
+				label = "hrcw";
+				reg = <0 20001>;

What?! Odd sized partition? Don't try to follow both the old and new
partition device tree specs -- you'll only get yourself into trouble with this. The size-cell doesn't bear r/o flag in the new paritions spec.

Quoted 7 lines
arch/powerpc/boot/dts/mpc8568mds.dts +7 -0
+				read-only;
+			};
+
+			kernel@20000 {
+				label = "kernel";
+				reg = <20000 200000>;
+			};

arch/powerpc/boot/dts/mpc8568mds.dts line 86

Quoted 10 lines
arch/powerpc/boot/dts/mpc8568mds.dts +10 -0
+
+			rootfs@220000 {
+				label = "rootfs";
+				reg = <220000 1d60000>;
+			};
+
+			uboot@1f80000 {
+				label = "u-boot";
+				reg = <1f80000 80000>;
+				read-only;

Well, this is not even consistent... :-)

arch/powerpc/boot/dts/mpc8568mds.dts line 89

Quoted 3 lines
arch/powerpc/boot/dts/mpc8568mds.dts +2 -0
+			};
+		};
 	};

WBR, Sergei

#6 lore raw

Re: [PATCH v2 2/2] [POWERPC] MPC8568E-MDS: add support for flash

Quoted 18 lines · Sergei Shtylyov
Quoted 16 lines · Anton Vorontsov

MPC8568E-MDS have 1 32MB Spansion x16 CFI flash chip. Let's use it.

arch/powerpc/boot/dts/mpc8568mds.dts +2 -1
index 8e15dba..1198363 100644
@@ -47,12 +47,45 @@
 		#address-cells = <2>;
 		#size-cells = <1>;
 		reg = <e0005000 d8>;
-		ranges = <1 0 f8000000 0008000>;
+		ranges = <1 0 f8000000 0008000
+			  0 0 fe000000 2000000>;
 
Quoted 14 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 61

Quoted 9 lines
arch/powerpc/boot/dts/mpc8568mds.dts +5 -0
 		bcsr@1,0 {
 			device_type = "board-control";
 			reg = <1 0 8000>;
 		};
+
+		flash@0,0 {
+			compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash";
+			reg = <0 0 2000000>;
+			probe-type = "CFI";

I don't get it -- has physmap_of.c rewrite been already committed?
If yes, you don't need probe_type; if no, your "compatible" won't work... Well, I see that the driver rewrite has been committed (when I wasn't looking 8-)...

Any NOR flash nodes should conform to the "new" bindings from David Gibson, et al. Not sure about the status of those being in physmap_of.c w/regards to 2.6.24.

- k

#7 lore raw

Re: [PATCH v2 2/2] [POWERPC] MPC8568E-MDS: add support for flash

Quoted 39 lines · Kumar Gala
Quoted 19 lines · Sergei Shtylyov
Quoted 17 lines · Anton Vorontsov

MPC8568E-MDS have 1 32MB Spansion x16 CFI flash chip. Let's use it.

arch/powerpc/ renamed from arch/powerpc/boot/dts/mpc8568mds.dts +0 -0

boot/dts/mpc8568mds.dts
index 8e15dba..1198363 100644

arch/powerpc/boot/dts/mpc8568mds.dts +2 -1
@@ -47,12 +47,45 @@
 		#address-cells = <2>;
 		#size-cells = <1>;
 		reg = <e0005000 d8>;
-		ranges = <1 0 f8000000 0008000>;
+		ranges = <1 0 f8000000 0008000
+			  0 0 fe000000 2000000>;
 
Quoted 16 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 61

Quoted 9 lines
arch/powerpc/boot/dts/mpc8568mds.dts +5 -0
 		bcsr@1,0 {
 			device_type = "board-control";
 			reg = <1 0 8000>;
 		};
+
+		flash@0,0 {
+			compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash";
+			reg = <0 0 2000000>;
+			probe-type = "CFI";

I don't get it -- has physmap_of.c rewrite been already committed?
If yes, you don't need probe_type; if no, your "compatible" won't work...
Well, I see that the driver rewrite has been committed (when I wasn't looking
8-)...

Quoted 3 lines

Any NOR flash nodes should conform to the "new" bindings from David Gibson, et al. Not sure about the status of those being in physmap_of.c w/regards to 2.6.24.

Yes, in which case probe_type should be dropped, as should the low bit in the read-only partitions.

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
#8 lore raw

Re: [PATCH v2 2/2] [POWERPC] MPC8568E-MDS: add support for flash

In reply to Sergei Shtylyov
Quoted 22 lines · Sergei Shtylyov
Quoted 20 lines · Anton Vorontsov

MPC8568E-MDS have 1 32MB Spansion x16 CFI flash chip. Let's use it.

arch/powerpc/boot/dts/mpc8568mds.dts +2 -1
index 8e15dba..1198363 100644
@@ -47,12 +47,45 @@
 		#address-cells = <2>;
 		#size-cells = <1>;
 		reg = <e0005000 d8>;
-		ranges = <1 0 f8000000 0008000>;
+		ranges = <1 0 f8000000 0008000
+			  0 0 fe000000 2000000>;
  		bcsr@1,0 {
 			device_type = "board-control";
 			reg = <1 0 8000>;
 		};
Quoted 8 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 61

Quoted 5 lines
arch/powerpc/boot/dts/mpc8568mds.dts +5 -0
+
+		flash@0,0 {
+			compatible = "Spansion,S29GL256N11TFIV2O", "cfi-flash";
+			reg = <0 0 2000000>;
+			probe-type = "CFI";

I don't get it -- has physmap_of.c rewrite been already committed?
If yes, you don't need probe_type; if no, your "compatible" won't work...

I see.

/* Helper function to handle probing of the obsolete "direct-mapped"
* compatible binding, which has an extra "probe-type" property [...]

Obsolete, very good.

Quoted 14 lines

Well, I see that the driver rewrite has been committed (when I wasn't looking 8-)...

arch/powerpc/boot/dts/mpc8568mds.dts line 69

Quoted 8 lines
arch/powerpc/boot/dts/mpc8568mds.dts +8 -0
+			bank-width = <2>;
+			device-width = <1>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			hrcw@0 {
+				label = "hrcw";
+				reg = <0 20001>;

What?! Odd sized partition? Don't try to follow both the old and new
partition device tree specs -- you'll only get yourself into trouble with this. The size-cell doesn't bear r/o flag in the new paritions spec.

Thanks for spotting this. It's, of course, forward-porting "thinko".

Quoted 11 lines
Quoted 11 lines
arch/powerpc/boot/dts/mpc8568mds.dts +11 -0
+				read-only;
+			};
+
+			kernel@20000 {
+				label = "kernel";
+				reg = <20000 200000>;
+			};
+
+			rootfs@220000 {
+				label = "rootfs";
+				reg = <220000 1d60000>;
Quoted 8 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 86

Quoted 6 lines
arch/powerpc/boot/dts/mpc8568mds.dts +6 -0
+			};
+
+			uboot@1f80000 {
+				label = "u-boot";
+				reg = <1f80000 80000>;
+				read-only;

Well, this is not even consistent... :-)

Yup, it was a thinko in the hrcw node, not something I really meant to spread over all ro nodes.

Quoted 5 lines

arch/powerpc/boot/dts/mpc8568mds.dts line 89

Quoted 3 lines
arch/powerpc/boot/dts/mpc8568mds.dts +2 -0
+			};
+		};
 	};

WBR, Sergei

Much thanks for the review,

Signature · 4 lines
Anton Vorontsov
email: [email protected]
backup email: [email protected]
irc://irc.freenode.net/bd2
#9 lore raw
In reply to Anton Vorontsov
Quoted 4 lines · Anton Vorontsov
Quoted 1 line · Sergei Shtylyov

Is the entity described as "localbus" indeed so *board* specific?

That's what booting-without-of.txt gives as an example.

The board should have been left out of that. Your compatible should be something like "fsl,mpc8568-localbus", possibly with some canonical mpc85xx chip as well, chosen to represent 85xx localbus in general.

-Scott

#10 lore raw
Quoted 9 lines · Scott Wood
Quoted 4 lines · Anton Vorontsov
Quoted 1 line · Sergei Shtylyov

Is the entity described as "localbus" indeed so *board* specific?

That's what booting-without-of.txt gives as an example.

The board should have been left out of that. Your compatible should be something like "fsl,mpc8568-localbus", possibly with some canonical mpc85xx chip as well, chosen to represent 85xx localbus in general.

Lets be careful, there are at least two forms of localbus on 85xx.

- k

#11 lore raw
Quoted 7 lines · Kumar Gala
Quoted 4 lines · Scott Wood
Quoted 3 lines · Anton Vorontsov
Quoted 1 line · Sergei Shtylyov

Is the entity described as "localbus" indeed so *board* specific?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

That's what booting-without-of.txt gives as an example.

The board should have been left out of that. Your compatible should be something like "fsl,mpc8568-localbus", possibly with some canonical mpc85xx chip as well, chosen to represent 85xx localbus in general.

Lets be careful, there are at least two forms of localbus on 85xx.

Do you mean LAWBAR v. BRn/ORn (the manuals refer to the latter as "localbus", so I'd be inclined to stick with that name, and call the former mpc8568-lawbar or something), or some 85xx being different than others?

-Scott