From 8d8e29fce6f11a10b4e194b5b6b927c27522dc94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 31 Oct 2010 10:21:50 +0000 Subject: [PATCH] ppc: Don't set up RTAS for OldWorld Macs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to historical device trees, pre-iMac Macs do not seem to have the /rtas node. Make /rtas conditional to NewWorld Macs for now, while allowing to extend this to future CHRP machines. This means that the ppc-softmmu would by default not have it, except when using -M mac99. ppc64-softmmu would get it by default. Signed-off-by: Andreas Färber git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@936 f158a5a8-5612-0410-a976-696ce0be7e32 --- arch/ppc/qemu/init.c | 20 +++++++++++++------- arch/ppc/qemu/methods.c | 4 +++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c index 9b62746..3bd6b40 100644 --- a/arch/ppc/qemu/init.c +++ b/arch/ppc/qemu/init.c @@ -753,13 +753,19 @@ arch_of_init( void ) node_methods_init(buf); #ifdef CONFIG_RTAS - if( !(ph=find_dev("/rtas")) ) - printk("Warning: No /rtas node\n"); - else { - unsigned long size = 0x1000; - while( size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start ) - size *= 2; - set_property( ph, "rtas-size", (char*)&size, sizeof(size) ); + /* OldWorld Macs don't have an /rtas node. */ + switch (machine_id) { + case ARCH_MAC99: + case ARCH_MAC99_U3: + if (!(ph = find_dev("/rtas"))) { + printk("Warning: No /rtas node\n"); + } else { + unsigned long size = 0x1000; + while (size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start) + size *= 2; + set_property(ph, "rtas-size", (char*)&size, sizeof(size)); + } + break; } #endif diff --git a/arch/ppc/qemu/methods.c b/arch/ppc/qemu/methods.c index bbb101f..12424e9 100644 --- a/arch/ppc/qemu/methods.c +++ b/arch/ppc/qemu/methods.c @@ -304,7 +304,9 @@ node_methods_init( const char *cpuname ) { phandle_t chosen, ph; #ifdef CONFIG_RTAS - REGISTER_NODE( rtas ); + if (is_newworld()) { + REGISTER_NODE( rtas ); + } #endif REGISTER_NODE( ciface ); REGISTER_NODE( memory );