coreboot/payloads/libpayload/arch/arm
Gabe Black ca88f39c21 libpayload: arm: Pass the coreboot table location to the payload.
To find the coreboot tables, the payload has historically searched for their
signature in a predefined region of memory. This is a little clumsy on x86,
but it works because you can assume certain regions are RAM. Also, there are
areas which are set aside for the firmware by convention. On x86 there's a
forwarding entry which goes in one of those fairly small conventional areas
and which points to the CBMEM area at the end of memory.

On ARM there aren't areas like that, so we've left out the forwarding entry and
gone directly to CBMEM. RAM may not start at the beginning of the address space
or go to its end, and that means there isn't really anywhere fixed you can put
the coreboot tables. That's meant that libpayload has to be configured on a
per board basis to know where to look for CBMEM.

Now that we have boards that don't have fixed amounts of memory, the location
of the end of RAM isn't fixed even on a per board level which means even that
workaround will no longer cut it.

This change makes coreboot pass the location of the coreboot tables to
libpayload using r0, the first argument register. That means we'll be able to
find them no matter where CBMEM is, and we can get rid of the per board search
ranges.

We can extend this mechanism to x86 as well, but there may be more
complications and it's less necessary there. It would be a good thing to do
eventually though.

BUG=None
TEST=Built and booted on nyan. Changed the size of memory and saw that the
payload could still find the coreboot tables where before it couldn't. Built
for pit, snow, and big.
BRANCH=None

Change-Id: I7218afd999da1662b0db8172fd8125670ceac471
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://chromium-review.googlesource.com/185572
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2014-02-11 05:30:59 +00:00
..
asmlib.h arm: Update mem* functions to newer versions 2014-01-14 03:29:44 +00:00
cache.c arm: Redesign, clarify and clean up cache related code 2014-01-29 21:33:35 +00:00
Config.in libpayload: arm: Pass the coreboot table location to the payload. 2014-02-11 05:30:59 +00:00
coreboot.c libpayload: arm: Pass the coreboot table location to the payload. 2014-02-11 05:30:59 +00:00
cpu.S arm: Fix up new cache flush algorithm and replace dcache_*_all() with it 2014-01-29 04:58:17 +00:00
dummy_media.c ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
exception.c arm: Remove exception_test() 2013-11-20 06:51:13 +00:00
exception_asm.S arm: Put assembly functions into separate sections 2014-01-29 21:33:41 +00:00
head.S libpayload: arm: Pass the coreboot table location to the payload. 2014-02-11 05:30:59 +00:00
libpayload.ldscript ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
main.c ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
Makefile.inc arm: Fix up new cache flush algorithm and replace dcache_*_all() with it 2014-01-29 04:58:17 +00:00
memcpy.S arm: Put assembly functions into separate sections 2014-01-29 21:33:41 +00:00
memmove.S arm: Put assembly functions into separate sections 2014-01-29 21:33:41 +00:00
memset.S arm: Put assembly functions into separate sections 2014-01-29 21:33:41 +00:00
sysinfo.c ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
timer.c ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00
util.S arm: Move libgcc assembly macros to arch/asm.h 2014-01-14 03:29:41 +00:00
virtual.c ARM: Generalize armv7 as arm. 2013-10-02 09:18:44 +00:00