From 28188e3e8b32ef78bfc755326cf6e9efa0ef6ad9 Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Mon, 5 Dec 2022 16:24:57 +0800 Subject: soc/mediatek/mt8173: Allow BL31 payload not targeting RAM selfboot.c blocks the payload that does not target RAM. But MT8173 loads and runs BL31 payload in SRAM. Make the exception by implementing `payload_arch_usable_ram_quirk()`. TEST=load and initialize BL31 successfully Change-Id: I8951b1c4673cdae7d1ad0c11d7d6c12376acd328 Signed-off-by: Yidi Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/70344 Reviewed-by: Hung-Te Lin Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/soc/mediatek/mt8173/soc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/soc/mediatek') diff --git a/src/soc/mediatek/mt8173/soc.c b/src/soc/mediatek/mt8173/soc.c index c1bb6212d1..ebdf4e5420 100644 --- a/src/soc/mediatek/mt8173/soc.c +++ b/src/soc/mediatek/mt8173/soc.c @@ -2,9 +2,23 @@ #include #include +#include #include #include +int payload_arch_usable_ram_quirk(uint64_t start, uint64_t size) +{ + if (size > REGION_SIZE(sram)) + return 0; + + if (start >= (uintptr_t)_sram && (start + size) <= (uintptr_t)_esram) { + printk(BIOS_DEBUG, "MT8173 uses SRAM for loading BL31.\n"); + return 1; + } + + return 0; +} + void bootmem_platform_add_ranges(void) { bootmem_add_range(0x101000, 124 * KiB, BM_MEM_BL31); -- cgit v1.2.3