Commit Graph

22 Commits

Author SHA1 Message Date
Graeme Russ fb0029088e x86: Defer setup of final stack 2011-02-12 15:11:58 +11:00
Graeme Russ 96cd66426a sc520: Move RAM sizing code from asm to C 2011-02-12 15:11:54 +11:00
Graeme Russ ed4cba79d6 x86: Use Cache-As-RAM for initial stack 2011-02-12 15:11:52 +11:00
Graeme Russ 2e2613d2c4 x86: Move initial gd to fixed location 2011-02-12 15:11:50 +11:00
Graeme Russ 4e33467d44 x86: Call early_board_init when warm booting
early_board_init has been skipped to avoid SDRAM corruption in the case
that a fully relocatable image has been loaded into SDRAM and is being
executed from SDRAM. x86 is being aligned with other architectures (ARM
and PPC in particlar) and will be using Cache-As-RAM to run a C
environment from Flash (or SRAM if you have some). early_board_init may
be needed to assist in the setup of Cache-As-RAM and the early C
environment
2011-02-12 15:11:33 +11:00
Graeme Russ 0c24c9cc71 x86: Add processor flags header from linux 2011-02-12 15:11:32 +11:00
Graeme Russ 9963a8216e x86: Fix mangled umlauts
git mergetool has a nasty habit of mangling umlats - fix ones that have
been missed in previous submissions
2011-02-12 15:11:26 +11:00
Graeme Russ c868af3e57 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'
2010-10-07 20:03:33 +11:00
Graeme Russ c81b26beb8 x86: Set cold/warm boot flag 2010-10-07 20:03:30 +11:00
Graeme Russ 161b3589ea x86: Place global data below stack before entering C
By reserving space for the Global Data immediately below the stack during
assembly level initialisation, the C declaration of the static global data
can be removed, along with the 'RAM Bootstrap' function. This results in
cleaner code, and the ability to pass boot-up flags from assembler into C
2010-10-07 20:03:29 +11:00
Graeme Russ 5a3876d2ac x86: Dont clobber %eax after getting memory size
By using another register, reduce code size by one instruction
2010-10-07 20:03:28 +11:00
Graeme Russ 5f2679055d x86: Don't clobber %ebx
%ebx will hold low-level boot flags and must be preserved
2010-10-07 20:03:28 +11:00
Graeme Russ 88fa0a6eb9 x86: Remove usage of %ebp as a return pointer
Using %ebp as a return pointer prevents creating 'load anywhere' images
2010-10-07 20:03:27 +11:00
Graeme Russ 00940a229d x86: Move ECC initialisation outside RAM initialisation
To allow for 'load anywhere' images, the %ebp return pointer 'hack' must
be removed, so we cannot have two 'calls' to get_mem_size
2010-10-07 20:03:26 +11:00
Graeme Russ 6ae032a86a x86: Remove progress indication in low-level init
Progress indication is not relocation friendly so remove it in
preperation for full relocatability support
2010-10-07 20:03:24 +11:00
Graeme Russ 5c161653db x86: Change compiler options
Change to:
 - reparam=3
 - no-from-pointer
 - no-stack-protector
 - preferred-stack-boundary=2
 - no-top-level-reorder

These options make the code a little smaller and faster
2010-10-07 20:03:23 +11:00
Graeme Russ 8ffb2e8f33 x86: Coding Style Cleanup
Perform some basic code cleanups of the x86 files
2010-10-07 20:03:21 +11:00
Graeme Russ 59c6d0ef9a x86: Move loading of GTD to C code
Linux has C macros and code to load the GTD after switching to Protected
Mode. Using these greatly simplifies the assembler code
2010-10-07 20:03:21 +11:00
Graeme Russ c14a3669b2 x86: Move GDT to a safe location in RAM
Currently, the GDT is either located in FLASH or in the non-relocated
U-Boot image in RAM. Both of these locations are unsafe as those
locations can be erased during a U-Boot update. Move the GDT into the
highest available memory location and relocate U-Boot to just below it

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2010-05-06 00:15:43 +02:00
Graeme Russ 077e1958ca x86: Add RAM bootstrap functionality
Add a parameter to the 32-bit entry to indicate if entry is from Real
Mode or not. If entry is from Real Mode, execute the destructive 'sizer'
routine to determine memory size as we are booting cold and running in
Flash. If not entering from Real Mode, we are executing a U-Boot image
from RAM and therefore the memory size is already known (and running
'sizer' will destroy the running image)

There are now two 32-bit entry points. The first is the 'in RAM' entry
point which exists at the start of the U-Boot binary image. As such,
you can load u-boot.bin in RAM and jump directly to the load address
without needing to calculate any offsets. The second entry point is
used by the real-to-protected mode switch

This patch also changes TEXT_BASE to 0x6000000 (in RAM). You can load
the resulting image at 0x6000000 and simple go 0x6000000 from the u-boot
prompt

Hopefully a later patch will completely elliminate any dependency on
TEXT_BASE like a relocatable linux kernel (perfect world)

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2010-05-06 00:15:31 +02:00
Graeme Russ 759598f82f x86: Split sc520 memory sizing versus reporting
This patch allows the low-level assembler boot-strap to obtain the RAM
size without calling the destructive 'sizer' routine. This allows
boot-strapping from a U-Boot image loaded in RAM

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
2010-05-06 00:14:44 +02:00
Peter Tyser e9a882803e i386: Move cpu/i386/* to arch/i386/cpu/*
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2010-04-13 09:13:26 +02:00