diff mbox series

[v3,4/6] spl: LOAD_FIT_FULL: Support 'kernel' and 'firmware' properties

Message ID 20210401182531.2147653-5-mr.nuke.me@gmail.com
State Accepted
Commit 51d3a8b54f2cd1bd8278d0611db4ff2d17235229
Delegated to: Tom Rini
Headers show
Series SPL: FIT: Fix some omissions of SPL_LOAD_FIT_FULL and bootm | expand

Commit Message

Alexandru Gagniuc April 1, 2021, 6:25 p.m. UTC
The 'firmware' property of a config node takes precedence over the
'kernel' property. 'standalone' is deprecated. However, give users a
couple of releases where 'standalone' still works, but warns loudly.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
 common/spl/spl.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

Comments

Tom Rini April 16, 2021, 12:26 p.m. UTC | #1
On Thu, Apr 01, 2021 at 01:25:29PM -0500, Alexandru Gagniuc wrote:

> The 'firmware' property of a config node takes precedence over the
> 'kernel' property. 'standalone' is deprecated. However, give users a
> couple of releases where 'standalone' still works, but warns loudly.
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 5a059c6dc5..4e028abf77 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -214,7 +214,24 @@  static int spl_load_fit_image(struct spl_image_info *spl_image,
 	ret = fit_image_load(&images, (ulong)header,
 			     NULL, &fit_uname_config,
 			     IH_ARCH_DEFAULT, IH_TYPE_STANDALONE, -1,
-			     FIT_LOAD_REQUIRED, &fw_data, &fw_len);
+			     FIT_LOAD_OPTIONAL, &fw_data, &fw_len);
+	if (ret >= 0) {
+		printf("DEPRECATED: 'standalone = ' property.");
+		printf("Please use either 'firmware =' or 'kernel ='\n");
+	} else {
+		ret = fit_image_load(&images, (ulong)header, NULL,
+				     &fit_uname_config, IH_ARCH_DEFAULT,
+				     IH_TYPE_FIRMWARE, -1, FIT_LOAD_OPTIONAL,
+				     &fw_data, &fw_len);
+	}
+
+	if (ret < 0) {
+		ret = fit_image_load(&images, (ulong)header, NULL,
+				     &fit_uname_config, IH_ARCH_DEFAULT,
+				     IH_TYPE_KERNEL, -1, FIT_LOAD_OPTIONAL,
+				     &fw_data, &fw_len);
+	}
+
 	if (ret < 0)
 		return ret;