From a565d16cd17090e30b6632e9ca56481def0b6395 Mon Sep 17 00:00:00 2001 From: anzhou Date: Tue, 4 Aug 2020 22:05:19 +0800 Subject: [PATCH] Tegra: common: fixup the bl31 code size to be copied at reset If the CPU doesn't run from BL31_BASE, the firmware needs to be copied from load address to BL31_BASE during cold boot. The size should be the actual size of the code, which is indicated by the __RELA_END__ linker variable. This patch updates the copy routine to use this variable as a result. Signed-off-by: anzhou Change-Id: Ie3a48dd54cda1dc152204903d609da3117a0ced9 --- plat/nvidia/tegra/common/aarch64/tegra_helpers.S | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plat/nvidia/tegra/common/aarch64/tegra_helpers.S b/plat/nvidia/tegra/common/aarch64/tegra_helpers.S index 64d21b49c..6c8c4f018 100644 --- a/plat/nvidia/tegra/common/aarch64/tegra_helpers.S +++ b/plat/nvidia/tegra/common/aarch64/tegra_helpers.S @@ -215,7 +215,8 @@ func plat_reset_handler */ mov x0, x17 mov x1, x18 - mov x2, #BL31_SIZE + adr x2, __RELA_END__ + sub x2, x2, x18 _loop16: cmp x2, #16 b.lo _loop1