From 3b045ae374d18e0d36528254bed39fff742fcb42 Mon Sep 17 00:00:00 2001 From: sophgo-forum-service Date: Mon, 13 Jan 2025 16:32:03 +0800 Subject: [PATCH] opensbi: weekly rls 2025.01.10 daa470, [fix](opensbi): add rls_info.txt b21a54, [test](opensbi): opensbi tailoring (time optimizing) 6ff231, [fix](str): fix riscv suspend section which do not use varivales and functions beyond syspend section. Change-Id: I8c6e7698b475b2d14c02308121f621dafe9b9e36 --- Makefile | 8 ++++++++ lib/sbi/sbi_init.c | 10 ++++++++++ lib/utils/timer/fdt_timer_clint.c | 12 ++++++++---- pm_default_cv180x.bin | Bin 1784 -> 1832 bytes pm_default_cv181x.bin | Bin 1776 -> 1832 bytes 5 files changed, 26 insertions(+), 4 deletions(-) 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 68903a79bde2f9f4ebc7977966f8de9c8bab387c..0ed0b86de7543f37aa68dd6eeae0acde4925c7fa 100755 GIT binary patch delta 188 zcmeytyMk{bhn47bRtAR2t*LyI+1VTP+JxEJ?{^<-ofvA&v^{lVmwJ6WE60xL%Go<^ z?}#o1lDg?v?h3QFZ`>Zr#Cqf4m&>f~+tZj>o0q%sJ)Zac-^}#wtPKppt?g3VIT)BH zx0OqoM=-HYZe`{8tS)e1^6~Hgm36+wDeEnZQ(m%yqgA~aC~7Zr#Cqf4m&>f~+tZj>o0q%sJ)Zac-^}#wtPKppt?g3VIT)BH zx0OqoM=-HYZe`{8tS)e1^6~Hgm36+wDeEnZQ(m%yqgA~aC~7