cbfstool: Use cbfs_image API for "add-*" (add-payload, add-stage, ...) commands.

add-payload, add-stage, and add-flat-binary are now all using cbfs_image API.
To test:
	cbfstool coreboot.rom add-stage -f FILE -n fallback/romstage -b 0xXXXX
	cbfstool coreboot.rom add-payload -f FILE -n fallback/pyload
And compare with old cbfstool.

Verified to boot on ARM(snow) and X86(qemu-i386).

Change-Id: If65cb495c476ef6f9d90c778531f0c3caf178281
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: http://review.coreboot.org/2220
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Hung-Te Lin
2013-01-29 15:22:11 +08:00
committed by Stefan Reinauer
parent 5f3eb26d85
commit c13e4bf3e1
4 changed files with 116 additions and 246 deletions

View File

@@ -98,14 +98,16 @@ comp_func_ptr compression_function(comp_algo algo);
uint64_t intfiletype(const char *name);
/* cbfs-mkpayload.c */
int parse_elf_to_payload(unsigned char *input, unsigned char **output,
comp_algo algo);
int parse_flat_binary_to_payload(unsigned char *input, unsigned char **output,
int32_t input_size, uint32_t loadaddress,
uint32_t entrypoint, comp_algo algo);
int parse_elf_to_payload(const struct buffer *input,
struct buffer *output, comp_algo algo);
int parse_flat_binary_to_payload(const struct buffer *input,
struct buffer *output,
uint32_t loadaddress,
uint32_t entrypoint,
comp_algo algo);
/* cbfs-mkstage.c */
int parse_elf_to_stage(unsigned char *input, unsigned char **output,
comp_algo algo, uint32_t * location);
int parse_elf_to_stage(const struct buffer *input, struct buffer *output,
comp_algo algo, uint32_t *location);
void *create_cbfs_file(const char *filename, void *data, uint32_t * datasize,
uint32_t type, uint32_t * location);