diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-01-03 06:04:51 +0300 |
---|---|---|
committer | Anup Patel <anup.patel@wdc.com> | 2020-01-07 07:52:24 +0300 |
commit | e746673a796d7e176ceeb56d160779be8386ffd9 (patch) | |
tree | 850e6708db5bfcd2c03e057f9415aa63848f9290 /lib/sbi/sbi_init.c | |
parent | c0849cd731fca884c939e6a1a699a853231292a2 (diff) | |
download | opensbi-e746673a796d7e176ceeb56d160779be8386ffd9.tar.xz |
lib: Remove unnecessary checks from init_coldboot() and init_warmboot()
We remove unnecessary checks related to hart hotplug and disabled
hart in coldboot and warmboot init path.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_init.c')
-rw-r--r-- | lib/sbi/sbi_init.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c index 51ce3a0..80e4a19 100644 --- a/lib/sbi/sbi_init.c +++ b/lib/sbi/sbi_init.c @@ -106,9 +106,10 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid) if (!(scratch->options & SBI_SCRATCH_NO_BOOT_PRINTS)) sbi_boot_prints(scratch, hartid); - if (!sbi_platform_has_hart_hotplug(plat)) - sbi_hart_wake_coldboot_harts(scratch, hartid); + sbi_hart_wake_coldboot_harts(scratch, hartid); + sbi_hart_mark_available(hartid); + sbi_hart_switch_mode(hartid, scratch->next_arg1, scratch->next_addr, scratch->next_mode, FALSE); } @@ -118,11 +119,7 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid) int rc; const struct sbi_platform *plat = sbi_platform_ptr(scratch); - if (!sbi_platform_has_hart_hotplug(plat)) - sbi_hart_wait_for_coldboot(scratch, hartid); - - if (sbi_platform_hart_disabled(plat, hartid)) - sbi_hart_hang(); + sbi_hart_wait_for_coldboot(scratch, hartid); rc = sbi_system_early_init(scratch, FALSE); if (rc) @@ -150,13 +147,9 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid) sbi_hart_mark_available(hartid); - if (sbi_platform_has_hart_hotplug(plat)) - /* TODO: To be implemented in-future. */ - sbi_hart_hang(); - else - sbi_hart_switch_mode(hartid, scratch->next_arg1, - scratch->next_addr, - scratch->next_mode, FALSE); + sbi_hart_switch_mode(hartid, scratch->next_arg1, + scratch->next_addr, + scratch->next_mode, FALSE); } static atomic_t coldboot_lottery = ATOMIC_INITIALIZER(0); |