diff --git a/Makefile b/Makefile index 598674e4..8d15eb17 100644 --- a/Makefile +++ b/Makefile @@ -217,6 +217,14 @@ GENFLAGS += $(libsbiutils-genflags-y) GENFLAGS += $(platform-genflags-y) GENFLAGS += $(firmware-genflags-y) +define add_define + GENFLAGS += -D$(1)$(if $(value $(1)),=$(value $(1)),) +endef + +ifeq (${CONFIG_OPENSBI_FASTBOOT},y) +$(eval $(call add_define,CONFIG_OPENSBI_FASTBOOT)) +endif + CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-strict-aliasing -O2 CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls CFLAGS += -mno-save-restore -mstrict-align diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c index 47ddb83d..59f1d350 100644 --- a/lib/sbi/sbi_init.c +++ b/lib/sbi/sbi_init.c @@ -225,7 +225,9 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) { int rc; unsigned long *init_count; +#ifndef CONFIG_OPENSBI_FASTBOOT const struct sbi_platform *plat = sbi_platform_ptr(scratch); +#endif /* Note: This has to be first thing in coldboot init sequence */ rc = sbi_scratch_init(scratch); @@ -246,20 +248,25 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) if (rc) sbi_hart_hang(); +#ifndef CONFIG_OPENSBI_FASTBOOT rc = sbi_platform_early_init(plat, TRUE); if (rc) sbi_hart_hang(); +#endif rc = sbi_hart_init(scratch, TRUE); if (rc) sbi_hart_hang(); +#ifndef CONFIG_OPENSBI_FASTBOOT rc = sbi_console_init(scratch); if (rc) sbi_hart_hang(); +#endif sbi_boot_print_banner(scratch); +#ifndef CONFIG_OPENSBI_FASTBOOT rc = sbi_platform_irqchip_init(plat, TRUE); if (rc) { sbi_printf("%s: platform irqchip init failed (error %d)\n", @@ -272,6 +279,7 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) sbi_printf("%s: ipi init failed (error %d)\n", __func__, rc); sbi_hart_hang(); } +#endif rc = sbi_tlb_init(scratch, TRUE); if (rc) { @@ -319,12 +327,14 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) * Note: Platform final initialization should be last so that * it sees correct domain assignment and PMP configuration. */ +#ifndef CONFIG_OPENSBI_FASTBOOT rc = sbi_platform_final_init(plat, TRUE); if (rc) { sbi_printf("%s: platform final init failed (error %d)\n", __func__, rc); sbi_hart_hang(); } +#endif sbi_boot_print_hart(scratch, hartid); diff --git a/lib/utils/timer/fdt_timer_clint.c b/lib/utils/timer/fdt_timer_clint.c index 0352e535..68c38dae 100644 --- a/lib/utils/timer/fdt_timer_clint.c +++ b/lib/utils/timer/fdt_timer_clint.c @@ -15,7 +15,9 @@ #define CLINT_TIMER_MAX_NR 16 static unsigned long clint_timer_count = 0; -static struct clint_data clint_timer[CLINT_TIMER_MAX_NR]; +static struct clint_data clint_timer[CLINT_TIMER_MAX_NR] = { + {.addr = 0x74000000, .first_hartid = 0, .hart_count = 1, .has_64bit_mmio = 0, }, +}; static int timer_clint_cold_init(void *fdt, int nodeoff, const struct fdt_match *match) @@ -29,9 +31,11 @@ static int timer_clint_cold_init(void *fdt, int nodeoff, if (1 < clint_timer_count) ctmaster = &clint_timer[0]; - rc = fdt_parse_clint_node(fdt, nodeoff, TRUE, ct); - if (rc) - return rc; + if (clint_timer_count != 1) { + rc = fdt_parse_clint_node(fdt, nodeoff, TRUE, ct); + if (rc) + return rc; + } return clint_cold_timer_init(ct, ctmaster); } diff --git a/pm_default_cv180x.bin b/pm_default_cv180x.bin index 68903a79..0ed0b86d 100755 Binary files a/pm_default_cv180x.bin and b/pm_default_cv180x.bin differ diff --git a/pm_default_cv181x.bin b/pm_default_cv181x.bin index e500704b..0ed0b86d 100755 Binary files a/pm_default_cv181x.bin and b/pm_default_cv181x.bin differ