pre-mem startup

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1207 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Greg Watson 2003-10-12 21:18:56 +00:00
parent 2caf089187
commit f610d2466c
2 changed files with 40 additions and 1 deletions

View File

@ -1,2 +1,2 @@
init crt0.S.lb
#initobject stuff.o
initobject ppc_main.o

View File

@ -0,0 +1,39 @@
/*
* Copyright (C) 2003 by Greg Watson, Los Alamos National Laboratory
* gwatson@lanl.gov
*/
extern unsigned _iseg[];
extern unsigned _liseg[];
extern unsigned _eliseg[];
void (*hardwaremain)(int) = _iseg;
/*
* At this point we're running out of flash with our
* stack in cache ram. We need to do the following:
*
* - turn on real memory
* - relocate our payload into real memory
* - start executing payload
*/
void ppc_main(void)
{
unsigned *from;
unsigned *to;
sdram_init();
/*
* Relocate payload (text & data) if necessary
*/
if (_liseg != _iseg) {
from = _liseg;
to = _iseg;
while (from < _eliseg)
*to++ = *from++;
}
hardwaremain(0);
}