@ -83,13 +83,33 @@ car_init_ret:
* or f u l l y i n i t i a l i s e d S D R A M - w e r e a l l y d o n ' t c a r e w h i c h )
* starting a t C O N F I G _ S Y S _ C A R _ A D D R t o b e u s e d a s a t e m p o r a r y s t a c k
* /
movl $ C O N F I G _ S Y S _ I N I T _ S P _ A D D R , % e s p
/* Initialise the Global Data Pointer */
movl $ C O N F I G _ S Y S _ I N I T _ G D _ A D D R , % e a x
movl % e a x , % e d x
addl $ G E N E R A T E D _ G B L _ D A T A _ S I Z E , % e d x
call i n i t _ g d ;
/* Stack grows down from top of CAR */
movl $ ( 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 ) , % 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 setup_gdt */
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
/* Set second parameter to setup_gdt */
movl % e s p , % e d x
/* gd->gd_addr = gd (Required to allow gd->xyz to work) */
movl % e a x , ( % e a x )
/* Setup global descriptor table so gd->xyz works */
call s e t u p _ g d t
/* Set parameter to board_init_f() to boot flags */
xorl % e a x , % e a x
@ -113,9 +133,42 @@ board_init_f_r_trampoline:
* % eax = A d d r e s s o f t o p o f n e w s t a c k
* /
/* Setup stack in RAM */
/* Stack grows down from top of SD RAM */
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
/* gd->gd_addr = gd (Required to allow gd->xyz to work) */
movl % e a x , ( % e a x )
/* Setup global descriptor table so gd->xyz works */
call s e t u p _ g d t
/* Re-enter U-Boot by calling board_init_f_r */
call b o a r d _ i n i t _ f _ r