linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] powerpc: Create "rom" (MTD) device prpmc2800
@ 2007-06-02  4:30 Milton Miller
  2007-06-02  7:39 ` Benjamin Herrenschmidt
                   ` (3 more replies)
  0 siblings, 4 replies; 81+ messages in thread
From: Milton Miller @ 2007-06-02  4:30 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: ppcdev

On Sat Jun 2 09:20:22 EST 2007,  Mark A. Greer wrote:

> Find the "rom" device for the prpmc2800 and create a device for it.
> The device will be picked up by the code in 
> drivers/mtd/maps/physmap_of.c
> and will setup MTD on that FLASH device.
...
>  /*
> + * Register a platform device for MTD.
> + */
> +static int __init prpmc2800_register_mtd(void)
> +{
> +       struct device_node *np;
> +
> +       np = of_find_compatible_node(NULL, "rom", "direct-mapped");
> +       of_platform_device_create(np, np->name, NULL);
> +}
> +arch_initcall(prpmc2800_register_mtd);
>

I think "direct-mapped" as compatible is a bit too broad or vague.

The compatible is supposed to be useable to find and match a driver
without regard to the name of the node.  Perhaps direct-mapped-rom?
(as opossed to a direct-mapped-ram, sram, or some width flash bank).

Actually, looking back at your device tree {1], your list several
properties for flash, including bank-width and partition names.
Perhaps first compatible should be direct-mapped-partitioned-flash,
direct-mapped-partitioned-rom, direct-mapped-rom  (to me a
direct-mapped-rom driver would expose one section of address space
read-only). I'm assuming that your driver for this "direct-mapped"
device will look at these properties from the of device node and
call the mtd layer somewhat directly with their contents.

[1] http://ozlabs.org/pipermail/linuxppc-dev/2007-May/035858.html

milton

PS: I know you've posted this a few times.  I'm just behind in
my reading and  replying :-).

^ permalink raw reply	[flat|nested] 81+ messages in thread
* [PATCH] powerpc: Create "rom" (MTD) device prpmc2800
@ 2007-06-01 23:20 Mark A. Greer
  2007-06-02  8:46 ` Segher Boessenkool
  2007-06-04 20:56 ` Mark A. Greer
  0 siblings, 2 replies; 81+ messages in thread
From: Mark A. Greer @ 2007-06-01 23:20 UTC (permalink / raw)
  To: linuxppc-dev


Find the "rom" device for the prpmc2800 and create a device for it.
The device will be picked up by the code in drivers/mtd/maps/physmap_of.c
and will setup MTD on that FLASH device.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>

---
 arch/powerpc/platforms/embedded6xx/prpmc2800.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
index d9db135..44c3144 100644
--- a/arch/powerpc/platforms/embedded6xx/prpmc2800.c
+++ b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
@@ -20,6 +20,7 @@
 #include <asm/system.h>
 #include <asm/time.h>
 #include <asm/kexec.h>
+#include <asm/of_platform.h>
 
 #include <mm/mmu_decl.h>
 
@@ -134,6 +135,18 @@ void prpmc2800_show_cpuinfo(struct seq_file *m)
 }
 
 /*
+ * Register a platform device for MTD.
+ */
+static int __init prpmc2800_register_mtd(void)
+{
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, "rom", "direct-mapped");
+	of_platform_device_create(np, np->name, NULL);
+}
+arch_initcall(prpmc2800_register_mtd);
+
+/*
  * Called very early, device-tree isn't unflattened
  */
 static int __init prpmc2800_probe(void)

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

end of thread, other threads:[~2007-06-15 11:22 UTC | newest]

