[coreboot-gerrit] Change in coreboot[master]: riscv: update mtime initialize

Xiang Wang (Code Review) gerrit at coreboot.org
Tue Aug 28 10:41:11 CEST 2018


Xiang Wang has uploaded this change for review. ( https://review.coreboot.org/28372


Change subject: riscv: update mtime initialize
......................................................................

riscv: update mtime initialize

Add a interface, which is implemented by SoC.

Change-Id: I5524732f6eb3841e43afd176644119b03b5e5e27
Signed-off-by: Xiang Wang <wxjstz at 126.com>
---
M src/arch/riscv/mcall.c
M src/soc/sifive/fu540/Makefile.inc
2 files changed, 10 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/28372/1

diff --git a/src/arch/riscv/mcall.c b/src/arch/riscv/mcall.c
index 2e44fb7..58d0d90 100644
--- a/src/arch/riscv/mcall.c
+++ b/src/arch/riscv/mcall.c
@@ -31,18 +31,24 @@
 #include <mcall.h>
 #include <string.h>
 #include <vm.h>
+#include <compiler.h>
 
 int mcalldebug; // set this interactively for copious debug.
 
+// this function is implemented by a specific SoC.
+// Used to init HLS()->time / HLS()->timecmp
+void mtime_init(void);
+
+//FIXME: removed when implemented by all specific platform
+__weak void mtime_init(void) { }
+
 void hls_init(uint32_t hart_id)
 {
 	printk(BIOS_SPEW, "hart %d: HLS is %p\n", hart_id, HLS());
 	memset(HLS(), 0, sizeof(*HLS()));
 	HLS()->hart_id = hart_id;
 
-	/* Initialize these pointers with dummy values, for now */
-	HLS()->time = NULL;
-	HLS()->timecmp = NULL;
+	mtime_init();
 
 	printk(BIOS_SPEW, "Time is %p and timecmp is %p\n",
 	       HLS()->time, HLS()->timecmp);
diff --git a/src/soc/sifive/fu540/Makefile.inc b/src/soc/sifive/fu540/Makefile.inc
index 9e7f584..e46294d 100644
--- a/src/soc/sifive/fu540/Makefile.inc
+++ b/src/soc/sifive/fu540/Makefile.inc
@@ -16,6 +16,7 @@
 bootblock-y += uart.c
 bootblock-y += media.c
 bootblock-y += bootblock.c
+bootblock-y += clint.c
 
 romstage-y += uart.c
 romstage-y += media.c

-- 
To view, visit https://review.coreboot.org/28372
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5524732f6eb3841e43afd176644119b03b5e5e27
Gerrit-Change-Number: 28372
Gerrit-PatchSet: 1
Gerrit-Owner: Xiang Wang <wxjstz at 126.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180828/f60e602a/attachment.html>


More information about the coreboot-gerrit mailing list