]> git.ipfire.org Git - thirdparty/u-boot.git/blame - tools/fit_common.h
Merge tag 'dm-pull-30may20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
[thirdparty/u-boot.git] / tools / fit_common.h
CommitLineData
83d290c5 1/* SPDX-License-Identifier: GPL-2.0+ */
6bf4ca07
HS
2/*
3 * (C) Copyright 2014
6bf4ca07
HS
4 */
5
6#ifndef _FIT_COMMON_H_
7#define _FIT_COMMON_H_
8
9#include "imagetool.h"
10#include "mkimage.h"
11#include <image.h>
12
d32aa3ca
JH
13/**
14 * Verify the format of FIT header pointed to by ptr
15 *
16 * @ptr: image header to be verified
17 * @image_size: size of while image
18 * @params: mkimage parameters
19 * @return 0 if OK, -1 on error
20 */
6bf4ca07
HS
21int fit_verify_header(unsigned char *ptr, int image_size,
22 struct image_tool_params *params);
23
24int fit_check_image_types(uint8_t type);
25
ef0af64b
SG
26/**
27 * Map an FDT into memory, optionally increasing its size
28 *
29 * @cmdname: Tool name (for displaying with error messages)
30 * @fname: Filename containing FDT
a9468115 31 * @size_inc: Amount to increase size by (0 = leave it alone)
ef0af64b
SG
32 * @blobp: Returns pointer to FDT blob
33 * @sbuf: File status information is stored here
34 * @delete_on_error: true to delete the file if we get an error
7d57485a 35 * @read_only: true to open in read-only mode
ef0af64b
SG
36 * @return 0 if OK, -1 on error.
37 */
a9468115 38int mmap_fdt(const char *cmdname, const char *fname, size_t size_inc,
7d57485a
LB
39 void **blobp, struct stat *sbuf, bool delete_on_error,
40 bool read_only);
6bf4ca07
HS
41
42#endif /* _FIT_COMMON_H_ */