Skip to contentSkip to conversation

spl: Add full fitImage support

PATCH In review Marek Vasut 3 participants 5 messages May 12, 2018 – May 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: Add full fitImage support

Add support for loading U-Boot and optionally FDT from a fitImage in SPL by using the full fitImage support from U-Boot. While we do have limited SPL loading support in SPL with a small footprint, it is missing a lot of important features, like checking signatures. This support has all the fitImage features, while the footprint is obviously larger.

Cc Pantelis Antoniou <[email protected]>
Cc Simon Glass <[email protected]>

---
V2: - Drop blank line below spl_load_fit_image()
- Explicitly enable image verification if available

---
 Kconfig          | 11 +++++++++
 common/spl/spl.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
Kconfig +11 -0
index 7d9e971f0e..5a82c95dd8 100644
@@ -328,6 +328,17 @@ config SPL_LOAD_FIT
 	  particular it can handle selecting from multiple device tree
 	  and passing the correct one to U-Boot.
 
+config SPL_LOAD_FIT_FULL
+	bool "Enable SPL loading U-Boot as a FIT"
+	select SPL_FIT
+	help
+	  Normally with the SPL framework a legacy image is generated as part
+	  of the build. This contains U-Boot along with information as to
+	  where it should be loaded. This option instead enables generation
+	  of a FIT (Flat Image Tree) which provides more flexibility. In
+	  particular it can handle selecting from multiple device tree
+	  and passing the correct one to U-Boot.
+
 config SPL_FIT_IMAGE_POST_PROCESS
 	bool "Enable post-processing of FIT artifacts after loading by the SPL"
 	depends on SPL_LOAD_FIT
common/spl/spl.c +74 -0

83 lines not on this page · raw message

Signature · 1 line
2.16.2
#1 lore raw

PATCH 1/1 spl: Add full fitImage support

Quoted 10 lines · Marek Vasut

Add support for loading U-Boot and optionally FDT from a fitImage in SPL by using the full fitImage support from U-Boot. While we do have limited SPL loading support in SPL with a small footprint, it is missing a lot of important features, like checking signatures. This support has all the fitImage features, while the footprint is obviously larger.

Cc Pantelis Antoniou <[email protected]>
Cc Simon Glass <[email protected]>
Quoted 8 lines

---
V2: - Drop blank line below spl_load_fit_image()
- Explicitly enable image verification if available

---
 Kconfig          | 11 +++++++++
 common/spl/spl.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)

Can you add this to the FIT tests?

#2 lore raw

PATCH 1/1 spl: Add full fitImage support

Quoted 20 lines · Simon Glass
Quoted 10 lines · Marek Vasut

Add support for loading U-Boot and optionally FDT from a fitImage in SPL by using the full fitImage support from U-Boot. While we do have limited SPL loading support in SPL with a small footprint, it is missing a lot of important features, like checking signatures. This support has all the fitImage features, while the footprint is obviously larger.

Cc Pantelis Antoniou <[email protected]>
Cc Simon Glass <[email protected]>
Quoted 8 lines

---
V2: - Drop blank line below spl_load_fit_image()
- Explicitly enable image verification if available

---
 Kconfig          | 11 +++++++++
 common/spl/spl.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
Quoted 3 lines

Can you add this to the FIT tests?

Yeah, do you have some pointers for me ?

Signature · 2 lines
Best regards,
Marek Vasut
#3 lore raw

PATCH 1/1 spl: Add full fitImage support

Hi Marek,

Quoted 21 lines · Marek Vasut
Quoted 20 lines · Simon Glass
Quoted 18 lines · Marek Vasut

Add support for loading U-Boot and optionally FDT from a fitImage in SPL by using the full fitImage support from U-Boot. While we do have limited SPL loading support in SPL with a small footprint, it is missing a lot of important features, like checking signatures. This support has all the fitImage features, while the footprint is obviously larger.

Cc Pantelis Antoniou <[email protected]>
Cc Simon Glass <[email protected]>

---
V2: - Drop blank line below spl_load_fit_image()
- Explicitly enable image verification if available

---
 Kconfig          | 11 +++++++++
 common/spl/spl.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 85 insertions(+)
Quoted 5 lines
Quoted 3 lines

Can you add this to the FIT tests?

Yeah, do you have some pointers for me ?

The current test is in test/py/tests/test_fit.py so you can start with that, or create a new one based on it.

At present we have sandbox_spl which includes SPL support. If you run a test with that (i.e. CONFIG_SPL set) it will run SPL, which in turn will load U-Boot. The logic for that is in u_boot_console_sandbox.py and the function which actually loads U-Boot is spl_board_load_image().

So I think you could create a FIT with U-Boot and a DTB in it, then modify spl_board_load_image() to use that instead. Then your test could simply check the console output. For example test_ofplatdata.py shows how to find a string in the output, although at present that test does nothing, since there is no way to tell SPL to output the platdata.

Regards,
Simon

#4 lore raw
In reply to Marek Vasut
Quoted 11 lines · Marek Vasut

Add support for loading U-Boot and optionally FDT from a fitImage in SPL by using the full fitImage support from U-Boot. While we do have limited SPL loading support in SPL with a small footprint, it is missing a lot of important features, like checking signatures. This support has all the fitImage features, while the footprint is obviously larger.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180524/f8f7e68a/attachment.sig>