fiptool.h 950 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef FIPTOOL_H
  7. #define FIPTOOL_H
  8. #include <stddef.h>
  9. #include <stdint.h>
  10. #include <firmware_image_package.h>
  11. #include <uuid.h>
  12. #include "fiptool_platform.h"
  13. #define NELEM(x) (sizeof (x) / sizeof *(x))
  14. enum {
  15. DO_UNSPEC = 0,
  16. DO_PACK = 1,
  17. DO_UNPACK = 2,
  18. DO_REMOVE = 3
  19. };
  20. enum {
  21. LOG_DBG,
  22. LOG_WARN,
  23. LOG_ERR
  24. };
  25. typedef struct image_desc {
  26. uuid_t uuid;
  27. char *name;
  28. char *cmdline_name;
  29. int action;
  30. char *action_arg;
  31. struct image *image;
  32. struct image_desc *next;
  33. } image_desc_t;
  34. typedef struct image {
  35. struct fip_toc_entry toc_e;
  36. void *buffer;
  37. } image_t;
  38. typedef struct cmd {
  39. char *name;
  40. int (*handler)(int, char **);
  41. void (*usage)(int);
  42. } cmd_t;
  43. #endif /* FIPTOOL_H */