summaryrefslogtreecommitdiff
path: root/arch/i386
Commit message (Collapse)AuthorAgeLines
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-04-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Coding style cleanup, update CHANGELOG.Wolfgang Denk2010-05-26-3/+0
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* 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/+3
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* sc520: Move PCI defines to PCI include fileGraeme Russ2010-05-06-29/+29
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* sc520: Allow boards to override udelayGraeme Russ2010-05-06-0/+5
| | | | | | | 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: Fix support for booting bzImageGraeme Russ2010-05-06-32/+424
| | | | | | | | | | | Add support for newer (up to 2.6.33) kernels Add zboot command which takes the address of a bzImage as its first argument and (optionally) the size of the bzImage as the second argument (the second argument is needed for older kernels which do not include the bzImage size in the header) Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* x86: Provide weak PC/AT compatibility setup functionGraeme Russ2010-05-06-0/+9
| | | | | | | | | | It is possibly to setup x86 boards to use non-PC/AT configurations. For example, the sc520 is an x86 CPU with PC/AT and non-PC/AT peripherals. This function allows the board to set itself up for maximum PC/AT compatibility just before booting the Linux kernel (the Linux kernel 'just works' if everything is PC/AT compliant) Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* x86: Use CONFIG_SERIAL_MULTIGraeme Russ2010-05-06-508/+5
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* x86: Fix copying of Real-Mode code into RAMGraeme Russ2010-05-06-2/+2
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* x86: Pass relocation offset into Global DataGraeme Russ2010-05-06-27/+36
| | | | | | | In order to locate the 16-bit BIOS code, we need to know the reloaction offset. 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: Fix do_go_exec()Graeme Russ2010-05-06-4/+4
| | | | | | | This was broken a long time ago by a49864593e083a5d0779fb9ca98e5a0f2053183d which munged the NIOS and x86 do_go_exec() 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>
* x86: #ifdef out getenv_IPaddr()Graeme Russ2010-05-06-0/+2
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* x86: Add unaligned.hGraeme Russ2010-05-06-0/+1
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* i386: Move cpu/i386/* to arch/i386/cpu/*Peter Tyser2010-04-13-2/+2645
| | | | Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Move architecture-specific includes to arch/$ARCH/include/asmPeter Tyser2010-04-13-0/+1940
| | | | | | | | This helps to clean up the include/ directory so that it only contains non-architecture-specific headers and also matches Linux's directory layout which many U-Boot developers are already familiar with. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Move lib_$ARCH directories to arch/$ARCH/libPeter Tyser2010-04-13-0/+3607
Also move lib_$ARCH/config.mk to arch/$ARCH/config.mk This change is intended to clean up the top-level directory structure and more closely mimic Linux's directory organization. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>