mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 15:51:41 +01:00
lib: Simplify sbi_platform early_init() and final_init() hooks
Instead of having separate early_init() and final_init() hooks for cold and warm boot, this patch updates struct sbi_platform to have just one early_init() and one final_init() hook. The type of boot (cold or warm) is now a boolean flag parameter for the updated early_init() and final_init() hooks. Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -29,11 +29,15 @@
|
||||
#define SIFIVE_U_UART0_ADDR 0x10013000
|
||||
#define SIFIVE_U_UART1_ADDR 0x10023000
|
||||
|
||||
static int sifive_u_cold_final_init(void)
|
||||
static int sifive_u_final_init(u32 hartid, bool cold_boot)
|
||||
{
|
||||
u32 i;
|
||||
void *fdt = sbi_scratch_thishart_arg1_ptr();
|
||||
void *fdt;
|
||||
|
||||
if (!cold_boot)
|
||||
return 0;
|
||||
|
||||
fdt = sbi_scratch_thishart_arg1_ptr();
|
||||
for (i = 0; i < SIFIVE_U_HART_COUNT; i++)
|
||||
plic_fdt_fixup(fdt, "riscv,plic0", 2 * i);
|
||||
|
||||
@@ -110,7 +114,7 @@ struct sbi_platform platform = {
|
||||
.disabled_hart_mask = 0,
|
||||
.pmp_region_count = sifive_u_pmp_region_count,
|
||||
.pmp_region_info = sifive_u_pmp_region_info,
|
||||
.cold_final_init = sifive_u_cold_final_init,
|
||||
.final_init = sifive_u_final_init,
|
||||
.console_putc = sifive_uart_putc,
|
||||
.console_getc = sifive_uart_getc,
|
||||
.console_init = sifive_u_console_init,
|
||||
|
Reference in New Issue
Block a user