[U-Boot] [PATCH v2 5/9] riscv: add support for multi-hart systems

Anup Patel Anup.Patel at wdc.com
Wed Mar 6 03:56:03 UTC 2019



> -----Original Message-----
> From: Lukas Auer <lukas.auer at aisec.fraunhofer.de>
> Sent: Wednesday, March 6, 2019 4:23 AM
> To: u-boot at lists.denx.de
> Cc: Atish Patra <Atish.Patra at wdc.com>; Anup Patel
> <Anup.Patel at wdc.com>; Bin Meng <bmeng.cn at gmail.com>; Andreas
> Schwab <schwab at suse.de>; Palmer Dabbelt <palmer at sifive.com>;
> Alexander Graf <agraf at suse.de>; Lukas Auer
> <lukas.auer at aisec.fraunhofer.de>; Anup Patel <anup at brainfault.org>; Rick
> Chen <rick at andestech.com>; Baruch Siach <baruch at tkos.co.il>; Stefan
> Roese <sr at denx.de>; Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
> Subject: [PATCH v2 5/9] riscv: add support for multi-hart systems
> 
> On RISC-V, all harts boot independently. To be able to run on a multi-hart
> system, U-Boot must be extended with the functionality to manage all harts
> in the system. All harts entering U-Boot are registered in the available_harts
> mask stored in global data. A hart lottery system as used in the Linux kernel
> selects the hart U-Boot runs on. All other harts are halted. U-Boot can
> delegate functions to them using smp_call_function().
> 
> Every hart has a valid pointer to the global data structure and a 8KiB stack by
> default. The stack size is set with CONFIG_STACK_SIZE_SHIFT.
> 
> Signed-off-by: Lukas Auer <lukas.auer at aisec.fraunhofer.de>
> ---
> 
> Changes in v2:
> - Implement hart lottery to pick main hart to run U-Boot
> - Remove CONFIG_MAIN_HART as it is not required anymore
> - Register available harts in the available_harts mask
> 
>  arch/riscv/Kconfig           |   4 ++
>  arch/riscv/cpu/cpu.c         |   9 ++-
>  arch/riscv/cpu/start.S       | 134 ++++++++++++++++++++++++++++++++++-
>  arch/riscv/include/asm/csr.h |   1 +
>  arch/riscv/lib/asm-offsets.c |   1 +
>  5 files changed, 147 insertions(+), 2 deletions(-)

Reviewed-by: Anup Patel <anup.patel at wdc.com>

Regards,
Anup


More information about the U-Boot mailing list