Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2000-2004 |
| 3 | * DENX Software Engineering |
| 4 | * Wolfgang Denk, wd@denx.de |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 5 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 7 | */ |
| 8 | |
Prafulla Wadaskar | 89a4d6b | 2009-08-19 17:36:46 +0530 | [diff] [blame] | 9 | #ifndef _MKIIMAGE_H_ |
| 10 | #define _MKIIMAGE_H_ |
| 11 | |
Peter Tyser | 2f8d396 | 2009-03-13 18:54:51 -0500 | [diff] [blame] | 12 | #include "os_support.h" |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 13 | #include <errno.h> |
| 14 | #include <fcntl.h> |
| 15 | #include <stdio.h> |
| 16 | #include <stdlib.h> |
| 17 | #include <string.h> |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 18 | #include <sys/stat.h> |
| 19 | #include <time.h> |
| 20 | #include <unistd.h> |
Bartlomiej Sieka | a6e530f | 2008-02-29 16:00:23 +0100 | [diff] [blame] | 21 | #include <sha1.h> |
Bartlomiej Sieka | 8cf3080 | 2008-02-29 16:00:24 +0100 | [diff] [blame] | 22 | #include "fdt_host.h" |
Guilherme Maciel Ferreira | f86ed6a | 2013-12-01 12:43:10 -0700 | [diff] [blame] | 23 | #include "imagetool.h" |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 24 | |
Prafulla Wadaskar | 89a4d6b | 2009-08-19 17:36:46 +0530 | [diff] [blame] | 25 | #undef MKIMAGE_DEBUG |
Marian Balakowicz | 5dfb521 | 2008-02-29 21:24:06 +0100 | [diff] [blame] | 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 | |
Simon Glass | 2434c66 | 2013-05-16 13:53:20 +0000 | [diff] [blame] | 33 | static inline void *map_sysmem(ulong paddr, unsigned long len) |
| 34 | { |
| 35 | return (void *)(uintptr_t)paddr; |
| 36 | } |
| 37 | |
| 38 | static inline ulong map_to_sysmem(void *ptr) |
| 39 | { |
| 40 | return (ulong)(uintptr_t)ptr; |
| 41 | } |
| 42 | |
Bartlomiej Sieka | 9d25438 | 2008-03-11 12:34:47 +0100 | [diff] [blame] | 43 | #define MKIMAGE_TMPFILE_SUFFIX ".tmp" |
| 44 | #define MKIMAGE_MAX_TMPFILE_LEN 256 |
| 45 | #define MKIMAGE_DEFAULT_DTC_OPTIONS "-I dts -O dtb -p 500" |
| 46 | #define MKIMAGE_MAX_DTC_CMDLINE_LEN 512 |
| 47 | #define MKIMAGE_DTC "dtc" /* assume dtc is in $PATH */ |
Prafulla Wadaskar | 89a4d6b | 2009-08-19 17:36:46 +0530 | [diff] [blame] | 48 | |
Prafulla Wadaskar | 89a4d6b | 2009-08-19 17:36:46 +0530 | [diff] [blame] | 49 | #endif /* _MKIIMAGE_H_ */ |