* [PATCH] sysdev,mv64x60: MV64x60 device bus
@ 2008-04-28 17:12 Remi Machet
2008-04-28 18:09 ` Dale Farnsworth
2008-04-29 1:54 ` Stephen Rothwell
0 siblings, 2 replies; 5+ messages in thread
From: Remi Machet @ 2008-04-28 17:12 UTC (permalink / raw)
To: Paul Mackerras, Dale Farnsworth; +Cc: linuxppc-dev
Follow up of my email of 4/16/2008 titled "MV64x60 device bus".
For each mv64360 entry in the OpenFirmware database, add the
registration of an of_bus to take care of devices connected to
the MV64x60 asynchronous devices controller.
Signed-off-by: Remi Machet (rmachet@slac.stanford.edu)
---
I did not modify the PRPMC2800 dts file to use that feature because
I cannot test it on that board. I will soon submit a patch to add
support for a board that makes use of this feature. If someone want
to use that feature to register the PRPMC2800 flash you just need
to move the NOR flash declaration in a subcategory whose device_type
field is set to "devicectrl".
arch/powerpc/sysdev/mv64x60_dev.c | 10 ++++++++++
1 files changed, 10 insertions(+)
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c
index 41af122..f335fd5 100644
--- a/arch/powerpc/sysdev/mv64x60_dev.c
+++ b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -15,6 +15,7 @@
#include <linux/console.h>
#include <linux/mv643xx.h>
#include <linux/platform_device.h>
+#include <linux/of_platform.h>
#include <asm/prom.h>
@@ -25,6 +26,11 @@
* PowerPC of_platform_bus_type. They support platform_bus_type instead.
*/
+static struct of_device_id of_mv64x60_devices[] = {
+ { .type = "devicectrl", },
+ {}
+};
+
/*
* Create MPSC platform devices
*/
@@ -482,6 +488,10 @@ static int __init mv64x60_device_setup(void)
of_node_put(np);
}
+ /* Now add every node that is on the device bus (type is devicectrl */
+ for_each_compatible_node(np, NULL, "marvell,mv64360")
+ of_platform_bus_probe(np, of_mv64x60_devices, NULL);
+
return 0;
}
arch_initcall(mv64x60_device_setup);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sysdev,mv64x60: MV64x60 device bus
2008-04-28 17:12 [PATCH] sysdev,mv64x60: MV64x60 device bus Remi Machet
@ 2008-04-28 18:09 ` Dale Farnsworth
2008-04-28 19:22 ` Remi Machet
2008-04-29 1:54 ` Stephen Rothwell
1 sibling, 1 reply; 5+ messages in thread
From: Dale Farnsworth @ 2008-04-28 18:09 UTC (permalink / raw)
To: Remi Machet; +Cc: linuxppc-dev, Paul Mackerras
On Mon, Apr 28, 2008 at 10:12:09AM -0700, Remi Machet wrote:
> Follow up of my email of 4/16/2008 titled "MV64x60 device bus".
> For each mv64360 entry in the OpenFirmware database, add the
> registration of an of_bus to take care of devices connected to
> the MV64x60 asynchronous devices controller.
I'd like to see your dts file to see exactly how you're using it.
The only problem I see now is that you have introduced a new device
type, "devicectrl". New device types are frowned upon. It's better
to match based on the compatible field. Maybe use
"marvell,mv64306-devctrl" or similar.
-Dale
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sysdev,mv64x60: MV64x60 device bus
2008-04-28 18:09 ` Dale Farnsworth
@ 2008-04-28 19:22 ` Remi Machet
2008-04-28 19:25 ` Dale Farnsworth
0 siblings, 1 reply; 5+ messages in thread
From: Remi Machet @ 2008-04-28 19:22 UTC (permalink / raw)
To: Dale Farnsworth; +Cc: linuxppc-dev, Paul Mackerras
On Mon, 2008-04-28 at 11:09 -0700, Dale Farnsworth wrote:
> On Mon, Apr 28, 2008 at 10:12:09AM -0700, Remi Machet wrote:
> > Follow up of my email of 4/16/2008 titled "MV64x60 device bus".
> > For each mv64360 entry in the OpenFirmware database, add the
> > registration of an of_bus to take care of devices connected to
> > the MV64x60 asynchronous devices controller.
>
> I'd like to see your dts file to see exactly how you're using it.
Here it is, I removed everything that is not related to the subject:
/dts-v1/;
/ {
#address-cells = <1>;
#size-cells = <1>;
model = "C2K";
compatible = "GEFanuc,C2K";
coherency-off;
<...>
system-controller@d8000000 { /* Marvell Discovery */
#address-cells = <1>;
#size-cells = <1>;
model = "mv64460";
compatible = "marvell,mv64360";
<...>
/* Devices attached to the device controller */
devicebus {
device_type = "devicectrl";
#address-cells = <1>;
#size-cells = <1>;
nor_flash {
compatible = "cfi-flash";
reg = <0xf8000000 0x8000000>; /* 128MB */
bank-width = <4>;
device-width = <1>;
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "boot";
reg = <0x00000000 0x00080000>;
};
partition@40000 {
label = "kernel";
reg = <0x00080000 0x00400000>;
};
partition@440000 {
label = "initrd";
reg = <0x00480000 0x00B80000>;
};
partition@1000000 {
label = "rootfs";
reg = <0x01000000 0x06800000>;
};
partition@7800000 {
label = "recovery";
reg = <0x07800000 0x00800000>;
read-only;
};
};
};
};
<...>
};
>
> The only problem I see now is that you have introduced a new device
> type, "devicectrl". New device types are frowned upon. It's better
> to match based on the compatible field. Maybe use
> "marvell,mv64306-devctrl" or similar.
>
Do you mean having the DTS file look like this:
<...>
devicebus {
compatible = "marvell,mv64306-devctrl";
#address-cells = <1>;
#size-cells = <1>;
nor_flash {
compatible = "cfi-flash";
reg = <0xf8000000 0x8000000>;
<...>
};
};
Remi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sysdev,mv64x60: MV64x60 device bus
2008-04-28 19:22 ` Remi Machet
@ 2008-04-28 19:25 ` Dale Farnsworth
0 siblings, 0 replies; 5+ messages in thread
From: Dale Farnsworth @ 2008-04-28 19:25 UTC (permalink / raw)
To: Remi Machet; +Cc: linuxppc-dev, Paul Mackerras
On Mon, Apr 28, 2008 at 12:22:36PM -0700, Remi Machet wrote:
> On Mon, 2008-04-28 at 11:09 -0700, Dale Farnsworth wrote:
> > On Mon, Apr 28, 2008 at 10:12:09AM -0700, Remi Machet wrote:
> > > Follow up of my email of 4/16/2008 titled "MV64x60 device bus".
> > > For each mv64360 entry in the OpenFirmware database, add the
> > > registration of an of_bus to take care of devices connected to
> > > the MV64x60 asynchronous devices controller.
> >
> > I'd like to see your dts file to see exactly how you're using it.
> Here it is, I removed everything that is not related to the subject:
>
> /dts-v1/;
>
> / {
> #address-cells = <1>;
> #size-cells = <1>;
> model = "C2K";
> compatible = "GEFanuc,C2K";
> coherency-off;
>
> <...>
>
> system-controller@d8000000 { /* Marvell Discovery */
> #address-cells = <1>;
> #size-cells = <1>;
> model = "mv64460";
> compatible = "marvell,mv64360";
>
> <...>
>
> /* Devices attached to the device controller */
> devicebus {
> device_type = "devicectrl";
> #address-cells = <1>;
> #size-cells = <1>;
> nor_flash {
> compatible = "cfi-flash";
> reg = <0xf8000000 0x8000000>; /* 128MB */
> bank-width = <4>;
> device-width = <1>;
> #address-cells = <1>;
> #size-cells = <1>;
> partition@0 {
> label = "boot";
> reg = <0x00000000 0x00080000>;
> };
> partition@40000 {
> label = "kernel";
> reg = <0x00080000 0x00400000>;
> };
> partition@440000 {
> label = "initrd";
> reg = <0x00480000 0x00B80000>;
> };
> partition@1000000 {
> label = "rootfs";
> reg = <0x01000000 0x06800000>;
> };
> partition@7800000 {
> label = "recovery";
> reg = <0x07800000 0x00800000>;
> read-only;
> };
> };
> };
> };
> <...>
> };
Thanks.
> > The only problem I see now is that you have introduced a new device
> > type, "devicectrl". New device types are frowned upon. It's better
> > to match based on the compatible field. Maybe use
> > "marvell,mv64306-devctrl" or similar.
> >
> Do you mean having the DTS file look like this:
Yes, exactly.
-Dale
> <...>
> devicebus {
> compatible = "marvell,mv64306-devctrl";
> #address-cells = <1>;
> #size-cells = <1>;
> nor_flash {
> compatible = "cfi-flash";
> reg = <0xf8000000 0x8000000>;
> <...>
> };
> };
>
> Remi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sysdev,mv64x60: MV64x60 device bus
2008-04-28 17:12 [PATCH] sysdev,mv64x60: MV64x60 device bus Remi Machet
2008-04-28 18:09 ` Dale Farnsworth
@ 2008-04-29 1:54 ` Stephen Rothwell
1 sibling, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2008-04-29 1:54 UTC (permalink / raw)
To: Remi Machet; +Cc: Paul Mackerras, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 286 bytes --]
Hi Remi,
On Mon, 28 Apr 2008 10:12:09 -0700 Remi Machet <rmachet@slac.stanford.edu> wrote:
>
> +static struct of_device_id of_mv64x60_devices[] = {
__initdata, please.
--
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
end of thread, other threads:[~2008-04-29 1:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-28 17:12 [PATCH] sysdev,mv64x60: MV64x60 device bus Remi Machet
2008-04-28 18:09 ` Dale Farnsworth
2008-04-28 19:22 ` Remi Machet
2008-04-28 19:25 ` Dale Farnsworth
2008-04-29 1:54 ` Stephen Rothwell
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).