This adds the option to compress ramstage and payloads with zstd.
zstd compressed ramstages are typically +5% bigger than lzma compressed
ramstages. The decompressor .text section grows by 20KiB and the
decompressor needs 16KiB more heap than the lzma decompressor.
To use less heap inside the zstd decompressor the build time define
ZSTD_DECODER_INTERNAL_BUFFER is used.
Quote:
The build macro `ZSTD_DECODER_INTERNAL_BUFFER` can be set to control
the amount of extra memory used during decompression to store
literals. This defaults to 64kB. Reducing this value reduces the
memory footprint of `ZSTD_DCtx` decompression contexts, but might
also result in a small decompression speed cost
TEST=Booted on Lenovo X220 with zstd ramstage showed no disadvantage
over a bigger internal buffer used.
TEST=Booted on Lenovo X220. The zstd decompressor is twice as fast
as the lzma decompressor.
cbmem -t shows:
- finished ZSTD decompress (ignore for x86) 79,444 (24,494)
- finished LZMA decompress (ignore for x86) 94,971 (45,545)
TEST=Booted on QEMU Q35, QEMU aarch64 virt, QEMU riscv RV64 with
zstd compressed ramstage.
Change-Id: Ic1b1f53327c598d07bd83d4391e8012d41696a16
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69893
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
201 lines
5.8 KiB
Text
201 lines
5.8 KiB
Text
## SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
menu "Payload"
|
|
|
|
config PAYLOAD_NONE
|
|
bool "Don't add a payload"
|
|
default y if !ARCH_X86 && !ARCH_PPC64
|
|
help
|
|
Select this option if you want to create an "empty" coreboot
|
|
ROM image for a certain mainboard, i.e. a coreboot ROM image
|
|
which does not yet contain a payload.
|
|
|
|
For such an image to be useful, you have to use 'cbfstool'
|
|
to add a payload to the ROM image later.
|
|
|
|
if !PAYLOAD_NONE
|
|
choice
|
|
prompt "Payload to add"
|
|
default PAYLOAD_SEABIOS if ARCH_X86
|
|
default PAYLOAD_SKIBOOT if ARCH_PPC64
|
|
|
|
config PAYLOAD_ELF
|
|
bool "An ELF executable payload"
|
|
help
|
|
Select this option if you have a payload image (an ELF file)
|
|
which coreboot should run as soon as the basic hardware
|
|
initialization is completed.
|
|
|
|
You will be able to specify the location and file name of the
|
|
payload image later.
|
|
|
|
config PAYLOAD_FIT
|
|
bool "A FIT payload"
|
|
depends on ARCH_ARM64 || ARCH_RISCV || ARCH_ARM
|
|
select PAYLOAD_FIT_SUPPORT
|
|
help
|
|
Select this option if you have a payload image (a FIT file) which
|
|
coreboot should run as soon as the basic hardware initialization
|
|
is completed.
|
|
|
|
You will be able to specify the location and file name of the
|
|
payload image later.
|
|
|
|
config PAYLOAD_FLAT_BINARY
|
|
bool "A flat binary"
|
|
select PAYLOAD_IS_FLAT_BINARY
|
|
help
|
|
Select this option if you have a flat binary without any
|
|
executable format surrounding it which coreboot should run
|
|
as soon as the basic hardware initialization is completed.
|
|
|
|
You will be able to specify the location and file name of the
|
|
payload image later.
|
|
|
|
source "payloads/external/*/Kconfig.name"
|
|
|
|
endchoice
|
|
|
|
source "payloads/external/*/Kconfig"
|
|
|
|
config PAYLOAD_FILE
|
|
string "Payload path and filename"
|
|
depends on PAYLOAD_ELF || PAYLOAD_FIT || PAYLOAD_FLAT_BINARY
|
|
default "payload.elf" if PAYLOAD_ELF
|
|
default "uImage" if PAYLOAD_FIT
|
|
help
|
|
The path and filename of the ELF executable file to use as payload.
|
|
|
|
choice
|
|
prompt "Payload compression algorithm"
|
|
default COMPRESSED_PAYLOAD_LZMA
|
|
default COMPRESSED_PAYLOAD_NONE if PAYLOAD_FIT
|
|
depends on !PAYLOAD_FIT
|
|
help
|
|
Choose the compression algorithm for the chosen payloads.
|
|
You can choose between None, LZMA, or LZ4.
|
|
|
|
config COMPRESSED_PAYLOAD_NONE
|
|
bool "Use no compression for payloads"
|
|
help
|
|
Do not compress the payload.
|
|
|
|
config COMPRESSED_PAYLOAD_LZMA
|
|
bool "Use LZMA compression for payloads"
|
|
help
|
|
In order to reduce the size payloads take up in the ROM chip
|
|
coreboot can compress them using the LZMA algorithm.
|
|
|
|
config COMPRESSED_PAYLOAD_ZSTD
|
|
bool "Use ZSTD compression for payloads"
|
|
help
|
|
In order to reduce the size payloads take up in the ROM chip
|
|
coreboot can compress them using the ZSTD algorithm.
|
|
|
|
config COMPRESSED_PAYLOAD_LZ4
|
|
bool "Use LZ4 compression for payloads"
|
|
help
|
|
In order to reduce the size payloads take up in the ROM chip
|
|
coreboot can compress them using the LZ4 algorithm.
|
|
endchoice
|
|
|
|
config PAYLOAD_OPTIONS
|
|
string "Additional cbfstool options" if PAYLOAD_FLAT_BINARY
|
|
default ""
|
|
depends on PAYLOAD_IS_FLAT_BINARY
|
|
help
|
|
Additional cbfstool options for the payload
|
|
|
|
config PAYLOAD_IS_FLAT_BINARY
|
|
bool
|
|
default n
|
|
|
|
config COMPRESS_SECONDARY_PAYLOAD
|
|
bool "Use LZMA compression for secondary payloads"
|
|
default y
|
|
help
|
|
In order to reduce the size secondary payloads take up in the
|
|
ROM chip they can be compressed using the LZMA algorithm.
|
|
|
|
menu "Secondary Payloads"
|
|
|
|
config COREINFO_SECONDARY_PAYLOAD
|
|
bool "Load coreinfo as a secondary payload"
|
|
default n
|
|
depends on ARCH_X86
|
|
help
|
|
coreinfo can be loaded as a secondary payload under SeaBIOS, GRUB,
|
|
or any other payload that can load additional payloads.
|
|
|
|
config GRUB2_SECONDARY_PAYLOAD
|
|
bool "Load GRUB2 as a secondary payload"
|
|
default n
|
|
depends on !PAYLOAD_GRUB2
|
|
select PAYLOAD_BUILD_GRUB2
|
|
help
|
|
GRUB2 can be loaded as a secondary payload under SeaBIOS or any
|
|
other payload that can load additional payloads.
|
|
|
|
config MEMTEST_SECONDARY_PAYLOAD
|
|
bool "Load Memtest86+ as a secondary payload"
|
|
default n
|
|
depends on ARCH_X86
|
|
help
|
|
Memtest86+ can be loaded as a secondary payload under SeaBIOS, GRUB,
|
|
or any other payload that can load additional payloads.
|
|
|
|
config NVRAMCUI_SECONDARY_PAYLOAD
|
|
bool "Load nvramcui as a secondary payload"
|
|
default n
|
|
depends on ARCH_X86 && HAVE_OPTION_TABLE
|
|
help
|
|
nvramcui can be loaded as a secondary payload under SeaBIOS, GRUB,
|
|
or any other payload that can load additional payloads.
|
|
|
|
config SEABIOS_SECONDARY_PAYLOAD
|
|
bool "Load SeaBIOS as a secondary payload"
|
|
default n
|
|
depends on ARCH_X86
|
|
depends on !PAYLOAD_SEABIOS
|
|
depends on !PAYLOAD_SEAGRUB
|
|
select PAYLOAD_BUILD_SEABIOS
|
|
help
|
|
SeaBIOS can be loaded as a secondary payload under GRUB or any
|
|
other payload that can load additional payloads.
|
|
|
|
config TINT_SECONDARY_PAYLOAD
|
|
bool "Load tint as a secondary payload"
|
|
default n
|
|
depends on ARCH_X86
|
|
help
|
|
tint can be loaded as a secondary payload under SeaBIOS, GRUB,
|
|
or any other payload that can load additional payloads.
|
|
|
|
config COREDOOM_SECONDARY_PAYLOAD
|
|
bool "Load coreDOOM as a secondary payload"
|
|
default n
|
|
depends on ARCH_X86
|
|
help
|
|
coreDOOM can be loaded as a secondary payload under SeaBIOS, GRUB,
|
|
or any other payload that can load additional payloads. Requires a
|
|
linear framebuffer. If built as a secondary payload for SeaBIOS, the
|
|
generated VGA BIOS option rom is also required.
|
|
|
|
source "payloads/external/*/Kconfig.secondary"
|
|
|
|
endmenu # "Secondary Payloads"
|
|
|
|
endif # !PAYLOAD_NONE
|
|
|
|
config PAYLOAD_FIT_SUPPORT
|
|
bool "FIT support"
|
|
default n
|
|
default y if PAYLOAD_LINUX && (ARCH_ARM || ARCH_ARM64 || ARCH_RISCV)
|
|
depends on ARCH_ARM64 || ARCH_RISCV || ARCH_ARM
|
|
select FLATTENED_DEVICE_TREE
|
|
help
|
|
Select this option if your payload is of type FIT.
|
|
Enables FIT parser and devicetree patching. The FIT is non
|
|
self-extracting and needs to have a compatible compression format.
|
|
|
|
endmenu
|