linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc: publish 85xx soc dts entries as of_device
@ 2008-02-11 20:32 Dave Jiang
  2008-02-11 22:01 ` Jon Loeliger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dave Jiang @ 2008-02-11 20:32 UTC (permalink / raw)
  To: galak, linuxppc-dev

Publish the devices listed in dts under SOC as of_device just like what
mpc85xx_mds platforms do. The 85xx cds and ads platforms currently do not
export the devices in dts as of_device.

The memory controller, L2 cache-controller, and the PCI controller(s) are
published as of_device so the mpc85xx EDAC driver can claim them for usage.

Signed-off-by: Dave Jiang <djiang@mvista.com>

---
commit 187841bf9dff25e4ac1a7174daa55bb036c724b1
tree 3206ffbbfc5075d195345281f72f7b52f060b41b
parent a99824f327c748b2753f4fa570eb1fefcd6a9c4d
author Dave Jiang <djiang@mvista.com> Mon, 11 Feb 2008 12:51:33 -0700
committer Dave Jiang <djiang@blade.(none)> Mon, 11 Feb 2008 12:51:33 -0700

 arch/powerpc/platforms/85xx/mpc85xx_ads.c |   19 +++++++++++++++++++
 arch/powerpc/platforms/85xx/mpc85xx_cds.c |   19 +++++++++++++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)

mpc85xx EDAC driver is in mainline kernel now

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 4e03050..024393c 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -26,6 +26,8 @@
 #include <asm/mpic.h>
 #include <mm/mmu_decl.h>
 #include <asm/udbg.h>
+#include <asm/of_device.h>
+#include <asm/of_platform.h>
 
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
@@ -249,6 +251,23 @@ static int __init mpc85xx_ads_probe(void)
         return of_flat_dt_is_compatible(root, "MPC85xxADS");
 }
 
+static struct of_device_id mpc85xx_ids[] = {
+	{ .type = "soc", },
+	{ .compatible = "soc", },
+	{},
+};
+
+static int __init mpc85xx_publish_devices(void)
+{
+	if (!machine_is(mpc85xx_ads))
+		return 0;
+
+	of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
+
+	return 0;
+}
+device_initcall(mpc85xx_publish_devices);
+
 define_machine(mpc85xx_ads) {
 	.name			= "MPC85xx ADS",
 	.probe			= mpc85xx_ads_probe,
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 8b1de78..8525882 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -42,6 +42,8 @@
 #include <asm/udbg.h>
 #include <asm/mpic.h>
 #include <asm/i8259.h>
+#include <asm/of_device.h>
+#include <asm/of_platform.h>
 
 #include <sysdev/fsl_soc.h>
 #include <sysdev/fsl_pci.h>
@@ -335,6 +337,23 @@ static int __init mpc85xx_cds_probe(void)
         return of_flat_dt_is_compatible(root, "MPC85xxCDS");
 }
 
+static struct of_device_id mpc85xx_ids[] = {
+	{ .type = "soc", },
+	{ .compatible = "soc", },
+	{},
+};
+
+static int __init mpc85xx_publish_devices(void)
+{
+	if (!machine_is(mpc85xx_cds))
+		return 0;
+
+	of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
+
+	return 0;
+}
+device_initcall(mpc85xx_publish_devices);
+
 define_machine(mpc85xx_cds) {
 	.name		= "MPC85xx CDS",
 	.probe		= mpc85xx_cds_probe,

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

* Re: [PATCH 1/2] powerpc: publish 85xx soc dts entries as of_device
  2008-02-11 20:32 [PATCH 1/2] powerpc: publish 85xx soc dts entries as of_device Dave Jiang
@ 2008-02-11 22:01 ` Jon Loeliger
  2008-02-11 23:12 ` Grant Likely
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jon Loeliger @ 2008-02-11 22:01 UTC (permalink / raw)
  To: Dave Jiang; +Cc: linuxppc-dev

Dave Jiang wrote:

> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> index 4e03050..024393c 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> @@ -26,6 +26,8 @@
>  #include <asm/mpic.h>
>  #include <mm/mmu_decl.h>
>  #include <asm/udbg.h>
> +#include <asm/of_device.h>
> +#include <asm/of_platform.h>

Please use <linux/of_{device,platform}.h> throughout instead.

Thanks.
jdl

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

* Re: [PATCH 1/2] powerpc: publish 85xx soc dts entries as of_device
  2008-02-11 20:32 [PATCH 1/2] powerpc: publish 85xx soc dts entries as of_device Dave Jiang
  2008-02-11 22:01 ` Jon Loeliger
