From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anup Patel Date: Wed, 6 Mar 2019 03:56:03 +0000 Subject: [U-Boot] [PATCH v2 5/9] riscv: add support for multi-hart systems In-Reply-To: <20190305225331.1353-6-lukas.auer@aisec.fraunhofer.de> References: <20190305225331.1353-1-lukas.auer@aisec.fraunhofer.de> <20190305225331.1353-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 > Sent: Wednesday, March 6, 2019 4:23 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 ; Daniel Schwierzeck > 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 > --- > > 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 Regards, Anup