Thread overview: 81+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-02  4:30 [PATCH] powerpc: Create "rom" (MTD) device prpmc2800 Milton Miller
2007-06-02  7:39 ` Benjamin Herrenschmidt
2007-06-03 16:10   ` Sergei Shtylyov
2007-06-03 17:36     ` Segher Boessenkool
2007-06-03 18:03       ` Sergei Shtylyov
2007-06-03 18:25         ` Segher Boessenkool
2007-06-03 18:36           ` Sergei Shtylyov
2007-06-03 18:46             ` Segher Boessenkool
2007-06-03 19:16               ` Sergei Shtylyov
2007-06-03 21:04         ` Benjamin Herrenschmidt
2007-06-04 12:34           ` Sergei Shtylyov
2007-06-04 14:37             ` Segher Boessenkool
2007-06-04 14:49               ` Sergei Shtylyov
2007-06-07 14:53           ` David Woodhouse
2007-06-07 15:49             ` Segher Boessenkool
2007-06-07 14:47         ` David Woodhouse
2007-06-07 15:32           ` Segher Boessenkool
2007-06-02  8:53 ` Segher Boessenkool
2007-06-03 16:22   ` Sergei Shtylyov
2007-06-03 17:40     ` Segher Boessenkool
2007-06-03 18:31       ` Sergei Shtylyov
2007-06-03 18:44         ` Segher Boessenkool
2007-06-03 19:13           ` Sergei Shtylyov
2007-06-03 19:56             ` Segher Boessenkool
2007-06-03 20:26               ` Sergei Shtylyov
2007-06-04  8:07                 ` Segher Boessenkool
2007-06-04 13:34                   ` Sergei Shtylyov
2007-06-07 15:00                 ` David Woodhouse
2007-06-07 15:55                   ` Segher Boessenkool
2007-06-07 16:05                     ` David Woodhouse
2007-06-07 16:46                       ` Segher Boessenkool
2007-06-12  4:44                     ` David Gibson
2007-06-12 10:53                       ` Segher Boessenkool
2007-06-13  3:16                         ` David Gibson
2007-06-13  5:05                           ` Segher Boessenkool
2007-06-13  6:11                             ` David Gibson
2007-06-13  9:10                               ` Segher Boessenkool
2007-06-15  4:12                                 ` David Gibson
2007-06-15 11:22                                   ` Segher Boessenkool
2007-06-15  4:14                     ` David Gibson
2007-06-15  8:42                       ` Segher Boessenkool
2007-06-15  8:47                         ` David Woodhouse
2007-06-15  8:59                           ` Segher Boessenkool
2007-06-03 21:12     ` Benjamin Herrenschmidt
2007-06-04  8:11       ` Segher Boessenkool
2007-06-04 13:16         ` Sergei Shtylyov
2007-06-04 12:41       ` Sergei Shtylyov
2007-06-04 14:49         ` Segher Boessenkool
2007-06-04 15:54           ` Sergei Shtylyov
2007-06-03 17:29 ` Sergei Shtylyov
2007-06-03 17:45   ` Segher Boessenkool
2007-06-03 18:18     ` Sergei Shtylyov
2007-06-03 18:43       ` Segher Boessenkool
2007-06-03 18:59         ` Sergei Shtylyov
2007-06-03 19:48           ` Segher Boessenkool
2007-06-03 20:10             ` Sergei Shtylyov
2007-06-04  8:02               ` Segher Boessenkool
2007-06-04 19:40 ` Mark A. Greer
  -- strict thread matches above, loose matches on Subject: below --
2007-06-01 23:20 Mark A. Greer
2007-06-02  8:46 ` Segher Boessenkool
2007-06-04 20:56 ` Mark A. Greer
2007-06-05 20:35   ` Sergei Shtylyov
2007-06-05 21:11     ` Mark A. Greer
2007-06-06 12:41       ` Sergei Shtylyov
2007-06-07 15:08         ` David Woodhouse
2007-06-06  2:39   ` David Gibson
2007-06-07 13:30     ` Segher Boessenkool
2007-06-12  4:42       ` David Gibson
2007-06-12 10:50         ` Segher Boessenkool
2007-06-13  6:12           ` David Gibson
2007-06-13  9:13             ` Segher Boessenkool
2007-06-13  9:19               ` David Gibson
2007-06-13  9:37                 ` Segher Boessenkool
2007-06-14  4:29                   ` David Gibson
2007-06-14  8:00                     ` Segher Boessenkool
2007-06-14 12:39                     ` Sergei Shtylyov
2007-06-14 13:20                       ` Segher Boessenkool
2007-06-14 12:48           ` Sergei Shtylyov
2007-06-14 13:18             ` Segher Boessenkool
2007-06-14 12:50         ` Sergei Shtylyov
2007-06-14 13:43           ` Segher Boessenkool

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