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 
8 #ifndef _MKIIMAGE_H_
9 #define _MKIIMAGE_H_
10 
11 #include "os_support.h"
12 #include <errno.h>
13 #include <fcntl.h>
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <string.h>
17 #include <sys/stat.h>
18 #include <time.h>
19 #include <unistd.h>
20 #include <limits.h>
21 #include <u-boot/sha1.h>
22 #include "fdt_host.h"
23 #include "imagetool.h"
24 
25 #undef MKIMAGE_DEBUG
26 
27 #ifdef MKIMAGE_DEBUG
28 #define debug(fmt,args...)	printf (fmt ,##args)
29 #else
30 #define debug(fmt,args...)
31 #endif /* MKIMAGE_DEBUG */
32 
33 #define log_debug(fmt, args...)	debug(fmt, ##args)
34 
map_sysmem(ulong paddr,unsigned long len)35 static inline void *map_sysmem(ulong paddr, unsigned long len)
36 {
37 	return (void *)(uintptr_t)paddr;
38 }
39 
unmap_sysmem(const void * vaddr)40 static inline void unmap_sysmem(const void *vaddr)
41 {
42 }
43 
map_to_sysmem(const void * ptr)44 static inline ulong map_to_sysmem(const void *ptr)
45 {
46 	return (ulong)(uintptr_t)ptr;
47 }
48 
49 #define ALLOC_CACHE_ALIGN_BUFFER(type, name, size) type name[size]
50 
51 #define MKIMAGE_TMPFILE_SUFFIX		".tmp"
52 #define MKIMAGE_MAX_TMPFILE_LEN		PATH_MAX
53 #define MKIMAGE_DEFAULT_DTC_OPTIONS	"-I dts -O dtb -p 500"
54 #define MKIMAGE_MAX_DTC_CMDLINE_LEN	2 * MKIMAGE_MAX_TMPFILE_LEN + 35
55 
56 #endif /* _MKIIMAGE_H_ */
57