summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnup Patel <apatel@ventanamicro.com>2021-06-29 10:44:04 +0300
committerAnup Patel <anup@brainfault.org>2022-02-15 18:04:24 +0300
commit10509405b2722d25389280b7d914579a16e2eb7e (patch)
treeef1736a60178619f07a52b32203f8b32351b23a4 /lib
parent5f56314618d4733c83bb80c65f9181e952f051ed (diff)
downloadopensbi-10509405b2722d25389280b7d914579a16e2eb7e.tar.xz
include: sbi: Introduce nascent_init() platform callback
We introduce nascent_init() platform callback which will allow platforms to do very early initialization of platform specific per-HART CSRs and per-HART devices. Signed-off-by: Anup Patel <anup.patel@wdc.com> Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Atish Patra <atishp@rivosinc.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi/sbi_init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
index 83043c5..27d03a7 100644
--- a/lib/sbi/sbi_init.c
+++ b/lib/sbi/sbi_init.c
@@ -494,6 +494,14 @@ void __noreturn sbi_init(struct sbi_scratch *scratch)
if (next_mode_supported && atomic_xchg(&coldboot_lottery, 1) == 0)
coldboot = TRUE;
+ /*
+ * Do platform specific nascent (very early) initialization so
+ * that platform can initialize platform specific per-HART CSRs
+ * or per-HART devices.
+ */
+ if (sbi_platform_nascent_init(plat))
+ sbi_hart_hang();
+
if (coldboot)
init_coldboot(scratch, hartid);
else