Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2000-2004 |
| 4 | * DENX Software Engineering |
| 5 | * Wolfgang Denk, wd@denx.de |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
Prafulla Wadaskar | 89a4d6b | 2009-08-19 17:36:46 +0530 | [diff] [blame] | 8 | #ifndef _MKIIMAGE_H_ |
| 9 | #define _MKIIMAGE_H_ |
| 10 | |
Peter Tyser | 2f8d396 | 2009-03-13 18:54:51 -0500 | [diff] [blame] | 11 | #include "os_support.h" |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 12 | #include <errno.h> |
| 13 | #include <fcntl.h> |
| 14 | #include <stdio.h> |
| 15 | #include <stdlib.h> |
| 16 | #include <string.h> |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 17 | #include <sys/stat.h> |
| 18 | #include <time.h> |
| 19 | #include <unistd.h> |
Jeroen Hofstee | 2b9912e | 2014-06-12 22:27:12 +0200 | [diff] [blame] | 20 | #include <u-boot/sha1.h> |
Bartlomiej Sieka | 8cf3080 | 2008-02-29 16:00:24 +0100 | [diff] [blame] | 21 | #include "fdt_host.h" |
Guilherme Maciel Ferreira | f86ed6a | 2013-12-01 12:43:10 -0700 | [diff] [blame] | 22 | #include "imagetool.h" |
Marian Balakowicz | b97a2a0 | 2008-01-08 18:14:09 +0100 | [diff] [blame] | 23 | |
Prafulla Wadaskar | 89a4d6b | 2009-08-19 17:36:46 +0530 | [diff] [blame] | 24 | #undef MKIMAGE_DEBUG |
Marian Balakowicz | 5dfb521 | 2008-02-29 21:24:06 +0100 | [diff] [blame] | 25 | |
| 26 | #ifdef MKIMAGE_DEBUG |
| 27 | #define debug(fmt,args...) printf (fmt ,##args) |
| 28 | #else |
| 29 | #define debug(fmt,args...) |
| 30 | #endif /* MKIMAGE_DEBUG */ |
| 31 | |
Simon Glass | c581970 | 2021-02-15 17:08:09 -0700 | [diff] [blame] | 32 | #define log_debug(fmt, args...) debug(fmt, ##args) |
| 33 | |
Simon Glass | 2434c66 | 2013-05-16 13:53:20 +0000 | [diff] [blame] | 34 | static inline void *map_sysmem(ulong paddr, unsigned long len) |
| 35 | { |
| 36 | return (void *)(uintptr_t)paddr; |
| 37 | } |
| 38 | |
| 39 | static inline ulong map_to_sysmem(void *ptr) |
| 40 | { |
| 41 | return (ulong)(uintptr_t)ptr; |
| 42 | } |
| 43 | |
Sean Anderson | b583348 | 2022-03-24 11:26:11 -0400 | [diff] [blame] | 44 | #define ARCH_DMA_MINALIGN 1 |
| 45 | #define DEFINE_ALIGN_BUFFER(type, name, size, alugn) type name[size] |
| 46 | |
Bartlomiej Sieka | 9d25438 | 2008-03-11 12:34:47 +0100 | [diff] [blame] | 47 | #define MKIMAGE_TMPFILE_SUFFIX ".tmp" |
| 48 | #define MKIMAGE_MAX_TMPFILE_LEN 256 |
| 49 | #define MKIMAGE_DEFAULT_DTC_OPTIONS "-I dts -O dtb -p 500" |
Sven Roederer | fc21a88 | 2020-04-27 02:08:38 +0200 | [diff] [blame] | 50 | #define MKIMAGE_MAX_DTC_CMDLINE_LEN 2 * MKIMAGE_MAX_TMPFILE_LEN + 35 |
Prafulla Wadaskar | 89a4d6b | 2009-08-19 17:36:46 +0530 | [diff] [blame] | 51 | |
Prafulla Wadaskar | 89a4d6b | 2009-08-19 17:36:46 +0530 | [diff] [blame] | 52 | #endif /* _MKIIMAGE_H_ */ |