diff options
| author | Anup Patel <[email protected]> | 2020-11-20 16:42:15 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2020-12-04 18:01:00 +0530 |
| commit | 9b65dcaedd737b36c21cd9ff585585c188a92b41 (patch) | |
| tree | e3a0f3e8bc45b447b9b4208626d2a17d30f9354c /include | |
| parent | 555e73778add1f1bc85011f98b3210c7103d60a5 (diff) | |
include: sbi: Add domains_init() platform operation
We introduce domains_init() platform operation which can be used by
platform support to initialize/populate domains in the coldboot path.
The domains_init() is called late in the coldboot sequence from the
sbi_domain_finalize() so sbi_printf() can be used by platform support
to print errors/warnings at time of populating domains.
Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/sbi_platform.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index ee723233..3681a78e 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -91,6 +91,8 @@ struct sbi_platform_operations { */ int (*misa_get_xlen)(void); + /** Initialize (or populate) domains for the platform */ + int (*domains_init)(void); /** Get domain pointer for given HART id */ struct sbi_domain *(*domain_get)(u32 hartid); @@ -452,6 +454,20 @@ static inline int sbi_platform_misa_xlen(const struct sbi_platform *plat) } /** + * Initialize (or populate) domains for the platform + * + * @param plat pointer to struct sbi_platform + * + * @return 0 on success and negative error code on failure + */ +static inline int sbi_platform_domains_init(const struct sbi_platform *plat) +{ + if (plat && sbi_platform_ops(plat)->domains_init) + return sbi_platform_ops(plat)->domains_init(); + return 0; +} + +/** * Get domain pointer for given HART * * @param plat pointer to struct sbi_platform |
