mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-30 00:21:06 +00:00
8b3e97badf
Add the function riscv_get_ipi() for reading the pending status of IPIs. The supported controllers are Andes' Platform Level Interrupt Controller (PLIC), the Supervisor Binary Interface (SBI), and SiFive's Core Local Interruptor (CLINT). Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Rick Chen <rick@andestech.com>
36 lines
536 B
C
36 lines
536 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2019 Fraunhofer AISEC,
|
|
* Lukas Auer <lukas.auer@aisec.fraunhofer.de>
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <asm/sbi.h>
|
|
|
|
int riscv_send_ipi(int hart)
|
|
{
|
|
ulong mask;
|
|
|
|
mask = 1UL << hart;
|
|
sbi_send_ipi(&mask);
|
|
|
|
return 0;
|
|
}
|
|
|
|
int riscv_clear_ipi(int hart)
|
|
{
|
|
sbi_clear_ipi();
|
|
|
|
return 0;
|
|
}
|
|
|
|
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;
|
|
}
|