[coreboot-gerrit] New patch to review for coreboot: RISCV: hacks for nexys4 and lowrisc.

Ronald G. Minnich (rminnich@gmail.com) gerrit at coreboot.org
Sun Oct 9 20:08:01 CEST 2016


Ronald G. Minnich (rminnich at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16957

-gerrit

commit 2f688fa4877129651e4697da9a2e9c3923c1ceea
Author: Ronald G. Minnich <rminnich at gmail.com>
Date:   Sun Oct 9 11:07:21 2016 -0700

    RISCV: hacks for nexys4 and lowrisc.
    
    Still not quite right.
    
    Change-Id: Ieb56d964f2912c7a05c612611d259fd4e056a665
    Signed-off-by: Ronald G. Minnich <rminnich at gmail.com>
---
 src/arch/riscv/trap_handler.c   | 1 +
 src/arch/riscv/virtual_memory.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c
index 8120b66..c8d0d20 100644
--- a/src/arch/riscv/trap_handler.c
+++ b/src/arch/riscv/trap_handler.c
@@ -163,6 +163,7 @@ void trap_handler(trapframe *tf) {
 			break;
 	}
 
+	//print_page_table();
 	die("Can't recover from trap. Halting.\n");
 }
 
diff --git a/src/arch/riscv/virtual_memory.c b/src/arch/riscv/virtual_memory.c
index 7fb1a8e..97e6cca 100644
--- a/src/arch/riscv/virtual_memory.c
+++ b/src/arch/riscv/virtual_memory.c
@@ -94,7 +94,7 @@ static void print_page_table_at(pte_t *pt, intptr_t virt_addr, int level)
 
 /* Print the page table structures to the console */
 void print_page_table(void) {
-	print_page_table_at(root_page_table, 0, 0);
+	print_page_table_at((void *)(read_csr(sptbr)<<12), 0, 0);
 }
 
 void flush_tlb(void)
@@ -121,7 +121,7 @@ pte_t pte_create(uintptr_t ppn, int prot, int user)
 		pte |= PTE_X;
 	if (user)
 		pte |= PTE_U;
-	return pte;
+	return pte | 0x1f;
 }
 
 void init_vm(uintptr_t virtMemStart, uintptr_t physMemStart, uintptr_t pageTableStart) {



More information about the coreboot-gerrit mailing list