2 * Creation Date: <2004/08/28 18:38:22 greg>
3 * Time-stamp: <2004/08/28 18:38:22 greg>
7 * Initialization for pearpc
9 * Copyright (C) 2004 Greg Watson
10 * Copyright (C) 2005 Stefan Reinauer
12 * based on mol/init.c:
14 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Samuel & David Rydh
15 * (samuel@ibrium.se, dary@lindesign.se)
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation
24 #include "libopenbios/openbios.h"
25 #include "libopenbios/bindings.h"
26 #include "arch/common/nvram.h"
27 #include "pearpc/pearpc.h"
28 #include "libopenbios/ofmem.h"
29 #include "openbios-version.h"
31 extern void unexpected_excep( int vector
);
32 extern void ob_pci_init( void );
33 extern void ob_adb_init( void );
34 extern void setup_timers( void );
38 get_bool_res( const char *res
)
42 p
= BootHGetStrRes( res
, buf
, sizeof(buf
) );
45 if( !strcasecmp(p
,"true") || !strcasecmp(p
,"yes") || !strcasecmp(p
,"1") )
52 unexpected_excep( int vector
)
54 printk("openbios panic: Unexpected exception %x\n", vector
);
59 unsigned long isa_io_base
;
64 isa_io_base
= 0x80000000;
67 printk("=============================================================\n");
68 printk(PROGRAM_NAME
" " OPENBIOS_VERSION_STR
" [%s]\n",
75 printk("of_startup returned!\n");
81 setenv( char *env
, char *value
)
97 nvram_init("/pci/mac-io/nvram");
101 #ifdef CONFIG_DRIVER_PCI
108 if( !(ph
=find_dev("/rtas")) )
109 printk("Warning: No /rtas node\n");
111 unsigned long size
= 0x1000;
112 while( size
< (unsigned long)of_rtas_end
- (unsigned long)of_rtas_start
)
114 set_property( ph
, "rtas-size", (char*)&size
, sizeof(size
) );
119 /* tweak boot settings */
120 autoboot
= !!get_bool_res("autoboot");
124 printk("Autobooting disabled - dropping into OpenFirmware\n");
125 setenv("auto-boot?", autoboot
? "true" : "false" );
126 setenv("boot-command", "pearpcboot");
129 if( get_bool_res("tty-interface") == 1 )
131 fword("activate-tty-interface");
135 bind_func("pearpcboot", boot
);