summaryrefslogtreecommitdiff
path: root/util/cbfstool/cbfstool.c
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2018-04-26 09:35:13 +0200
committerPatrick Georgi <pgeorgi@google.com>2018-06-15 09:13:24 +0000
commit7ee05eddf184764de8aa1e015936a42d069893f2 (patch)
treebab7d92178e35e35b4f60f496243b0f58099beab /util/cbfstool/cbfstool.c
parent31ff06a2da7380ecfe56365992d013b8ad0f7760 (diff)
util/cbfstool: Support FIT payloads
In order to support booting a GNU/Linux payload on non x86, the FIT format should be used, as it is the defacto standard on ARM. Due to greater complexity of FIT it is not converted to simple ELF format. Add support for autodecting FIT payloads and add them as new CBFS_TYPE 'fit'. The payload is included as is, with no special header. The code can determine the type at runtime using the CBFS_TYPE field. Support for parsing FIT payloads in coreboot is added in a follow on commit. Compression of FIT payloads is not supported, as the FIT sections might be compressed itself. Starting at this point a CBFS payload/ can be either of type FIT or SELF. Tested on Cavium SoC. Change-Id: Ic5fc30cd5419eb76c4eb50cca3449caea60270de Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/25860 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'util/cbfstool/cbfstool.c')
-rw-r--r--util/cbfstool/cbfstool.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 08f2e32230..9b654b11b2 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -631,7 +631,14 @@ static int cbfstool_convert_mkpayload(struct buffer *buffer,
/* per default, try and see if payload is an ELF binary */
ret = parse_elf_to_payload(buffer, &output, param.compression);
- /* If it's not an ELF, see if it's a UEFI FV */
+ /* If it's not an ELF, see if it's a FIT */
+ if (ret != 0) {
+ ret = parse_fit_to_payload(buffer, &output, param.compression);
+ if (ret == 0)
+ header->type = htonl(CBFS_COMPONENT_FIT);
+ }
+
+ /* If it's not an FIT, see if it's a UEFI FV */
if (ret != 0)
ret = parse_fv_to_payload(buffer, &output, param.compression);