blob: abafca9e5c1366d18608272f328d1cc79560dd02 [file] [log] [blame]
Lukas Auere79178b2019-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
7#include <common.h>
Bin Mengfb5eabc2020-03-06 00:44:17 -08008#include <asm/encoding.h>
Lukas Auere79178b2019-03-17 19:28:34 +01009#include <asm/sbi.h>
10
11int riscv_send_ipi(int hart)
12{
13 ulong mask;
14
15 mask = 1UL << hart;
16 sbi_send_ipi(&mask);
17
18 return 0;
19}
20
21int riscv_clear_ipi(int hart)
22{
Bin Mengfb5eabc2020-03-06 00:44:17 -080023 csr_clear(CSR_SIP, SIP_SSIP);
Lukas Auere79178b2019-03-17 19:28:34 +010024
25 return 0;
26}
Lukas Auerc7460b82019-12-08 23:28:50 +010027
28int riscv_get_ipi(int hart, int *pending)
29{
30 /*
31 * The SBI does not support reading the IPI status. We always return 0
32 * to indicate that no IPI is pending.
33 */
34 *pending = 0;
35
36 return 0;
37}