From c90f1d7be0bb41e1e74b5a6f7c4ceb4a2fceada8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Tue, 26 Sep 2017 01:44:45 +0200 Subject: arch/riscv: gettimer: Don't use the config string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/21687 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/arch/riscv/trap_handler.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/arch/riscv') diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c index 4359ed9974..842e3eab3b 100644 --- a/src/arch/riscv/trap_handler.c +++ b/src/arch/riscv/trap_handler.c @@ -125,17 +125,19 @@ static void print_trap_information(const trapframe *tf) 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; + + time = (void *)(clint + 0xbff8); + timecmp = (void *)(clint + 0x4000); - config = configstring(); - query_rtc(config, (uintptr_t *)&time); 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) -- cgit v1.2.3