-
- data = (ulong)image_get_data(hdr);
- data_size = image_get_data_size(hdr);
- rc = fpga_load(dev, (void *)data, data_size);
+ uint8_t comp;
+
+ comp = image_get_comp(hdr);
+ if (comp == IH_COMP_GZIP) {
+#if defined(CONFIG_GZIP)
+ ulong image_buf = image_get_data(hdr);
+ data = image_get_load(hdr);
+ ulong image_size = ~0UL;
+
+ if (gunzip((void *)data, ~0UL,
+ (void *)image_buf,
+ &image_size) != 0) {
+ puts("GUNZIP: error\n");
+ return 1;
+ }
+ data_size = image_size;
+#else
+ puts("Gunzip image is not supported\n");
+ return 1;
+#endif
+ } else {
+ data = (ulong)image_get_data(hdr);
+ data_size = image_get_data_size(hdr);
+ }
+ rc = fpga_load(dev, (void *)data, data_size,
+ BIT_FULL);