u-boot/arch
Gabe Black 03228b26d5 x86: Fix how the location of the realmode and bios blobs are calculated
There are two blobs embedded into the u-boot image which are linked to run
at an address which is different from where they actually end up in the
ROM, one called "realmode" and one called "bios". There are realmode_setup
and bios_setup functions which prepare those blobs by copying them into the
location they're supposed to run from, among other things.

During u-boot relocation from ROM to RAM, the text and a few data segments
are copied over. The realmode and bios sections are not copied, and so the
only place they can be read from is their original location in the ROM.
Looking specifically at the bios blob, there are symbols defined in the
linker script called __bios_start and __bios_size which are defined to be
the start and size of the blob in the ROM.

In the bios_setup function, there seem to be two mistakes happening. First,
the offset from ROM to RAM is being added to __bios_start which implies that
this code expects to use the copy moved to RAM. No such copy is made, so
that's wrong. More subtly, when u-boot relocates itself, it goes through
all of the relocations stored in .rel.dyn and fixes them up. This has the
effect of transforming the __bios_start reference in bios_setup so that it
refers to the version in RAM (if one existed) instead of the one in ROM. To
correct for that, the offset actually needs to be subtracted out again to
translate the address back into the ROM.

The net effect is that for both blobs, a + needs to be changed to a -.

Signed-off-by: Gabe Black <gabeblack@chromium.org>
2011-11-29 21:30:38 +11:00
..
arm hawkboard: Replace HAWKBOARD_KICK{0, 1}_UNLOCK defines 2011-11-27 19:45:35 +01:00
avr32 avr32: Use getenv_ulong() in place of getenv(), strtoul 2011-10-23 23:33:17 +02:00
blackfin Blackfin: cache result of cpp check 2011-11-18 22:13:26 -05:00
m68k m68k: Use getenv_ulong() in place of getenv(), strtoul 2011-10-23 23:33:18 +02:00
microblaze microblaze: Fix strict-aliasing rules for in_be32 2011-10-24 07:57:03 +02:00
mips mips: Use getenv_ulong() in place of getenv(), strtoul 2011-10-23 23:33:19 +02:00
nds32 nds32/ag101: clean up for SoC related code 2011-11-23 14:05:51 +08:00
nios2 nios2: Offer ft_board_setup() capability and call fdt_fixup_ethernet(). 2011-10-30 21:02:43 +08:00
powerpc mpc83xx: spd_sdram - fix gcc 4.6 compiler warning 2011-11-16 21:40:26 +01:00
sandbox sandbox: drop unused return 2011-11-03 22:35:25 +01:00
sh cosmetic: s/BOARD_LATE_INIT/CONFIG_BOARD_LATE_INIT 2011-10-27 23:53:59 +02:00
sparc sparc: Use getenv_ulong() in place of getenv(), strtoul 2011-10-23 23:33:19 +02:00
x86 x86: Fix how the location of the realmode and bios blobs are calculated 2011-11-29 21:30:38 +11:00
.gitignore update include/asm/ gitignore after move 2010-05-07 00:17:30 +02:00