diff options
author | Graeme Russ <graeme.russ@gmail.com> | 2011-02-12 15:11:54 +1100 |
---|---|---|
committer | Graeme Russ <graeme.russ@gmail.com> | 2011-02-12 15:11:54 +1100 |
commit | 96cd66426a6a615373f7f33fb2a8b7ee3925b1cf (patch) | |
tree | 4adf528d0ce2fb58f0c90933fd86c5b60a3be0fe /arch/i386/cpu/start.S | |
parent | ed4cba79d640daa33806fa228c1a10c6bf9e2101 (diff) |
sc520: Move RAM sizing code from asm to C
Diffstat (limited to 'arch/i386/cpu/start.S')
-rw-r--r-- | arch/i386/cpu/start.S | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/arch/i386/cpu/start.S b/arch/i386/cpu/start.S index df9ca0d277..95be5a2f9a 100644 --- a/arch/i386/cpu/start.S +++ b/arch/i386/cpu/start.S @@ -82,29 +82,22 @@ car_init_ret: * starting at CONFIG_SYS_CAR_ADDR to be used as a temporary stack */ movl $CONFIG_SYS_INIT_SP_ADDR, %esp + movl $CONFIG_SYS_INIT_GD_ADDR, %ebp - /* Skip memory initialization if not starting from cold-reset */ - movl %ebx, %ecx - andl $GD_FLG_COLD_BOOT, %ecx - jz skip_mem_init + /* Set Boot Flags in Global Data */ + movl %ebx, (GD_FLAGS * 4)(%ebp) - /* size memory */ - call mem_init - -skip_mem_init: - /* fetch memory size (into %eax) */ - call get_mem_size - movl %eax, %esp + /* Determine our load offset (and put in Global Data) */ + call 1f +1: popl %ecx + subl $1b, %ecx + movl %ecx, (GD_LOAD_OFF * 4)(%ebp) -#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 skip_ecc_init - call init_ecc + /* size memory */ + call dram_init_f -skip_init_ecc: -#endif + /* Setup stack in SDRAM */ + movl (GD_RAM_SIZE * 4)(%ebp), %esp /* Test the stack */ pushl $0 @@ -118,21 +111,8 @@ skip_init_ecc: wbinvd - /* Determine our load offset */ - call 1f -1: popl %ecx - subl $1b, %ecx - - /* Set the upper memory limit parameter */ - subl $CONFIG_SYS_STACK_SIZE, %eax - - /* Pointer to temporary global data */ - movl $CONFIG_SYS_INIT_GD_ADDR, %edx - - /* %edx points to the global data structure */ - movl %esp, (GD_RAM_SIZE * 4)(%edx) - movl %ebx, (GD_FLAGS * 4)(%edx) - movl %ecx, (GD_LOAD_OFF * 4)(%edx) + /* Set parameter to board_init_f() to boot flags */ + movl (GD_FLAGS * 4)(%ebp), %eax call board_init_f /* Enter, U-boot! */ |