public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4] sunxi: SPL size reduction patches
@ 2015-02-04 12:05 Hans de Goede
  2015-02-04 12:05 ` [U-Boot] [PATCH 1/4] sunxi: dram: Un-inline dram helper functions Hans de Goede
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Hans de Goede @ 2015-02-04 12:05 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-02-10 21:33 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-04 12:05 [U-Boot] [PATCH 0/4] sunxi: SPL size reduction patches Hans de Goede
2015-02-04 12:05 ` [U-Boot] [PATCH 1/4] sunxi: dram: Un-inline dram helper functions Hans de Goede
2015-02-05  3:04   ` Simon Glass
2015-02-04 12:05 ` [U-Boot] [PATCH 2/4] malloc_simple: Allow malloc_simple to be used with non stack RAM Hans de Goede
2015-02-05  3:04   ` Simon Glass
2015-02-04 12:05 ` [U-Boot] [PATCH 3/4] malloc_simple: Return NULL on malloc failure rather then calling panic() Hans de Goede
2015-02-05  3:04   ` Simon Glass
2015-02-05 11:24   ` Siarhei Siamashka
2015-02-05 17:53     ` Hans de Goede
2015-02-05 18:00       ` Simon Glass
2015-02-10 21:33         ` Simon Glass
2015-02-04 12:05 ` [U-Boot] [PATCH 4/4] sunxi: Switch to using malloc_simple for the spl Hans de Goede
2015-02-05  3:05   ` Simon Glass
2015-02-05 10:01 ` [U-Boot] [PATCH 0/4] sunxi: SPL size reduction patches Ian Campbell
2015-02-05 10:54 ` Siarhei Siamashka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox