Commit eabbdafe authored by Igor Opaniuk's avatar Igor Opaniuk
Browse files

rpi3: fix RPI3_PRELOADED_DTB_BASE usage


In case if `RPI3_PRELOADED_DTB_BASE` isn't defined explicitly with
proper pre-loaded DTB address, `add_define` macro defined in
`make_helpers/build_macros.mk` still supplies this definition to the
compiler like `-DRPI3_PRELOADED_DTB_BASE`, and it's obviously is set to
default value 1.

This simply leads to the wrong `MAP_NS_DTB` region definition (base_va
is set `0x1` instead of `0x00010000`) in `plat/rpi3/rpi3_common.c`:

Which causes aligment check to fail in `mmap_add_region_check()`:
VERBOSE: base_pa: 0x00000001, base_va: 0x00000001, size: 0x00010000
...
ERROR:   mmap_add_region_check() failed. error -22
Signed-off-by: default avatarIgor Opaniuk <igor.opaniuk@linaro.org>
Showing with 4 additions and 0 deletions
+4 -0
......@@ -130,7 +130,9 @@ endif
$(eval $(call add_define,RPI3_BL32_RAM_LOCATION_ID))
$(eval $(call add_define,RPI3_BL33_IN_AARCH32))
$(eval $(call add_define,RPI3_DIRECT_LINUX_BOOT))
ifdef RPI3_PRELOADED_DTB_BASE
$(eval $(call add_define,RPI3_PRELOADED_DTB_BASE))
endif
$(eval $(call add_define,RPI3_RUNTIME_UART))
$(eval $(call add_define,RPI3_USE_UEFI_MAP))
......
......@@ -141,6 +141,7 @@ void bl31_plat_arch_setup(void)
enable_mmu_el3(0);
}
#ifdef RPI3_PRELOADED_DTB_BASE
/*
* Add information to the device tree (if any) about the reserved DRAM used by
* the Trusted Firmware.
......@@ -204,6 +205,7 @@ static void rpi3_dtb_add_mem_rsv(void)
INFO("rpi3: Reserved 0x%llx - 0x%llx in DTB\n", SEC_SRAM_BASE,
SEC_SRAM_BASE + SEC_SRAM_SIZE);
}
#endif
void bl31_platform_setup(void)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment