[U-Boot] [PATCH v4 0/4] configs: rk3288: Tinker Board SPL file must fit into 32 KiB
Simon Goldschmidt
simon.k.r.goldschmidt at gmail.com
Tue Apr 2 18:08:54 UTC 2019
On 02.04.19 19:33, Heinrich Schuchardt wrote:
> On 4/2/19 7:29 PM, Tom Rini wrote:
>> On Tue, Apr 02, 2019 at 07:19:03PM +0200, Heinrich Schuchardt wrote:
>>
>>> The SPL image for the Tinker Board has to fit into 32 KiB. This includes
>>> up to 2 KiB for the file header.
>>>
>>> A new configuration variable CONFIG_SPL_SIZE_LIMIT is introduced to define
>>> the board specific limit.
>>>
>>> A common Makefile function is used for this test and the test against
>>> CONFIG_BOARD_SIZE_LIMIT.
>>>
>>> Move the board size check from arch/arm/mach-imx/Makefile to Makefile.
>>
>> I'm sorry you weren't Cc'd on Simon's thread where we're trying to
>> improve the size check stuff to be generic enough to use everywhere. We
>> can't generically use a shell script as we need to know some processed
>> values too. I don't know if Simon got to the point of writing a C based
>> helper to use or not.
Right, I should have included you, Heinrich, sorry.
No, unfortunately, I haven't found the time to work on the C based
approach, yet.
To sum it up, Heinrich, the issue was that for socfpga gen5, we're
approaching the 64KiB total limit for SPL. That includes all regions we
can check via CONFIG_SPL_MAX_FOOTPRINT (e.g. text, data, bss) plus
devicetree, early malloc, global data and initial stack.
My approach would have been much like your check (which by the way is
better than mine in that the check stays in main Makefile), but the size
limit needs to include those items I've mentioned above. So while I
could add a Kconfig based total size, I would need to subtract gd,
malloc area and reserved stack size to get the SPL_SIZE_LIMIT value.
The problem I see here is that this is a different size limit to the one
you want to check. I need "SRAM_SIZE - x - y - z" while you need
"LOAD_LIMIT", which is constant.
Maybe we could start with your limit and then add bool config options
like "SPL_SIZE_LIMIT_SUBTRACT_GD", "SPL_SIZE_LIMIT_SUBTRACT_MALLOC_F"
and "SPL_SIZE_LIMIT_SUBTRACT_STACK_SIZE" that could then be used by a C
program to help the size check.
Regards,
Simon
>>
>
> Hello Tom,
>
> could you, please, provide a link to the thread.
>
> Is the test prior to my patch incorrect? Or do you want to imply that
> after my patch we get different results?
>
> Best regards
>
> Heinrich
>
More information about the U-Boot
mailing list