summaryrefslogtreecommitdiff
path: root/util/cbfstool/ifwitool.c
AgeCommit message (Collapse)Author
2019-12-17ifwitool: Introduce a use the Second Logical Boot Partition optionJeremy Compostella
The ApolloLake SoC allows two Logical Boot Partitions. This patch introduces a '-s' optional parameter to select the second Logical Boot Partition. Change-Id: If32ec11fc7291d52b821bf95c1e186690d06ba11 Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37660 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-10-08Move compiler.h to commonlibNico Huber
Its spreading copies got out of sync. And as it is not a standard header but used in commonlib code, it belongs into commonlib. While we are at it, always include it via GCC's `-include` switch. Some Windows and BSD quirk handling went into the util copies. We always guard from redefinitions now to prevent further issues. Change-Id: I850414e6db1d799dce71ff2dc044e6a000ad2552 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/28927 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-07-13Rename __attribute__((packed)) --> __packedStefan Reinauer
Also unify __attribute__ ((..)) to __attribute__((..)) and handle ((__packed__)) like ((packed)) Change-Id: Ie60a51c3fa92b5009724a5b7c2932e361bf3490c Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-on: https://review.coreboot.org/15921 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2017-03-29cbfstool/ifwitool: Remove unnecessary assignmentPaul Menzel
Fix the warning below. ``` util/cbfstool/ifwitool.c:551:2: warning: Value stored to 'offset' is never read offset = read_member(data, offset, sizeof(h->fit_tool_version), ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Found-by: scan-build from clang 3.8.1 Change-Id: I6c322a335a371a20561b32e04e7dcc7310dab607 Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Reviewed-on: https://review.coreboot.org/18667 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
2016-06-26ifwitool: Fix gcc error due to shadowed global declarationWerner Zeh
The name 'bpdt_size' is used for a function as well as ia local variable. As ifwitool is compiled using HOSTCC, there can be an older gcc version used for the compilation. With gcc version 4.4.7 I get the following error: declaration of 'bpdt_size' shadows a global declaration To fix it, rename the function to get_bpdt_size so that names are unique now. Change-Id: I47791c705ac4ab28307c52b86940a7a14a5cfef8 Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/15343 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Furquan Shaikh <furquan@google.com>
2016-06-16ifwitool: Calculate checksum for subpart_dirFurquan Shaikh
Checksum is calculated by using 2s complement method. 8-bit sum of the entire subpart directory from first byte of header to last byte of last partition directory entry. BUG=chrome-os-partner:53508 Change-Id: I991d79dfdb5331ab732bf0d71cf8223d63426fa8 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/15200 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-06-15ifwitool: Fix calculation of dst_sizeRolf Evers-Fischer
Change-Id: I07523252eacffb323e2bb54c306f5e9ac83e4cbd Signed-off-by: Rolf Evers-Fischer <embedded24@evers-fischer.de> Reviewed-on: https://review.coreboot.org/15162 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-12ifwitool: Do not calculate checksum for subpart_dirFurquan Shaikh
1. The checksum method that was documented is not correct. So, no use filling in a value based on wrong calculations. This can be added back once updated information is available. 2. Checksum does not seem to affect the booting up of SoC. So, fill in 0 for now. Change-Id: I0e49ac8e0e04abb6d7c9be70323612bdef309975 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/15145 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-12ifwitool: Correct pack order and header orderFurquan Shaikh
Update pack and header order and mark the entries as mandatory and recommended w.r.t. ordering (mandatory = essential for booting, recommended = okay to change, but this config is tested and known to work). Change-Id: Ia089bdaa0703de830bb9553130caf91a3665d2c4 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/15144 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
2016-06-01ifwitool: Fix syntax issues with ifwitoolFurquan Shaikh
Change-Id: Ie7a12a39116ee08f5e24c81c97695201169a63f7 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/15022 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-05-30ifwitool: Add new tool for managing IFWI imagesFurquan Shaikh
- Supports following operations: 1. add raw/dir sub-partition 2. extract raw/dir sub-partition 3. print info 4. delete raw sub-partition 5. replace raw/dir sub-partition Change-Id: I683a0ab13cc50eb60eecca34db4a8ffefc8dccbd Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/14896 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>