[coreboot-gerrit] Change in coreboot[master]: arch/riscv: gettimer: Don't use the config string

Jonathan Neuschäfer (Code Review) gerrit at coreboot.org
Tue Sep 26 02:20:34 CEST 2017


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 at 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)

-- 
To view, visit https://review.coreboot.org/21687
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I684fc51dc0916f2235e57e36b913d363e1cb02b1
Gerrit-Change-Number: 21687
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170926/7fe6c3af/attachment-0001.html>


More information about the coreboot-gerrit mailing list