@ 2008-02-11 23:12 ` Grant Likely
  2008-02-11 23:36 ` Stephen Rothwell
  2008-02-13 21:08 ` [PATCH 1/2 rev2] powerpc: publish 85xx cds " Dave Jiang
  3 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2008-02-11 23:12 UTC (permalink / raw)
  To: Dave Jiang; +Cc: linuxppc-dev

On Feb 11, 2008 1:32 PM, Dave Jiang <djiang@mvista.com> wrote:
> Publish the devices listed in dts under SOC as of_device just like what
> mpc85xx_mds platforms do. The 85xx cds and ads platforms currently do not
> export the devices in dts as of_device.
>
> The memory controller, L2 cache-controller, and the PCI controller(s) are
> published as of_device so the mpc85xx EDAC driver can claim them for usage.
>
> Signed-off-by: Dave Jiang <djiang@mvista.com>
>
> ---
> commit 187841bf9dff25e4ac1a7174daa55bb036c724b1
> tree 3206ffbbfc5075d195345281f72f7b52f060b41b
> parent a99824f327c748b2753f4fa570eb1fefcd6a9c4d
> author Dave Jiang <djiang@mvista.com> Mon, 11 Feb 2008 12:51:33 -0700
> committer Dave Jiang <djiang@blade.(none)> Mon, 11 Feb 2008 12:51:33 -0700
>
>  arch/powerpc/platforms/85xx/mpc85xx_ads.c |   19 +++++++++++++++++++
>  arch/powerpc/platforms/85xx/mpc85xx_cds.c |   19 +++++++++++++++++++
>  2 files changed, 38 insertions(+), 0 deletions(-)
>
> mpc85xx EDAC driver is in mainline kernel now
>
> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> index 4e03050..024393c 100644
> --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> @@ -26,6 +26,8 @@
>  #include <asm/mpic.h>
>  #include <mm/mmu_decl.h>
>  #include <asm/udbg.h>
> +#include <asm/of_device.h>
> +#include <asm/of_platform.h>
>
>  #include <sysdev/fsl_soc.h>
>  #include <sysdev/fsl_pci.h>
> @@ -249,6 +251,23 @@ static int __init mpc85xx_ads_probe(void)
>          return of_flat_dt_is_compatible(root, "MPC85xxADS");
>  }
>
> +static struct of_device_id mpc85xx_ids[] = {
> +       { .type = "soc", },
> +       { .compatible = "soc", },
> +       {},
> +};
> +
> +static int __init mpc85xx_publish_devices(void)
> +{
> +       if (!machine_is(mpc85xx_ads))
> +               return 0;
> +
> +       of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
> +
> +       return 0;
> +}
> +device_initcall(mpc85xx_publish_devices);

machine_device_initcall() please.  (which lets you eliminate the
machine_is() test).

> +
> +static int __init mpc85xx_publish_devices(void)
> +{
> +       if (!machine_is(mpc85xx_cds))
> +               return 0;
> +
> +       of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
> +
> +       return 0;
> +}
> +device_initcall(mpc85xx_publish_devices);
> +

ditto

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

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

* Re: [PATCH 1/2] powerpc: publish 85xx soc dts entries as of_device
  2008-02-11 20:32 [PATCH 1/2] powerpc: publish 85xx soc dts entries as of_device Dave Jiang
  2008-02-11 22:01 ` Jon Loeliger
  2008-02-11 23:12 ` Grant Likely
@ 2008-02-11 23:36 ` Stephen Rothwell
  2008-02-13 21:08 ` [PATCH 1/2 rev2] powerpc: publish 85xx cds " Dave Jiang
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2008-02-11 23:36 UTC (permalink / raw)
  To: Dave Jiang; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

Hi Dave,

On Mon, 11 Feb 2008 13:32:43 -0700 Dave Jiang <djiang@mvista.com> wrote:
>
> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
> @@ -26,6 +26,8 @@
>  #include <asm/mpic.h>
>  #include <mm/mmu_decl.h>
>  #include <asm/udbg.h>
> +#include <asm/of_device.h>
> +#include <asm/of_platform.h>

Like Jon said ...

> +static struct of_device_id mpc85xx_ids[] = {

make this __initdata

> +static int __init mpc85xx_publish_devices(void)
> +{
> +	if (!machine_is(mpc85xx_ads))
> +		return 0;

You don't need this if you make the change below.

> +	of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
> +
> +	return 0;
> +}
> +device_initcall(mpc85xx_publish_devices);

machine_devce_initcall(mpc85xx_ads, mpc85xx_publish_devices);

> +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c

> +static struct of_device_id mpc85xx_ids[] = {

__initdata

> +static int __init mpc85xx_publish_devices(void)
> +{
> +	if (!machine_is(mpc85xx_cds))
> +		return 0;
> +
> +	of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
> +
> +	return 0;
> +}
> +device_initcall(mpc85xx_publish_devices);

Same as above.

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

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* [PATCH 1/2 rev2] powerpc: publish 85xx cds soc dts entries as of_device
  2008-02-11 20:32 [PATCH 1/2] powerpc: publish 85xx soc dts entries as of_device Dave Jiang
                   ` (2 preceding siblings ...)
  2008-02-11 23:36 ` Stephen Rothwell
@ 2008-02-13 21:08 ` Dave Jiang
  3 siblings, 0 replies; 5+ messages in thread
