mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
lib: Remove hartid parameter from IRQCHIP callbacks
The hartid parameter in IRQCHIP callbacks of sbi_platform is not required because current hartid can be determined using sbi_current_hartid() API. Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -82,7 +82,7 @@ struct sbi_platform {
|
||||
int (*console_init)(void);
|
||||
|
||||
/** Initialize the platform interrupt controller */
|
||||
int (*irqchip_init)(u32 hartid, bool cold_boot);
|
||||
int (*irqchip_init)(bool cold_boot);
|
||||
|
||||
/** Inject IPI to a target HART */
|
||||
void (*ipi_inject)(u32 target_hart);
|
||||
@@ -308,16 +308,15 @@ static inline int sbi_platform_console_init(struct sbi_platform *plat)
|
||||
* Initialize the platform interrupt controller for given HART
|
||||
*
|
||||
* @param plat pointer to struct sbi_platform
|
||||
* @param hartid HART ID
|
||||
* @param cold_boot whether cold boot (TRUE) or warm_boot (FALSE)
|
||||
*
|
||||
* @return 0 on success and negative error code on failure
|
||||
*/
|
||||
static inline int sbi_platform_irqchip_init(struct sbi_platform *plat,
|
||||
u32 hartid, bool cold_boot)
|
||||
bool cold_boot)
|
||||
{
|
||||
if (plat && plat->irqchip_init)
|
||||
return plat->irqchip_init(hartid, cold_boot);
|
||||
return plat->irqchip_init(cold_boot);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,7 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
|
||||
if (rc)
|
||||
sbi_hart_hang();
|
||||
|
||||
rc = sbi_platform_irqchip_init(plat, hartid, TRUE);
|
||||
rc = sbi_platform_irqchip_init(plat, TRUE);
|
||||
if (rc)
|
||||
sbi_hart_hang();
|
||||
|
||||
@@ -111,7 +111,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)
|
||||
if (rc)
|
||||
sbi_hart_hang();
|
||||
|
||||
rc = sbi_platform_irqchip_init(plat, hartid, FALSE);
|
||||
rc = sbi_platform_irqchip_init(plat, FALSE);
|
||||
if (rc)
|
||||
sbi_hart_hang();
|
||||
|
||||
|
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <sbi/riscv_encoding.h>
|
||||
#include <sbi/sbi_const.h>
|
||||
#include <sbi/sbi_hart.h>
|
||||
#include <sbi/sbi_platform.h>
|
||||
#include <sbi/sbi_console.h>
|
||||
#include <plat/irqchip/plic.h>
|
||||
@@ -35,9 +36,10 @@ static char k210_console_getc(void)
|
||||
return uarths_getc();
|
||||
}
|
||||
|
||||
static int k210_irqchip_init(u32 hartid, bool cold_boot)
|
||||
static int k210_irqchip_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
u32 hartid = sbi_current_hartid();
|
||||
|
||||
if (cold_boot) {
|
||||
rc = plic_cold_irqchip_init(PLIC_BASE_ADDR,
|
||||
|
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <sbi/riscv_encoding.h>
|
||||
#include <sbi/sbi_const.h>
|
||||
#include <sbi/sbi_hart.h>
|
||||
#include <sbi/sbi_platform.h>
|
||||
#include <plat/irqchip/plic.h>
|
||||
#include <plat/serial/sifive-uart.h>
|
||||
@@ -72,9 +73,10 @@ static int sifive_u_console_init(void)
|
||||
SIFIVE_U_PERIPH_CLK, 115200);
|
||||
}
|
||||
|
||||
static int sifive_u_irqchip_init(u32 hartid, bool cold_boot)
|
||||
static int sifive_u_irqchip_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
u32 hartid = sbi_current_hartid();
|
||||
|
||||
if (cold_boot) {
|
||||
rc = plic_cold_irqchip_init(SIFIVE_U_PLIC_ADDR,
|
||||
|
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <sbi/riscv_encoding.h>
|
||||
#include <sbi/sbi_const.h>
|
||||
#include <sbi/sbi_hart.h>
|
||||
#include <sbi/sbi_platform.h>
|
||||
#include <plat/irqchip/plic.h>
|
||||
#include <plat/serial/uart8250.h>
|
||||
@@ -73,9 +74,10 @@ static int virt_console_init(void)
|
||||
VIRT_UART_BAUDRATE, 0, 1);
|
||||
}
|
||||
|
||||
static int virt_irqchip_init(u32 hartid, bool cold_boot)
|
||||
static int virt_irqchip_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
u32 hartid = sbi_current_hartid();
|
||||
|
||||
if (cold_boot) {
|
||||
rc = plic_cold_irqchip_init(VIRT_PLIC_ADDR,
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include <fdt.h>
|
||||
#include <sbi/riscv_encoding.h>
|
||||
#include <sbi/sbi_const.h>
|
||||
#include <sbi/sbi_hart.h>
|
||||
#include <sbi/sbi_console.h>
|
||||
#include <sbi/sbi_platform.h>
|
||||
#include <sbi/riscv_io.h>
|
||||
@@ -124,9 +125,10 @@ static int fu540_console_init(void)
|
||||
peri_in_freq, FU540_UART_BAUDRATE);
|
||||
}
|
||||
|
||||
static int fu540_irqchip_init(u32 hartid, bool cold_boot)
|
||||
static int fu540_irqchip_init(bool cold_boot)
|
||||
{
|
||||
int rc;
|
||||
u32 hartid = sbi_current_hartid();
|
||||
|
||||
if (cold_boot) {
|
||||
rc = plic_cold_irqchip_init(FU540_PLIC_ADDR,
|
||||
|
Reference in New Issue
Block a user