fit_common.h 892 B

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