
Tom Rini trini@konsulko.com schrieb am Mo., 27. Mai 2019, 16:54:
On Mon, May 27, 2019 at 03:47:13PM +0200, Jean-Jacques Hiblot wrote:
Simon,
On 24/05/2019 22:10, Simon Goldschmidt wrote:
Am 24.05.2019 um 22:07 schrieb Simon Goldschmidt:
This adds a size check for SPL that can dynamically check generated SPL binaries (including devicetree) for a size limit that ensures this image plus global data, heap and stack fit in initial SRAM.
Since some of these sizes are not available to make, a new host tool 'spl_size_limit' is added that dumps the resulting maximum size for an SPL binary to stdout. This tool is used in toplevel Makefile to implement the size check on SPL binaries.
Signed-off-by: Simon Goldschmidt simon.k.r.goldschmidt@gmail.com
Changes in v3:
- don't build this new tools for 'make tools-only'
So this is how far I got.
Tom, your idea with making this multi-config aware (U-Boot, SPL and TPL) does not seem to work as 'tools' are only built once, not once per U-Boot/SPL/TPL. So if we wanted to use this for TPL, too, that would either mean create yet another tool or pass an option to this new tool
to
differ between SPL and TPL.
If the trouble comes from GENERATED_GBL_DATA_SIZE, you could get its
value
by parsing lib/asm-offsets.s. all the other values could be extracted
from
{.,spl,tpl}/u-boot.cfg
Getting that file to exist has the same problem over for "tools-only".
If this flies, it could be done by a python script without the need to compile a program
I'm not sure that provides better clarity over what we have here tho.
I also think a python script would be less clear than a C tool. But it could have the problem hidden by not being used for "tools-only" - it would only be executed after linking SPL...
Regrds, Simon