summaryrefslogtreecommitdiffstats
path: root/arch/i386/cpu
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2010-10-07 20:03:33 +1100
committerGraeme Russ <graeme.russ@gmail.com>2010-10-07 20:03:33 +1100
commitc868af3e57610b41c6ed4fd8d8744d8cc0a21b29 (patch)
tree6d2d1efd72aa3e7fc506f7ac65f106d163410ea5 /arch/i386/cpu
parentf2ff75c0a25eb78b4b86fd96c5f0be9dd327e2d7 (diff)
downloadbootable_bootloader_goldelico_gta04-c868af3e57610b41c6ed4fd8d8744d8cc0a21b29.zip
bootable_bootloader_goldelico_gta04-c868af3e57610b41c6ed4fd8d8744d8cc0a21b29.tar.gz
bootable_bootloader_goldelico_gta04-c868af3e57610b41c6ed4fd8d8744d8cc0a21b29.tar.bz2
x86: Implement fully relocatable image
u-boot.bin can be loaded at any 4-byte aligned memory location and directly 'jumped' to using the 'go' command using the load address as the start address. Doing so performs a 'warm boot' which skips memory initialisation and other low-level initialisations, relocates U-Boot to upper memory and starts U-Boot in RAM as per normal 'cold boot'
Diffstat (limited to 'arch/i386/cpu')
-rw-r--r--arch/i386/cpu/start.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/i386/cpu/start.S b/arch/i386/cpu/start.S
index 8fdcd81..829468f 100644
--- a/arch/i386/cpu/start.S
+++ b/arch/i386/cpu/start.S
@@ -118,6 +118,11 @@ mem_ok:
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
@@ -127,6 +132,7 @@ mem_ok:
/* %eax points to the global data structure */
movl %esp, (GD_RAM_SIZE * 4)(%eax)
movl %ebx, (GD_FLAGS * 4)(%eax)
+ movl %ecx, (GD_LOAD_OFF * 4)(%eax)
call board_init_f /* Enter, U-boot! */