Re: [PATCH] bootm: Pass SMP core ID and DTB address for ELF-formatted kernels

Heinrich Schuchardt xypron.glpk at gmx.de
Fri May 23 19:04:46 CEST 2025


Am 23. Mai 2025 18:41:45 MESZ schrieb Simon Glass <sjg at chromium.org>:
>+Heinrich Schuchardt
>
>Hi,
>
>On Tue, 13 May 2025 at 13:28, 牛 志宏 <Zone.Niuzh at hotmail.com> wrote:
>>
>> When booting RISC-V ELF-formatted kernel images (IH_TYPE_KERNEL + IH_OS_ELF),
>> explicitly pass SMP core/hart ID and DTB address to comply with modern
>> SMP-enabled kernels' boot protocol requirements.
>>
>> Signed-off-by: Zone.N <zone.niuzh at hotmail.com>
>> ---
>>  boot/bootm_os.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/boot/bootm_os.c b/boot/bootm_os.c
>> index a3c7cb5332e..a0f310b1359 100644
>> --- a/boot/bootm_os.c
>> +++ b/boot/bootm_os.c
>> @@ -402,6 +402,11 @@ static int do_bootm_elf(int flag, struct bootm_info *bmi)
>>         if (flag != BOOTM_STATE_OS_GO)
>>                 return 0;
>>
>> +#if defined(CONFIG_RISCV)
>> +       bmi->argc = gd->arch.boot_hart;
>> +       bmi->argv = (char **)bmi->images->ft_addr;
>> +#endif
>
>If this is a kernel, it should really be using a FIT.  The Elf entry
>is for general ELF files, not Linux. Perhaps RISC-V is special in some
>way?

A defconfig kernel is booted via the booti command or via its EFI stub.

Why would you use an ELF formatted kernel? What kernel configuration are you using to get such a kernel?

Best regards

Heinrich 


>
>> +
>>         bootelf(bmi->images->ep, flags, bmi->argc, bmi->argv);
>>
>>         return 1;
>> --
>> 2.45.2
>
>Regards,
>Simon



More information about the U-Boot mailing list