2019-03-17 18:28:34 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Fraunhofer AISEC,
|
|
|
|
* Lukas Auer <lukas.auer@aisec.fraunhofer.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2020-03-06 08:44:17 +00:00
|
|
|
#include <asm/encoding.h>
|
2019-03-17 18:28:34 +00:00
|
|
|
#include <asm/sbi.h>
|
|
|
|
|
2020-06-24 10:41:18 +00:00
|
|
|
int riscv_init_ipi(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-03-17 18:28:34 +00:00
|
|
|
int riscv_send_ipi(int hart)
|
|
|
|
{
|
|
|
|
ulong mask;
|
|
|
|
|
|
|
|
mask = 1UL << hart;
|
|
|
|
sbi_send_ipi(&mask);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int riscv_clear_ipi(int hart)
|
|
|
|
{
|
2020-03-06 08:44:17 +00:00
|
|
|
csr_clear(CSR_SIP, SIP_SSIP);
|
2019-03-17 18:28:34 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2019-12-08 22:28:50 +00:00
|
|
|
|
|
|
|
int riscv_get_ipi(int hart, int *pending)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* The SBI does not support reading the IPI status. We always return 0
|
|
|
|
* to indicate that no IPI is pending.
|
|
|
|
*/
|
|
|
|
*pending = 0;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|