2014-01-10 18:00:33 +00:00
|
|
|
/*
|
2017-05-08 10:29:03 +01:00
|
|
|
* Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
|
2014-01-10 18:00:33 +00:00
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2014-01-10 18:00:33 +00:00
|
|
|
*/
|
|
|
|
|
2018-11-08 10:20:19 +00:00
|
|
|
#ifndef FIPTOOL_H
|
|
|
|
#define FIPTOOL_H
|
2014-01-10 18:00:33 +00:00
|
|
|
|
2016-05-25 16:20:20 +01:00
|
|
|
#include <stddef.h>
|
2014-01-10 18:00:33 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-07-14 10:46:32 +01:00
|
|
|
#include <firmware_image_package.h>
|
2017-05-08 10:29:03 +01:00
|
|
|
#include <uuid.h>
|
2014-01-10 18:00:33 +00:00
|
|
|
|
2017-05-25 19:06:47 +01:00
|
|
|
#include "fiptool_platform.h"
|
|
|
|
|
2016-05-25 16:20:20 +01:00
|
|
|
#define NELEM(x) (sizeof (x) / sizeof *(x))
|
2014-01-10 18:00:33 +00:00
|
|
|
|
2016-05-25 16:20:20 +01:00
|
|
|
enum {
|
2016-11-14 15:54:32 +00:00
|
|
|
DO_UNSPEC = 0,
|
2016-05-25 16:20:20 +01:00
|
|
|
DO_PACK = 1,
|
|
|
|
DO_UNPACK = 2,
|
|
|
|
DO_REMOVE = 3
|
|
|
|
};
|
2014-01-10 18:00:33 +00:00
|
|
|
|
2016-05-25 16:20:20 +01:00
|
|
|
enum {
|
|
|
|
LOG_DBG,
|
|
|
|
LOG_WARN,
|
|
|
|
LOG_ERR
|
|
|
|
};
|
2014-01-10 18:00:33 +00:00
|
|
|
|
2016-11-14 15:54:32 +00:00
|
|
|
typedef struct image_desc {
|
|
|
|
uuid_t uuid;
|
|
|
|
char *name;
|
|
|
|
char *cmdline_name;
|
|
|
|
int action;
|
|
|
|
char *action_arg;
|
2017-02-14 15:22:13 +00:00
|
|
|
struct image *image;
|
2016-11-14 15:54:32 +00:00
|
|
|
struct image_desc *next;
|
|
|
|
} image_desc_t;
|
|
|
|
|
2016-05-25 16:20:20 +01:00
|
|
|
typedef struct image {
|
2017-01-26 18:56:58 +00:00
|
|
|
struct fip_toc_entry toc_e;
|
|
|
|
void *buffer;
|
2016-05-25 16:20:20 +01:00
|
|
|
} image_t;
|
|
|
|
|
|
|
|
typedef struct cmd {
|
2016-11-14 15:54:32 +00:00
|
|
|
char *name;
|
|
|
|
int (*handler)(int, char **);
|
|
|
|
void (*usage)(void);
|
2016-05-25 16:20:20 +01:00
|
|
|
} cmd_t;
|
|
|
|
|
2018-11-08 10:20:19 +00:00
|
|
|
#endif /* FIPTOOL_H */
|