summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/riscv/include/mcall.h3
-rw-r--r--src/arch/riscv/mcall.c4
-rw-r--r--src/soc/lowrisc/lowrisc/Makefile.inc1
-rw-r--r--src/soc/lowrisc/lowrisc/mtime.c22
-rw-r--r--src/soc/sifive/fu540/Makefile.inc1
-rw-r--r--src/soc/sifive/fu540/mtime.c22
-rw-r--r--src/soc/ucb/riscv/Makefile.inc1
-rw-r--r--src/soc/ucb/riscv/mtime.c22
8 files changed, 73 insertions, 3 deletions
diff --git a/src/arch/riscv/include/mcall.h b/src/arch/riscv/include/mcall.h
index 114808aae7..d1e414a42f 100644
--- a/src/arch/riscv/include/mcall.h
+++ b/src/arch/riscv/include/mcall.h
@@ -61,6 +61,9 @@ typedef struct {
void hls_init(uint32_t hart_id); // need to call this before launching linux
+/* This function is used to initialize HLS()->time/HLS()->timecmp */
+void mtime_init(void);
+
#endif // __ASSEMBLER__
#endif
diff --git a/src/arch/riscv/mcall.c b/src/arch/riscv/mcall.c
index 2e44fb76fe..47cdd88d4d 100644
--- a/src/arch/riscv/mcall.c
+++ b/src/arch/riscv/mcall.c
@@ -40,9 +40,7 @@ void hls_init(uint32_t hart_id)
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/lowrisc/lowrisc/Makefile.inc b/src/soc/lowrisc/lowrisc/Makefile.inc
index 343c909377..9fc52da776 100644
--- a/src/soc/lowrisc/lowrisc/Makefile.inc
+++ b/src/soc/lowrisc/lowrisc/Makefile.inc
@@ -1,5 +1,6 @@
ifeq ($(CONFIG_SOC_LOWRISC_LOWRISC),y)
+bootblock-y += mtime.c
romstage-y += cbmem.c
ramstage-y += cbmem.c
diff --git a/src/soc/lowrisc/lowrisc/mtime.c b/src/soc/lowrisc/lowrisc/mtime.c
new file mode 100644
index 0000000000..f8c2717563
--- /dev/null
+++ b/src/soc/lowrisc/lowrisc/mtime.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 HardenedLinux
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <mcall.h>
+
+/* FIXME: This is an empty implementation, please improve */
+/* This function is used to initialize HLS()->time/HLS()->timecmp */
+void mtime_init(void)
+{
+}
diff --git a/src/soc/sifive/fu540/Makefile.inc b/src/soc/sifive/fu540/Makefile.inc
index 9e7f584f78..abd3458b28 100644
--- a/src/soc/sifive/fu540/Makefile.inc
+++ b/src/soc/sifive/fu540/Makefile.inc
@@ -14,6 +14,7 @@
ifeq ($(CONFIG_SOC_SIFIVE_FU540),y)
bootblock-y += uart.c
+bootblock-y += mtime.c
bootblock-y += media.c
bootblock-y += bootblock.c
diff --git a/src/soc/sifive/fu540/mtime.c b/src/soc/sifive/fu540/mtime.c
new file mode 100644
index 0000000000..f8c2717563
--- /dev/null
+++ b/src/soc/sifive/fu540/mtime.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 HardenedLinux
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <mcall.h>
+
+/* FIXME: This is an empty implementation, please improve */
+/* This function is used to initialize HLS()->time/HLS()->timecmp */
+void mtime_init(void)
+{
+}
diff --git a/src/soc/ucb/riscv/Makefile.inc b/src/soc/ucb/riscv/Makefile.inc
index 1072a2b32e..16225c0968 100644
--- a/src/soc/ucb/riscv/Makefile.inc
+++ b/src/soc/ucb/riscv/Makefile.inc
@@ -1,5 +1,6 @@
ifeq ($(CONFIG_SOC_UCB_RISCV),y)
+bootblock-y += mtime.c
romstage-y += cbmem.c
ramstage-y += cbmem.c
diff --git a/src/soc/ucb/riscv/mtime.c b/src/soc/ucb/riscv/mtime.c
new file mode 100644
index 0000000000..f8c2717563
--- /dev/null
+++ b/src/soc/ucb/riscv/mtime.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 HardenedLinux
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <mcall.h>
+
+/* FIXME: This is an empty implementation, please improve */
+/* This function is used to initialize HLS()->time/HLS()->timecmp */
+void mtime_init(void)
+{
+}