Commit 2b67b2d7 authored by Andre Przywara's avatar Andre Przywara
Browse files

fel: Fix SPL size check against thunk addr



We have a check to avoid that the SPL accidentally overwrites the thunk
buffer we use to execute code on the board.

Unfortunately this compares the SPL *size* against the thunk *address*,
which is only valid when the SPL starts at 0 (older 32-bit SoCs).

Factor in the SoC dependent SPL start address, to make this check work
properly on newer (64-bit) SoCs.
Signed-off-by: default avatarAndre Przywara <osp@andrep.de>
parent 8af203ec
......@@ -808,8 +808,8 @@ void aw_fel_write_and_execute_spl(feldev_handle *dev, uint8_t *buf, size_t len)
}
/* Clarify the SPL size limitations, and bail out if they are not met */
if (soc_info->thunk_addr < spl_len_limit)
spl_len_limit = soc_info->thunk_addr;
if (soc_info->thunk_addr - soc_info->spl_addr < spl_len_limit)
spl_len_limit = soc_info->thunk_addr - soc_info->spl_addr;
if (spl_len > spl_len_limit)
pr_fatal("SPL: too large (need %u, have %u)\n",
......
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