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 <jouni.ukkonen@unikie.com>
This commit is contained in:
Jouni Ukkonen 2022-05-11 12:51:56 +03:00 committed by Petro Karashchenko
parent 1e5568b030
commit e268b23142
2 changed files with 14 additions and 0 deletions

View File

@ -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,

View File

@ -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