summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2023-10-08 09:58:55 -0400
committerTom Rini <[email protected]>2023-10-08 09:58:55 -0400
commitd9bb6d779b69c2548891e568e5e2a23e1b7eedaa (patch)
tree53bccb62f9302d5cba0e709475683e4f823b00dc /common
parent83aa0ed1e93e1ffac24888d98d37a5b04ed3fb07 (diff)
parentdd8d52c934e8858264f91e8e8e2d8c7d8b059dd7 (diff)
Merge tag 'u-boot-rockchip-20231007' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
- Add Board: rk3568 Bananapi R2Pro; - Update pcie bifurcation support; - dwc_eth_qos controller support for rk3568 and rk3588; - Compressed binary support for U-Boot on rockchip platform; - dts and config updates for different board and soc; [ trini: Fix conflict on include/spl.h ] Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_fit.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 93480a5a60d..ce6b8aa370a 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -240,14 +240,14 @@ static int load_simple_fit(struct spl_load_info *info, ulong sector,
bool external_data = false;
if (IS_ENABLED(CONFIG_SPL_FPGA) ||
- (IS_ENABLED(CONFIG_SPL_OS_BOOT) && IS_ENABLED(CONFIG_SPL_GZIP))) {
+ (IS_ENABLED(CONFIG_SPL_OS_BOOT) && spl_decompression_enabled())) {
if (fit_image_get_type(fit, node, &type))
puts("Cannot get image type.\n");
else
debug("%s ", genimg_get_type_name(type));
}
- if (IS_ENABLED(CONFIG_SPL_GZIP)) {
+ if (spl_decompression_enabled()) {
fit_image_get_comp(fit, node, &image_comp);
debug("%s ", genimg_get_comp_name(image_comp));
}
@@ -282,7 +282,11 @@ static int load_simple_fit(struct spl_load_info *info, ulong sector,
return 0;
}
- src_ptr = map_sysmem(ALIGN(load_addr, ARCH_DMA_MINALIGN), len);
+ if (spl_decompression_enabled() &&
+ (image_comp == IH_COMP_GZIP || image_comp == IH_COMP_LZMA))
+ src_ptr = map_sysmem(ALIGN(CONFIG_SYS_LOAD_ADDR, ARCH_DMA_MINALIGN), len);
+ else
+ src_ptr = map_sysmem(ALIGN(load_addr, ARCH_DMA_MINALIGN), len);
length = len;
overhead = get_aligned_image_overhead(info, offset);
@@ -327,6 +331,16 @@ static int load_simple_fit(struct spl_load_info *info, ulong sector,
return -EIO;
}
length = size;
+ } else if (IS_ENABLED(CONFIG_SPL_LZMA) && image_comp == IH_COMP_LZMA) {
+ size = CONFIG_SYS_BOOTM_LEN;
+ ulong loadEnd;
+
+ if (image_decomp(IH_COMP_LZMA, CONFIG_SYS_LOAD_ADDR, 0, 0,
+ load_ptr, src, length, size, &loadEnd)) {
+ puts("Uncompressing error\n");
+ return -EIO;
+ }
+ length = loadEnd - CONFIG_SYS_LOAD_ADDR;
} else {
memcpy(load_ptr, src, length);
}