Skip to content

Commit

Permalink
RISC-V: Initialize SBI early
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
atishp04 authored and palmer-dabbelt committed Nov 26, 2020
1 parent 5cb0080 commit 62149f3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions arch/riscv/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 62149f3

Please sign in to comment.