Skip to contentSkip to conversation

Add flash node to mpc8641_hpcn.dts

PATCH In review Wade Farnsworth 4 participants 17 messages Jan 22, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Add flash node to mpc8641_hpcn.dts

Add flash and partition information to mpc8641_hpcn.dts

---
 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   27 +++++++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/powerpc/boot/dts/mpc8641_hpcn.dts +27 -0
index a719179..679e857 100644
@@ -457,4 +457,31 @@
 				  0 00100000>;
 		};
 	};
+
+	flash@ff800000 {
+		compatible = "cfi-flash";
+		reg = <ff800000 00800000>;
+		bank-width = <2>;
+		device-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		partition@0 {
+			label = "kernel";
+			reg = <00000000 00300000>;
+		};
+		partition@300000 {
+			label = "firmware b";
+			reg = <00300000 00100000>;
+			read-only;
+		};
+		partition@400000 {
+			label = "fs";
+			reg = <00400000 00300000>;
+		};
+		partition@700000 {
+			label = "firmware a";
+			reg = <00700000 00100000>;
+			read-only;
+		};
+	};
 };
#1 lore raw
Quoted 13 lines · Wade Farnsworth

Add flash and partition information to mpc8641_hpcn.dts

---
arch/powerpc/boot/dts/mpc8641_hpcn.dts | 27 +++++++++++++++++++++++

1 file changed, 27 insertions(+)
arch/powerpc/boot/dts/mpc8641_hpcn.dts +0 -0
index a719179..679e857 100644

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

Quoted 3 lines
arch/powerpc/boot/dts/mpc8641_hpcn.dts +0 -0
@@ -457,4 +457,31 @@
 				  0 00100000>;
 		};
 	};

This really should be under a localbus node.

- k

Quoted 30 lines
arch/powerpc/boot/dts/mpc8641_hpcn.dts +27 -0
+
+	flash@ff800000 {
+		compatible = "cfi-flash";
+		reg = <ff800000 00800000>;
+		bank-width = <2>;
+		device-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		partition@0 {
+			label = "kernel";
+			reg = <00000000 00300000>;
+		};
+		partition@300000 {
+			label = "firmware b";
+			reg = <00300000 00100000>;
+			read-only;
+		};
+		partition@400000 {
+			label = "fs";
+			reg = <00400000 00300000>;
+		};
+		partition@700000 {
+			label = "firmware a";
+			reg = <00700000 00100000>;
+			read-only;
+		};
+	};
 };
#2 lore raw
Quoted 22 lines · Kumar Gala
Quoted 14 lines · Wade Farnsworth

Add flash and partition information to mpc8641_hpcn.dts

---
arch/powerpc/boot/dts/mpc8641_hpcn.dts | 27 +++++++++++++++++++++++

1 file changed, 27 insertions(+)
arch/powerpc/ renamed from arch/powerpc/boot/dts/mpc8641_hpcn.dts +0 -0

boot/dts/mpc8641_hpcn.dts
index a719179..679e857 100644

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

Quoted 3 lines
arch/powerpc/boot/dts/mpc8641_hpcn.dts +0 -0
@@ -457,4 +457,31 @@
 				  0 00100000>;
 		};
 	};

This really should be under a localbus node.

Quoted 2 lines

- k

Ok. I'll fix it up and resend.

--Wade

#3 lore raw
Quoted 24 lines · Wade Farnsworth
Quoted 23 lines · Kumar Gala
Quoted 15 lines · Wade Farnsworth

Add flash and partition information to mpc8641_hpcn.dts

---
arch/powerpc/boot/dts/mpc8641_hpcn.dts | 27 +++++++++++++++++++++
++

1 file changed, 27 insertions(+)
arch/powerpc/ renamed from arch/powerpc/boot/dts/mpc8641_hpcn.dts +0 -0

boot/dts/mpc8641_hpcn.dts
index a719179..679e857 100644

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

Quoted 3 lines
arch/powerpc/boot/dts/mpc8641_hpcn.dts +0 -0
@@ -457,4 +457,31 @@
 				  0 00100000>;
 		};
 	};

This really should be under a localbus node.

Quoted 4 lines
Quoted 2 lines

- k

Ok. I'll fix it up and resend.

look at the mpc8313erdb.dts (in my tree, as an example).

- k

#4 lore raw

PATCH 2/2 MPC8641 HPCN: publish all soc and flash devices

In reply to Wade Farnsworth

Publish all soc and flash devices from the device tree, similar to what is done for other boards.

---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +16 -0
index 14f4e52..f266264 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>
@@ -212,6 +213,21 @@ mpc86xx_time_init(void)
 	return 0;
 }
 
