Author: blueswirl Date: 2009-01-02 08:41:40 +0100 (Fri, 02 Jan 2009) New Revision: 341
Modified: openbios-devel/arch/ppc/qemu/init.c openbios-devel/arch/ppc/qemu/kernel.h openbios-devel/arch/ppc/qemu/methods.c openbios-devel/arch/ppc/qemu/qemu.fs openbios-devel/arch/ppc/qemu/tree.fs Log: Correct duplicate /cpus and more (Laurent Vivier)
Correct duplicate /cpus Correct mmu properties in /chosen Add mmu methods to /cpus/<cpu>
Modified: openbios-devel/arch/ppc/qemu/init.c =================================================================== --- openbios-devel/arch/ppc/qemu/init.c 2009-01-01 07:48:12 UTC (rev 340) +++ openbios-devel/arch/ppc/qemu/init.c 2009-01-02 07:41:40 UTC (rev 341) @@ -489,7 +489,7 @@ #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")) )
Modified: openbios-devel/arch/ppc/qemu/kernel.h =================================================================== --- openbios-devel/arch/ppc/qemu/kernel.h 2009-01-01 07:48:12 UTC (rev 340) +++ openbios-devel/arch/ppc/qemu/kernel.h 2009-01-02 07:41:40 UTC (rev 341) @@ -25,7 +25,7 @@ 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 );
Modified: openbios-devel/arch/ppc/qemu/methods.c =================================================================== --- openbios-devel/arch/ppc/qemu/methods.c 2009-01-01 07:48:12 UTC (rev 340) +++ openbios-devel/arch/ppc/qemu/methods.c 2009-01-02 07:41:40 UTC (rev 341) @@ -149,7 +149,7 @@ /************************************************************************/
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 @@ /************************************************************************/
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); + } }
Modified: openbios-devel/arch/ppc/qemu/qemu.fs =================================================================== --- openbios-devel/arch/ppc/qemu/qemu.fs 2009-01-01 07:48:12 UTC (rev 340) +++ openbios-devel/arch/ppc/qemu/qemu.fs 2009-01-02 07:41:40 UTC (rev 341) @@ -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
Modified: openbios-devel/arch/ppc/qemu/tree.fs =================================================================== --- openbios-devel/arch/ppc/qemu/tree.fs 2009-01-01 07:48:12 UTC (rev 340) +++ openbios-devel/arch/ppc/qemu/tree.fs 2009-01-02 07:41:40 UTC (rev 341) @@ -35,13 +35,6 @@ : 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 \ -------------------------------------------------------------