[U-Boot] SUNXI: A64: Increase SPL size

Andre Przywara andre.przywara at arm.com
Thu Nov 9 15:33:41 UTC 2017


Hi,

On 09/11/17 15:23, Jagan Teki wrote:
> Hi Andre,
> 
> On Thu, Nov 9, 2017 at 5:48 PM, Andre Przywara <andre.przywara at arm.com> wrote:
>> Hi,
>>
>> On 09/11/17 12:11, Maxime Ripard wrote:
>>> On Thu, Nov 09, 2017 at 01:29:21AM +0530, Jagan Teki wrote:
>>>> Hi,
>>>>
>>>> I'm trying to increase SPL size to 64K(with SRAM A2), so-that SPL can
>>>> able to fit new features like falcon. I knew the limit about 32K but
>>>> page[1] stating that we can use approximately 192 KiB of contiguous
>>>> SRAM.
>>>>
>>>> eGON.BT0 has limit of reading 32KB, Can't we use > 32KB SPL here?
>>>> because I've tried with 64K SPL size with existing SPL code and was
>>>> able to boot, but with increasing SPL by enabling falcon seems like
>>>> BROM unable read eGON.BT0 which eventually booting failed. Any inputs?
>>>
>>> I've been able to use the falcon mode without this change on an A33,
>>> what's so different about the A64?
>>
>> That the SPL is bigger in AArch64 and enabling SPL_OS_BOOT will probably
>> exceed 32KB (we are quite close already)
>>
>> Jagan: you could try this branch of mine [1], this enables a 32-bit SPL,
>> which is smaller than the AArch64 version.
>> You might be able to include Falcon there, but I am afraid you have to
>> work out how to boot a 64-bit kernel from there and how to enable SMP.
>>
>> Hence my question about the pain you want to endure and if those 500ms
>> are really worth it.
>>
>> Cheers,
>> Andre
>>
>> [1] https://github.com/apritzel/u-boot/commits/a64-fel32-wip
> 
> Looking at the "32-bit SPL" patch [2], commit message "so a 32-bit SPL
> can be combined with a 64-bit U-Boot" Does this means we need to build
> U-Boot proper for 64-bit compiler with pine64_plus_defconfig and SPL
> for 32-bit compiler with sun50i_spl32_defconfig?

Well, yes. One thing is the issue you mention below, which should be
easy to fix (was just too lazy to look at it).
But more importantly a 32-bit U-Boot proper only allows you to boot
32-bit kernels, which is interesting, but not my goal.
Also AFAIK you can't build a 32-bit mainline kernel for an A64 out of
the box.

I just build the SPL from this tree and use it for FEL booting.
Another use case is your's, when you want more features and this exceeds
the maximum SPL size on AArch64.

Those patches were part of my original A64 SPL series, so I also keep
them around just in case.

So: Yes, I build this tree with an ARM cross-compiler, copy
spl/sunxi-spl.bin somewhere, then build again (after make clean) with an
Aarch64 cross compiler and combine the pieces manually, for instance:

$ sunxi-fel -v -p spl /tmp/sunxi-spl32.bin write 0x44000 bl31.bin write
0x4a000000 u-boot.bin reset64 0x44000

or:

$ cat /tmp/sunxi-spl32.bin u-boot.itb > u-boot-sunxi-with-spl.bin

(which would be your use case).

This nastiness is one of the reasons I haven't tried to upstream this yet.

Cheers,
Andre.

> because I've tried of
> sun50i_spl32 with 32-bit compiler ended with build issue.
> 
> Build log:
> ----------
>   MKIMAGE u-boot.img
>   BINMAN  u-boot-sunxi-with-spl.bin
> binman: Device tree 'u-boot.dtb' does not have a 'binman' node
> Makefile:1157: recipe for target 'u-boot-sunxi-with-spl.bin' failed
> make: *** [u-boot-sunxi-with-spl.bin] Error 1
> 
> Look like it is not taking CONFIG_SPL_FIT_GENERATOR script.
> 
> [2] https://github.com/apritzel/u-boot/commit/5f1fe133aabfd0c3c5867c453cb405d9624e52ce
> 
> thanks!
> 


More information about the U-Boot mailing list