From e268b23142834af317372d691f329828d387a22a Mon Sep 17 00:00:00 2001 From: Jouni Ukkonen Date: Wed, 11 May 2022 12:51:56 +0300 Subject: [PATCH] OpenSBI: Add configurable support for domain init Initialize .domains_init function entry point in sbi_platform_operations when CONFIG_OPENSBI_DOMAINS=y. In this case, the board specific code must provide the "board_domains_init" function. Signed-off-by: Jouni Ukkonen --- arch/risc-v/src/mpfs/mpfs_opensbi.c | 9 +++++++++ arch/risc-v/src/opensbi/Kconfig | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/arch/risc-v/src/mpfs/mpfs_opensbi.c b/arch/risc-v/src/mpfs/mpfs_opensbi.c index e3cbcc6d30..8ac3e6645d 100644 --- a/arch/risc-v/src/mpfs/mpfs_opensbi.c +++ b/arch/risc-v/src/mpfs/mpfs_opensbi.c @@ -124,6 +124,12 @@ static int mpfs_opensbi_ecall_handler(long extid, long funcid, extern void riscv_lowputc(char ch); +/* domains init implemented in board specific file */ + +#ifdef CONFIG_OPENSBI_DOMAINS +extern int board_domains_init(void); +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -157,6 +163,9 @@ static struct aclint_mtimer_data mpfs_mtimer = static const struct sbi_platform_operations platform_ops = { +#ifdef CONFIG_OPENSBI_DOMAINS + .domains_init = board_domains_init, +#endif .console_init = mpfs_opensbi_console_init, .early_init = mpfs_early_init, .irqchip_init = mpfs_irqchip_init, diff --git a/arch/risc-v/src/opensbi/Kconfig b/arch/risc-v/src/opensbi/Kconfig index 1c538be6b6..455ba46529 100644 --- a/arch/risc-v/src/opensbi/Kconfig +++ b/arch/risc-v/src/opensbi/Kconfig @@ -10,3 +10,8 @@ config OPENSBI ---help--- Enable or disable Open Source Supervisor Binary Interface (OpenSBI) features for RISC-V. + +config OPENSBI_DOMAINS + bool "Support multiple OpenSBI boot domains" + depends on OPENSBI + default n