1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2019 Fraunhofer AISEC,
4  * Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5  */
6 
7 #include <common.h>
8 #include <asm/encoding.h>
9 #include <asm/sbi.h>
10 
riscv_init_ipi(void)11 int riscv_init_ipi(void)
12 {
13 	return 0;
14 }
15 
riscv_send_ipi(int hart)16 int riscv_send_ipi(int hart)
17 {
18 	ulong mask;
19 
20 	mask = 1UL << hart;
21 	sbi_send_ipi(&mask);
22 
23 	return 0;
24 }
25 
riscv_clear_ipi(int hart)26 int riscv_clear_ipi(int hart)
27 {
28 	csr_clear(CSR_SIP, SIP_SSIP);
29 
30 	return 0;
31 }
32 
riscv_get_ipi(int hart,int * pending)33 int riscv_get_ipi(int hart, int *pending)
34 {
35 	/*
36 	 * The SBI does not support reading the IPI status. We always return 0
37 	 * to indicate that no IPI is pending.
38 	 */
39 	*pending = 0;
40 
41 	return 0;
42 }
43