fiptool.h 950 Bytes
Newer Older
1
/*
2
 * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

7
8
#ifndef FIPTOOL_H
#define FIPTOOL_H
9

dp-arm's avatar
dp-arm committed
10
#include <stddef.h>
11
12
#include <stdint.h>

Isla Mitchell's avatar
Isla Mitchell committed
13
#include <firmware_image_package.h>
14
#include <uuid.h>
15

16
17
#include "fiptool_platform.h"

dp-arm's avatar
dp-arm committed
18
#define NELEM(x) (sizeof (x) / sizeof *(x))
19

dp-arm's avatar
dp-arm committed
20
enum {
21
	DO_UNSPEC = 0,
dp-arm's avatar
dp-arm committed
22
23
24
25
	DO_PACK   = 1,
	DO_UNPACK = 2,
	DO_REMOVE = 3
};
26

dp-arm's avatar
dp-arm committed
27
28
29
30
31
enum {
	LOG_DBG,
	LOG_WARN,
	LOG_ERR
};
32

33
34
35
36
37
38
typedef struct image_desc {
	uuid_t             uuid;
	char              *name;
	char              *cmdline_name;
	int                action;
	char              *action_arg;
39
	struct image      *image;
40
41
42
	struct image_desc *next;
} image_desc_t;

dp-arm's avatar
dp-arm committed
43
typedef struct image {
44
45
	struct fip_toc_entry toc_e;
	void                *buffer;
dp-arm's avatar
dp-arm committed
46
47
48
} image_t;

typedef struct cmd {
49
50
	char              *name;
	int              (*handler)(int, char **);
51
	void             (*usage)(int);
dp-arm's avatar
dp-arm committed
52
53
} cmd_t;

54
#endif /* FIPTOOL_H */