Lukas Auer | f152feb | 2019-03-17 19:28:34 +0100 | [diff] [blame] | 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> |
Bin Meng | f295e00 | 2020-03-06 00:44:17 -0800 | [diff] [blame] | 8 | #include <asm/encoding.h> |
Lukas Auer | f152feb | 2019-03-17 19:28:34 +0100 | [diff] [blame] | 9 | #include <asm/sbi.h> |
| 10 | |
Sean Anderson | 40686c3 | 2020-06-24 06:41:18 -0400 | [diff] [blame] | 11 | int riscv_init_ipi(void) |
| 12 | { |
| 13 | return 0; |
| 14 | } |
| 15 | |
Lukas Auer | f152feb | 2019-03-17 19:28:34 +0100 | [diff] [blame] | 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 | |
| 26 | int riscv_clear_ipi(int hart) |
| 27 | { |
Bin Meng | f295e00 | 2020-03-06 00:44:17 -0800 | [diff] [blame] | 28 | csr_clear(CSR_SIP, SIP_SSIP); |
Lukas Auer | f152feb | 2019-03-17 19:28:34 +0100 | [diff] [blame] | 29 | |
| 30 | return 0; |
| 31 | } |
Lukas Auer | 8b3e97b | 2019-12-08 23:28:50 +0100 | [diff] [blame] | 32 | |
| 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 | } |