mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 07:41:42 +01:00
platform: generic: Allow platform_override to select cold boot HART
We add a generic platform override callback to allow platform specific selection of cold boot HART. Signed-off-by: Anup Patel <apatel@ventanamicro.com>
This commit is contained in:
@@ -18,6 +18,7 @@ struct platform_override {
|
|||||||
const struct fdt_match *match_table;
|
const struct fdt_match *match_table;
|
||||||
u64 (*features)(const struct fdt_match *match);
|
u64 (*features)(const struct fdt_match *match);
|
||||||
u64 (*tlbr_flush_limit)(const struct fdt_match *match);
|
u64 (*tlbr_flush_limit)(const struct fdt_match *match);
|
||||||
|
bool (*cold_boot_allowed)(u32 hartid, const struct fdt_match *match);
|
||||||
int (*early_init)(bool cold_boot, const struct fdt_match *match);
|
int (*early_init)(bool cold_boot, const struct fdt_match *match);
|
||||||
int (*final_init)(bool cold_boot, const struct fdt_match *match);
|
int (*final_init)(bool cold_boot, const struct fdt_match *match);
|
||||||
void (*early_exit)(const struct fdt_match *match);
|
void (*early_exit)(const struct fdt_match *match);
|
||||||
|
@@ -122,6 +122,14 @@ fail:
|
|||||||
wfi();
|
wfi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool generic_cold_boot_allowed(u32 hartid)
|
||||||
|
{
|
||||||
|
if (generic_plat && generic_plat->cold_boot_allowed)
|
||||||
|
return generic_plat->cold_boot_allowed(
|
||||||
|
hartid, generic_plat_match);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static int generic_nascent_init(void)
|
static int generic_nascent_init(void)
|
||||||
{
|
{
|
||||||
if (platform_has_mlevel_imsic)
|
if (platform_has_mlevel_imsic)
|
||||||
@@ -261,6 +269,7 @@ static int generic_console_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const struct sbi_platform_operations platform_ops = {
|
const struct sbi_platform_operations platform_ops = {
|
||||||
|
.cold_boot_allowed = generic_cold_boot_allowed,
|
||||||
.nascent_init = generic_nascent_init,
|
.nascent_init = generic_nascent_init,
|
||||||
.early_init = generic_early_init,
|
.early_init = generic_early_init,
|
||||||
.final_init = generic_final_init,
|
.final_init = generic_final_init,
|
||||||
|
Reference in New Issue
Block a user