summaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_hart.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-09-23 19:19:01 +0300
committerAnup Patel <anup@brainfault.org>2020-10-21 09:31:34 +0300
commitc347408a39eb66c9705ccc0cbd4537149fda938f (patch)
tree429ba4624a35a0b92004e1bc527de4f73b59614d /lib/sbi/sbi_hart.c
parentc10c30b485e286b7ebe3f63897616107fb05ddce (diff)
downloadopensbi-c347408a39eb66c9705ccc0cbd4537149fda938f.tar.xz
lib: sbi: Display domain details in boot prints
We extend boot prints to display details of each domain. In the process, we remove sbi_hart_pmp_dump() because it shows redundant information which domain details already show. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_hart.c')
-rw-r--r--lib/sbi/sbi_hart.c44
1 files changed, 10 insertions, 34 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
index 1871a1e..ff18c9d 100644
--- a/lib/sbi/sbi_hart.c
+++ b/lib/sbi/sbi_hart.c
@@ -123,18 +123,23 @@ static int delegate_traps(struct sbi_scratch *scratch)
return 0;
}
-void sbi_hart_delegation_dump(struct sbi_scratch *scratch)
+void sbi_hart_delegation_dump(struct sbi_scratch *scratch,
+ const char *prefix, const char *suffix)
{
if (!misa_extension('S'))
/* No delegation possible as mideleg does not exist*/
return;
#if __riscv_xlen == 32
- sbi_printf("MIDELEG : 0x%08lx\n", csr_read(CSR_MIDELEG));
- sbi_printf("MEDELEG : 0x%08lx\n", csr_read(CSR_MEDELEG));
+ sbi_printf("%sMIDELEG%s: 0x%08lx\n",
+ prefix, suffix, csr_read(CSR_MIDELEG));
+ sbi_printf("%sMEDELEG%s: 0x%08lx\n",
+ prefix, suffix, csr_read(CSR_MEDELEG));
#else
- sbi_printf("MIDELEG : 0x%016lx\n", csr_read(CSR_MIDELEG));
- sbi_printf("MEDELEG : 0x%016lx\n", csr_read(CSR_MEDELEG));
+ sbi_printf("%sMIDELEG%s: 0x%016lx\n",
+ prefix, suffix, csr_read(CSR_MIDELEG));
+ sbi_printf("%sMEDELEG%s: 0x%016lx\n",
+ prefix, suffix, csr_read(CSR_MEDELEG));
#endif
}
@@ -154,35 +159,6 @@ unsigned int sbi_hart_pmp_count(struct sbi_scratch *scratch)
return hfeatures->pmp_count;
}
-void sbi_hart_pmp_dump(struct sbi_scratch *scratch)
-{
- unsigned long prot, addr, size, log2size;
- unsigned int i, pmp_count;
-
- pmp_count = sbi_hart_pmp_count(scratch);
- for (i = 0; i < pmp_count; i++) {
- pmp_get(i, &prot, &addr, &log2size);
- if (!(prot & PMP_A))
- continue;
- size = (log2size < __riscv_xlen) ? 1UL << log2size : 0;
-#if __riscv_xlen == 32
- sbi_printf("PMP%d : 0x%08lx-0x%08lx (A",
-#else
- sbi_printf("PMP%d : 0x%016lx-0x%016lx (A",
-#endif
- i, addr, addr + size - 1);
- if (prot & PMP_L)
- sbi_printf(",L");
- if (prot & PMP_R)
- sbi_printf(",R");
- if (prot & PMP_W)
- sbi_printf(",W");
- if (prot & PMP_X)
- sbi_printf(",X");
- sbi_printf(")\n");
- }
-}
-
int sbi_hart_pmp_configure(struct sbi_scratch *scratch)
{
struct sbi_domain_memregion *reg;