From a82a033c7405a61550b709634c9109dc83f9cb0a Mon Sep 17 00:00:00 2001 From: Xiang W Date: Mon, 14 Aug 2023 18:41:00 +0800 Subject: [PATCH] fix hart_stack_size change --- include/sbi/sbi_platform.h | 2 +- platform/generic/sophgo/mango.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index 47eebe4d..546c0a61 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -136,7 +136,7 @@ struct sbi_platform_operations { }; /** Platform default per-HART stack size for exception/interrupt handling */ -#define SBI_PLATFORM_DEFAULT_HART_STACK_SIZE 16384 +#define SBI_PLATFORM_DEFAULT_HART_STACK_SIZE 8192 /** Representation of a platform */ struct sbi_platform { diff --git a/platform/generic/sophgo/mango.c b/platform/generic/sophgo/mango.c index faeb6fac..34f62ab6 100644 --- a/platform/generic/sophgo/mango.c +++ b/platform/generic/sophgo/mango.c @@ -24,6 +24,7 @@ #define SOPHGO_MANGO_TIMER_BASE 0x70ac000000UL #define SOPHGO_MANGO_TIMER_OFFSET 0x10000UL +extern struct sbi_platform platform; static u32 selected_hartid = -1; static bool mango_cold_boot_allowed(u32 hartid, @@ -65,6 +66,10 @@ static int mango_extensions_init(const struct fdt_match *match, return 0; } +static void mango_fw_init(void *fdt, const struct fdt_match *match) +{ + platform.hart_stack_size = 16384; +} static const struct fdt_match sophgo_mango_match[] = { { .compatible = "sophgo,mango" }, @@ -73,6 +78,7 @@ static const struct fdt_match sophgo_mango_match[] = { const struct platform_override sophgo_mango = { .match_table = sophgo_mango_match, + .fw_init = mango_fw_init, .cold_boot_allowed = mango_cold_boot_allowed, .early_init = mango_early_init, .extensions_init = mango_extensions_init,