u-boot/arch/riscv/lib/sbi_ipi.c
Bin Meng f295e00c61 riscv: Avoid calling sbi_clear_ipi()
There is no need for S-mode U-Boot to call sbi_clear_ipi() as it
can be cleared directly from S-mode. This saves some cycles.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Lukas Auer <lukas@auer.io>
2020-03-17 11:29:40 +08:00

37 lines
575 B
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2019 Fraunhofer AISEC,
* Lukas Auer <lukas.auer@aisec.fraunhofer.de>
*/
#include <common.h>
#include <asm/encoding.h>
#include <asm/sbi.h>
int riscv_send_ipi(int hart)
{
ulong mask;
mask = 1UL << hart;
sbi_send_ipi(&mask);
return 0;
}
int riscv_clear_ipi(int hart)
{
csr_clear(CSR_SIP, SIP_SSIP);
return 0;
}
int riscv_get_ipi(int hart, int *pending)
{
/*
* The SBI does not support reading the IPI status. We always return 0
* to indicate that no IPI is pending.
*/
*pending = 0;
return 0;
}