diff mbox series

[2/6] spl: LOAD_FIT_FULL: Do not hard-code os to IH_OS_U_BOOT

Message ID 20210311213209.4013010-3-mr.nuke.me@gmail.com
State Superseded
Delegated to: Tom Rini
Headers show
Series SPL: FIT: Fix some omissions of SPL_LOAD_FIT_FULL and bootm | expand

Commit Message

Alex G. March 11, 2021, 9:32 p.m. UTC
The information on the OS should be contained in the FIT, as the
self-explanatory "os" property of a node under /images. Hard-coding
this to U_BOOT might send us down the wrong path later in the boot
process.

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

Comments

Simon Glass March 29, 2021, 7:43 a.m. UTC | #1
On Fri, 12 Mar 2021 at 10:32, Alexandru Gagniuc <mr.nuke.me@gmail.com> wrote:
>
> The information on the OS should be contained in the FIT, as the
> self-explanatory "os" property of a node under /images. Hard-coding
> this to U_BOOT might send us down the wrong path later in the boot
> process.
>
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> ---
>  common/spl/spl.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index 986cfbc6fd..8f6c8dba6f 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -220,8 +220,9 @@ static int spl_load_fit_image(struct spl_image_info *spl_image,
>         spl_image->size = fw_len;
>         spl_image->entry_point = fw_data;
>         spl_image->load_addr = fw_data;
> -       spl_image->os = IH_OS_U_BOOT;

Again I wonder about the code-size impact of this. Should it depend on Kconfig?

> -       spl_image->name = "U-Boot";
> +       if (!fit_image_get_os(header, ret, &spl_image->os))
> +               spl_image->os = IH_OS_INVALID;
> +       spl_image->name = genimg_get_os_name(spl_image->os);
>
>         debug(SPL_TPL_PROMPT "payload image: %32s load addr: 0x%lx size: %d\n",
>               spl_image->name, spl_image->load_addr, spl_image->size);
> --
> 2.26.2
>

Regards,
Simon
Alex G. March 30, 2021, 5:54 p.m. UTC | #2
On 3/29/21 2:43 AM, Simon Glass wrote:
> On Fri, 12 Mar 2021 at 10:32, Alexandru Gagniuc <mr.nuke.me@gmail.com> wrote:
>>
>> The information on the OS should be contained in the FIT, as the
>> self-explanatory "os" property of a node under /images. Hard-coding
>> this to U_BOOT might send us down the wrong path later in the boot
>> process.
>>
>> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
>> ---
>>   common/spl/spl.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>> index 986cfbc6fd..8f6c8dba6f 100644
>> --- a/common/spl/spl.c
>> +++ b/common/spl/spl.c
>> @@ -220,8 +220,9 @@ static int spl_load_fit_image(struct spl_image_info *spl_image,
>>          spl_image->size = fw_len;
>>          spl_image->entry_point = fw_data;
>>          spl_image->load_addr = fw_data;
>> -       spl_image->os = IH_OS_U_BOOT;
> 

+8 bytes. Down in the noise

Alex

>> -       spl_image->name = "U-Boot";
>> +       if (!fit_image_get_os(header, ret, &spl_image->os))
>> +               spl_image->os = IH_OS_INVALID;
>> +       spl_image->name = genimg_get_os_name(spl_image->os);
>>
>>          debug(SPL_TPL_PROMPT "payload image: %32s load addr: 0x%lx size: %d\n",
>>                spl_image->name, spl_image->load_addr, spl_image->size);
>> --
>> 2.26.2
>>
> 
> Regards,
> Simon
>
Simon Glass April 14, 2021, 7:38 p.m. UTC | #3
On Tue, 30 Mar 2021 at 18:54, Alex G. <mr.nuke.me@gmail.com> wrote:
>
>
>
> On 3/29/21 2:43 AM, Simon Glass wrote:
> > On Fri, 12 Mar 2021 at 10:32, Alexandru Gagniuc <mr.nuke.me@gmail.com> wrote:
> >>
> >> The information on the OS should be contained in the FIT, as the
> >> self-explanatory "os" property of a node under /images. Hard-coding
> >> this to U_BOOT might send us down the wrong path later in the boot
> >> process.
> >>
> >> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> >> ---
> >>   common/spl/spl.c | 5 +++--
> >>   1 file changed, 3 insertions(+), 2 deletions(-)
> >>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 986cfbc6fd..8f6c8dba6f 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -220,8 +220,9 @@  static int spl_load_fit_image(struct spl_image_info *spl_image,
 	spl_image->size = fw_len;
 	spl_image->entry_point = fw_data;
 	spl_image->load_addr = fw_data;
-	spl_image->os = IH_OS_U_BOOT;
-	spl_image->name = "U-Boot";
+	if (!fit_image_get_os(header, ret, &spl_image->os))
+		spl_image->os = IH_OS_INVALID;
+	spl_image->name = genimg_get_os_name(spl_image->os);
 
 	debug(SPL_TPL_PROMPT "payload image: %32s load addr: 0x%lx size: %d\n",
 	      spl_image->name, spl_image->load_addr, spl_image->size);