summaryrefslogtreecommitdiff
path: root/arch/i386/cpu
Commit message (Collapse)AuthorAgeLines
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-04-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hush shell dynamically allocates (and re-allocates) memory for the argument strings in the "char *argv[]" argument vector passed to commands. Any code that modifies these pointers will cause serious corruption of the malloc data structures and crash U-Boot, so make sure the compiler can check that no such modifications are being done by changing the code into "char * const argv[]". This modification is the result of debugging a strange crash caused after adding a new command, which used the following argument processing code which has been working perfectly fine in all Unix systems since version 6 - but not so in U-Boot: int main (int argc, char **argv) { while (--argc > 0 && **++argv == '-') { /* ====> */ while (*++*argv) { switch (**argv) { case 'd': debug++; break; ... default: usage (); } } } ... } The line marked "====>" will corrupt the malloc data structures and usually cause U-Boot to crash when the next command gets executed by the shell. With the modification, the compiler will prevent this with an error: increment of read-only location '*argv' N.B.: The code above can be trivially rewritten like this: while (--argc > 0 && **++argv == '-') { char *arg = *argv; while (*++arg) { switch (*arg) { ... Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* sc520: Fix minor DRAM Controller Setup bugGraeme Russ2010-05-06-1/+1
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* sc520: Update to new AMD CopyrightGraeme Russ2010-05-06-40/+77
| | | | | | | AMD recently changed the licensing of the RAM sizing code to the GPLv2 (or at your option any later version) Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* sc520: Board Specific PCI InitGraeme Russ2010-05-06-37/+2
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* sc520: Allow boards to override udelayGraeme Russ2010-05-06-0/+4
| | | | | | | If the board has a high precision mico-second timer, it maked sense to use it instead of the on-chip one Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* x86: Use CONFIG_SERIAL_MULTIGraeme Russ2010-05-06-507/+1
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* x86: Move GDT to a safe location in RAMGraeme Russ2010-05-06-14/+103
| | | | | | | | | 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>
* x86: Add RAM bootstrap functionalityGraeme Russ2010-05-06-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* x86: Split sc520 memory sizing versus reportingGraeme Russ2010-05-06-38/+61
| | | | | | | | 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>
* x86: Fix sc520 memory size reportingGraeme Russ2010-05-06-18/+17
| | | | | | | | There is an error in how the assembler version of the sc520 memory size reporting code works. As a result, it will only ever report at most the size of one bank of RAM Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* x86: Add register dump to crash handlersGraeme Russ2010-05-06-34/+180
| | | | | | | | Shamelessly steal the Linux x86 crash handling code and shove it into U-Boot (cool - it fits). Be sure to include suitable attribution to Linus Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* x86: Fix MMCR AccessGraeme Russ2010-05-06-52/+63
| | | | | | Change sc520 MMCR Access to use memory accessor functions Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* i386: Move cpu/i386/* to arch/i386/cpu/*Peter Tyser2010-04-13-0/+2643
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>