summaryrefslogtreecommitdiff
path: root/common/image-fit.c
Commit message (Collapse)AuthorAgeLines
* x86: image: Add new image type for x64_64Simon Glass2014-10-28-1/+2
| | | | | | | This is a bit odd in that we are permitted to boot images for either, even though they are separate architectures. Signed-off-by: Simon Glass <sjg@chromium.org>
* image-fit: make local function staticJeroen Hofstee2014-10-25-1/+1
| | | | Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* x86: Support loading kernel setup from a FITSimon Glass2014-10-22-0/+22
| | | | | | | | Add a new setup@ section to the FIT which can be used to provide a setup binary for booting Linux on x86. This makes it possible to boot x86 from a FIT. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: bootm: Don't fail the architecture checkSimon Glass2014-10-22-1/+1
| | | | | | | | Since sandbox is used for testing, it should be able to 'boot' an image from any archhitecture. This allows us to test an image by loading it in sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* Fix test failure caused by bad handling of ramdiskSimon Glass2014-08-28-1/+1
| | | | | | | | | | | Commit e3a5bbce broke the FIT image tests by not loading a ramdisk even if a load address is provided in the FIT. The rationale was that a load address of 0 should be considered to mean 'do not load'. Add a new load operation which supports this feature, so that the ramdisk will be loaded if a non-zero load address is provided. Signed-off-by: Simon Glass <sjg@chromium.org>
* includes: move openssl headers to include/u-bootJeroen Hofstee2014-06-19-2/+2
| | | | | | | | | | | | commit 18b06652cd "tools: include u-boot version of sha256.h" unconditionally forced the sha256.h from u-boot to be used for tools instead of the host version. This is fragile though as it will also include the host version. Therefore move it to include/u-boot to join u-boot/md5.h etc which were renamed for the same reason. cc: Simon Glass <sjg@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* Enhance fit_check_sign to check all imagesSimon Glass2014-06-19-1/+2
| | | | | | | | | At present this tool only checks the configuration signing. Have it also look at each of the images in the configuration and confirm that they verify. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de> (v1)
* Fix small 'case' typo in image-fit.cSimon Glass2014-06-19-1/+1
| | | | | | This typo makes the comment confusing. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Remove the fit_load_image() property parameterSimon Glass2014-06-19-1/+28
| | | | | | | This can be obtained by looking up the image type, so is redundant. It is better to centralise this lookup to avoid errors. Signed-off-by: Simon Glass <sjg@chromium.org>
* Reverse the meaning of the fit_config_verify() return codeSimon Glass2014-06-19-1/+1
| | | | | | | It is more common to have 0 mean OK, and -ve mean error. Change this function to work the same way to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
* fdt: Update functions which write to an FDT to return -ENOSPCSimon Glass2014-06-11-2/+2
| | | | | | | | | | When writing values into an FDT it is possible that there will be insufficient space. If the caller gets a useful error then it can potentially deal with the situation. Adjust these functions to return -ENOSPC when the FDT is full. Signed-off-by: Simon Glass <sjg@chromium.org>
* fit: add sha256 supportHeiko Schocher2014-03-21-0/+5
| | | | | | | add sha256 support to fit images Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Simon Glass <sjg@chromium.org>
* cosmetic: FIT: fix a strange commentMasahiro Yamada2014-02-19-1/+1
| | | | | | | | | | There is a strange comment in fit_image_load(). This function can be used for loading Kernel Image, FDT as well as ramdisk. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org>
* FIT: delete unnecessary castsMasahiro Yamada2013-09-20-1/+1
| | | | | | | | Becuase fdt_check_header function takes (const void *) type argument, the argument should be passed to it without being casted to (char *). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* cosmetic: FIT: fix typos in commentsMasahiro Yamada2013-09-20-2/+2
| | | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
* Fix some obvious typos across multiple subsystems.Robert P. J. Day2013-09-20-1/+1
| | | | | | | | | | Typoes fixed: "partion" -> "partition" "retrive", "retreive" -> "retrieve" "th" -> "to" Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
* image: Display FIT timestamp when bootingSimon Glass2013-08-16-0/+11
| | | | | | | | | | | | | The timestamp is shown in fit_print_contents() but for some reason not in fit_image_print(). This seems to be an oversight, since it is the latter which is used by bootm. Add timestamp printing in this case. (There is code duplication in these two function, for looking at in a future patch). Signed-off-by: Simon Glass <sjg@chromium.org>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* bootm: Use selected configuration for ramdisk and fdtSimon Glass2013-07-12-1/+5
| | | | | | | | | | | | | | | If a specific configuraion is selected by the bootm command, e.g. with 'bootm 84000000#recoveryconf' we must honour this for not just the kernel, but also the ramdisk and FDT. In the conversion to using a common fit_image_load() function for loading images from FITs (commits a51ec63 and 53f375f) this feature was lost. Reinstate it by passing the selected configuration back from fit_image_load() to boot_get_kernel(), then use this configuration (which is stored in images->fit_uname_cfg) in both boot_get_ramdisk() and boot_get_fdt(). Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Support signing of imagesSimon Glass2013-06-26-23/+60
| | | | | | | | Add support for signing images using a new signature node. The process is handled by fdt_add_verification_data() which now takes parameters to provide the keys and related information. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Use ENOENT instead of ENOMEDIUM for better compatibilitySimon Glass2013-06-17-1/+1
| | | | | | | | | This error may not be defined on some platforms such as MacOS so host compilation will fail. Use one of the more common errors instead. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Andreas Bießmann <andreas.devel@googlemail.com> Tested-by: Lubomir Popov <lpopov@mm-sol.com>
* sandbox: image: Adjust FIT image printing to work with sandboxSimon Glass2013-06-04-3/+6
| | | | | | | Use map_sysmem() to convert from address to pointer, so that sandbox can print FIT information without crashing. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Use fit_image_load() to load kernelSimon Glass2013-06-04-19/+0
| | | | | | | Use the new common code to load a kernel. The functionality should not change. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Use fit_image_load() to load FDTSimon Glass2013-06-04-19/+0
| | | | | | | | Use the new common code to load a flat device tree. Also fix up a few casts so that this code works with sandbox. Other than that the functionality should not change. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Use fit_image_load() to load ramdiskSimon Glass2013-06-04-62/+0
| | | | | | | Use the new common code to load a ramdisk. The functionality should not change. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Introduce fit_image_load() to load images from FITsSimon Glass2013-06-04-0/+231
| | | | | | | | | | | At present code to load an image from a FIT is duplicated in the three places where it is needed (kernel, fdt, ramdisk). The differences between these different code copies is fairly minor. Create a new function in the fit code which can handle any of the requirements of those cases. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Add CONFIG_FIT_SPL_PRINT to control FIT image printing in SPLSimon Glass2013-05-14-3/+5
| | | | | | | | This code is very large, and in SPL it isn't always useful to print out image information (in fact there might not even be a console active). So disable this feature unless this option is set. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Remove remaining #ifdefs in image-fit.cSimon Glass2013-05-14-7/+2
| | | | | | | There are only two left. One is unnecessary and the other can be moved to the header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Rename hash printing to fit_image_print_verification_data()Simon Glass2013-05-14-52/+79
| | | | | | | | This function will be used to print signatures as well as hashes, so rename it. Also make it static since it is not used outside this file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* image: Export fit_conf_get_prop_node()Simon Glass2013-05-14-4/+4
| | | | | | | This function will be needed by signature checking code, so export it, and also add docs. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Move error! string to common placeSimon Glass2013-05-14-11/+8
| | | | | | | | The string " error\n" appears in each error string. Move it out to a common place. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* image: Move hash checking into its own functionSimon Glass2013-05-14-62/+66
| | | | | | | | The existing function is long and most of the code is indented a long way. Before adding yet more code, split this out into its own function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de> (v1)
* image: Rename fit_image_check_hashes() to fit_image_verify()Simon Glass2013-05-14-8/+8
| | | | | | | | | This is the main entry point to the FIT image verification code. We will be using it to handle image verification with signatures, so rename the function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* image: Move HOSTCC image code to tools/Simon Glass2013-05-14-170/+1
| | | | | | | | This code is never compiled into U-Boot, so move it into a separate file in tools/ to avoid the large #ifdef. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* image: Split FIT code into new image-fit.cSimon Glass2013-05-14-0/+1636
The FIT code is about half the size of the >3000-line image.c. Split this code into its own file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>