+static struct of_device_id mpc86xx_ids[] = {
+	{ .type = "soc", },
+	{ .compatible = "soc", },
+	{ .compatible = "cfi-flash", },
+	{},
+};
+
+static int __init mpc86xx_publish_devices(void)
+{
+	of_platform_bus_probe(NULL, mpc86xx_ids, NULL);
+
+	return 0;
+}
+device_initcall(mpc86xx_publish_devices);
+
 define_machine(mpc86xx_hpcn) {
 	.name			= "MPC86xx HPCN",
 	.probe			= mpc86xx_hpcn_probe,
#5 lore raw

Re: [PATCH 2/2] MPC8641 HPCN: publish all soc and flash devices

Quoted 30 lines · Wade Farnsworth

Publish all soc and flash devices from the device tree, similar to what is done for other boards.

---
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 16 ++++++++++++++++

1 file changed, 16 insertions(+)
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +6 -0
index 14f4e52..f266264 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>
@@ -212,6 +213,21 @@ mpc86xx_time_init(void)
 	return 0;
 }
 
+static struct of_device_id mpc86xx_ids[] = {
+	{ .type = "soc", },
+	{ .compatible = "soc", },
+	{ .compatible = "cfi-flash", },
+	{},

arch/powerpc/platforms/86xx/mpc86xx_hpcn.c mpc86xx_time_init(void) · line 230

Quoted 10 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +10 -0
+};
+
+static int __init mpc86xx_publish_devices(void)
+{
+	of_platform_bus_probe(NULL, mpc86xx_ids, NULL);
+
+	return 0;
+}
+device_initcall(mpc86xx_publish_devices);
+

this should look more like:

+static struct of_device_id __initdata of_bus_ids[] = {
+ { .compatible = "simple-bus" },
+ {},
+};
+
+static int __init declare_of_platform_devices(void) +{
+ of_platform_bus_probe(NULL, of_bus_ids, NULL);
+ return 0;
+}
+machine_device_initcall(mpc86xx_hpcn, mpc86xx_publish_devices); +

Quoted 5 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +0 -0
 define_machine(mpc86xx_hpcn) {
 	.name			= "MPC86xx HPCN",
 	.probe			= mpc86xx_hpcn_probe,
#7 lore raw

PATCH v2 1/2 Add localbus and flash nodes to mpc8641_hpcn.dts

In reply to Wade Farnsworth

Add local bus, flash, and MTD partition nodes to mpc8641_hpcn.dts

Also add compatible field for the soc node, so that it will be picked up by of_platform_bus_probe().

---
Updated per Kumar's comments.

 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   42 +++++++++++++++++++++++
 1 file changed, 42 insertions(+)
arch/powerpc/boot/dts/mpc8641_hpcn.dts +42 -0
index a719179..556a9ca 100644
@@ -60,10 +60,52 @@
 		reg = <00000000 40000000>;	// 1G at 0x0
 	};
 
+	localbus@f8005000 {
+		#address-cells = <2>;
+		#size-cells = <1>;
+		compatible = "fsl,mpc8641-localbus", "simple-bus";
+		reg = <f8005000 1000>;
+		interrupts = <13 2>;
+		interrupt-parent = <&mpic>;
+
+		ranges = <0 0 ff800000 00800000
+			  1 0 fe000000 01000000
+			  2 0 f8200000 00100000
+			  3 0 f8100000 00100000>;
+
+		flash@0,0 {
+			compatible = "cfi-flash";
+			reg = <0 0 00800000>;
+			bank-width = <2>;
+			device-width = <2>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			partition@0 {
+				label = "kernel";
+				reg = <00000000 00300000>;
+			};
+			partition@300000 {
+				label = "firmware b";
+				reg = <00300000 00100000>;
+				read-only;
+			};
+			partition@400000 {
+				label = "fs";
+				reg = <00400000 00300000>;
+			};
+			partition@700000 {
+				label = "firmware a";
+				reg = <00700000 00100000>;
+				read-only;
+			};
+		};
+	};
+
 	soc8641@f8000000 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		device_type = "soc";
+		compatible = "simple-bus";
 		ranges = <00000000 f8000000 00100000>;
 		reg = <f8000000 00001000>;	// CCSRBAR
 		bus-frequency = <0>;
#8 lore raw

PATCH v2 2/2 MPC8641 HPCN: call of_platform_bus_probe()

Call of_platform_bus_probe() on the MPC8641 HPCN, similar to what is done for other platforms.

---
Updated per Kumar's comments.

 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +14 -0
