summaryrefslogtreecommitdiff
path: root/src/mainboard/emulation/spike-riscv
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/mainboard/emulation/spike-riscv
parent3965a522c23ea50b1a861b89a8215a524caa35f7 (diff)
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/mainboard/emulation/spike-riscv')
-rw-r--r--src/mainboard/emulation/spike-riscv/spike_util.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/mainboard/emulation/spike-riscv/spike_util.c b/src/mainboard/emulation/spike-riscv/spike_util.c
index f0f5301814..7ddf16ba2c 100644
--- a/src/mainboard/emulation/spike-riscv/spike_util.c
+++ b/src/mainboard/emulation/spike-riscv/spike_util.c
@@ -25,12 +25,13 @@
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
-#include <spike_util.h>
#include <arch/barrier.h>
#include <arch/errno.h>
#include <atomic.h>
-#include <string.h>
#include <console/console.h>
+#include <spike_util.h>
+#include <string.h>
+#include <vm.h>
uintptr_t translate_address(uintptr_t vAddr) {
// TODO: implement the page table translation algorithm
@@ -41,13 +42,13 @@ uintptr_t translate_address(uintptr_t vAddr) {
return translationResult;
}
-uintptr_t mcall_query_memory(uintptr_t id, memory_block_info *p)
+uintptr_t mcall_query_memory(uintptr_t id, memory_block_info *info)
{
- uintptr_t physicalAddr = translate_address((uintptr_t) p);
- memory_block_info *info = (memory_block_info*) physicalAddr;
if (id == 0) {
- info->base = 0x1000000; // hard coded for now, but we can put these values somewhere later
- info->size = 0x7F000000 - info->base;
+ mprv_write_ulong(&info->base, 2U*GiB);
+
+ /* TODO: Return the correct value */
+ mprv_write_ulong(&info->size, 1*GiB);
return 0;
}
@@ -79,7 +80,7 @@ uintptr_t mcall_shutdown(void)
uintptr_t mcall_set_timer(unsigned long long when)
{
- die("mcall_set_timer is currently not implemented");
+ printk(BIOS_DEBUG, "mcall_set_timer is currently not implemented, ignoring\n");
return 0;
}
@@ -95,11 +96,6 @@ uintptr_t mcall_dev_resp(void)
return 0;
}
-uintptr_t mcall_hart_id(void)
-{
- return HLS()->hart_id;
-}
-
void hls_init(uint32_t hart_id)
{
memset(HLS(), 0, sizeof(*HLS()));