On Wed, Mar 6, 2019 at 6:54 AM Lukas Auer <lukas.a...@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.a...@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...@gmail.com> Tested-by: Bin Meng <bmeng...@gmail.com> _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot