diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-09-23 21:49:01 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-10-21 12:01:34 +0530 |
commit | c347408a39eb66c9705ccc0cbd4537149fda938f (patch) | |
tree | 429ba4624a35a0b92004e1bc527de4f73b59614d /lib/sbi/sbi_hart.c | |
parent | c10c30b485e286b7ebe3f63897616107fb05ddce (diff) |
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.c | 44 |
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; |