Merge tag 'ti-v2020.07-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
[oweals/u-boot.git] / common / spl / spl_fit.c
index ac69d8312ee96aa46d718d82c032f80f8fae8651..f581a2242132e29903df4b018a8bc4af5980075e 100644 (file)
 #include <fpga.h>
 #include <gzip.h>
 #include <image.h>
+#include <log.h>
 #include <malloc.h>
 #include <spl.h>
+#include <asm/cache.h>
 #include <linux/libfdt.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -259,11 +261,9 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
                        debug("%s ", genimg_get_type_name(type));
        }
 
-       if (IS_ENABLED(CONFIG_SPL_OS_BOOT) && IS_ENABLED(CONFIG_SPL_GZIP)) {
-               if (fit_image_get_comp(fit, node, &image_comp))
-                       puts("Cannot get image compression format.\n");
-               else
-                       debug("%s ", genimg_get_comp_name(image_comp));
+       if (IS_ENABLED(CONFIG_SPL_GZIP)) {
+               fit_image_get_comp(fit, node, &image_comp);
+               debug("%s ", genimg_get_comp_name(image_comp));
        }
 
        if (fit_image_get_load(fit, node, &load_addr))
@@ -427,8 +427,7 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,
                        debug("%s: DT overlay %s applied\n", __func__,
                              fit_get_name(fit, node, NULL));
                }
-               if (tmpbuffer)
-                       free(tmpbuffer);
+               free(tmpbuffer);
                if (ret)
                        return ret;
        }
@@ -648,10 +647,6 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 
                if (!spl_fit_image_get_os(fit, node, &os_type))
                        debug("Loadable is %s\n", genimg_get_os_name(os_type));
-#if CONFIG_IS_ENABLED(FIT_IMAGE_TINY)
-               else
-                       os_type = IH_OS_U_BOOT;
-#endif
 
                if (os_type == IH_OS_U_BOOT) {
                        spl_fit_append_fdt(&image_info, info, sector,