linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/4] mpc8313erdb: Add NAND to device tree, and call of_platform_bus_probe().
@ 2007-12-14 18:58 Scott Wood
  2007-12-15  1:55 ` David Gibson
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2007-12-14 18:58 UTC (permalink / raw)
  To: galak; +Cc: linuxppc-dev

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
As requested, compatible is used rather than name for probing.
The simple-bus name comes from ePAPR drafts.

 arch/powerpc/boot/dts/mpc8313erdb.dts     |   38 +++++++++++++++++++++++++++++
 arch/powerpc/platforms/83xx/mpc8313_rdb.c |   16 ++++++++++++
 2 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
index c5b6665..66b53ec 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -45,10 +45,48 @@
 		reg = <00000000 08000000>;	// 128MB at 0
 	};
 
+	localbus {
+		#address-cells = <2>;
+		#size-cells = <1>;
+		compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
+		reg = <e0005000 1000>;
+		interrupts = <d#77 8>;
+		interrupt-parent = <&ipic>;
+
+		// CS0 and CS1 are swapped when
+		// booting from nand, but the
+		// addresses are the same.
+		ranges = <0 0 fe000000 00800000
+		          1 0 e2800000 00008000
+		          2 0 f0000000 00020000
+		          3 0 fa000000 00008000>;
+
+		nand@1,0 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "fsl,mpc8313-fcm-nand", "fsl,elbc-fcm-nand";
+			reg = <1 0 2000>;
+
+			u-boot@0 {
+				reg = <0 100000>;
+				read-only;
+			};
+
+			kernel@100000 {
+				reg = <100000 300000>;
+			};
+
+			fs@400000 {
+				reg = <400000 1c00000>;
+			};
+		};
+	};
+
 	soc8313@e0000000 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		device_type = "soc";
+		compatible = "simple-bus";
 		ranges = <0 e0000000 00100000>;
 		reg = <e0000000 00000200>;
 		bus-frequency = <0>;
diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
index 6fb8299..4e57448 100644
--- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
@@ -14,6 +14,7 @@
  */
 
 #include <linux/pci.h>
+#include <linux/of_platform.h>
 
 #include <asm/time.h>
 #include <asm/ipic.h>
@@ -75,6 +76,21 @@ static int __init mpc8313_rdb_probe(void)
 	return of_flat_dt_is_compatible(root, "MPC8313ERDB");
 }
 
+static struct of_device_id __initdata of_bus_ids[] = {
+	{ .compatible = "simple-bus" },
+	{},
+};
+
+static int __init declare_of_platform_devices(void)
+{
+	if (!machine_is(mpc8313_rdb))
+		return 0;
+
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
+	return 0;
+}
+device_initcall(declare_of_platform_devices);
+
 define_machine(mpc8313_rdb) {
 	.name			= "MPC8313 RDB",
 	.probe			= mpc8313_rdb_probe,
-- 
1.5.3.7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 2/4] mpc8313erdb: Add NAND to device tree, and call of_platform_bus_probe().
  2007-12-14 18:58 [PATCH v2 2/4] mpc8313erdb: Add NAND to device tree, and call of_platform_bus_probe() Scott Wood
@ 2007-12-15  1:55 ` David Gibson
  2007-12-15  3:48   ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: David Gibson @ 2007-12-15  1:55 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev

On Fri, Dec 14, 2007 at 12:58:26PM -0600, Scott Wood wrote:
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> As requested, compatible is used rather than name for probing.
> The simple-bus name comes from ePAPR drafts.
> 
>  arch/powerpc/boot/dts/mpc8313erdb.dts     |   38 +++++++++++++++++++++++++++++
>  arch/powerpc/platforms/83xx/mpc8313_rdb.c |   16 ++++++++++++
>  2 files changed, 54 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
> index c5b6665..66b53ec 100644
> --- a/arch/powerpc/boot/dts/mpc8313erdb.dts
> +++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
> @@ -45,10 +45,48 @@
>  		reg = <00000000 08000000>;	// 128MB at 0
>  	};
>  
> +	localbus {

Should be "localbus@e0005000".

> +		#address-cells = <2>;
> +		#size-cells = <1>;
> +		compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
> +		reg = <e0005000 1000>;
> +		interrupts = <d#77 8>;
> +		interrupt-parent = <&ipic>;
> +
> +		// CS0 and CS1 are swapped when
> +		// booting from nand, but the
> +		// addresses are the same.

Should the bootwrapper have some kind of fixup to poke in the correct
chipselect values based on the state?

Or should we have a function to fill in the elbc's ranges property
based on the bridge control registers, as we do for the ebc on 4xx.

-- 
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 2/4] mpc8313erdb: Add NAND to device tree, and call of_platform_bus_probe().
  2007-12-15  1:55 ` David Gibson
@ 2007-12-15  3:48   ` Scott Wood
  0 siblings, 0 replies; 3+ messages in thread
From: Scott Wood @ 2007-12-15  3:48 UTC (permalink / raw)
  To: galak, linuxppc-dev

On Sat, Dec 15, 2007 at 12:55:43PM +1100, David Gibson wrote:
> > +		// CS0 and CS1 are swapped when
> > +		// booting from nand, but the
> > +		// addresses are the same.
> 
> Should the bootwrapper have some kind of fixup to poke in the correct
> chipselect values based on the state?
> 
> Or should we have a function to fill in the elbc's ranges property
> based on the bridge control registers, as we do for the ebc on 4xx.

We could, though I'm inclined to be lazy about it since nothing really
cares (well, the elbc nand code *does* care which chip select it's on,
but it figures it out by matching the address in the localbus registers).

-Scott

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-12-15  3:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-14 18:58 [PATCH v2 2/4] mpc8313erdb: Add NAND to device tree, and call of_platform_bus_probe() Scott Wood
2007-12-15  1:55 ` David Gibson
2007-12-15  3:48   ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).