* [U-Boot] [PATCH v2] common: spl_fit: Allow firmware image if no loadables
@ 2019-03-10 11:42 Abel Vesa
2019-03-10 12:02 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Abel Vesa @ 2019-03-10 11:42 UTC (permalink / raw)
To: u-boot
If CONFIG_SPL_OS_BOOT and FIT_IMAGE_TINY are enabled,
the os will not be set to anything and therefore will
remain as IH_OS_INVALID. What's needed here is to
have IH_OS_U_BOOT as default. And since using the
mkimage oneline command (that is, no its file), the
loadables can't be specified, so we allow firmware
as a fallback.
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
Tested-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
* added braces to get rid of the build warning
common/spl/spl_fit.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index db43626..bfcf71a 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -478,11 +478,15 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
/* Now check if there are more images for us to load */
for (; ; index++) {
- uint8_t os_type = IH_OS_INVALID;
+ uint8_t os_type = IH_OS_U_BOOT;
node = spl_fit_get_image_node(fit, images, "loadables", index);
- if (node < 0)
- break;
+ if (node < 0) {
+ node = spl_fit_get_image_node(fit, images,
+ "firmware", index);
+ if (node < 0)
+ break;
+ }
ret = spl_load_fit_image(info, sector, fit, base_offset, node,
&image_info);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] common: spl_fit: Allow firmware image if no loadables
2019-03-10 11:42 [U-Boot] [PATCH v2] common: spl_fit: Allow firmware image if no loadables Abel Vesa
@ 2019-03-10 12:02 ` Marek Vasut
2019-03-10 12:26 ` Abel Vesa
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2019-03-10 12:02 UTC (permalink / raw)
To: u-boot
On 3/10/19 12:42 PM, Abel Vesa wrote:
> If CONFIG_SPL_OS_BOOT and FIT_IMAGE_TINY are enabled,
> the os will not be set to anything and therefore will
> remain as IH_OS_INVALID. What's needed here is to
> have IH_OS_U_BOOT as default. And since using the
> mkimage oneline command (that is, no its file), the
> loadables can't be specified, so we allow firmware
> as a fallback.
Wouldn't it make more sense to fix the mkimage ?
> Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
> Tested-by: Fabio Estevam <festevam@gmail.com>
> ---
>
> Changes since v1:
> * added braces to get rid of the build warning
>
> common/spl/spl_fit.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> index db43626..bfcf71a 100644
> --- a/common/spl/spl_fit.c
> +++ b/common/spl/spl_fit.c
> @@ -478,11 +478,15 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
>
> /* Now check if there are more images for us to load */
> for (; ; index++) {
> - uint8_t os_type = IH_OS_INVALID;
> + uint8_t os_type = IH_OS_U_BOOT;
Does that mean invalid image type is then always handled as if it was
U-Boot ? That looks kinda iffy.
> node = spl_fit_get_image_node(fit, images, "loadables", index);
> - if (node < 0)
> - break;
> + if (node < 0) {
> + node = spl_fit_get_image_node(fit, images,
> + "firmware", index);
> + if (node < 0)
> + break;
> + }
>
> ret = spl_load_fit_image(info, sector, fit, base_offset, node,
> &image_info);
>
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] common: spl_fit: Allow firmware image if no loadables
2019-03-10 12:02 ` Marek Vasut
@ 2019-03-10 12:26 ` Abel Vesa
0 siblings, 0 replies; 3+ messages in thread
From: Abel Vesa @ 2019-03-10 12:26 UTC (permalink / raw)
To: u-boot
On 19-03-10 13:02:28, Marek Vasut wrote:
> On 3/10/19 12:42 PM, Abel Vesa wrote:
> > If CONFIG_SPL_OS_BOOT and FIT_IMAGE_TINY are enabled,
> > the os will not be set to anything and therefore will
> > remain as IH_OS_INVALID. What's needed here is to
> > have IH_OS_U_BOOT as default. And since using the
> > mkimage oneline command (that is, no its file), the
> > loadables can't be specified, so we allow firmware
> > as a fallback.
>
> Wouldn't it make more sense to fix the mkimage ?
>
OK then, I'll add a new option to mkimage for loadables.
> > Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
> > Tested-by: Fabio Estevam <festevam@gmail.com>
> > ---
> >
> > Changes since v1:
> > * added braces to get rid of the build warning
> >
> > common/spl/spl_fit.c | 10 +++++++---
> > 1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> > index db43626..bfcf71a 100644
> > --- a/common/spl/spl_fit.c
> > +++ b/common/spl/spl_fit.c
> > @@ -478,11 +478,15 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
> >
> > /* Now check if there are more images for us to load */
> > for (; ; index++) {
> > - uint8_t os_type = IH_OS_INVALID;
> > + uint8_t os_type = IH_OS_U_BOOT;
>
> Does that mean invalid image type is then always handled as if it was
> U-Boot ? That looks kinda iffy.
>
Hmm, fair enough. I'll do the fix in mkimage and this change won't be necessary then.
> > node = spl_fit_get_image_node(fit, images, "loadables", index);
> > - if (node < 0)
> > - break;
> > + if (node < 0) {
> > + node = spl_fit_get_image_node(fit, images,
> > + "firmware", index);
> > + if (node < 0)
> > + break;
> > + }
> >
> > ret = spl_load_fit_image(info, sector, fit, base_offset, node,
> > &image_info);
> >
>
>
> --
> Best regards,
> Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-10 12:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-10 11:42 [U-Boot] [PATCH v2] common: spl_fit: Allow firmware image if no loadables Abel Vesa
2019-03-10 12:02 ` Marek Vasut
2019-03-10 12:26 ` Abel Vesa
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.