sunxi: SPL size reduction patches
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | sunxi: dram: Un-inline dram helper functionsarch/ arch/ arch/ | +40 | 1 reply | |
| 2/4 | malloc_simple: Allow malloc_simple to be used with non stack RAMarch/ common/ common/ | +8 | 1 reply | |
| 3/4 | malloc_simple: Return NULL on malloc failure rather then calling panic()common/ | +1 | 2 replies | |
| 3/4 | malloc_simple: Return NULL on malloc failure rather then calling panic() | +0 | 2 replies | |
| 4/4 | sunxi: Switch to using malloc_simple for the splinclude/ | +3 | 1 reply |
Reviews trailers per patch
All 5 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Simon Glass | Ian Campbell |
|---|---|---|
| Series | A-b | |
| 1/4 | R-b | |
| 2/4 | R-b | |
| 3/4 | A-b | |
| 3/4 | A-b | |
| 4/4 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [U-Boot] [PATCH 0/4] sunxi: SPL size reduction patches
Hi All,
Inspired by Simon's work to make the FEL SPL and regular SPL builds more similar I've been looking into reducing the size of the SPL, resulting in the following patch series. This all seems quite safe, but we are past rc1, so may be best to keep this on a branch for now, or not ...
Simon, I think the malloc_simple changes should go through your tree, once those are merged I'll add the sunxi patch enabling malloc_simple usage in the SPL.
With this series we're already quite close to getting a full-blown SPL to fit in 16K, I've looked at removing CONFIG_SPL_LIBCOMMON_SUPPORT but that won't fly well I think. We could however add a CONFIG_SPL_NO_PRINTF, which automatically gets set when CONFIG_SPL_LIBCOMMON_SUPPORT is not set, and use that on sunxi, assuming that you (Simon) are ok with not being able to use printf in the device-model code which gets used in the SPL.
Things already almost built when not setting CONFIG_SPL_LIBCOMMON_SUPPORT since there are already a lot of places checking for that before calling printf. We could change all the CONFIG_SPL_LIBCOMMON_SUPPORT to CONFIG_SPL_NO_PRINTF checks and define CONFIG_SPL_NO_PRINTF on sunxi to win another "large" chunk of RAM.
Something else to look at is at the memory map of the first 32k of SRAM when in FEL mode. The only documentation we've is:
https://github.com/hno/Allwinner-Info/blob/master/FEL-usb/USB-protocol.txt
Which is reverse engineered and not 100% clear on the memory map. We could add a memset to 0xaa for 0x6000 - 0x8000 to the fel spl as a test, as I've the feeling that what hno has found there are just scratch buffers and that using that in the SPL will be save, if that is the case we could use 0x2000 - 0x0000 (growing downwards) as stack, and always use a text-base of 0x2000 for the SPL, with the SPL code / data segments living at 0x2000 - 0x8000 and then everything should fit as is, and we can have one unified SPL binary for both FEL and sdcard booting.
I don't have the time to look into this further atm, so I hope that one of you (Simon or Siarhei) has time to look into this further.
I see that we also never merged this related fix:
http://lists.denx.de/pipermail/u-boot/2014-July/183986.html
We should probably merge a version of that when Simon's patches for fixing FEL have landed. I think it may be best to just always set the L2EN bit on sun4i/sun5i, without detecting whether we're in fel mode or not, setting it when it is already said should be a nop, and thus harmless.
Regards,
Hans