index 14f4e52..510913e 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>
@@ -212,6 +213,19 @@ mpc86xx_time_init(void)
 	return 0;
 }
 
+static struct of_device_id of_bus_ids[] = {
+	{ .compatible = "simple-bus", },
+	{},
+};
+
+static int __init declare_of_platform_devices(void)
+{
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
+
+	return 0;
+}
+machine_device_initcall(mpc86xx_hpcn, declare_of_platform_devices);
+
 define_machine(mpc86xx_hpcn) {
 	.name			= "MPC86xx HPCN",
 	.probe			= mpc86xx_hpcn_probe,
Applied
#9 lore raw

Re: [PATCH v2 2/2] MPC8641 HPCN: call of_platform_bus_probe()

Quoted 10 lines · Wade Farnsworth

Call of_platform_bus_probe() on the MPC8641 HPCN, similar to what is done for other platforms.

---
Updated per Kumar's comments.

 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

applied.

- k

#11 lore raw

Re: [PATCH v2 2/2] MPC8641 HPCN: call of_platform_bus_probe()

Quoted 6 lines · Stephen Rothwell

On Tue, 22 Jan 2008 13:17:45 -0700 Wade Farnsworth <[email protected]

Quoted 3 lines

wrote:

+static struct of_device_id of_bus_ids[] = {

You forgot the __initdata.

I've fixed it.

- k

Applied
#12 lore raw

Re: [PATCH v2 1/2] Add localbus and flash nodes to mpc8641_hpcn.dts

In reply to Wade Farnsworth
Quoted 5 lines · Wade Farnsworth

Add local bus, flash, and MTD partition nodes to mpc8641_hpcn.dts

Also add compatible field for the soc node, so that it will be picked up by of_platform_bus_probe().

Quoted 8 lines

---
Updated per Kumar's comments.

 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   42 +++++++++++++++++++++++
 1 file changed, 42 insertions(+)

applied.

- k

#13 lore raw

Re: [PATCH v2 1/2] Add localbus and flash nodes to mpc8641_hpcn.dts

In reply to Wade Farnsworth

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

Quoted 6 lines · Wade Farnsworth
arch/powerpc/boot/dts/mpc8641_hpcn.dts +6 -0
+
+		ranges = <0 0 ff800000 00800000
+			  1 0 fe000000 01000000
+			  2 0 f8200000 00100000
+			  3 0 f8100000 00100000>;
+

I think you want just:

ranges = <0 0 f8000000 8000000>

right? And is it really on CS 0?

jdl

#14 lore raw

Re: [PATCH v2 1/2] Add localbus and flash nodes to mpc8641_hpcn.dts

Quoted 11 lines · Jon Loeliger

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

Quoted 6 lines · Wade Farnsworth
arch/powerpc/boot/dts/mpc8641_hpcn.dts +6 -0
+
+		ranges = <0 0 ff800000 00800000
+			  1 0 fe000000 01000000
+			  2 0 f8200000 00100000
+			  3 0 f8100000 00100000>;
+

I think you want just:

Quoted 3 lines

ranges = <0 0 f8000000 8000000>

right? And is it really on CS 0?

I'm assuming he's listed CS1, CS2, and CS3 even though we don't have a children yet. (second flash chip, CF, and pixis).

- k

#15 lore raw

Re: [PATCH v2 1/2] Add localbus and flash nodes to mpc8641_hpcn.dts

Quoted 13 lines · Kumar Gala
Quoted 11 lines · Jon Loeliger

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

Quoted 6 lines · Wade Farnsworth
arch/powerpc/boot/dts/mpc8641_hpcn.dts +6 -0
+
+		ranges = <0 0 ff800000 00800000
+			  1 0 fe000000 01000000
+			  2 0 f8200000 00100000
+			  3 0 f8100000 00100000>;
+

I think you want just:

Quoted 1 line
Quoted 1 line

ranges = <0 0 f8000000 8000000>

Wouldn't that cover all of the CCSR regs, not just CS0?

Quoted 5 lines
Quoted 2 lines

right? And is it really on CS 0?

I'm assuming he's listed CS1, CS2, and CS3 even though we don't have a children yet. (second flash chip, CF, and pixis).

Yes that's correct.

--Wade

#16 lore raw

Re: [PATCH v2 1/2] Add localbus and flash nodes to mpc8641_hpcn.dts

In reply to Kumar Gala
Quoted 3 lines · Kumar Gala

I'm assuming he's listed CS1, CS2, and CS3 even though we don't have a children yet. (second flash chip, CF, and pixis).

- k

OK -- I just wasn't sure if you wanted the other CS entries for nodes that weren't actually present yet.

jdl