spl: Add an arch-specific hook for writing to SPL handoff
[oweals/u-boot.git] / common / image-fit.c
index e346fed550e842538430eb6fcb0a6b192784eeaa..5c63c769de274e721ae767fae96da61f013bb8be 100644 (file)
@@ -1998,10 +1998,11 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
        comp = IH_COMP_NONE;
        loadbuf = buf;
        /* Kernel images get decompressed later in bootm_load_os(). */
-       if (!(image_type == IH_TYPE_KERNEL ||
-             image_type == IH_TYPE_KERNEL_NOLOAD) &&
-           !fit_image_get_comp(fit, noffset, &comp) &&
-           comp != IH_COMP_NONE) {
+       if (!fit_image_get_comp(fit, noffset, &comp) &&
+           comp != IH_COMP_NONE &&
+           !(image_type == IH_TYPE_KERNEL ||
+             image_type == IH_TYPE_KERNEL_NOLOAD ||
+             image_type == IH_TYPE_RAMDISK)) {
                ulong max_decomp_len = len * 20;
                if (load == data) {
                        loadbuf = malloc(max_decomp_len);
@@ -2021,6 +2022,10 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
                memcpy(loadbuf, buf, len);
        }
 
+       if (image_type == IH_TYPE_RAMDISK && comp != IH_COMP_NONE)
+               puts("WARNING: 'compression' nodes for ramdisks are deprecated,"
+                    " please fix your .its file!\n");
+
        /* verify that image data is a proper FDT blob */
        if (image_type == IH_TYPE_FLATDT && fdt_check_header(loadbuf)) {
                puts("Subimage data is not a FDT");