ppc: Adjust isa_io_base for ppc64
[openbios/afaerber.git] / arch / ppc / briq / init.c
blobb32e97aa2f57effe13a89aa4c8434cf5936b8426
1 /*
2 * Creation Date: <2004/08/28 18:38:22 greg>
3 * Time-stamp: <2004/08/28 18:38:22 greg>
5 * <init.c>
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
22 #include "config.h"
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 );
33 #if 0
34 int
35 get_bool_res( const char *res )
37 char buf[8], *p;
39 p = BootHGetStrRes( res, buf, sizeof(buf) );
40 if( !p )
41 return -1;
42 if( !strcasecmp(p,"true") || !strcasecmp(p,"yes") || !strcasecmp(p,"1") )
43 return 1;
44 return 0;
46 #endif
48 void
49 unexpected_excep( int vector )
51 printk("briQ panic: Unexpected exception %x\n", vector );
52 for( ;; )
56 unsigned long isa_io_base;
58 void
59 entry( void )
61 isa_io_base = 0x80000000;
63 printk("\n");
64 printk("=============================================================\n");
65 printk(PROGRAM_NAME " " OPENBIOS_VERSION_STR " [%s]\n",
66 OPENBIOS_BUILD_DATE);
68 ofmem_init();
69 initialize_forth();
70 /* won't return */
72 printk("of_startup returned!\n");
73 for( ;; )
77 static void
78 setenv( char *env, char *value )
80 push_str( value );
81 push_str( env );
82 fword("$setenv");
85 void
86 arch_of_init( void )
88 #if CONFIG_RTAS
89 phandle_t ph;
90 #endif
91 int autoboot;
93 devtree_init();
94 node_methods_init();
95 modules_init();
96 setup_timers();
97 #ifdef CONFIG_DRIVER_PCI
98 ob_pci_init();
99 #endif
101 #if CONFIG_RTAS
102 if( !(ph=find_dev("/rtas")) )
103 printk("Warning: No /rtas node\n");
104 else {
105 unsigned long size = 0x1000;
106 while( size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start )
107 size *= 2;
108 set_property( ph, "rtas-size", (char*)&size, sizeof(size) );
110 #endif
112 #if 0
113 /* tweak boot settings */
114 autoboot = !!get_bool_res("autoboot");
115 #endif
116 autoboot = 0;
117 if( !autoboot )
118 printk("Autobooting disabled - dropping into OpenFirmware\n");
119 setenv("auto-boot?", autoboot ? "true" : "false" );
120 setenv("boot-command", "briqboot");
122 #if 0
123 if( get_bool_res("tty-interface") == 1 )
124 #endif
125 fword("activate-tty-interface");
127 /* hack */
128 device_end();
129 bind_func("briqboot", boot );