blob: 511d3816da84aa6b749c9052d3b080774c8c03d5 [file] [log] [blame]
Lukas Auerf152feb2019-03-17 19:28:34 +01001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2019 Fraunhofer AISEC,
4 * Lukas Auer <lukas.auer@aisec.fraunhofer.de>
5 */
6
Bin Mengf295e002020-03-06 00:44:17 -08007#include <asm/encoding.h>
Lukas Auerf152feb2019-03-17 19:28:34 +01008#include <asm/sbi.h>
9
Sean Anderson40686c32020-06-24 06:41:18 -040010int riscv_init_ipi(void)
11{
12 return 0;
13}
14
Lukas Auerf152feb2019-03-17 19:28:34 +010015int riscv_send_ipi(int hart)
16{
17 ulong mask;
18
19 mask = 1UL << hart;
20 sbi_send_ipi(&mask);
21
22 return 0;
23}
24
25int riscv_clear_ipi(int hart)
26{
Bin Mengf295e002020-03-06 00:44:17 -080027 csr_clear(CSR_SIP, SIP_SSIP);
Lukas Auerf152feb2019-03-17 19:28:34 +010028
29 return 0;
30}
Lukas Auer8b3e97b2019-12-08 23:28:50 +010031
32int riscv_get_ipi(int hart, int *pending)
33{
34 /*
35 * The SBI does not support reading the IPI status. We always return 0
36 * to indicate that no IPI is pending.
37 */
38 *pending = 0;
39
40 return 0;
41}