From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anup Patel Date: Tue, 12 Feb 2019 01:48:10 +0000 Subject: [U-Boot] [PATCH 5/7] riscv: add support for multi-hart systems In-Reply-To: <20190211221345.31980-6-lukas.auer@aisec.fraunhofer.de> References: <20190211221345.31980-1-lukas.auer@aisec.fraunhofer.de> <20190211221345.31980-6-lukas.auer@aisec.fraunhofer.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > -----Original Message----- > From: Lukas Auer [mailto:lukas.auer at aisec.fraunhofer.de] > Sent: Tuesday, February 12, 2019 3:44 AM > To: u-boot at lists.denx.de > Cc: Atish Patra ; Anup Patel > ; Bin Meng ; Andreas > Schwab ; Palmer Dabbelt ; > Alexander Graf ; Lukas Auer > ; Anup Patel ; Rick > Chen ; Baruch Siach ; Stefan > Roese > Subject: [PATCH 5/7] 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. A new config option, CONFIG_MAIN_HART, is used to select > 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 > --- > > arch/riscv/Kconfig | 12 +++++ > arch/riscv/cpu/start.S | 102 ++++++++++++++++++++++++++++++++++- > arch/riscv/include/asm/csr.h | 1 + > 3 files changed, 114 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index > 3a51339c4d..af8d0f8d67 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -140,4 +140,16 @@ config SBI_IPI > default y if RISCV_SMODE > depends on SMP > > +config MAIN_HART > + int "Main hart in system" > + default 0 > + help > + Some SoCs include harts of various sizes, some of which might not > + be suitable for running U-Boot. CONFIG_MAIN_HART is used to > select > + the hart U-Boot runs on. This config option can be avoided altogether if we have lottery based system to select "Main HART" in start.S. With the MAIN_HART config option in-place, every system will have to pick a "Main HART". What if the "Main HART" itself does not come online due to HW failure. Regards, Anup