blob: d5491b6e60ae8eddcbbf8d6e67db8ed19ab4db5c [file] [log] [blame]
Marian Balakowiczb97a2a02008-01-08 18:14:09 +01001/*
2 * (C) Copyright 2000-2004
3 * DENX Software Engineering
4 * Wolfgang Denk, wd@denx.de
Marian Balakowiczb97a2a02008-01-08 18:14:09 +01005 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Marian Balakowiczb97a2a02008-01-08 18:14:09 +01007 */
8
Prafulla Wadaskar89a4d6b2009-08-19 17:36:46 +05309#ifndef _MKIIMAGE_H_
10#define _MKIIMAGE_H_
11
Peter Tyser2f8d3962009-03-13 18:54:51 -050012#include "os_support.h"
Marian Balakowiczb97a2a02008-01-08 18:14:09 +010013#include <errno.h>
14#include <fcntl.h>
15#include <stdio.h>
16#include <stdlib.h>
17#include <string.h>
Marian Balakowiczb97a2a02008-01-08 18:14:09 +010018#include <sys/stat.h>
19#include <time.h>
20#include <unistd.h>
Bartlomiej Siekaa6e530f2008-02-29 16:00:23 +010021#include <sha1.h>
Bartlomiej Sieka8cf30802008-02-29 16:00:24 +010022#include "fdt_host.h"
Guilherme Maciel Ferreiraf86ed6a2013-12-01 12:43:10 -070023#include "imagetool.h"
Marian Balakowiczb97a2a02008-01-08 18:14:09 +010024
Prafulla Wadaskar89a4d6b2009-08-19 17:36:46 +053025#undef MKIMAGE_DEBUG
Marian Balakowicz5dfb5212008-02-29 21:24:06 +010026
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 Glass2434c662013-05-16 13:53:20 +000033static inline void *map_sysmem(ulong paddr, unsigned long len)
34{
35 return (void *)(uintptr_t)paddr;
36}
37
38static inline ulong map_to_sysmem(void *ptr)
39{
40 return (ulong)(uintptr_t)ptr;
41}
42
Bartlomiej Sieka9d254382008-03-11 12:34:47 +010043#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 Wadaskar89a4d6b2009-08-19 17:36:46 +053048
Prafulla Wadaskar89a4d6b2009-08-19 17:36:46 +053049#endif /* _MKIIMAGE_H_ */