summaryrefslogtreecommitdiff
path: root/src/arch/riscv/virtual_memory.c
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>2016-08-22 19:37:16 +0200
committerRonald G. Minnich <rminnich@gmail.com>2016-08-23 23:47:01 +0200
commit857e33e27f1feeec328ae8be5ad61ee51b75e4ec (patch)
treedd743b4fda0ac4c6f485e56a982fbc50932a4e42 /src/arch/riscv/virtual_memory.c
parent3965a522c23ea50b1a861b89a8215a524caa35f7 (diff)
downloadcoreboot-857e33e27f1feeec328ae8be5ad61ee51b75e4ec.tar.xz
arch/riscv: Implement the SBI again
Not all SBI calls are implemented, but it's enough to see a couple dozen lines of Linux boot output. It should also be noted that the SBI is still in flux: https://groups.google.com/a/groups.riscv.org/forum/#!topic/sw-dev/6oNhlW0OFKM Change-Id: I80e4fe508336d6428ca7136bc388fbc3cda4f1e4 Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Reviewed-on: https://review.coreboot.org/16119 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/arch/riscv/virtual_memory.c')
-rw-r--r--src/arch/riscv/virtual_memory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/riscv/virtual_memory.c b/src/arch/riscv/virtual_memory.c
index fab7d90d70..74b382527b 100644
--- a/src/arch/riscv/virtual_memory.c
+++ b/src/arch/riscv/virtual_memory.c
@@ -16,6 +16,7 @@
#include <arch/barrier.h>
#include <arch/encoding.h>
+#include <arch/sbi.h>
#include <atomic.h>
#include <console/console.h>
#include <stdint.h>
@@ -151,7 +152,7 @@ void init_vm(uintptr_t virtMemStart, uintptr_t physMemStart, uintptr_t pageTable
// map SBI at top of vaddr space
uintptr_t num_sbi_pages = 1; // only need to map a single page for sbi interface
- uintptr_t sbiStartAddress = 0x2000; // the start of the sbi mapping
+ uintptr_t sbiStartAddress = (uintptr_t) &sbi_page;
uintptr_t sbiAddr = sbiStartAddress;
for (uintptr_t i = 0; i < num_sbi_pages; i++) {
uintptr_t idx = (1 << RISCV_PGLEVEL_BITS) - num_sbi_pages + i;