diff options
author | Aaron Durbin <adurbin@chromium.org> | 2014-07-11 15:56:31 -0500 |
---|---|---|
committer | Marc Jones <marc.jones@se-eng.com> | 2015-03-05 17:31:42 +0100 |
commit | f13c567c9713538789ec3ef3f478e1c52816d959 (patch) | |
tree | 33314b9860cac1f29c975c798a0dc625c0c24ccc /src/soc/nvidia/tegra132/cbmem.c | |
parent | eeacf74a7ce9f3302d813287e6409d660da43958 (diff) | |
download | coreboot-f13c567c9713538789ec3ef3f478e1c52816d959.tar.xz |
t132: handle carve-outs for addressable memory
The carve-out regions need to be taken into account when
calculating addressable memory because those regions aren't
accessible from the main cpu. The additional exposed functions
are to accommodate adding resources during ramstage resource
reading. The TZ (trust zone) region is empty for now until
more documentation is provided on determining its location.
BUG=None
TEST=Built and booted through attempting payload loading.
MTS carve-out is taken into account programmatically.
Original-Change-Id: I3301b2a12680ad79047198ada41f32eb1b7fa68b
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/207585
Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org>
(cherry picked from commit 15b9c74dd1ef5bfb1fd7c6dab50624f815658e14)
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Change-Id: I46d54dbbb8e102fc70ab34bc4bbd2361ef1ea504
Reviewed-on: http://review.coreboot.org/8591
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/soc/nvidia/tegra132/cbmem.c')
-rw-r--r-- | src/soc/nvidia/tegra132/cbmem.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/soc/nvidia/tegra132/cbmem.c b/src/soc/nvidia/tegra132/cbmem.c index 136d3eac89..ee95ba985c 100644 --- a/src/soc/nvidia/tegra132/cbmem.c +++ b/src/soc/nvidia/tegra132/cbmem.c @@ -18,15 +18,16 @@ */ #include <cbmem.h> -#include <soc/display.h> #include <soc/addressmap.h> -#define MTS_SIZE_MB 128 - void *cbmem_top(void) { - /* FIXME(adurbin): use carveout registers properly. */ - const uintptr_t reserve = FB_SIZE_MB + MTS_SIZE_MB; + static uintptr_t addr; + size_t fb_size; + + /* CBMEM starts downwards from the framebuffer. */ + if (addr == 0) + addr = framebuffer_attributes(&fb_size); - return (void *)((sdram_max_addressable_mb() - reserve) << 20UL); + return (void *)(addr << 20UL); } |