blob: d02e2b4c4882385156b2a7484902a73455f52239 [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
Sean Andersonb1d0cb32020-06-24 06:41:18 -040011int riscv_init_ipi(void)
12{
13 return 0;
14}
15
Lukas Auere79178b2019-03-17 19:28:34 +010016int 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
26int riscv_clear_ipi(int hart)
27{
Bin Mengfb5eabc2020-03-06 00:44:17 -080028 csr_clear(CSR_SIP, SIP_SSIP);
Lukas Auere79178b2019-03-17 19:28:34 +010029
30 return 0;
31}
Lukas Auerc7460b82019-12-08 23:28:50 +010032
33int 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}