binman.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: Intel */
  2. /*
  3. * Access to binman information at runtime
  4. *
  5. * Copyright 2019 Google LLC
  6. * Written by Simon Glass <sjg@chromium.org>
  7. */
  8. #ifndef _BINMAN_H_
  9. #define _BINMAN_H_
  10. /**
  11. *struct binman_entry - information about a binman entry
  12. *
  13. * @image_pos: Position of entry in the image
  14. * @size: Size of entry
  15. */
  16. struct binman_entry {
  17. u32 image_pos;
  18. u32 size;
  19. };
  20. /**
  21. * binman_entry_find() - Find a binman symbol
  22. *
  23. * This searches the binman information in the device tree for a symbol of the
  24. * given name
  25. *
  26. * @name: Path to entry to examine (e.g. "/read-only/u-boot")
  27. * @entry: Returns information about the entry
  28. * @return 0 if OK, -ENOENT if the path is not found, other -ve value if the
  29. * binman information is invalid (missing image-pos or size)
  30. */
  31. int binman_entry_find(const char *name, struct binman_entry *entry);
  32. /**
  33. * binman_init() - Set up the binman symbol information
  34. *
  35. * This locates the binary symbol information in the device tree ready for use
  36. *
  37. * @return 0 if OK, -ENOMEM if out of memory, -EINVAL if there is no binman node
  38. */
  39. int binman_init(void);
  40. #endif