From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 1 Jun 2007 16:20:22 -0700 From: "Mark A. Greer" To: linuxppc-dev Subject: [PATCH] powerpc: Create "rom" (MTD) device prpmc2800 Message-ID: <20070601232022.GA21237@mag.az.mvista.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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 #include #include +#include #include @@ -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)