From f3db7445278ff76b9c3631a0d5cf125617541991 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 23 Aug 2024 08:13:00 +0100 Subject: [PATCH] zephyr: Add Kconfig for decompression Adds a Kconfig allowing the decompression option to be selected Signed-off-by: Jamie McCrae --- boot/zephyr/Kconfig | 27 +++++++++++++++++++ .../include/mcuboot_config/mcuboot_config.h | 4 +++ 2 files changed, 31 insertions(+) diff --git a/boot/zephyr/Kconfig b/boot/zephyr/Kconfig index bf772cac7..64e23ac6d 100644 --- a/boot/zephyr/Kconfig +++ b/boot/zephyr/Kconfig @@ -729,6 +729,33 @@ config MCUBOOT_BOOT_BANNER config BOOT_BANNER_STRING default "Using Zephyr OS build" if MCUBOOT_BOOT_BANNER +config BOOT_DECOMPRESSION_SUPPORT + bool + help + Hidden symbol which should be selected if a system provided decompression support. + +if BOOT_DECOMPRESSION_SUPPORT + +menuconfig BOOT_DECOMPRESSION + bool "Decompression" + help + If enabled, will include support for compressed images being loaded to the secondary slot + which then get decompressed into the primary slot. This mode allows the secondary slot to + be smaller than primary slot which otherwise would not be allowed. + +if BOOT_DECOMPRESSION + +config BOOT_DECOMPRESSION_BUFFER_SIZE + int "Write buffer size" + range 16 16384 + default 4096 + help + The size of a secondary buffer used for writing decompressed data to the storage device. + +endif # BOOT_DECOMPRESSION + +endif # BOOT_DECOMPRESSION_SUPPORT + endmenu config MCUBOOT_DEVICE_SETTINGS diff --git a/boot/zephyr/include/mcuboot_config/mcuboot_config.h b/boot/zephyr/include/mcuboot_config/mcuboot_config.h index bb30ce298..0891a4b11 100644 --- a/boot/zephyr/include/mcuboot_config/mcuboot_config.h +++ b/boot/zephyr/include/mcuboot_config/mcuboot_config.h @@ -127,6 +127,10 @@ #define MCUBOOT_ENCRYPT_X25519 #endif +#ifdef CONFIG_BOOT_DECOMPRESSION +#define MCUBOOT_DECOMPRESS_IMAGES +#endif + #ifdef CONFIG_BOOT_BOOTSTRAP #define MCUBOOT_BOOTSTRAP 1 #endif