All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] common: fit: Allow U-Boot images to be booted
@ 2016-07-18 12:05 Mario Six
  2016-07-18 15:59 ` Tom Rini
  2016-07-19  5:46 ` Michal Simek
  0 siblings, 2 replies; 8+ messages in thread
From: Mario Six @ 2016-07-18 12:05 UTC (permalink / raw)
  To: u-boot

In certain circumstances it comes in handy to be able to boot into a second
U-Boot. But as of now it is not possible to boot a U-Boot binary that is inside
a FIT image, which is problematic for projects that e.g. need to guarantee a
unbroken chain of trust from SOC all the way into the OS, since the FIT signing
mechanism cannot be used.

This patch adds the capability to load such FIT images.

An example its snippet (utilizing signature verification) might look like the
following:

images {
	kernel at 1 {
		description = "2nd stage U-Boot image";
		data = /incbin/("u-boot-dtb.img.gz");
		type = "kernel";
		arch = "arm";
		os = "u-boot";
		compression = "gzip";
		load = <0x8FFFC0>;
		entry = <0x900000>;
		signature at 1 {
			algo = "sha256,rsa4096";
			key-name-hint = "key";
		};
	};
};

Signed-off-by: Mario Six <mario.six@gdsys.cc>
---
 common/image-fit.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/image-fit.c b/common/image-fit.c
index 6f920da..0c7b400 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1690,6 +1690,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr,

 	os_ok = image_type == IH_TYPE_FLATDT || IH_TYPE_FPGA ||
 		fit_image_check_os(fit, noffset, IH_OS_LINUX) ||
+		fit_image_check_os(fit, noffset, IH_OS_U_BOOT) ||
 		fit_image_check_os(fit, noffset, IH_OS_OPENRTOS);

 	/*
--
2.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-07-19  7:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-18 12:05 [U-Boot] [PATCH] common: fit: Allow U-Boot images to be booted Mario Six
2016-07-18 15:59 ` Tom Rini
2016-07-19  5:46 ` Michal Simek
2016-07-19  6:45   ` Mario Six
2016-07-19  6:47     ` Michal Simek
2016-07-19  7:04       ` Mario Six
2016-07-19  7:14     ` Wolfgang Denk
2016-07-19  7:41       ` Mario Six

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.