riscv: add option to wait for ack from secondary harts in smp functions
authorLukas Auer <lukas.auer@aisec.fraunhofer.de>
Sun, 8 Dec 2019 22:28:51 +0000 (23:28 +0100)
committerAndes <uboot@andestech.com>
Tue, 10 Dec 2019 00:23:10 +0000 (08:23 +0800)
commit90ae28143700bae4edd23930a7772899ad259058
tree302fd5ab611f913831da41971eb582270f7295b0
parent8b3e97badf97d6e399014fb4a152031f8a0c94ba
riscv: add option to wait for ack from secondary harts in smp functions

Add a wait option to smp_call_function() to wait for the secondary harts
to acknowledge the call-function request. The request is considered to
be acknowledged once each secondary hart has cleared the corresponding
IPI.

As part of the call-function request, the secondary harts invalidate the
instruction cache after clearing the IPI. This adds a delay between
acknowledgment (clear IPI) and fulfillment (call function) of the
request. We want to use the acknowledgment to be able to judge when the
request has been completed. Remove the delay by clearing the IPI after
cache invalidation and just before calling the function from the
request.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Rick Chen <rick@andestech.com>
Tested-by: Rick Chen <rick@andestech.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
arch/riscv/cpu/start.S
arch/riscv/include/asm/smp.h
arch/riscv/lib/bootm.c
arch/riscv/lib/smp.c
arch/riscv/lib/spl.c
common/spl/spl_opensbi.c