mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-18 18:44:22 +00:00
Merge "fix(xilinx): warn if reserved memory pre-exists in DT" into integration
This commit is contained in:
commit
a16dad0b22
1 changed files with 24 additions and 5 deletions
|
@ -86,6 +86,18 @@ static int remove_mmap_dynamic_region(uintptr_t base_va, size_t size)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(XILINX_OF_BOARD_DTB_ADDR)
|
||||||
|
static int check_fdt_reserved_memory(void *dtb, const char *node_name)
|
||||||
|
{
|
||||||
|
int offset = fdt_path_offset(dtb, "/reserved-memory");
|
||||||
|
|
||||||
|
if (offset >= 0) {
|
||||||
|
offset = fdt_subnode_offset(dtb, offset, node_name);
|
||||||
|
}
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void prepare_dtb(void)
|
void prepare_dtb(void)
|
||||||
{
|
{
|
||||||
#if defined(XILINX_OF_BOARD_DTB_ADDR)
|
#if defined(XILINX_OF_BOARD_DTB_ADDR)
|
||||||
|
@ -112,12 +124,19 @@ void prepare_dtb(void)
|
||||||
WARN("Failed to add PSCI cpu enable methods in DT\n");
|
WARN("Failed to add PSCI cpu enable methods in DT\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reserve memory used by Trusted Firmware. */
|
/* Check reserved memory set in DT*/
|
||||||
ret = fdt_add_reserved_memory(dtb, "tf-a",
|
ret = check_fdt_reserved_memory(dtb, "tf-a");
|
||||||
BL31_BASE,
|
|
||||||
BL31_LIMIT - BL31_BASE);
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
WARN("Failed to add reserved memory nodes for BL31 to DT.\n");
|
/* Reserve memory used by Trusted Firmware. */
|
||||||
|
ret = fdt_add_reserved_memory(dtb, "tf-a",
|
||||||
|
BL31_BASE,
|
||||||
|
BL31_LIMIT - BL31_BASE);
|
||||||
|
if (ret < 0) {
|
||||||
|
WARN("Failed to add reserved memory nodes for BL31 to DT.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
WARN("Reserved memory pre-exists in DT.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = fdt_pack(dtb);
|
ret = fdt_pack(dtb);
|
||||||
|
|
Loading…
Add table
Reference in a new issue