diff options
| author | Anup Patel <[email protected]> | 2022-12-29 10:56:15 +0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2023-01-07 15:58:49 +0530 |
| commit | f14595a7cfc8de16a06335c6ecdf9ae23a0adf53 (patch) | |
| tree | 85c79c44afff34a609e56ac0ffc336aa044e5b0c /lib | |
| parent | 65638f8d6b1f438ae442bad7a4f77b188d3d3689 (diff) | |
lib: sbi: Allow platform to influence cold boot HART selection
We add an optional cold_boot_allowed() platform callback which allows
platform support to decide which HARTs can do cold boot initialization.
If this platform callback is not available then any HART can do cold
boot initialization.
Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sbi/sbi_init.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c index ded3da00..259a1910 100644 --- a/lib/sbi/sbi_init.c +++ b/lib/sbi/sbi_init.c @@ -498,8 +498,11 @@ void __noreturn sbi_init(struct sbi_scratch *scratch) * HARTs which satisfy above condition. */ - if (next_mode_supported && atomic_xchg(&coldboot_lottery, 1) == 0) - coldboot = true; + if (sbi_platform_cold_boot_allowed(plat, hartid)) { + if (next_mode_supported && + atomic_xchg(&coldboot_lottery, 1) == 0) + coldboot = true; + } /* * Do platform specific nascent (very early) initialization so |