From: Dave Jiang @ 2008-02-13 21:08 UTC (permalink / raw)
  To: galak, linuxppc-dev

Publish the devices listed in dts under SOC as of_device for mpc85xx_cds
platforms.

The memory controller, L2 cache-controller, and the PCI controller(s) are
published as of_device so the mpc85xx EDAC driver can claim them for usage.

Signed-off-by: Dave Jiang <djiang@mvista.com>

---
commit 4be72413410c560fe7ad5ef9156d43159003dad3
tree 8890093ee1cff0ec0cc9ce0b9367e134f528eed2
parent 19af35546de68c872dcb687613e0902a602cb20e
author Dave Jiang <djiang@mvista.com> Wed, 13 Feb 2008 14:03:33 -0700
committer Dave Jiang <djiang@blade.(none)> Wed, 13 Feb 2008 14:03:33 -0700

 arch/powerpc/platforms/85xx/mpc85xx_cds.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 8b1de78..374c9d5 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -26,6 +26,7 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/fsl_devices.h>
+#include <linux/of_platform.h>
 
 #include <asm/system.h>
 #include <asm/pgtable.h>
@@ -324,6 +325,19 @@ static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
 	seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
 }
 
+static struct of_device_id __initdata of_bus_ids[] = {
+	{ .name = "soc", },
+	{ .type = "soc", },
+	{},
+};
+
+static int __init declare_of_platform_devices(void)
+{
+	of_platform_bus_probe(NULL, of_bus_ids, NULL);
+
+	return 0;
+}
+machine_device_initcall(mpc85xx_cds, declare_of_platform_devices);
 
 /*
  * Called very early, device-tree isn't unflattened

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

end of thread, other threads:[~2008-02-13 21:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-11 20:32 [PATCH 1/2] powerpc: publish 85xx soc dts entries as of_device Dave Jiang
2008-02-11 22:01 ` Jon Loeliger
2008-02-11 23:12 ` Grant Likely
2008-02-11 23:36 ` Stephen Rothwell
2008-02-13 21:08 ` [PATCH 1/2 rev2] powerpc: publish 85xx cds " Dave Jiang

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