[U-Boot] [PATCH 1/2] rpi: Change load addresses to make more room for the kernel

Tom Rini trini at konsulko.com
Mon Jun 19 12:28:30 UTC 2017


On Mon, Jun 19, 2017 at 02:08:03PM +0300, Tuomas Tynkkynen wrote:
> According to the comment in rpi.h, the current kernel load address is
> picked such that the compressed kernel and the uncompressed kernel don't
> overlap in memory to avoid unnecessary relocation of the compressed
> image in the decompressor stub. However, as is evident from the
> kernel boot log snipped below, a full-blown ARMv7 distro kernel
> (v4.11.3) can use as much as 17063 kB uncompressed. That is larger
> than the current 16M reservation which means that the relocation
> indeed is happening.
> 
> [    0.000000] Virtual kernel memory layout:
>                  .text : 0xc0208000 - 0xc0f00000   (13280 kB)
>                  .init : 0xc1500000 - 0xc1700000   (2048 kB)
>                  .data : 0xc1700000 - 0xc18b1978   (1735 kB)
> 
> Additionally, on AArch64 the kernel images are much larger than
> on ARM. A full-blown 4.11.3 distro kernel takes 24M, which with the
> current load addresses (reserving only 17M) stomps over the initrd,
> breaking the boot of such large kernels.
> 
> Fix both of these problems by tweaking the load addresses as appropriate
> depending on the CPU architecture. To make things simpler, pxefile_addr_r
> is moved from low memory next to scriptaddr.
> 
> After this patch we end up with this memory map on ARM (assuming the
> most conservative CPU-GPU memory split of 128M for the CPU):
> 0x00000100 - 0x00008000 (    31 kB): fdt_addr_r - decompressed_kernel_start
> 0x00008000 - 0x03000000 ( 49120 kB): decompressed_kernel - kernel_addr_r
> 0x03000000 - 0x04000000 ( 16384 kB): kernel_addr_r - scriptaddr
> 0x04000000 - 0x04100000 (  1024 kB): scriptaddr - pxefile_addr_r
> 0x04100000 - 0x04200000 (  1024 kB): pxefile_addr_r - ramdisk_addr_r
> 0x04200000 - 0x08000000 ( 63488 kB): ramdisk_addr_r - top_of_ram
> 
> And this for AArch64:
> 0x00000100 - 0x00080000 (   511 kB): fdt_addr_r - kernel_addr_r
> 0x00080000 - 0x04000000 ( 65024 kB): kernel_addr_r - scriptaddr
> 0x04000000 - 0x04100000 (  1024 kB): scriptaddr - pxefile_addr_r
> 0x04100000 - 0x04200000 (  1024 kB): pxefile_addr_r - ramdisk_addr_r
> 0x04200000 - 0x08000000 ( 63488 kB): ramdisk_addr_r - top_of_ram
> 
> Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen at iki.fi>
> ---
> This has been tested on:
>  - RPi 1 booting the RPi Foundation downstream kernel
>  - RPi 3 booting a distro multi_v7_defconfig in 32-bit mode
>  - RPi 3 booting a AArch64 distro defconfig in 64-bit mode

Can we try using bootm_size instead so that things are relocated
appropriately?  See DEFAULT_LINUX_BOOT_ENV in
include/configs/ti_armv7_common.h (and then Documentation/arm/Booting
and Documentation/arm64/booting.txt in the kernel).  Thanks!

-- 
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/20170619/cfbe3ae3/attachment.sig>


More information about the U-Boot mailing list