forked from Mirrors/opensbi
lib: Remove source_hart and hartid parameter from IPI callbacks
The source_hart and hartid parameter is really not required in IPI callbacks of sbi_platform because current hartid can always be obtained by calling sbi_current_hartid() API. Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -12,13 +12,13 @@
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
|
||||
void clint_ipi_inject(u32 target_hart, u32 source_hart);
|
||||
void clint_ipi_inject(u32 target_hart);
|
||||
|
||||
void clint_ipi_sync(u32 target_hart, u32 source_hart);
|
||||
void clint_ipi_sync(u32 target_hart);
|
||||
|
||||
void clint_ipi_clear(u32 target_hart);
|
||||
|
||||
int clint_warm_ipi_init(u32 target_hart);
|
||||
int clint_warm_ipi_init(void);
|
||||
|
||||
int clint_cold_ipi_init(unsigned long base, u32 hart_count);
|
||||
|
||||
|
@@ -9,28 +9,28 @@
|
||||
|
||||
#include <sbi/riscv_io.h>
|
||||
#include <sbi/riscv_atomic.h>
|
||||
#include <sbi/sbi_hart.h>
|
||||
#include <plat/sys/clint.h>
|
||||
|
||||
static u32 clint_ipi_hart_count;
|
||||
static volatile void *clint_ipi_base;
|
||||
static volatile u32 *clint_ipi;
|
||||
|
||||
void clint_ipi_inject(u32 target_hart, u32 source_hart)
|
||||
void clint_ipi_inject(u32 target_hart)
|
||||
{
|
||||
if ((clint_ipi_hart_count <= target_hart) ||
|
||||
(clint_ipi_hart_count <= source_hart))
|
||||
if (clint_ipi_hart_count <= target_hart)
|
||||
return;
|
||||
|
||||
/* Set CLINT IPI */
|
||||
writel(1, &clint_ipi[target_hart]);
|
||||
}
|
||||
|
||||
void clint_ipi_sync(u32 target_hart, u32 source_hart)
|
||||
void clint_ipi_sync(u32 target_hart)
|
||||
{
|
||||
u32 target_ipi, incoming_ipi;
|
||||
u32 source_hart = sbi_current_hartid();
|
||||
|
||||
if ((clint_ipi_hart_count <= target_hart) ||
|
||||
(clint_ipi_hart_count <= source_hart))
|
||||
if (clint_ipi_hart_count <= target_hart)
|
||||
return;
|
||||
|
||||
/* Wait until target HART has handled IPI */
|
||||
@@ -57,14 +57,15 @@ void clint_ipi_clear(u32 target_hart)
|
||||
writel(0, &clint_ipi[target_hart]);
|
||||
}
|
||||
|
||||
int clint_warm_ipi_init(u32 target_hart)
|
||||
int clint_warm_ipi_init(void)
|
||||
{
|
||||
if (clint_ipi_hart_count <= target_hart ||
|
||||
!clint_ipi_base)
|
||||
u32 hartid = sbi_current_hartid();
|
||||
|
||||
if (!clint_ipi_base)
|
||||
return -1;
|
||||
|
||||
/* Clear CLINT IPI */
|
||||
clint_ipi_clear(target_hart);
|
||||
clint_ipi_clear(hartid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ static int k210_irqchip_init(u32 hartid, bool cold_boot)
|
||||
(2 * hartid + 1));
|
||||
}
|
||||
|
||||
static int k210_ipi_init(u32 hartid, bool cold_boot)
|
||||
static int k210_ipi_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -63,7 +63,7 @@ static int k210_ipi_init(u32 hartid, bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return clint_warm_ipi_init(hartid);
|
||||
return clint_warm_ipi_init();
|
||||
}
|
||||
|
||||
static int k210_timer_init(u32 hartid, bool cold_boot)
|
||||
|
@@ -89,7 +89,7 @@ static int sifive_u_irqchip_init(u32 hartid, bool cold_boot)
|
||||
(2 * hartid + 1));
|
||||
}
|
||||
|
||||
static int sifive_u_ipi_init(u32 hartid, bool cold_boot)
|
||||
static int sifive_u_ipi_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -100,7 +100,7 @@ static int sifive_u_ipi_init(u32 hartid, bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return clint_warm_ipi_init(hartid);
|
||||
return clint_warm_ipi_init();
|
||||
}
|
||||
|
||||
static int sifive_u_timer_init(u32 hartid, bool cold_boot)
|
||||
|
@@ -90,7 +90,7 @@ static int virt_irqchip_init(u32 hartid, bool cold_boot)
|
||||
(2 * hartid + 1));
|
||||
}
|
||||
|
||||
static int virt_ipi_init(u32 hartid, bool cold_boot)
|
||||
static int virt_ipi_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -101,7 +101,7 @@ static int virt_ipi_init(u32 hartid, bool cold_boot)
|
||||
return rc;
|
||||
}
|
||||
|
||||
return clint_warm_ipi_init(hartid);
|
||||
return clint_warm_ipi_init();
|
||||
}
|
||||
|
||||
static int virt_timer_init(u32 hartid, bool cold_boot)
|
||||
|
@@ -141,7 +141,7 @@ static int fu540_irqchip_init(u32 hartid, bool cold_boot)
|
||||
(hartid) ? (2 * hartid) : -1);
|
||||
}
|
||||
|
||||
static int fu540_ipi_init(u32 hartid, bool cold_boot)
|
||||
static int fu540_ipi_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
|
||||
@@ -153,7 +153,7 @@ static int fu540_ipi_init(u32 hartid, bool cold_boot)
|
||||
|
||||
}
|
||||
|
||||
return clint_warm_ipi_init(hartid);
|
||||
return clint_warm_ipi_init();
|
||||
}
|
||||
|
||||
static int fu540_timer_init(u32 hartid, bool cold_boot)
|
||||
|
Reference in New Issue
Block a user