lib: sbi_irqchip: Call driver warm_init from SBI core

Currently, each platform keeps track of which irqchip driver is in use
and calls its warm init function. Since the generic platform may use
multiple irqchip drivers, it has logic to track an array of drivers.

The code is simplified and made common across platforms by treating warm
init and exit as properties of the driver, not the platform. Then the
platform's only role is to select and prepare a driver during cold boot.

For now, only add a .warm_init hook, since none of the existing drivers
need an .exit hook. It could be added in the future if needed.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Samuel Holland
2024-11-04 20:10:08 -08:00
committed by Anup Patel
parent e3e5686ef9
commit 2dd6eaf680
14 changed files with 24 additions and 20 deletions

View File

@@ -110,7 +110,7 @@ static int ariane_irqchip_init(bool cold_boot)
return ret;
}
return plic_warm_irqchip_init();
return 0;
}
/*

View File

@@ -143,7 +143,7 @@ static int openpiton_irqchip_init(bool cold_boot)
return ret;
}
return plic_warm_irqchip_init();
return 0;
}
/*

View File

@@ -146,7 +146,7 @@ static int k210_irqchip_init(bool cold_boot)
return rc;
}
return plic_warm_irqchip_init();
return 0;
}
static int k210_ipi_init(void)

View File

@@ -200,7 +200,7 @@ static int ux600_irqchip_init(bool cold_boot)
return rc;
}
return plic_warm_irqchip_init();
return 0;
}
static int ux600_ipi_init(void)

View File

@@ -100,7 +100,7 @@ static int platform_irqchip_init(bool cold_boot)
return ret;
}
return plic_warm_irqchip_init();
return 0;
}
/*