On Mon Jun 22, 2026 at 3:12 AM CDT, Ilias Apalodimas wrote:
> Hi Randolph
>
> On Sat, 20 Jun 2026 at 02:17, <[email protected]> wrote:
>>
>> From: Randolph Sapp <[email protected]>
>>
>> Add a weak definition for board_setup_dest_addr, as a way for specific
>> boards to override the gd->relocaddr address before the relocation
>> actually occurs.
>>
>> Signed-off-by: Randolph Sapp <[email protected]>
>> ---
>
> board_get_usable_ram_top() can be used instead.
>
> Cheers
> /Ilias
It *could*. Just felt a little weird to artificially restrict the usable memory
because the stack just barely runs into one of our reserved regions long enough
to break a dt reserved-memory allocation.
Initially this was proposed because there are multiple runtimes with their own
allocation techniques that could potentially take advantage of that space. If
it's still preferable to use board_get_usable_ram_top though I will change it.
>> common/board_f.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/common/board_f.c b/common/board_f.c
>> index fdb3577fec09..d9d09ac94bf2 100644
>> --- a/common/board_f.c
>> +++ b/common/board_f.c
>> @@ -328,6 +328,11 @@ __weak int arch_setup_dest_addr(void)
>> return 0;
>> }
>>
>> +__weak int board_setup_dest_addr(void)
>> +{
>> + return 0;
>> +}
>> +
>> static int setup_dest_addr(void)
>> {
>> int ret;
>> @@ -362,6 +367,10 @@ static int setup_dest_addr(void)
>> if (ret)
>> return ret;
>>
>> + ret = board_setup_dest_addr();
>> + if (ret)
>> + return ret;
>> +
>> gd->initial_relocaddr = gd->relocaddr;
>> return 0;
>> }
>> --
>> 2.54.0
>>