Code review comment for lp://qastaging/~jcrigby/linaro-image-tools/mx51-initrd_addr-fix

Revision history for this message
John Rigby (jcrigby) wrote :

No we don't need 128M. The arm kernel actually reserves the initrd location early in the boot process but apparently not early enough. The scenario that failed for me had the initrd loaded above the kernel including all the bss so at first I thought the larger kernel was not the problem. I then realized that early in the boot process the kernel does allocate some boot memory. Those early allocations before the initrd memory is reserved are apparently the problem.

I believe the test should be for both kernel_addr + some M and load_addr + some M. Also if there is ever a platform that loads the initrd before the kernel and the initrd image was too large it could corrupt the kernel. Not sure if that future proofing is worth it.

For modern u-boot's (not the LT ones that are not 2010.12 or later) u-boot relocates itself to the top of ram - size calculated at runtime. For that case the best place to put the initrd is top of ram - max size of u-boot runtime - max size of initrd.

This is all really a bug in arm u-boot. PPC u-boot does this relocation for you. In fact I enabled this for ARM when adding DT support but it is only turned on with DT.

« Back to merge proposal