fix the boot issue of Rockchip RK3036
Get series with b4
b4 am 20170704133241.GG9889@bill-the-catVersions newest first
- v1 Latest0 of 5 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 5 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [U-Boot] [PATCH 0/5] fix the boot issue of Rockchip RK3036
Quoted 35 lines · Andy Yan
Hi Philipp:
Quoted 22 lines · Dr. Philipp Tomsich
Andy,
Quoted 20 lines · Andy Yan
As Kever mentioned in [0], the RK3036 based boards could't bootup for a long time.
After a git bisect, I found the RK3036 SPL code size has increased from patch [1] [2]. Before Tom's patch [1], the SPL size is 3160 bytes, but it becomes 4080 bytes after [1] applied. After a look at this patch, I realised I should disable SPL_USE_ARCH_MEMCPY/MEMSET, and the code size indeed come down after I disabled them. But I got a LD error after apply patch[2]: "undefined reference to memset", RK3036 SPL didn't use lib/string because of the sram space imitation. The compile succeed afterCONFIG_SPL_LIBGENERIC_SUPPORTenabled, but the spl code size become 3248 bytes.Additionally, Simon post patch [3] call printf to print a message before back to bootrom from spl, which make the spl code size increased to nearly 3.7 kb.
Quoted 8 lines
Quoted 3 lines
RK3036 SPL only has 4kb sram to use, the spl code will use 3.4 ~ 3.5 kb, the last 0.5kb are used for SP and GD, so there is no space for malloc.
gcc-6-arm-linux-gnueabi
What version of GCC are you using?
If your problem can also be solved by moving to GCC 6.3 (or newer) and the code-size improvements there, I’d rather just require a more recent GCC version.
Quoted 5 lines
I default use arm-linux-gnueabe-gcc v5.4.
The current upstream kylin-rk3036_defconfig compiled by gcc-5.4
is 4384 bytes, the size comes down to 3936 bytes if I use arm-linux-gnueabihf-gcc v6.3 from linaro. But this is still too large for rk3036.
Please note that (and U-Boot should be complaining at you) that with v2018.01 we'll be moving to gcc-6.x or later for ARM.
Quoted 10 lines
Disable SPL_USE_ARCH_MEMCPY/MEMSET will make the spl size comes
down to 3042 bytes by gcc v6.3. But I still need some hack: enableCONFIG_SPL_LIBGENERICto get support for memset, masks Simon's print inbootrom.c, or the code size will become very large. Event though this hack make things work, we still lost a few hundreds bytes by functionboard_init_f_alloc_reserve, because platforms with very limit sram like rk3036 will return to bootrom after the dram initialized, they never use the malloc space. This few hundreds bytes is a large space for 4kb sarm, it's better to letf them for code or SP.
Since we're really size constrained here maybe it makes sense to move that print to a debug() ?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170704/e5ef8446/attachment.sig>