diff options
author | Wolfgang Denk <wd@denx.de> | 2012-02-17 23:47:29 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2012-02-17 23:47:29 +0100 |
commit | e390e8709149664ff96cf19384264c84573f3082 (patch) | |
tree | a14b00ce6732eedf0b9c20b2cb54f17f1ac14596 /arch/x86/cpu/start.S | |
parent | e9d44b35beb45869863f3ca6929089d9df4df3e5 (diff) | |
parent | afd855d534de22aa625cb12aa9aa45e459f7de99 (diff) | |
download | u-boot-imx-e390e8709149664ff96cf19384264c84573f3082.zip u-boot-imx-e390e8709149664ff96cf19384264c84573f3082.tar.gz u-boot-imx-e390e8709149664ff96cf19384264c84573f3082.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-x86
* 'master' of git://git.denx.de/u-boot-x86:
x86: Convert board_init_f_r to a processing loop
x86: Split init functions out of board.c
x86: Move relocation code out of board.c
x86: Move setup_pcat_compatibility() out of board.c
x86: Move do_go_exec() out of board.c
CHECKPATCH: arch/x86/lib/*
x86: Tweak IDT and GDT for alignment and readability
x86: Allow cache before copy to RAM
x86: Create weak init_cache() and default enable_caches() functions
x86: Set GD_FLG_RELOC after entering in-RAM copy of U-Boot
x86: Use fs for global data
x86: Rework relocation calculations
x86: Simplify Flash-to-RAM code execution transition
x86: Rework Global Descriptor Table loading
x86: Remove GDR related magic numbers
x86: Speed up copy-to-RAM and clear BSS operations
x86: Import glibc memcpy implementation
Diffstat (limited to 'arch/x86/cpu/start.S')
-rw-r--r-- | arch/x86/cpu/start.S | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S index f87633b..ee0dabe 100644 --- a/arch/x86/cpu/start.S +++ b/arch/x86/cpu/start.S @@ -29,8 +29,9 @@ #include <config.h> #include <version.h> #include <asm/global_data.h> +#include <asm/processor.h> #include <asm/processor-flags.h> -#include <generated/asm-offsets.h> +#include <generated/generic-asm-offsets.h> .section .text .code32 @@ -58,7 +59,7 @@ _start: /* This is the 32-bit cold-reset entry point */ /* Load the segement registes to match the gdt loaded in start16.S */ - movl $0x18, %eax + movl $(X86_GDT_ENTRY_32BIT_DS * X86_GDT_ENTRY_SIZE), %eax movw %ax, %fs movw %ax, %ds movw %ax, %gs @@ -84,6 +85,12 @@ car_init_ret: */ movl $CONFIG_SYS_INIT_SP_ADDR, %esp + /* Initialise the Global Data Pointer */ + movl $CONFIG_SYS_INIT_GD_ADDR, %eax + movl %eax, %edx + addl $GENERATED_GBL_DATA_SIZE, %edx + call init_gd; + /* Set parameter to board_init_f() to boot flags */ xorl %eax, %eax movw %bx, %ax @@ -95,32 +102,22 @@ car_init_ret: movw $0x85, %ax jmp die -.globl relocate_code -.type relocate_code, @function -relocate_code: +.globl board_init_f_r_trampoline +.type board_init_f_r_trampoline, @function +board_init_f_r_trampoline: /* * SDRAM has been initialised, U-Boot code has been copied into * RAM, BSS has been cleared and relocation adjustments have been * made. It is now time to jump into the in-RAM copy of U-Boot * - * %eax = Address of top of stack - * %edx = Address of Global Data - * %ecx = Base address of in-RAM copy of U-Boot + * %eax = Address of top of new stack */ /* Setup stack in RAM */ movl %eax, %esp - /* Setup call address of in-RAM copy of board_init_r() */ - movl $board_init_r, %ebp - addl (GENERATED_GD_RELOC_OFF)(%edx), %ebp - - /* Setup parameters to board_init_r() */ - movl %edx, %eax - movl %ecx, %edx - - /* Jump to in-RAM copy of board_init_r() */ - call *%ebp + /* Re-enter U-Boot by calling board_init_f_r */ + call board_init_f_r die: hlt |