Jonathan Neuschäfer has uploaded this change for review. ( https://review.coreboot.org/21687
Change subject: arch/riscv: gettimer: Don't use the config string ......................................................................
arch/riscv: gettimer: Don't use the config string
Accessing the config string doesn't work anymore on current versions of spike. Thus return dummy pointers until we have a better solution.
Change-Id: I684fc51dc0916f2235e57e36b913d363e1cb02b1 Signed-off-by: Jonathan Neuschäfer j.neuschaefer@gmx.net --- M src/arch/riscv/trap_handler.c 1 file changed, 9 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/21687/1
diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c index ca4954f..54cd7e7 100644 --- a/src/arch/riscv/trap_handler.c +++ b/src/arch/riscv/trap_handler.c @@ -125,17 +125,19 @@
static void gettimer(void) { - query_result res; - const char *config; + /* + * FIXME: This hard-coded value (currently) works on spike, but we + * should really read it from the device tree. + */ + uintptr_t clint = 0x02000000;
- config = configstring(); - query_rtc(config, (uintptr_t *)&time); + time = (void *)(clint + 0xbff8); + timecmp = (void *)(clint + 0x4000); + if (!time) die("Got timer interrupt but found no timer."); - res = query_config_string(config, "core{0{0{timecmp"); - timecmp = (void *)get_uint(res); if (!timecmp) - die("Got a timer interrupt but found no timecmp."); + die("Got timer interrupt but found no timecmp."); }
static void interrupt_handler(trapframe *tf)