[PATCH 2/2] sandbox: provide /chosen/boot-hartid property

Simon Glass sjg at chromium.org
Thu Oct 21 20:49:27 CEST 2021


On 10/20/21 00:54, Simon Glass wrote:
> Hi Heinrich,
>
> On Sat, 28 Aug 2021 at 03:42, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>>
>> On RISC-V the sandbox must provide the /chosen/boot-hartid in the
>> devicetree.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>> ---
>>   arch/sandbox/lib/Makefile    |  2 +-
>>   arch/sandbox/lib/fdt_fixup.c | 25 +++++++++++++++++++++++++
>>   2 files changed, 26 insertions(+), 1 deletion(-)
>>   create mode 100644 arch/sandbox/lib/fdt_fixup.c
>
> Can you add a bit more detail here? This is for the sandbox build, so
> we don't actually get to boot the kernel. So who is actually using
> this data?

The U-Boot sandbox can be built on RISC-V. It is very convenient to
debug the Linux EFI stub and its interaction with other UEFI software
like GRUB.

The Linux EFI stub reads the /chosen/boot-hartid property in function
get_boot_hartid_from_fdt(), drivers/firmware/efi/libstub/riscv-stub.c.
It will stop booting if /chosen/boot-hartid is not found.

Of course the kernel will fail when trying to set up virtual memory. But
that is after most of the interesting stuff in the EFI stub have
occurred. Linux can run in nommu mode. So maybe you could even run Linux
on the sandbox.

Best regards

Heinrich

>
> Regards,
> Simon
>
>
>>
Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list