Re: powerpc_flash_init(), wtf!?

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

2 messages, 2 authors, 2007-05-24 · open the first message on its own page

Re: powerpc_flash_init(), wtf!?

From: Mark A. Greer <hidden>
Date: 2007-05-23 21:57:35

Sorry, I've lost the thread in my inbox so I can't reply to it directly.

Is something like this what everyone agreed upon?

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

Re: powerpc_flash_init(), wtf!?

From: David Gibson <hidden>
Date: 2007-05-24 00:56:18

On Wed, May 23, 2007 at 02:57:35PM -0700, Mark A. Greer wrote:
Sorry, I've lost the thread in my inbox so I can't reply to it directly.

Is something like this what everyone agreed upon?
That's the right approach if your flash device isn't on a bus that's
already being scanned with of_platform_bus_probe().

-- 
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help