[U-Boot] spl: Weed out CONFIG_SYS_TEXT_BASE usage
Marek Vasut
marex at denx.de
Tue Jul 10 19:33:11 UTC 2018
On 07/10/2018 08:47 PM, Tom Rini wrote:
> On Thu, May 31, 2018 at 06:02:24PM +0200, Marek Vasut wrote:
>
>> The SPL loaders assume that the CONFIG_SYS_TEXT_BASE memory location
>> is available and can be corrupted by loading ie. uImage or fitImage
>> headers there. Sometimes it could be beneficial to load the headers
>> elsewhere, ie. if CONFIG_SYS_TEXT_BASE is not yet writable while we
>> still want to parse the image headers in some local onchip memory to
>> ie. extract firmware from that image.
>>
>> Add the possibility to override the location where the headers get
>> loaded by introducing new function, spl_get_load_buffer() which takes
>> two arguments -- offset from the CONFIG_SYS_TEXT_BASE and size of the
>> data that are to be loaded there -- and returns a valid buffer address
>> or hangs the system. The default behavior is the same as before, add
>> the offset to CONFIG_SYS_TEXT_BASE and return that address. User can
>> override the weak spl_get_load_buffer() function though.
>>
>> Signed-off-by: Marek Vasut <marex at denx.de>
>> Cc: Tom Rini <trini at konsulko.com>
>
> This adds a number of warnings like:
> w+(xilinx_zynqmp_zc1275_revA) common/spl/spl.c: In function 'spl_get_load_buffer':
> w+(xilinx_zynqmp_zc1275_revA) common/spl/spl.c:127:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> w+(xilinx_zynqmp_zc1275_revA) common/spl/spl_ram.c: In function 'spl_ram_load_image':
> w+(xilinx_zynqmp_zc1275_revA) common/spl/spl_ram.c:66:33: warning: overflow in implicit constant conversion [-Woverflow]
Well, yes, since that board didn't exist when I sent this patch over a
month ago.
But I'd rather like some feedback on this patch itself.
--
Best regards,
Marek Vasut
More information about the U-Boot
mailing list