cbfstool: Use cbfs_serialized.h and standard vboot helpers

This patch reduces some code duplication in cbfstool by switching it to
use the CBFS data structure definitions in commonlib rather than its own
private copy. In addition, replace a few custom helpers related to hash
algorithms with the official vboot APIs of the same purpose.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I22eae1bcd76d85fff17749617cfe4f1de55603f4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41117
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Wim Vervoorn <wvervoorn@eltan.com>
This commit is contained in:
Julius Werner
2020-03-13 16:43:34 -07:00
parent 9d0cc2aea9
commit d477565dbd
17 changed files with 204 additions and 413 deletions

View File

@@ -51,7 +51,7 @@ void xdr_get_seg(struct cbfs_payload_segment *out,
}
int parse_elf_to_payload(const struct buffer *input, struct buffer *output,
enum comp_algo algo)
enum cbfs_compression algo)
{
Elf64_Phdr *phdr;
Elf64_Ehdr ehdr;
@@ -232,7 +232,7 @@ 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)
{
comp_func_ptr compress;
struct cbfs_payload_segment segs[2] = { {0} };
@@ -277,7 +277,7 @@ int parse_flat_binary_to_payload(const struct buffer *input,
}
int parse_fv_to_payload(const struct buffer *input, struct buffer *output,
enum comp_algo algo)
enum cbfs_compression algo)
{
comp_func_ptr compress;
struct cbfs_payload_segment segs[2] = { {0} };
@@ -405,7 +405,7 @@ int parse_fv_to_payload(const struct buffer *input, struct buffer *output,
}
int parse_fit_to_payload(const struct buffer *input, struct buffer *output,
enum comp_algo algo)
enum cbfs_compression algo)
{
struct fdt_header *fdt_h;