[PATCH 1/2] Add flash node to mpc8641_hpcn.dts

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE6803d

17 messages, 4 authors, 2008-01-22 · open the first message on its own page

[PATCH 1/2] Add flash node to mpc8641_hpcn.dts

From: Wade Farnsworth <hidden>
Date: 2008-01-22 17:04:09

Add flash and partition information to mpc8641_hpcn.dts

Signed-off-by: Wade Farnsworth <redacted>

---
 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   27 +++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index a719179..679e857 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -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;
+		};
+	};
 };

Re: [PATCH 1/2] Add flash node to mpc8641_hpcn.dts

From: Kumar Gala <hidden>
Date: 2008-01-22 16:44:47

On Jan 22, 2008, at 10:38 AM, Wade Farnsworth wrote:
quoted hunk
Add flash and partition information to mpc8641_hpcn.dts

Signed-off-by: Wade Farnsworth <redacted>

---
arch/powerpc/boot/dts/mpc8641_hpcn.dts |   27 +++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/ 
boot/dts/mpc8641_hpcn.dts
index a719179..679e857 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -457,4 +457,31 @@
				  0 00100000>;
		};
	};
This really should be under a localbus node.

- k
+
+	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;
+		};
+	};
};

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

From: Wade Farnsworth <hidden>
Date: 2008-01-22 16:47:13

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

Signed-off-by: Wade Farnsworth <redacted>

---
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 14f4e52..f266264 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -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,

Re: [PATCH 1/2] Add flash node to mpc8641_hpcn.dts

From: Wade Farnsworth <hidden>
Date: 2008-01-22 16:47:45

On Tue, 2008-01-22 at 10:44 -0600, Kumar Gala wrote:
On Jan 22, 2008, at 10:38 AM, Wade Farnsworth wrote:
quoted
Add flash and partition information to mpc8641_hpcn.dts

Signed-off-by: Wade Farnsworth <redacted>

---
arch/powerpc/boot/dts/mpc8641_hpcn.dts |   27 +++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/ 
boot/dts/mpc8641_hpcn.dts
index a719179..679e857 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -457,4 +457,31 @@
				  0 00100000>;
		};
	};
This really should be under a localbus node.

- k
Ok. I'll fix it up and resend.

--Wade

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

From: Kumar Gala <hidden>
Date: 2008-01-22 16:51:19

On Jan 22, 2008, at 10:47 AM, Wade Farnsworth wrote:
quoted hunk
Publish all soc and flash devices from the device tree, similar to  
what
is done for other boards.

Signed-off-by: Wade Farnsworth <redacted>

---
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/ 
powerpc/platforms/86xx/mpc86xx_hpcn.c
index 14f4e52..f266264 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -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);
+
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);
+

define_machine(mpc86xx_hpcn) {
	.name			= "MPC86xx HPCN",
	.probe			= mpc86xx_hpcn_probe,

Re: [PATCH 1/2] Add flash node to mpc8641_hpcn.dts

From: Kumar Gala <hidden>
Date: 2008-01-22 16:52:14

On Jan 22, 2008, at 10:47 AM, Wade Farnsworth wrote:
On Tue, 2008-01-22 at 10:44 -0600, Kumar Gala wrote:
quoted
On Jan 22, 2008, at 10:38 AM, Wade Farnsworth wrote:
quoted
Add flash and partition information to mpc8641_hpcn.dts

Signed-off-by: Wade Farnsworth <redacted>

---
arch/powerpc/boot/dts/mpc8641_hpcn.dts |   27 +++++++++++++++++++++ 
++
1 file changed, 27 insertions(+)
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/
boot/dts/mpc8641_hpcn.dts
index a719179..679e857 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -457,4 +457,31 @@
				  0 00100000>;
		};
	};
This really should be under a localbus node.

- k
Ok. I'll fix it up and resend.
look at the mpc8313erdb.dts (in my tree, as an example).

- k

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

From: Wade Farnsworth <hidden>
Date: 2008-01-22 20:13:41

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().

Signed-off-by: Wade Farnsworth <redacted>

---
Updated per Kumar's comments.

 arch/powerpc/boot/dts/mpc8641_hpcn.dts |   42 +++++++++++++++++++++++
 1 file changed, 42 insertions(+)
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index a719179..556a9ca 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -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>;

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

From: Wade Farnsworth <hidden>
Date: 2008-01-22 20:17:48

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

Signed-off-by: Wade Farnsworth <redacted>

---
Updated per Kumar's comments.

 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 14f4e52..510913e 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -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,

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

From: Kumar Gala <hidden>
Date: 2008-01-22 20:39:23

On Tue, 22 Jan 2008, Wade Farnsworth wrote:
Call of_platform_bus_probe() on the MPC8641 HPCN, similar to what is
done for other platforms.

Signed-off-by: Wade Farnsworth <redacted>

---
Updated per Kumar's comments.

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

- k

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

From: Kumar Gala <hidden>
Date: 2008-01-22 20:39:42

On Tue, 22 Jan 2008, Wade Farnsworth wrote:
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().

Signed-off-by: Wade Farnsworth <redacted>

---
Updated per Kumar's comments.

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

- k

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

From: Jon Loeliger <hidden>
Date: 2008-01-22 20:42:12

Wade Farnsworth wrote:
+
+		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

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

From: Kumar Gala <hidden>
Date: 2008-01-22 21:07:51

On Jan 22, 2008, at 2:41 PM, Jon Loeliger wrote:
Wade Farnsworth wrote:
quoted
+
+		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?
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

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

From: Wade Farnsworth <hidden>
Date: 2008-01-22 21:19:47

On Tue, 2008-01-22 at 15:07 -0600, Kumar Gala wrote:
On Jan 22, 2008, at 2:41 PM, Jon Loeliger wrote:
quoted
Wade Farnsworth wrote:
quoted
+
+		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>
Wouldn't that cover all of the CCSR regs, not just CS0?
quoted
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

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

From: Jon Loeliger <hidden>
Date: 2008-01-22 21:22:54

Kumar Gala wrote:
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

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

From: Stephen Rothwell <hidden>
Date: 2008-01-22 23:26:21

Hi Wade,

On Tue, 22 Jan 2008 09:47:12 -0700 Wade Farnsworth [off-list ref] wrote:
+static struct of_device_id mpc86xx_ids[] = {
__initdata, please.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

From: Stephen Rothwell <hidden>
Date: 2008-01-22 23:28:05

On Tue, 22 Jan 2008 13:17:45 -0700 Wade Farnsworth [off-list ref] wrote:
+static struct of_device_id of_bus_ids[] = {
You forgot the __initdata.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

From: Kumar Gala <hidden>
Date: 2008-01-22 23:36:56

On Jan 22, 2008, at 5:28 PM, Stephen Rothwell wrote:
On Tue, 22 Jan 2008 13:17:45 -0700 Wade Farnsworth <wfarnsworth@mvista.com 
quoted
wrote:

+static struct of_device_id of_bus_ids[] = {
You forgot the __initdata.
I've fixed it.

- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help