Lukas Auer | e79178b | 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> |
| 8 | #include <asm/sbi.h> |
| 9 | |
| 10 | int riscv_send_ipi(int hart) |
| 11 | { |
| 12 | ulong mask; |
| 13 | |
| 14 | mask = 1UL << hart; |
| 15 | sbi_send_ipi(&mask); |
| 16 | |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | int riscv_clear_ipi(int hart) |
| 21 | { |
| 22 | sbi_clear_ipi(); |
| 23 | |
| 24 | return 0; |
| 25 | } |
Lukas Auer | c7460b8 | 2019-12-08 23:28:50 +0100 | [diff] [blame] | 26 | |
| 27 | int riscv_get_ipi(int hart, int *pending) |
| 28 | { |
| 29 | /* |
| 30 | * The SBI does not support reading the IPI status. We always return 0 |
| 31 | * to indicate that no IPI is pending. |
| 32 | */ |
| 33 | *pending = 0; |
| 34 | |
| 35 | return 0; |
| 36 | } |