diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2018-04-26 09:35:13 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-06-15 09:13:24 +0000 |
commit | 7ee05eddf184764de8aa1e015936a42d069893f2 (patch) | |
tree | bab7d92178e35e35b4f60f496243b0f58099beab /util/cbfstool/fdt.h | |
parent | 31ff06a2da7380ecfe56365992d013b8ad0f7760 (diff) | |
download | coreboot-7ee05eddf184764de8aa1e015936a42d069893f2.tar.xz |
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/fdt.h')
-rw-r--r-- | util/cbfstool/fdt.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/util/cbfstool/fdt.h b/util/cbfstool/fdt.h new file mode 100644 index 0000000000..387cd328ed --- /dev/null +++ b/util/cbfstool/fdt.h @@ -0,0 +1,34 @@ +/* + * Copyright 2013 Google Inc. + * Copyright 2018-present Facebook, Inc. + * + * Taken from depthcharge: src/base/device_tree.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but without any warranty; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +struct fdt_header { + uint32_t magic; + uint32_t totalsize; + uint32_t structure_offset; + uint32_t strings_offset; + uint32_t reserve_map_offset; + + uint32_t version; + uint32_t last_compatible_version; + + uint32_t boot_cpuid_phys; + + uint32_t strings_size; + uint32_t structure_size; +}; + +#define FDT_HEADER_MAGIC 0xd00dfeed |