Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 1 | /* |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 5 | */ |
6 | |||||
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 7 | #ifndef __FIPTOOL_H__ |
8 | #define __FIPTOOL_H__ | ||||
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 9 | |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 10 | #include <stddef.h> |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 11 | #include <stdint.h> |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 12 | |
Masahiro Yamada | 2fe0dad | 2017-01-27 03:56:58 +0900 | [diff] [blame] | 13 | #include "firmware_image_package.h" |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 14 | #include "uuid.h" |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 15 | |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 16 | #define NELEM(x) (sizeof (x) / sizeof *(x)) |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 17 | |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 18 | enum { |
dp-arm | 90d2f0e | 2016-11-14 15:54:32 +0000 | [diff] [blame] | 19 | DO_UNSPEC = 0, |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 20 | DO_PACK = 1, |
21 | DO_UNPACK = 2, | ||||
22 | DO_REMOVE = 3 | ||||
23 | }; | ||||
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 24 | |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 25 | enum { |
26 | LOG_DBG, | ||||
27 | LOG_WARN, | ||||
28 | LOG_ERR | ||||
29 | }; | ||||
30 | |||||
dp-arm | 90d2f0e | 2016-11-14 15:54:32 +0000 | [diff] [blame] | 31 | typedef struct image_desc { |
32 | uuid_t uuid; | ||||
33 | char *name; | ||||
34 | char *cmdline_name; | ||||
35 | int action; | ||||
36 | char *action_arg; | ||||
dp-arm | afa1efa | 2017-02-14 15:22:13 +0000 | [diff] [blame] | 37 | struct image *image; |
dp-arm | 90d2f0e | 2016-11-14 15:54:32 +0000 | [diff] [blame] | 38 | struct image_desc *next; |
39 | } image_desc_t; | ||||
40 | |||||
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 41 | typedef struct image { |
Masahiro Yamada | 2fe0dad | 2017-01-27 03:56:58 +0900 | [diff] [blame] | 42 | struct fip_toc_entry toc_e; |
43 | void *buffer; | ||||
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 44 | } image_t; |
45 | |||||
46 | typedef struct cmd { | ||||
dp-arm | 90d2f0e | 2016-11-14 15:54:32 +0000 | [diff] [blame] | 47 | char *name; |
48 | int (*handler)(int, char **); | ||||
49 | void (*usage)(void); | ||||
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 50 | } cmd_t; |
Harry Liebel | f58ad36 | 2014-01-10 18:00:33 +0000 | [diff] [blame] | 51 | |
dp-arm | 4972ec5 | 2016-05-25 16:20:20 +0100 | [diff] [blame] | 52 | #endif /* __FIPTOOL_H__ */ |