lib: sbi: Replace sbi_hart_pmp_xyz() and sbi_hart_map/unmap_addr()

The sbi_hart_pmp_xyz() and sbi_hart_map/unmap_addr() functions can
now be replaced by various sbi_hart_protection_xyz() functions.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Link: https://lore.kernel.org/r/20251209135235.423391-5-apatel@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Anup Patel
2025-12-09 19:22:34 +05:30
committed by Anup Patel
parent b6da690ffb
commit 42139bb9b7
9 changed files with 58 additions and 83 deletions

View File

@@ -389,12 +389,12 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
}
/*
* Configure PMP at last because if SMEPMP is detected,
* M-mode access to the S/U space will be rescinded.
* Configure hart isolation at last because if SMEPMP is,
* detected, M-mode access to the S/U space will be rescinded.
*/
rc = sbi_hart_pmp_configure(scratch);
rc = sbi_hart_protection_configure(scratch);
if (rc) {
sbi_printf("%s: PMP configure failed (error %d)\n",
sbi_printf("%s: hart isolation configure failed (error %d)\n",
__func__, rc);
sbi_hart_hang();
}
@@ -468,10 +468,10 @@ static void __noreturn init_warm_startup(struct sbi_scratch *scratch,
sbi_hart_hang();
/*
* Configure PMP at last because if SMEPMP is detected,
* M-mode access to the S/U space will be rescinded.
* Configure hart isolation at last because if SMEPMP is,
* detected, M-mode access to the S/U space will be rescinded.
*/
rc = sbi_hart_pmp_configure(scratch);
rc = sbi_hart_protection_configure(scratch);
if (rc)
sbi_hart_hang();
@@ -492,7 +492,7 @@ static void __noreturn init_warm_resume(struct sbi_scratch *scratch,
if (rc)
sbi_hart_hang();
rc = sbi_hart_pmp_configure(scratch);
rc = sbi_hart_protection_configure(scratch);
if (rc)
sbi_hart_hang();