summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2026-04-30 14:55:24 +1000
committerAnup Patel <anup@brainfault.org>2026-06-10 17:37:49 +0530
commit63350c6ea6a9ba8097b15c7159a00c428377623c (patch)
tree283932a0b1710452bc6eb12d0bcad5dbb8b4e791 /platform
parentf7738cc1e5cea8cae6919810407a8903248ad497 (diff)
downloadopensbi-63350c6ea6a9ba8097b15c7159a00c428377623c.tar.gz
opensbi-63350c6ea6a9ba8097b15c7159a00c428377623c.zip
lib: sbi: Add hart_ prefix to PMP functions
PMP functions that deal with hart PMP CSRs are given a sbi_hart_ prefix, to distinguish from RISC-V PMP encoding functions. The is_pmp_entry_mapped() function is changed a little more, to align with other PMP conventions, and made to return a bool to make it more obvious that it returns a bool and not an SBI_ return code. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260430045528.420437-8-npiggin@gmail.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'platform')
-rw-r--r--platform/generic/eswin/eic770x.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/platform/generic/eswin/eic770x.c b/platform/generic/eswin/eic770x.c
index 7330df9f..d5bfe4a8 100644
--- a/platform/generic/eswin/eic770x.c
+++ b/platform/generic/eswin/eic770x.c
@@ -254,21 +254,21 @@ static int eswin_eic7700_final_init(bool cold_boot)
__func__);
return SBI_EFAIL;
}
- pmp_set(pmp_idx++, sbi_domain_get_oldpmp_flags(reg),
- reg->base, reg->order);
+ sbi_hart_pmp_set(pmp_idx++, sbi_domain_get_oldpmp_flags(reg),
+ reg->base, reg->order);
}
- pmp_set(PMP_RESERVED_A, PMP_L, EIC770X_L3_ZERO_REMOTE,
- log2roundup(EIC770X_L3_ZERO_SIZE));
+ sbi_hart_pmp_set(PMP_RESERVED_A, PMP_L, EIC770X_L3_ZERO_REMOTE,
+ log2roundup(EIC770X_L3_ZERO_SIZE));
/**
* Enable P550 internal + System Port, so OpenSBI can access
* CLINT/PLIC/UART. Might be overwritten in pmp_configure.
*/
- pmp_set(PMP_FREE_A_START + PMP_FREE_A_COUNT - 1, 0, 0,
- log2roundup(EIC770X_MEMPORT_BASE));
+ sbi_hart_pmp_set(PMP_FREE_A_START + PMP_FREE_A_COUNT - 1, 0, 0,
+ log2roundup(EIC770X_MEMPORT_BASE));
- pmp_set(PMP_RESERVED_B, PMP_L, 0,
- log2roundup(EIC770X_MEMPORT_LIMIT));
+ sbi_hart_pmp_set(PMP_RESERVED_B, PMP_L, 0,
+ log2roundup(EIC770X_MEMPORT_LIMIT));
/**
* These must come after the setup of PMP, as we are about to
* enable speculation and HW prefetcher bits
@@ -321,13 +321,13 @@ static int eswin_eic7700_pmp_configure(struct sbi_scratch *scratch)
if (pmp_idx >= pmp_max)
goto no_more_pmp;
- pmp_set(pmp_idx++, sbi_domain_get_oldpmp_flags(reg),
- reg->base, reg->order);
+ sbi_hart_pmp_set(pmp_idx++, sbi_domain_get_oldpmp_flags(reg),
+ reg->base, reg->order);
prev = reg;
}
/* Disable the rest */
while (pmp_idx < pmp_max)
- pmp_disable(pmp_idx++);
+ sbi_hart_pmp_disable(pmp_idx++);
/* Process the second free range B [7-7] */
pmp_idx = PMP_FREE_B_START,
@@ -340,12 +340,12 @@ static int eswin_eic7700_pmp_configure(struct sbi_scratch *scratch)
if (pmp_idx >= pmp_max)
goto no_more_pmp;
- pmp_set(pmp_idx++, sbi_domain_get_oldpmp_flags(reg),
- reg->base, reg->order);
+ sbi_hart_pmp_set(pmp_idx++, sbi_domain_get_oldpmp_flags(reg),
+ reg->base, reg->order);
}
/* Disable the rest */
while (pmp_idx < pmp_max)
- pmp_disable(pmp_idx++);
+ sbi_hart_pmp_disable(pmp_idx++);
sbi_hart_pmp_fence();
return 0;
@@ -357,14 +357,14 @@ no_more_pmp:
static void eswin_eic7700_pmp_unconfigure(struct sbi_scratch *scratch)
{
/* Enable P550 internal + System Port */
- pmp_set(PMP_FREE_A_START + PMP_FREE_A_COUNT - 1, 0, 0,
- log2roundup(EIC770X_MEMPORT_BASE));
+ sbi_hart_pmp_set(PMP_FREE_A_START + PMP_FREE_A_COUNT - 1, 0, 0,
+ log2roundup(EIC770X_MEMPORT_BASE));
for (unsigned int i = 0; i < PMP_FREE_A_COUNT - 1; i++)
- pmp_disable(i + PMP_FREE_A_START);
+ sbi_hart_pmp_disable(i + PMP_FREE_A_START);
for (unsigned int i = 0; i < PMP_FREE_B_COUNT; i++)
- pmp_disable(i + PMP_FREE_B_START);
+ sbi_hart_pmp_disable(i + PMP_FREE_B_START);
}
static struct sbi_hart_protection eswin_eic7700_pmp_protection = {