diff options
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm64/arm_tf.c | 2 | ||||
-rw-r--r-- | src/arch/arm64/include/arch/memlayout.h | 4 | ||||
-rw-r--r-- | src/arch/arm64/tables.c | 5 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/arch/arm64/arm_tf.c b/src/arch/arm64/arm_tf.c index c0526e08d5..3f1aa2a265 100644 --- a/src/arch/arm64/arm_tf.c +++ b/src/arch/arm64/arm_tf.c @@ -50,7 +50,7 @@ void arm_tf_run_bl31(u64 payload_entry, u64 payload_arg0, u64 payload_spsr) if (prog_locate(&bl31)) die("BL31 not found"); - if (!selfload(&bl31)) + if (!selfload_check(&bl31, BM_MEM_BL31)) die("BL31 load failed"); bl31_entry = prog_entry(&bl31); diff --git a/src/arch/arm64/include/arch/memlayout.h b/src/arch/arm64/include/arch/memlayout.h index 7fce9aa2f8..a3fdd66e4f 100644 --- a/src/arch/arm64/include/arch/memlayout.h +++ b/src/arch/arm64/include/arch/memlayout.h @@ -37,4 +37,8 @@ REGION(stack, addr, size, 16) \ _ = ASSERT(size >= 2K, "stack should be >= 2K, see toolchain.inc"); +#define BL31(addr, size) \ + REGION(bl31, addr, size, 4K) \ + _ = ASSERT(size % 4K == 0, "BL31 size must be divisible by 4K!"); + #endif /* __ARCH_MEMLAYOUT_H */ diff --git a/src/arch/arm64/tables.c b/src/arch/arm64/tables.c index f36679e67f..ec949fd83b 100644 --- a/src/arch/arm64/tables.c +++ b/src/arch/arm64/tables.c @@ -20,6 +20,8 @@ #include <boot/coreboot_tables.h> #include <symbols.h> +DECLARE_OPTIONAL_REGION(bl31); + void arch_write_tables(uintptr_t coreboot_table) { } @@ -28,6 +30,9 @@ void bootmem_arch_add_ranges(void) { bootmem_add_range((uintptr_t)_ttb, _ttb_size, BM_MEM_RAMSTAGE); + if (IS_ENABLED(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE) && _bl31_size > 0) + bootmem_add_range((uintptr_t)_bl31, _bl31_size, BM_MEM_BL31); + if (!IS_ENABLED(CONFIG_COMMON_CBFS_SPI_WRAPPER)) return; bootmem_add_range((uintptr_t)_postram_cbfs_cache, |