@ -104,8 +104,7 @@ car_init_ret:
*
* top- > C O N F I G _ S Y S _ C A R _ A D D R + C O N F I G _ S Y S _ C A R _ S I Z E
* MRC a r e a
* global_ d a t a
* x8 6 g l o b a l d e s c r i p t o r t a b l e
* global_ d a t a w i t h x86 g l o b a l d e s c r i p t o r t a b l e
* early m a l l o c a r e a
* stack
* bottom- > C O N F I G _ S Y S _ C A R _ A D D R
@ -120,13 +119,10 @@ car_init_ret:
* and e s i h o l d s t h e H O B l i s t a d d r e s s r e t u r n e d b y t h e F S P .
* /
# endif
/* Reserve space on stack for global data */
subl $ G E N E R A T E D _ G B L _ D A T A _ S I Z E , % e s p
/* Align global data to 16-byte boundary */
andl $ 0 x f f f f f f f0 , % e s p
post_ c o d e ( P O S T _ S T A R T _ S T A C K )
/* Set up global data */
mov % e s p , % e a x
call b o a r d _ i n i t _ f _ m e m
mov % e a x , % e s p
/ *
* Debug U A R T i s a v a i l a b l e h e r e a l t h o u g h i t m a y n o t b e p l u m b e d o u t
@ -137,56 +133,21 @@ car_init_ret:
* call p r i n t c h
* /
/* Zero the global data since it won't happen later */
xorl % e a x , % e a x
movl $ G E N E R A T E D _ G B L _ D A T A _ S I Z E , % e c x
movl % e s p , % e d i
rep s t o s b
/* Get address of global_data */
mov % f s : 0 , % e d x
# ifdef C O N F I G _ H A V E _ F S P
/* Store the HOB list if we have one */
test % e s i , % e s i
jz s k i p _ h o b
/* Store HOB list */
movl % e s p , % e d x
addl $ G D _ H O B _ L I S T , % e d x
movl % e s i , ( % e d x )
movl % e s i , G D _ H O B _ L I S T ( % e d x )
skip_hob :
# else
/* Store table pointer */
movl % e s p , % e d x
addl $ G D _ T A B L E , % e d x
movl % e s i , ( % e d x )
movl % e s i , G D _ T A B L E ( % e d x )
# endif
/* Setup first parameter to setup_gdt, pointer to global_data */
movl % e s p , % e a x
/* Reserve space for global descriptor table */
subl $ X 8 6 _ G D T _ S I Z E , % e s p
/* Align temporary global descriptor table to 16-byte boundary */
andl $ 0 x f f f f f f f0 , % e s p
movl % e s p , % e c x
# if d e f i n e d ( C O N F I G _ S Y S _ M A L L O C _ F _ L E N )
/* Set up the pre-relocation malloc pool */
subl $ C O N F I G _ S Y S _ M A L L O C _ F _ L E N , % e s p
movl % e a x , % e d x
addl $ G D _ M A L L O C _ B A S E , % e d x
movl % e s p , ( % e d x )
# endif
/* Store BIST into global_data */
movl % e a x , % e d x
addl $ G D _ B I S T , % e d x
movl % e b p , ( % e d x )
/* Set second parameter to setup_gdt() */
movl % e c x , % e d x
/* Setup global descriptor table so gd->xyz works */
call s e t u p _ g d t
/* Store BIST */
movl % e b p , G D _ B I S T ( % e d x )
/* Set parameter to board_init_f() to boot flags */
post_ c o d e ( P O S T _ S T A R T _ D O N E )
@ -213,37 +174,7 @@ board_init_f_r_trampoline:
/* Stack grows down from top of SDRAM */
movl % e a x , % e s p
/* Reserve space on stack for global data */
subl $ G E N E R A T E D _ G B L _ D A T A _ S I Z E , % e s p
/* Align global data to 16-byte boundary */
andl $ 0 x f f f f f f f0 , % e s p
/* Setup first parameter to memcpy() and setup_gdt() */
movl % e s p , % e a x
/* Setup second parameter to memcpy() */
fs m o v l 0 , % e d x
/* Set third parameter to memcpy() */
movl $ G E N E R A T E D _ G B L _ D A T A _ S I Z E , % e c x
/* Copy global data from CAR to SDRAM stack */
call m e m c p y
/* Reserve space for global descriptor table */
subl $ X 8 6 _ G D T _ S I Z E , % e s p
/* Align global descriptor table to 16-byte boundary */
andl $ 0 x f f f f f f f0 , % e s p
/* Set second parameter to setup_gdt() */
movl % e s p , % e d x
/* Setup global descriptor table so gd->xyz works */
call s e t u p _ g d t
/* Set if we need to disable CAR */
/* See if we need to disable CAR */
.weak car_uninit
movl $ c a r _ u n i n i t , % e a x
cmpl $ 0 , % e a x