lib: sbi: Ensure coldboot HART supports next privilege mode
authorAnup Patel <anup.patel@wdc.com>
Wed, 9 Sep 2020 03:49:09 +0000 (09:19 +0530)
committerAnup Patel <anup@brainfault.org>
Wed, 16 Sep 2020 03:35:29 +0000 (09:05 +0530)
commit172fa1601c7faaa01c547e8c498f5bdefd52d7cb
treeabd488410a942da16c3c06440bb3c91628431d4a
parent9f935a4a4372657e43b25fe2f4022fdeb3ca2387
lib: sbi: Ensure coldboot HART supports next privilege mode

The coldboot HART jumps to the next booting stage at the end of
init_coldboot() so it is absolutely necessary for coldboot HART
to support the privilege mode expected by the next booting stage.

We extend the coldboot HART selection in sbi_init() to ensure that
the selected coldboot HART always supports privilege mode specified
in scratch space (i.e. scratch->next_mode). This will further help
us allow E-core (without MMU) on SiFive Unleashed and PolarFire
ICICLE boards to proceed further and wait in HSM STOPPED state.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
lib/sbi/sbi_init.c