* (C) Copyright 2000, 2001
* Rich Ireland, Enterasys Networks, rireland@enterasys.com.
*
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
+ * SPDX-License-Identifier: GPL-2.0+
*/
/*
image_header_t *hdr =
(image_header_t *)fpga_data;
ulong data;
-
- data = (ulong)image_get_data(hdr);
- data_size = image_get_data_size(hdr);
+ uint8_t comp;
+
+ comp = image_get_comp(hdr);
+ if (comp == IH_COMP_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 {
+ data = (ulong)image_get_data(hdr);
+ data_size = image_get_data_size(hdr);
+ }
rc = fpga_load(dev, (void *)data, data_size);
}
break;