3 * Texas Instruments Incorporated
4 * Add gpimage format for keystone devices to format spl image. This is
8 * Linaro LTD, www.linaro.org
9 * Author: John Rigby <john.rigby@linaro.org>
10 * Based on TI's signGP.c
13 * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
16 * Marvell Semiconductor <www.marvell.com>
17 * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
19 * SPDX-License-Identifier: GPL-2.0+
22 #include "imagetool.h"
27 static uint8_t gpimage_header[GPIMAGE_HDR_SIZE];
29 /* to be in keystone gpimage */
30 static int gpimage_check_image_types(uint8_t type)
32 if (type == IH_TYPE_GPIMAGE)
37 static int gpimage_verify_header(unsigned char *ptr, int image_size,
38 struct image_tool_params *params)
40 struct gp_header *gph = (struct gp_header *)ptr;
42 return gph_verify_header(gph, 1);
45 static void gpimage_print_header(const void *ptr)
47 const struct gp_header *gph = (struct gp_header *)ptr;
49 gph_print_header(gph, 1);
52 static void gpimage_set_header(void *ptr, struct stat *sbuf, int ifd,
53 struct image_tool_params *params)
55 struct gp_header *gph = (struct gp_header *)ptr;
57 gph_set_header(gph, sbuf->st_size - GPIMAGE_HDR_SIZE, params->addr, 1);
65 "TI KeyStone GP Image support",
67 (void *)&gpimage_header,
69 gpimage_verify_header,
73 gpimage_check_image_types,