summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/sifive/fu540/Kconfig8
-rw-r--r--src/soc/sifive/fu540/Makefile.inc1
-rw-r--r--src/soc/sifive/fu540/clint.c5
-rw-r--r--src/soc/ucb/riscv/Kconfig4
-rw-r--r--src/soc/ucb/riscv/Makefile.inc5
-rw-r--r--src/soc/ucb/riscv/ipi.c (renamed from src/soc/sifive/fu540/include/soc/clint.h)13
6 files changed, 25 insertions, 11 deletions
diff --git a/src/soc/sifive/fu540/Kconfig b/src/soc/sifive/fu540/Kconfig
index bee8292199..72305d67a9 100644
--- a/src/soc/sifive/fu540/Kconfig
+++ b/src/soc/sifive/fu540/Kconfig
@@ -39,4 +39,12 @@ config RISCV_CODEMODEL
string
default "medany"
+config RISCV_HART_NUM
+ int
+ default 5
+
+config RISCV_WORKING_HARTID
+ int
+ default 0
+
endif
diff --git a/src/soc/sifive/fu540/Makefile.inc b/src/soc/sifive/fu540/Makefile.inc
index e2bdd03a00..fef859d9e4 100644
--- a/src/soc/sifive/fu540/Makefile.inc
+++ b/src/soc/sifive/fu540/Makefile.inc
@@ -19,6 +19,7 @@ bootblock-y += media.c
bootblock-y += bootblock.c
romstage-y += uart.c
+romstage-y += clint.c
romstage-y += media.c
romstage-y += sdram.c
romstage-y += cbmem.c
diff --git a/src/soc/sifive/fu540/clint.c b/src/soc/sifive/fu540/clint.c
index 00aec1ab37..fb4b97fbb3 100644
--- a/src/soc/sifive/fu540/clint.c
+++ b/src/soc/sifive/fu540/clint.c
@@ -14,9 +14,9 @@
*/
#include <mcall.h>
+#include <stdint.h>
#include <arch/io.h>
#include <soc/addressmap.h>
-#include <soc/clint.h>
void mtime_init(void)
{
@@ -27,6 +27,5 @@ void mtime_init(void)
void set_msip(int hartid, int val)
{
- long hart_id = read_csr(mhartid);
- write32((void *)(FU540_CLINT + 4 * hart_id), !!val);
+ write32((void *)(FU540_CLINT + 4 * (uintptr_t)hartid), !!val);
}
diff --git a/src/soc/ucb/riscv/Kconfig b/src/soc/ucb/riscv/Kconfig
index 26adb56bfe..99b049068e 100644
--- a/src/soc/ucb/riscv/Kconfig
+++ b/src/soc/ucb/riscv/Kconfig
@@ -25,4 +25,8 @@ config RISCV_CODEMODEL
string
default "medany"
+config RISCV_WORKING_HARTID
+ int
+ default 0
+
endif
diff --git a/src/soc/ucb/riscv/Makefile.inc b/src/soc/ucb/riscv/Makefile.inc
index a10f3aae4c..c96e3637b7 100644
--- a/src/soc/ucb/riscv/Makefile.inc
+++ b/src/soc/ucb/riscv/Makefile.inc
@@ -1,8 +1,13 @@
ifeq ($(CONFIG_SOC_UCB_RISCV),y)
bootblock-y += mtime.c
+bootblock-y += ipi.c
+
romstage-y += cbmem.c
+romstage-y += ipi.c
+
ramstage-y += cbmem.c
ramstage-y += mtime.c
+ramstage-y += ipi.c
endif
diff --git a/src/soc/sifive/fu540/include/soc/clint.h b/src/soc/ucb/riscv/ipi.c
index d2399c220a..80307a8d2a 100644
--- a/src/soc/sifive/fu540/include/soc/clint.h
+++ b/src/soc/ucb/riscv/ipi.c
@@ -13,12 +13,9 @@
* GNU General Public License for more details.
*/
-#ifndef __SOC_SIFIVE_FU540_CLINT_H
-#define __SOC_SIFIVE_FU540_CLINT_H
+#include <mcall.h>
-/* This function is used to set MSIP.
- * It can be used to send an IPI (inter-processor interrupt) to
- * another hart*/
-void set_msip(int hartid, int val);
-
-#endif
+/* TODO: Please implement this function */
+void set_msip(int hartid, int val)
+{
+}