mkimage.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2000-2004
  4. * DENX Software Engineering
  5. * Wolfgang Denk, wd@denx.de
  6. */
  7. #ifndef _MKIIMAGE_H_
  8. #define _MKIIMAGE_H_
  9. #include "os_support.h"
  10. #include <errno.h>
  11. #include <fcntl.h>
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <string.h>
  15. #include <sys/stat.h>
  16. #include <time.h>
  17. #include <unistd.h>
  18. #include <limits.h>
  19. #include <u-boot/sha1.h>
  20. #include "fdt_host.h"
  21. #include "imagetool.h"
  22. #undef MKIMAGE_DEBUG
  23. #ifdef MKIMAGE_DEBUG
  24. #define debug(fmt,args...) printf (fmt ,##args)
  25. #else
  26. #define debug(fmt,args...)
  27. #endif /* MKIMAGE_DEBUG */
  28. #define log_debug(fmt, args...) debug(fmt, ##args)
  29. static inline void *map_sysmem(ulong paddr, unsigned long len)
  30. {
  31. return (void *)(uintptr_t)paddr;
  32. }
  33. static inline ulong map_to_sysmem(void *ptr)
  34. {
  35. return (ulong)(uintptr_t)ptr;
  36. }
  37. #define ALLOC_CACHE_ALIGN_BUFFER(type, name, size) type name[size]
  38. #define MKIMAGE_TMPFILE_SUFFIX ".tmp"
  39. #define MKIMAGE_MAX_TMPFILE_LEN PATH_MAX
  40. #define MKIMAGE_DEFAULT_DTC_OPTIONS "-I dts -O dtb -p 500"
  41. #define MKIMAGE_MAX_DTC_CMDLINE_LEN 2 * MKIMAGE_MAX_TMPFILE_LEN + 35
  42. #endif /* _MKIIMAGE_H_ */