From 071106ecf68c401173c58808b1cf5f68cc50d390 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 05 Jan 2024 08:39:27 +0000 Subject: [PATCH] change wifi driver to cypress --- u-boot/arch/arm/mach-rockchip/fit_misc.c | 34 ++++++++++++++++++++++++++++++++-- 1 files changed, 32 insertions(+), 2 deletions(-) diff --git a/u-boot/arch/arm/mach-rockchip/fit_misc.c b/u-boot/arch/arm/mach-rockchip/fit_misc.c index a279f5f..d3a2ad5 100644 --- a/u-boot/arch/arm/mach-rockchip/fit_misc.c +++ b/u-boot/arch/arm/mach-rockchip/fit_misc.c @@ -6,6 +6,7 @@ #include <common.h> #include <boot_rkimg.h> +#include <malloc.h> #include <misc.h> #ifdef CONFIG_SPL_BUILD #include <spl.h> @@ -25,7 +26,7 @@ #if CONFIG_IS_ENABLED(FIT_IMAGE_POST_PROCESS) #define FIT_UNCOMP_HASH_NODENAME "digest" -#if CONFIG_IS_ENABLED(MISC_DECOMPRESS) || CONFIG_IS_ENABLED(GZIP) +#if CONFIG_IS_ENABLED(MISC_DECOMPRESS) || CONFIG_IS_ENABLED(GZIP) || CONFIG_IS_ENABLED(LZMA) static int fit_image_get_uncomp_digest(const void *fit, int parent_noffset) { const char *name; @@ -126,8 +127,10 @@ else misc_decompress_sync(comp); #else +#if CONFIG_IS_ENABLED(GZIP) ret = gunzip((void *)(*load_addr), ALIGN(len, FIT_MAX_SPL_IMAGE_SZ), (void *)(*src_addr), (void *)(&len)); +#endif #endif } @@ -154,7 +157,7 @@ void board_fit_image_post_process(void *fit, int node, ulong *load_addr, ulong **src_addr, size_t *src_len, void *spec) { -#if CONFIG_IS_ENABLED(MISC_DECOMPRESS) || CONFIG_IS_ENABLED(GZIP) +#if CONFIG_IS_ENABLED(MISC_DECOMPRESS) || CONFIG_IS_ENABLED(GZIP) || CONFIG_IS_ENABLED(LZMA) fit_decomp_image(fit, node, load_addr, src_addr, src_len, spec); #endif @@ -169,6 +172,33 @@ } } #endif + +#ifndef CONFIG_SPL_BUILD + if (fit_image_check_type(fit, node, IH_TYPE_FIRMWARE)) { + const char *uname; + char *old, *new; + size_t len; + + uname = fdt_get_name(fit, node, NULL); + if (strcmp("bootargs", uname)) + return; + + old = env_get("bootargs"); + if (!old) + return; + + len = strlen(old) + (*src_len) + 2; + new = calloc(1, len); + if (new) { + strcpy(new, old); + strcat(new, " "); + strcat(new, (char *)(*src_addr)); + env_set("bootargs", new); + free(new); + } + + } +#endif } #endif /* FIT_IMAGE_POST_PROCESS */ /* -- Gitblit v1.6.2