<p>Xiang Wang has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/28372">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">riscv: update mtime initialize<br><br>Add a interface, which is implemented by SoC.<br><br>Change-Id: I5524732f6eb3841e43afd176644119b03b5e5e27<br>Signed-off-by: Xiang Wang <wxjstz@126.com><br>---<br>M src/arch/riscv/mcall.c<br>M src/soc/sifive/fu540/Makefile.inc<br>2 files changed, 10 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/28372/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/arch/riscv/mcall.c b/src/arch/riscv/mcall.c</span><br><span>index 2e44fb7..58d0d90 100644</span><br><span>--- a/src/arch/riscv/mcall.c</span><br><span>+++ b/src/arch/riscv/mcall.c</span><br><span>@@ -31,18 +31,24 @@</span><br><span> #include <mcall.h></span><br><span> #include <string.h></span><br><span> #include <vm.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <compiler.h></span><br><span> </span><br><span> int mcalldebug; // set this interactively for copious debug.</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+// this function is implemented by a specific SoC.</span><br><span style="color: hsl(120, 100%, 40%);">+// Used to init HLS()->time / HLS()->timecmp</span><br><span style="color: hsl(120, 100%, 40%);">+void mtime_init(void);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+//FIXME: removed when implemented by all specific platform</span><br><span style="color: hsl(120, 100%, 40%);">+__weak void mtime_init(void) { }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> void hls_init(uint32_t hart_id)</span><br><span> {</span><br><span>      printk(BIOS_SPEW, "hart %d: HLS is %p\n", hart_id, HLS());</span><br><span>         memset(HLS(), 0, sizeof(*HLS()));</span><br><span>    HLS()->hart_id = hart_id;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-        /* Initialize these pointers with dummy values, for now */</span><br><span style="color: hsl(0, 100%, 40%);">-      HLS()->time = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-  HLS()->timecmp = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+     mtime_init();</span><br><span> </span><br><span>    printk(BIOS_SPEW, "Time is %p and timecmp is %p\n",</span><br><span>               HLS()->time, HLS()->timecmp);</span><br><span>diff --git a/src/soc/sifive/fu540/Makefile.inc b/src/soc/sifive/fu540/Makefile.inc</span><br><span>index 9e7f584..e46294d 100644</span><br><span>--- a/src/soc/sifive/fu540/Makefile.inc</span><br><span>+++ b/src/soc/sifive/fu540/Makefile.inc</span><br><span>@@ -16,6 +16,7 @@</span><br><span> bootblock-y += uart.c</span><br><span> bootblock-y += media.c</span><br><span> bootblock-y += bootblock.c</span><br><span style="color: hsl(120, 100%, 40%);">+bootblock-y += clint.c</span><br><span> </span><br><span> romstage-y += uart.c</span><br><span> romstage-y += media.c</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/28372">change 28372</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/28372"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I5524732f6eb3841e43afd176644119b03b5e5e27 </div>
<div style="display:none"> Gerrit-Change-Number: 28372 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Xiang Wang <wxjstz@126.com> </div>