ppc: Adjust isa_io_base for ppc64
[openbios/afaerber.git] / arch / ppc / pearpc / init.c
blobca6da0a4431e6276b3d6c6f8fced33de7f5edd0a
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 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
23 #include "config.h"
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 );
36 #if 0
37 int
38 get_bool_res( const char *res )
40 char buf[8], *p;
42 p = BootHGetStrRes( res, buf, sizeof(buf) );
43 if( !p )
44 return -1;
45 if( !strcasecmp(p,"true") || !strcasecmp(p,"yes") || !strcasecmp(p,"1") )
46 return 1;
47 return 0;
49 #endif
51 void
52 unexpected_excep( int vector )
54 printk("openbios panic: Unexpected exception %x\n", vector );
55 for( ;; )
59 unsigned long isa_io_base;
61 void
62 entry( void )
64 isa_io_base = 0x80000000;
66 printk("\n");
67 printk("=============================================================\n");
68 printk(PROGRAM_NAME " " OPENBIOS_VERSION_STR " [%s]\n",
69 OPENBIOS_BUILD_DATE);
71 ofmem_init();
72 initialize_forth();
73 /* won't return */
75 printk("of_startup returned!\n");
76 for( ;; )
80 static void
81 setenv( char *env, char *value )
83 push_str( value );
84 push_str( env );
85 fword("$setenv");
88 void
89 arch_of_init( void )
91 #if CONFIG_RTAS
92 phandle_t ph;
93 #endif
94 int autoboot;
96 devtree_init();
97 nvram_init("/pci/mac-io/nvram");
98 openbios_init();
99 modules_init();
100 setup_timers();
101 #ifdef CONFIG_DRIVER_PCI
102 ob_pci_init();
103 #endif
104 node_methods_init();
105 init_video();
107 #if CONFIG_RTAS
108 if( !(ph=find_dev("/rtas")) )
109 printk("Warning: No /rtas node\n");
110 else {
111 unsigned long size = 0x1000;
112 while( size < (unsigned long)of_rtas_end - (unsigned long)of_rtas_start )
113 size *= 2;
114 set_property( ph, "rtas-size", (char*)&size, sizeof(size) );
116 #endif
118 #if 0
119 /* tweak boot settings */
120 autoboot = !!get_bool_res("autoboot");
121 #endif
122 autoboot = 0;
123 if( !autoboot )
124 printk("Autobooting disabled - dropping into OpenFirmware\n");
125 setenv("auto-boot?", autoboot ? "true" : "false" );
126 setenv("boot-command", "pearpcboot");
128 #if 0
129 if( get_bool_res("tty-interface") == 1 )
130 #endif
131 fword("activate-tty-interface");
133 /* hack */
134 device_end();
135 bind_func("pearpcboot", boot );