diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-09-20 10:09:32 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-10-20 11:18:03 +0530 |
commit | a126886bfa4bd11a8b1595dab8246476741fc098 (patch) | |
tree | f73ae5aa7ab97c52f7a0f385e4bdbd92fcbdfb90 /lib/sbi/sbi_hart.c | |
parent | a12d46a5e736b9eb582af9c43c876c6228bb4bda (diff) |
lib: sbi: Configure PMP late in coldboot and warmboot path
We factor-out PMP configuration from sbi_hart_init() as a separate
sbi_hart_pmp_configure() function and do the PMP configuration very
late in coldboot and warmboot path just before platform_final_init().
Eventually, this enable us to configure PMP totally based on OpenSBI
domain where OpenSBI domains can be parsed from device-tree in any of
the platform operations except platform_final_init().
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_hart.c')
-rw-r--r-- | lib/sbi/sbi_hart.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index edf79b7..7244f1c 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -224,7 +224,7 @@ int sbi_hart_pmp_check_addr(struct sbi_scratch *scratch, return SBI_OK; } -static int pmp_init(struct sbi_scratch *scratch, u32 hartid) +int sbi_hart_pmp_configure(struct sbi_scratch *scratch) { u32 pmp_idx = 0; unsigned long fw_start, fw_size_log2; @@ -462,7 +462,7 @@ int sbi_hart_init(struct sbi_scratch *scratch, u32 hartid, bool cold_boot) if (rc) return rc; - return pmp_init(scratch, hartid); + return 0; } void __attribute__((noreturn)) sbi_hart_hang(void) |