diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c index 8562c0f..d864ffd 100644 --- a/arch/ppc/qemu/init.c +++ b/arch/ppc/qemu/init.c @@ -489,7 +489,7 @@ arch_of_init( void ) #endif snprintf(buf, sizeof(buf), "/cpus/%s", cpu->name); ofmem_register(find_dev(buf)); - node_methods_init(); + node_methods_init(buf); #ifdef USE_RTAS if( !(ph=find_dev("/rtas")) ) diff --git a/arch/ppc/qemu/kernel.h b/arch/ppc/qemu/kernel.h index 605bf1f..666262e 100644 --- a/arch/ppc/qemu/kernel.h +++ b/arch/ppc/qemu/kernel.h @@ -25,7 +25,7 @@ extern char of_rtas_start[], of_rtas_end[]; extern void call_elf( ulong elf_entry ); /* methods.c */ -extern void node_methods_init( void ); +extern void node_methods_init( const char *cpuname ); /* main.c */ extern void boot( void ); diff --git a/arch/ppc/qemu/methods.c b/arch/ppc/qemu/methods.c index 3f7f683..83d3e31 100644 --- a/arch/ppc/qemu/methods.c +++ b/arch/ppc/qemu/methods.c @@ -149,7 +149,7 @@ NODE_METHODS( ciface ) = { /************************************************************************/ DECLARE_NODE( memory, INSTALL_OPEN, 0, "/memory" ); -DECLARE_NODE( mmu, INSTALL_OPEN, 0, "/cpu@0" ); +DECLARE_UNNAMED_NODE( mmu, INSTALL_OPEN, 0 ); DECLARE_NODE( mmu_ciface, 0, 0, "+/openprom/client-services" ); @@ -291,14 +291,21 @@ NODE_METHODS( mmu_ciface ) = { /************************************************************************/ void -node_methods_init( void ) +node_methods_init( const char *cpuname ) { + phandle_t chosen, ph; #ifdef USE_RTAS REGISTER_NODE( rtas ); #endif REGISTER_NODE( ciface ); REGISTER_NODE( memory ); - REGISTER_NODE( mmu ); + REGISTER_NODE_METHODS( mmu, cpuname ); REGISTER_NODE( mmu_ciface ); REGISTER_NODE( tty ); + + chosen = find_dev("/chosen"); + if (chosen) { + ph = find_dev(cpuname); + set_int_property(chosen, "mmu", ph); + } } diff --git a/arch/ppc/qemu/qemu.fs b/arch/ppc/qemu/qemu.fs index fb5cb7a..a2caf20 100644 --- a/arch/ppc/qemu/qemu.fs +++ b/arch/ppc/qemu/qemu.fs @@ -37,7 +37,6 @@ :noname " rtc" " rtc" preopen " memory" " /memory" preopen - " mmu" " /cpu@0" preopen \ " stdout" " /packages/terminal-emulator" preopen " stdout" " screen" preopen " stdin" " adb-keyboard" preopen diff --git a/arch/ppc/qemu/tree.fs b/arch/ppc/qemu/tree.fs index 649a56d..7fff2c4 100644 --- a/arch/ppc/qemu/tree.fs +++ b/arch/ppc/qemu/tree.fs @@ -35,13 +35,6 @@ new-device : close ; finish-device -new-device - " cpus" device-name - " cpus" device-type - 1 encode-int " #address-cells" property - 0 encode-int " #size-cells" property -finish-device - \ ------------------------------------------------------------- \ /packages \ -------------------------------------------------------------