From 314b5c370b4655bc701985ddf1d1d478067e7baa Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Wed, 20 Feb 2019 17:50:42 -0800 Subject: rockchip/rk3399: Fix BL31 bootmem regions The BL31 on RK3399 is split into multiple segments... the majority goes into DRAM, but small parts must be put into SRAM and PMUSRAM. With CB:31123 only the DRAM part was added to memlayout, so the SRAM parts will not be correctly marked in bootmem and BL31 loading fails the selfload check. This patch adds the remaining regions to fix the problem. Change-Id: Ia0597216c08512c47361a1dc0beb34d022a8994f Signed-off-by: Julius Werner Reviewed-on: https://review.coreboot.org/c/31538 Tested-by: build bot (Jenkins) Reviewed-by: Ting Shen --- src/soc/rockchip/rk3399/soc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/soc/rockchip/rk3399/soc.c') diff --git a/src/soc/rockchip/rk3399/soc.c b/src/soc/rockchip/rk3399/soc.c index 45ccbb3ead..8960c9e202 100644 --- a/src/soc/rockchip/rk3399/soc.c +++ b/src/soc/rockchip/rk3399/soc.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -20,12 +21,19 @@ #include #include #include +#include #include #include #include #include #include +void bootmem_platform_add_ranges(void) +{ + bootmem_add_range((uintptr_t)_pmu_sram, _pmu_sram_size, BM_MEM_BL31); + bootmem_add_range((uintptr_t)_bl31_sram, _bl31_sram_size, BM_MEM_BL31); +} + static void soc_read_resources(struct device *dev) { ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size_mb() * KiB); -- cgit v1.2.3