summaryrefslogtreecommitdiff
path: root/util/cbfstool/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/common.h')
-rw-r--r--util/cbfstool/common.h36
1 files changed, 9 insertions, 27 deletions
diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h
index 7dbc1f575d..f1287e299f 100644
--- a/util/cbfstool/common.h
+++ b/util/cbfstool/common.h
@@ -9,10 +9,10 @@
#include <string.h>
#include <assert.h>
+#include <commonlib/bsd/cbfs_serialized.h>
#include <commonlib/helpers.h>
#include <console/console.h>
-/* Endianness */
#include "swab.h"
#define IS_TOP_ALIGNED_ADDRESS(x) ((uint32_t)(x) > 0x80000000)
@@ -147,47 +147,29 @@ typedef int (*comp_func_ptr) (char *in, int in_len, char *out, int *out_len);
typedef int (*decomp_func_ptr) (char *in, int in_len, char *out, int out_len,
size_t *actual_size);
-enum comp_algo {
- CBFS_COMPRESS_NONE = 0,
- CBFS_COMPRESS_LZMA = 1,
- CBFS_COMPRESS_LZ4 = 2,
-};
-
-struct typedesc_t {
- uint32_t type;
- const char *name;
-};
-
-static const struct typedesc_t types_cbfs_compression[] = {
- {CBFS_COMPRESS_NONE, "none"},
- {CBFS_COMPRESS_LZMA, "LZMA"},
- {CBFS_COMPRESS_LZ4, "LZ4"},
- {0, NULL},
-};
-
-comp_func_ptr compression_function(enum comp_algo algo);
-decomp_func_ptr decompression_function(enum comp_algo algo);
+comp_func_ptr compression_function(enum cbfs_compression algo);
+decomp_func_ptr decompression_function(enum cbfs_compression algo);
uint64_t intfiletype(const char *name);
/* cbfs-mkpayload.c */
int parse_elf_to_payload(const struct buffer *input, struct buffer *output,
- enum comp_algo algo);
+ enum cbfs_compression algo);
int parse_fv_to_payload(const struct buffer *input, struct buffer *output,
- enum comp_algo algo);
+ enum cbfs_compression algo);
int parse_fit_to_payload(const struct buffer *input, struct buffer *output,
- enum comp_algo algo);
+ enum cbfs_compression algo);
int parse_bzImage_to_payload(const struct buffer *input,
struct buffer *output, const char *initrd,
- char *cmdline, enum comp_algo algo);
+ char *cmdline, enum cbfs_compression algo);
int parse_flat_binary_to_payload(const struct buffer *input,
struct buffer *output,
uint32_t loadaddress,
uint32_t entrypoint,
- enum comp_algo algo);
+ enum cbfs_compression algo);
/* cbfs-mkstage.c */
int parse_elf_to_stage(const struct buffer *input, struct buffer *output,
- enum comp_algo algo, uint32_t *location,
+ enum cbfs_compression algo, uint32_t *location,
const char *ignore_section);
/* location is TOP aligned. */
int parse_elf_to_xip_stage(const struct buffer *input, struct buffer *output,