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@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