summaryrefslogtreecommitdiffstats
path: root/arch/i386/cpu/start.S
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2011-02-12 15:11:52 +1100
committerGraeme Russ <graeme.russ@gmail.com>2011-02-12 15:11:52 +1100
commited4cba79d640daa33806fa228c1a10c6bf9e2101 (patch)
treeb6500012ce46b0cd5ae43fdf0ff136f42e3e7133 /arch/i386/cpu/start.S
parent2e2613d2c4755426cb6bfddf1ca7714b0deec177 (diff)
downloadbootable_bootloader_goldelico_gta04-ed4cba79d640daa33806fa228c1a10c6bf9e2101.zip
bootable_bootloader_goldelico_gta04-ed4cba79d640daa33806fa228c1a10c6bf9e2101.tar.gz
bootable_bootloader_goldelico_gta04-ed4cba79d640daa33806fa228c1a10c6bf9e2101.tar.bz2
x86: Use Cache-As-RAM for initial stack
Diffstat (limited to 'arch/i386/cpu/start.S')
-rw-r--r--arch/i386/cpu/start.S35
1 files changed, 17 insertions, 18 deletions
diff --git a/arch/i386/cpu/start.S b/arch/i386/cpu/start.S
index 0ce9713..df9ca0d 100644
--- a/arch/i386/cpu/start.S
+++ b/arch/i386/cpu/start.S
@@ -72,41 +72,40 @@ _start:
.globl early_board_init_ret
early_board_init_ret:
+ /* Initialise Cache-As-RAM */
+ jmp car_init
+.globl car_init_ret
+car_init_ret:
+ /*
+ * We now have CONFIG_SYS_CAR_SIZE bytes of Cache-As-RAM (or SRAM,
+ * or fully initialised SDRAM - we really don't care which)
+ * starting at CONFIG_SYS_CAR_ADDR to be used as a temporary stack
+ */
+ movl $CONFIG_SYS_INIT_SP_ADDR, %esp
+
/* Skip memory initialization if not starting from cold-reset */
movl %ebx, %ecx
andl $GD_FLG_COLD_BOOT, %ecx
jz skip_mem_init
/* size memory */
- jmp mem_init
-.globl mem_init_ret
-mem_init_ret:
+ call mem_init
skip_mem_init:
/* fetch memory size (into %eax) */
- jmp get_mem_size
-.globl get_mem_size_ret
-get_mem_size_ret:
+ call get_mem_size
+ movl %eax, %esp
#if CONFIG_SYS_SDRAM_ECC_ENABLE
/* Skip ECC initialization if not starting from cold-reset */
movl %ebx, %ecx
andl $GD_FLG_COLD_BOOT, %ecx
- jz init_ecc_ret
- jmp init_ecc
+ jz skip_ecc_init
+ call init_ecc
-.globl init_ecc_ret
-init_ecc_ret:
+skip_init_ecc:
#endif
- /* Check we have enough memory for stack */
- movl $CONFIG_SYS_STACK_SIZE, %ecx
- cmpl %ecx, %eax
- jb die
-mem_ok:
- /* Set stack pointer to upper memory limit*/
- movl %eax, %esp
-
/* Test the stack */
pushl $0
popl %ecx