From ce6ab56401c6f91c77bdadd3128df94b2e3f046e Mon Sep 17 00:00:00 2001 From: Manoj Sai Date: Mon, 18 Sep 2023 00:56:25 +0530 Subject: spl: fit: support for booting a GZIP-compressed U-boot binary If GZIP Compression support is enabled, GZIP compressed U-Boot binary will be at a specified RAM location which is defined at CONFIG_SYS_LOAD_ADDR and will be assign it as the source address. gunzip function in spl_load_fit_image ,will decompress the GZIP compressed U-Boot binary which is placed at source address(CONFIG_SYS_LOAD_ADDR) to the default CONFIG_SYS_TEXT_BASE location. spl_load_fit_image function will load the decompressed U-Boot binary, which is placed at the CONFIG_SYS_TEXT_BASE location. Signed-off-by: Manoj Sai Signed-off-by: Suniel Mahesh Reviewed-by: Kever Yang Reviewed-by: Simon Glass Reviewed-by: Tom Rini --- include/spl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/spl.h') diff --git a/include/spl.h b/include/spl.h index 0fedddd00ef..320ed942739 100644 --- a/include/spl.h +++ b/include/spl.h @@ -897,4 +897,14 @@ struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size); void board_boot_order(u32 *spl_boot_list); void spl_save_restore_data(void); + +/* + * spl_decompression_enabled() - check decompression support is enabled for SPL build + * + * Returns true if decompression support is enabled, else False + */ +static inline bool spl_decompression_enabled(void) +{ + return IS_ENABLED(CONFIG_SPL_GZIP); +} #endif -- cgit v1.2.3 From a1b7fd7f0af2bf342ec4899be3dda72e02d29c1e Mon Sep 17 00:00:00 2001 From: Manoj Sai Date: Mon, 18 Sep 2023 00:56:26 +0530 Subject: spl: fit: support for booting a LZMA-compressed U-boot binary If LZMA Compression support is enabled, LZMA compressed U-Boot binary will be placed at a specified RAM location which is defined at CONFIG_SYS_LOAD_ADDR and will be assigned as the source address. image_decomp() function, will decompress the LZMA compressed U-Boot binary which is placed at source address(CONFIG_SYS_LOAD_ADDR) to the default CONFIG_SYS_TEXT_BASE location. spl_load_fit_image function will load the decompressed U-Boot binary, which is placed at the CONFIG_SYS_TEXT_BASE location. Signed-off-by: Manoj Sai Signed-off-by: Suniel Mahesh Reviewed-by: Simon Glass Reviewed-by: Kever Yang Reviewed-by: Tom Rini --- include/spl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/spl.h') diff --git a/include/spl.h b/include/spl.h index 320ed942739..f62f385afaf 100644 --- a/include/spl.h +++ b/include/spl.h @@ -905,6 +905,6 @@ void spl_save_restore_data(void); */ static inline bool spl_decompression_enabled(void) { - return IS_ENABLED(CONFIG_SPL_GZIP); + return IS_ENABLED(CONFIG_SPL_GZIP) || IS_ENABLED(CONFIG_SPL_LZMA); } #endif -- cgit v1.2.3