Hi Stephen,

On 19 December 2017 at 18:30, Stephen Warren <swar...@wwwdotorg.org> wrote:
> From: Stephen Warren <swar...@nvidia.com>
>
> U-Boot typically uses a hard-coded value for the stack pointer before
> relocation. Implement option SYS_INIT_SP_BSS_OFFSET to instead calculate
> the initial SP at run-time. This is useful to avoid hard-coding addresses
> into U-Boot, so that can be loaded and executed at arbitrary addresses and
> thus avoid using arbitrary addresses at runtime. This option's value is
> the offset added to &_bss_start in order to calculate the stack pointer.
> This offset should be large enough so that the early malloc region, global
> data (gd), and early stack usage do not overlap any appended DTB.

I don't see why this is an offset from bss_start - shouldn't it be bss_end?

Also this seems error-prone since we don't know how large the DTB is.
Can we improve this, e.g. by:

- using binman to provide the stack start value or offset
- checking the DTB size and automatically using the address
immediately after it finishes (again I suppose binman could provide
that)

Regards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to