coreboot-kgpe-d16/payloads/libpayload/arch/arm64
Julius Werner 623368113c arm64: Decouple MMU functions from memranges
The current arm64 MMU interface is difficult to use in pre-RAM
environments. It is based on the memranges API which makes use of
malloc(), and early stages usually don't have a heap. It is also built
as a one-shot interface that requires all memory ranges to be laid out
beforehand, which is a problem when existing areas need to change (e.g.
after initializing DRAM).

The long-term goal of this patch is to completely switch to a
configure-as-you-go interface based on the mmu_config_range() function,
similar to what ARM32 does. As a first step this feature is added
side-by-side to the existing interface so that existing SoC
implementations continue to work and can be slowly ported over one by
one. Like the ARM32 version it does not garbage collect page tables that
become unused, so repeated mapping at different granularities will
exhaust the available table space (this is presumed to be a reasonable
limitation for a firmware environment and keeps the code much simpler).

Also do some cleanup, align comments between coreboot and libpayload for
easier diffing, and change all error cases to assert()s. Right now the
code just propagates error codes up the stack until it eventually
reaches a function that doesn't check them anymore. MMU configuration
errors (essentially just misaligned requests and running out of table
space) should always be compile-time programming errors, so failing hard
and fast seems like the best way to deal with them.

BRANCH=None
BUG=None
TEST=Compile-tested rush_ryu. Booted on Oak and hacked MMU init to use
mmu_config_range() insted of memranges. Confirmed that CRCs over all page
tables before and after the change are equal.

Change-Id: I93585b44a277c1d96d31ee9c3dd2522b5e10085b
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: f10fcba107aba1f3ea239471cb5a4f9239809539
Original-Change-Id: I6a2a11e3b94e6ae9e1553871f0cccd3b556b3e65
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/271991
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/10304
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2015-06-02 11:34:23 +02:00
..
lib libpayload arm64: Add helper functions with el argument 2015-03-21 13:43:03 +01:00
Config.in libpayload arm64: Allow board to define upper address limit on DMA 2015-03-23 13:11:24 +01:00
Makefile.inc libpayload arm64: Add support for mmu 2015-03-21 13:38:41 +01:00
cache.c arm64: Add arch_program_segment_loaded call to arm64 2015-04-22 08:56:36 +02:00
coreboot.c libpayload arm64: Remove dependency on coreboot tables for dma areas 2015-03-21 13:38:29 +01:00
cpu.S libpayload: Add support for arm64 in libpayload 2015-01-09 07:04:28 +01:00
dummy_media.c libpayload: Add support for arm64 in libpayload 2015-01-09 07:04:28 +01:00
exception.c libpayload arm64: Make exceptions work 2015-03-21 13:35:38 +01:00
exception_asm.S libpayload arm64: Remove tight-coupling with any particular EL 2015-03-21 13:35:47 +01:00
gdb.c Remove address from GPLv2 headers 2015-05-21 20:50:25 +02:00
head.S libpayload arm64: Initialize exception stack 2015-03-21 13:35:33 +01:00
libpayload.ldscript libpayload arm64: Initialize exception stack 2015-03-21 13:35:33 +01:00
main.c libpayload arm64: Move console_init after post_sysinfo_mmu_setup call 2015-03-21 13:40:04 +01:00
memcpy.S libpayload: Add support for arm64 in libpayload 2015-01-09 07:04:28 +01:00
memmove.S libpayload: Add support for arm64 in libpayload 2015-01-09 07:04:28 +01:00
memset.S libpayload arm64: Remove the DONT_USE_DC macro 2015-03-21 13:35:58 +01:00
mmu.c arm64: Decouple MMU functions from memranges 2015-06-02 11:34:23 +02:00
selfboot.c libpayload arm64: Add selfboot.c required by depthcharge 2015-01-09 07:07:53 +01:00
sysinfo.c libpayload arm64: Add functions for reading memranges 2015-03-21 13:36:04 +01:00
timer.c libpayload: Add support for arm64 in libpayload 2015-01-09 07:04:28 +01:00
util.S libpayload: Add support for arm64 in libpayload 2015-01-09 07:04:28 +01:00
virtual.c libpayload: Add support for arm64 in libpayload 2015-01-09 07:04:28 +01:00