add board_init
[coreboot.git] / src / arch / ppc / init / ppc_main.c
1 /* 
2  * Copyright (C) 2003 by Greg Watson, Los Alamos National Laboratory
3  * gwatson@lanl.gov
4  */
5
6 #include <sdram.h>
7
8 extern unsigned _iseg[];
9 extern unsigned _liseg[];
10 extern unsigned _eliseg[];
11
12 void (*hardwaremain)(int) = _iseg;
13
14 /*
15  * At this point we're running out of flash with our
16  * stack in cache ram. We need to do the following:
17  *
18  * - turn on real memory
19  * - relocate our payload into real memory
20  * - start hardwaremain() which does remainder of setup
21  */
22
23 void ppc_main(void)
24 {
25         unsigned *from;
26         unsigned *to;
27
28         board_init();
29
30         sdram_init();
31
32         /*
33          * Relocate payload (text & data) if necessary
34          */
35         if (_liseg != _iseg) {  
36                 from = _liseg;
37                 to = _iseg;
38                 while (from < _eliseg)
39                         *to++ = *from++;
40         }
41
42         hardwaremain(0);
43 }