xref: /OK3568_Linux_fs/u-boot/tools/fit_common.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * (C) Copyright 2014
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * SPDX-License-Identifier:	GPL-2.0+
5*4882a593Smuzhiyun  */
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun #ifndef _FIT_COMMON_H_
8*4882a593Smuzhiyun #define _FIT_COMMON_H_
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #include "imagetool.h"
11*4882a593Smuzhiyun #include "mkimage.h"
12*4882a593Smuzhiyun #include <image.h>
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun int fit_verify_header(unsigned char *ptr, int image_size,
15*4882a593Smuzhiyun 			struct image_tool_params *params);
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun int fit_check_image_types(uint8_t type);
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun /**
20*4882a593Smuzhiyun  * Map an FDT into memory, optionally increasing its size
21*4882a593Smuzhiyun  *
22*4882a593Smuzhiyun  * @cmdname:	Tool name (for displaying with error messages)
23*4882a593Smuzhiyun  * @fname:	Filename containing FDT
24*4882a593Smuzhiyun  * @size_inc:	Amount to increase size by (0 = leave it alone)
25*4882a593Smuzhiyun  * @blobp:	Returns pointer to FDT blob
26*4882a593Smuzhiyun  * @sbuf:	File status information is stored here
27*4882a593Smuzhiyun  * @delete_on_error:	true to delete the file if we get an error
28*4882a593Smuzhiyun  * @return 0 if OK, -1 on error.
29*4882a593Smuzhiyun  */
30*4882a593Smuzhiyun int mmap_fdt(const char *cmdname, const char *fname, size_t size_inc,
31*4882a593Smuzhiyun 	     void **blobp, struct stat *sbuf, bool delete_on_error);
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun #endif /* _FIT_COMMON_H_ */
34