RISC-V: Initialize SBI early

Currently, SBI is initialized towards the end of arch setup. This prevents
the set memory operations to be invoked earlier as it requires a full tlb
flush.

Initialize SBI as early as possible.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Tested-by: Greentime Hu <greentime.hu@sifive.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Atish Patra 2020-11-04 16:04:36 -08:00 committed by Palmer Dabbelt
parent 5cb0080f1b
commit 62149f3564
No known key found for this signature in database
GPG key ID: 2E1319F35FBB1889

View file

@ -249,6 +249,9 @@ void __init setup_arch(char **cmdline_p)
pr_err("No DTB found in kernel mappings\n");
#endif
if (IS_ENABLED(CONFIG_RISCV_SBI))
sbi_init();
#ifdef CONFIG_SWIOTLB
swiotlb_init(1);
#endif
@ -257,10 +260,6 @@ void __init setup_arch(char **cmdline_p)
kasan_init();
#endif
#if IS_ENABLED(CONFIG_RISCV_SBI)
sbi_init();
#endif
#ifdef CONFIG_SMP
setup_smp();
#endif