aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini2020-10-22 20:32:02 -0400
committerTom Rini2020-10-22 20:32:02 -0400
commit18261b8552232e342709e69eadec33090a7f04e4 (patch)
treeecd17a26e30f20db41fb4b67c0f9060398a145bf /common
parentae4fdd7b0432bcb0bc2fe7d90b6d3e92001ab478 (diff)
parent194923246c199bc6a4baa2ffcda1e08677b6f07c (diff)
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi
- sun8i emac changes (Andre) - SCP firmware (Samuel)
Diffstat (limited to 'common')
-rw-r--r--common/spl/Kconfig4
-rw-r--r--common/spl/spl_fit.c17
2 files changed, 17 insertions, 4 deletions
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index af47f5ce1c2..d8086bd9e87 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -465,9 +465,7 @@ config SPL_FIT_IMAGE_TINY
Enable this to reduce the size of the FIT image loading code
in SPL, if space for the SPL binary is very tight.
- This removes the detection of image types (which forces the
- first image to be treated as having a U-Boot style calling
- convention) and skips the recording of each loaded payload
+ This skips the recording of each loaded payload
(i.e. loadable) into the FDT (modifying the loaded FDT to
ensure this information is available to the next image
invoked).
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index a90d821c82e..fd6086a65c3 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -466,7 +466,22 @@ static int spl_fit_record_loadable(const void *fit, int images, int index,
static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os)
{
#if CONFIG_IS_ENABLED(FIT_IMAGE_TINY) && !defined(CONFIG_SPL_OS_BOOT)
- return -ENOTSUPP;
+ const char *name = fdt_getprop(fit, noffset, FIT_OS_PROP, NULL);
+
+ if (!name)
+ return -ENOENT;
+
+ /*
+ * We don't care what the type of the image actually is,
+ * only whether or not it is U-Boot. This saves some
+ * space by omitting the large table of OS types.
+ */
+ if (!strcmp(name, "u-boot"))
+ *os = IH_OS_U_BOOT;
+ else
+ *os = IH_OS_INVALID;
+
+ return 0;
#else
return fit_image_get_os(fit, noffset, os);
#endif