1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-01-12 03:10:15 +00:00

arm-bsp/corstone1000: use compressed kernel image

To fit the kernel image into the allotted space, a compressed kernel
image is now needed.  Use the Image.gz from the kernel build process
and change the relevant places to use the new image name.  This also
necessitates adding an unzip command to u-boot to uncompress it to
memory (and the loadm is still needed to setup the efi mem boot device).
Also, the unzipped image is larger than before.  So, increase the size
that loadm is copying.

This change shrinks the initramfs bundle size from 12MB to 4.8MB

Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Abdellatif El Khlifi
2022-10-19 10:15:56 +01:00
committed by Jon Mason
parent 11920e64f4
commit d54e50daa6
4 changed files with 38 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ EXTRA_IMAGEDEPENDS += "secure-partitions"
# Linux kernel
PREFERRED_PROVIDER_virtual/kernel:forcevariable = "linux-yocto"
PREFERRED_VERSION_linux-yocto = "5.15%"
KERNEL_IMAGETYPE = "Image"
KERNEL_IMAGETYPE = "Image.gz"
INITRAMFS_IMAGE_BUNDLE ?= "1"

View File

@@ -0,0 +1,35 @@
From 348cdb4bab63ad0a6b373396ad522f1bcc2d6bdb Mon Sep 17 00:00:00 2001
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Date: Mon, 17 Oct 2022 15:41:20 +0100
Subject: [PATCH] corstone1000: use a compressed kernel
The corstone1000 kernel has become too large to fit in the available
storage. Swtiching to a compressed kernel avoids the problem, but
requires uncompressing it. Add this decompression to the default boot
instructions.
Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Upstream-Status: Pending [Not submitted to upstream yet]
---
include/configs/corstone1000.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index d9855bf91e..a66e3a8c10 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -126,7 +126,8 @@
#define CONFIG_BOOTCOMMAND \
"run retrieve_kernel_load_addr;" \
"echo Loading kernel from $kernel_addr to memory ... ;" \
- "loadm $kernel_addr $kernel_addr_r 0xc00000;" \
+ "unzip $kernel_addr 0x90000000;" \
+ "loadm 0x90000000 $kernel_addr_r 0xd00000;" \
"usb start; usb reset;" \
"run distro_bootcmd;" \
"bootefi $kernel_addr_r $fdtcontroladdr;"
--
2.17.1

View File

@@ -44,6 +44,7 @@ SRC_URI:append:corstone1000 = " \
file://0025-efi_loader-send-bootcomplete-message-to-secure-encla.patch \
file://0026-efi_loader-fix-null-pointer-exception-with-get_image.patch \
file://0027-arm-corstone1000-add-mmc-for-fvp.patch \
file://0028-corstone1000-use-a-compressed-kernel.patch \
"
#

View File

@@ -12,4 +12,4 @@ part --source rawcopy --sourceparams="file=tfm_s_signed.bin" --align 1 --no-tabl
part --source rawcopy --sourceparams="file=signed_fip-corstone1000.bin" --align 1 --no-table --fixed-size 2
# Rawcopy of kernel with initramfs
part --source rawcopy --sourceparams="file=Image-initramfs-${MACHINE}.bin" --no-table --fixed-size 12
part --source rawcopy --sourceparams="file=Image.gz-initramfs-${MACHINE}.bin" --no-table --fixed-size 12