"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

boot: Respect the load_op in fit_image_load()

Some code has crept in which ignores this parameter. Fix this and add a
little debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: b1307f884a9 ("fit: Support compression for non-kernel components (e.g. FDT)")

authored by

Simon Glass and committed by
Tom Rini
47026475 19574e35

+8 -2
+8 -2
boot/image-fit.c
··· 2226 2226 data = map_to_sysmem(buf); 2227 2227 load = data; 2228 2228 if (load_op == FIT_LOAD_IGNORED) { 2229 + log_debug("load_op: not loading\n"); 2229 2230 /* Don't load */ 2230 2231 } else if (fit_image_get_load(fit, noffset, &load)) { 2231 2232 if (load_op == FIT_LOAD_REQUIRED) { ··· 2262 2263 /* Kernel images get decompressed later in bootm_load_os(). */ 2263 2264 if (!fit_image_get_comp(fit, noffset, &comp) && 2264 2265 comp != IH_COMP_NONE && 2266 + load_op != FIT_LOAD_IGNORED && 2265 2267 !(image_type == IH_TYPE_KERNEL || 2266 2268 image_type == IH_TYPE_KERNEL_NOLOAD || 2267 2269 image_type == IH_TYPE_RAMDISK)) { 2268 2270 ulong max_decomp_len = len * 20; 2271 + 2272 + log_debug("decompressing image\n"); 2269 2273 if (load == data) { 2270 2274 loadbuf = malloc(max_decomp_len); 2271 2275 load = map_to_sysmem(loadbuf); ··· 2280 2284 } 2281 2285 len = load_end - load; 2282 2286 } else if (load != data) { 2287 + log_debug("copying\n"); 2283 2288 loadbuf = map_sysmem(load, len); 2284 2289 memcpy(loadbuf, buf, len); 2285 2290 } ··· 2289 2294 " please fix your .its file!\n"); 2290 2295 2291 2296 /* verify that image data is a proper FDT blob */ 2292 - if (image_type == IH_TYPE_FLATDT && fdt_check_header(loadbuf)) { 2293 - puts("Subimage data is not a FDT"); 2297 + if (load_op != FIT_LOAD_IGNORED && image_type == IH_TYPE_FLATDT && 2298 + fdt_check_header(loadbuf)) { 2299 + puts("Subimage data is not a FDT\n"); 2294 2300 return -ENOEXEC; 2295 2301 } 2296 2302