2 * Creation Date: <2004/08/28 18:38:22 greg>
3 * Time-stamp: <2004/08/28 18:38:22 greg>
7 * Initialization for briq
9 * Copyright (C) 2004 Greg Watson
11 * based on mol/init.c:
13 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Samuel & David Rydh
14 * (samuel@ibrium.se, dary@lindesign.se)
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation
23 #include "libopenbios/openbios.h"
24 #include "libopenbios/bindings.h"
25 #include "arch/common/nvram.h"
26 #include "briq/briq.h"
27 #include "libopenbios/ofmem.h"
28 #include "openbios-version.h"
30 extern void unexpected_excep( int vector
);
31 extern void setup_timers( void );
35 get_bool_res( const char *res
)
39 p
= BootHGetStrRes( res
, buf
, sizeof(buf
) );
42 if( !strcasecmp(p
,"true") || !strcasecmp(p
,"yes") || !strcasecmp(p
,"1") )
49 unexpected_excep( int vector
)
51 printk("briQ panic: Unexpected exception %x\n", vector
);
56 unsigned long isa_io_base
;
61 isa_io_base
= 0x80000000;
64 printk("=============================================================\n");
65 printk(PROGRAM_NAME
" " OPENBIOS_VERSION_STR
" [%s]\n",
72 printk("of_startup returned!\n");
78 setenv( char *env
, char *value
)
97 #ifdef CONFIG_DRIVER_PCI
102 if( !(ph
=find_dev("/rtas")) )
103 printk("Warning: No /rtas node\n");
105 unsigned long size
= 0x1000;
106 while( size
< (unsigned long)of_rtas_end
- (unsigned long)of_rtas_start
)
108 set_property( ph
, "rtas-size", (char*)&size
, sizeof(size
) );
113 /* tweak boot settings */
114 autoboot
= !!get_bool_res("autoboot");
118 printk("Autobooting disabled - dropping into OpenFirmware\n");
119 setenv("auto-boot?", autoboot
? "true" : "false" );
120 setenv("boot-command", "briqboot");
123 if( get_bool_res("tty-interface") == 1 )
125 fword("activate-tty-interface");
129 bind_func("briqboot", boot
);