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

Bin Meng bmeng.cn at gmail.com
Sun Mar 10 13:01:19 UTC 2019


On Wed, Mar 6, 2019 at 6:54 AM Lukas Auer
<lukas.auer at aisec.fraunhofer.de> wrote:
>
> 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(-)
>

Looks quite good!

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
Tested-by: Bin Meng <bmeng.cn at gmail.com>


More information about the U-Boot mailing list