summaryrefslogtreecommitdiff
path: root/arch/riscv
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/cpu/ax25/cache.c1
-rw-r--r--arch/riscv/cpu/cpu.c2
-rw-r--r--arch/riscv/cpu/generic/cpu.c1
-rw-r--r--arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi11
-rw-r--r--arch/riscv/include/asm/encoding.h3
-rw-r--r--arch/riscv/include/asm/sbi.h5
-rw-r--r--arch/riscv/lib/boot.c2
-rw-r--r--arch/riscv/lib/bootm.c6
-rw-r--r--arch/riscv/lib/fdt_fixup.c1
-rw-r--r--arch/riscv/lib/image.c1
-rw-r--r--arch/riscv/lib/reset.c2
-rw-r--r--arch/riscv/lib/sbi.c37
-rw-r--r--arch/riscv/lib/spl.c2
13 files changed, 48 insertions, 26 deletions
diff --git a/arch/riscv/cpu/ax25/cache.c b/arch/riscv/cpu/ax25/cache.c
index 9df629d23c..35f23c748d 100644
--- a/arch/riscv/cpu/ax25/cache.c
+++ b/arch/riscv/cpu/ax25/cache.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <cpu_func.h>
#include <dm.h>
+#include <asm/cache.h>
#include <dm/uclass-internal.h>
#include <cache.h>
#include <asm/csr.h>
diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c
index e457f6acbf..5804aa8e73 100644
--- a/arch/riscv/cpu/cpu.c
+++ b/arch/riscv/cpu/cpu.c
@@ -6,9 +6,11 @@
#include <common.h>
#include <cpu.h>
#include <dm.h>
+#include <init.h>
#include <log.h>
#include <asm/encoding.h>
#include <dm/uclass-internal.h>
+#include <linux/bitops.h>
/*
* The variables here must be stored in the data section since they are used
diff --git a/arch/riscv/cpu/generic/cpu.c b/arch/riscv/cpu/generic/cpu.c
index 13a69ef0cc..d78e1a3453 100644
--- a/arch/riscv/cpu/generic/cpu.c
+++ b/arch/riscv/cpu/generic/cpu.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <irq_func.h>
+#include <asm/cache.h>
/*
* cleanup_before_linux() is called just before we call linux
diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
new file mode 100644
index 0000000000..2aebfab646
--- /dev/null
+++ b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com>
+ */
+
+/ {
+ aliases {
+ spi0 = &qspi0;
+ spi2 = &qspi2;
+ };
+};
diff --git a/arch/riscv/include/asm/encoding.h b/arch/riscv/include/asm/encoding.h
index a0695da936..edafad36b3 100644
--- a/arch/riscv/include/asm/encoding.h
+++ b/arch/riscv/include/asm/encoding.h
@@ -8,6 +8,9 @@
#define RISCV_CSR_ENCODING_H
#include <asm/csr.h>
+#ifndef __ASSEMBLY__
+#include <linux/bitops.h>
+#endif
#if CONFIG_IS_ENABLED(RISCV_SMODE)
#define MODE_PREFIX(__suffix) s##__suffix
diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h
index 3595ee8bf7..453cb5cec5 100644
--- a/arch/riscv/include/asm/sbi.h
+++ b/arch/riscv/include/asm/sbi.h
@@ -106,8 +106,6 @@ void sbi_console_putchar(int ch);
int sbi_console_getchar(void);
void sbi_clear_ipi(void);
void sbi_shutdown(void);
-#endif
-void sbi_set_timer(uint64_t stime_value);
void sbi_send_ipi(const unsigned long *hart_mask);
void sbi_remote_fence_i(const unsigned long *hart_mask);
void sbi_remote_sfence_vma(const unsigned long *hart_mask,
@@ -117,7 +115,8 @@ void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
unsigned long start,
unsigned long size,
unsigned long asid);
-
+#endif
+void sbi_set_timer(uint64_t stime_value);
int sbi_probe_extension(int ext);
#endif
diff --git a/arch/riscv/lib/boot.c b/arch/riscv/lib/boot.c
index 42b15a13a2..778d011f7c 100644
--- a/arch/riscv/lib/boot.c
+++ b/arch/riscv/lib/boot.c
@@ -8,7 +8,7 @@
#include <command.h>
unsigned long do_go_exec(ulong (*entry)(int, char * const []),
- int argc, char * const argv[])
+ int argc, char *const argv[])
{
cleanup_before_linux();
diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index 0d06095da1..c4137ded83 100644
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -7,10 +7,12 @@
*/
#include <common.h>
+#include <bootstage.h>
#include <command.h>
#include <dm.h>
#include <fdt_support.h>
#include <hang.h>
+#include <log.h>
#include <dm/root.h>
#include <image.h>
#include <asm/byteorder.h>
@@ -105,7 +107,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
}
}
-int do_bootm_linux(int flag, int argc, char * const argv[],
+int do_bootm_linux(int flag, int argc, char *const argv[],
bootm_headers_t *images)
{
/* No need for those on RISC-V */
@@ -127,7 +129,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
return 0;
}
-int do_bootm_vxworks(int flag, int argc, char * const argv[],
+int do_bootm_vxworks(int flag, int argc, char *const argv[],
bootm_headers_t *images)
{
return do_bootm_linux(flag, argc, argv, images);
diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
index 20e0759f13..6db48ad04a 100644
--- a/arch/riscv/lib/fdt_fixup.c
+++ b/arch/riscv/lib/fdt_fixup.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <fdt_support.h>
+#include <log.h>
#include <mapmem.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/riscv/lib/image.c b/arch/riscv/lib/image.c
index 7357d3b07d..91b7f1624e 100644
--- a/arch/riscv/lib/image.c
+++ b/arch/riscv/lib/image.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <image.h>
#include <mapmem.h>
#include <errno.h>
#include <linux/sizes.h>
diff --git a/arch/riscv/lib/reset.c b/arch/riscv/lib/reset.c
index ce3c1cf872..8779c619cc 100644
--- a/arch/riscv/lib/reset.c
+++ b/arch/riscv/lib/reset.c
@@ -7,7 +7,7 @@
#include <command.h>
#include <hang.h>
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
printf("resetting ...\n");
diff --git a/arch/riscv/lib/sbi.c b/arch/riscv/lib/sbi.c
index 7bdf071dbb..993597e33d 100644
--- a/arch/riscv/lib/sbi.c
+++ b/arch/riscv/lib/sbi.c
@@ -39,6 +39,23 @@ struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0,
return ret;
}
+/**
+ * sbi_set_timer() - Program the timer for next timer event.
+ * @stime_value: The value after which next timer event should fire.
+ *
+ * Return: None
+ */
+void sbi_set_timer(uint64_t stime_value)
+{
+#if __riscv_xlen == 32
+ sbi_ecall(SBI_EXT_SET_TIMER, SBI_FID_SET_TIMER, stime_value,
+ stime_value >> 32, 0, 0, 0, 0);
+#else
+ sbi_ecall(SBI_EXT_SET_TIMER, SBI_FID_SET_TIMER, stime_value,
+ 0, 0, 0, 0, 0);
+#endif
+}
+
#ifdef CONFIG_SBI_V01
/**
@@ -86,25 +103,6 @@ void sbi_shutdown(void)
sbi_ecall(SBI_EXT_0_1_SHUTDOWN, 0, 0, 0, 0, 0, 0, 0);
}
-#endif /* CONFIG_SBI_V01 */
-
-/**
- * sbi_set_timer() - Program the timer for next timer event.
- * @stime_value: The value after which next timer event should fire.
- *
- * Return: None
- */
-void sbi_set_timer(uint64_t stime_value)
-{
-#if __riscv_xlen == 32
- sbi_ecall(SBI_EXT_SET_TIMER, SBI_FID_SET_TIMER, stime_value,
- stime_value >> 32, 0, 0, 0, 0);
-#else
- sbi_ecall(SBI_EXT_SET_TIMER, SBI_FID_SET_TIMER, stime_value,
- 0, 0, 0, 0, 0);
-#endif
-}
-
/**
* sbi_send_ipi() - Send an IPI to any hart.
* @hart_mask: A cpu mask containing all the target harts.
@@ -185,3 +183,4 @@ int sbi_probe_extension(int extid)
return -ENOTSUPP;
}
+#endif /* CONFIG_SBI_V01 */
diff --git a/arch/riscv/lib/spl.c b/arch/riscv/lib/spl.c
index 4ca038b148..c47dcd46ce 100644
--- a/arch/riscv/lib/spl.c
+++ b/arch/riscv/lib/spl.c
@@ -6,6 +6,8 @@
#include <common.h>
#include <cpu_func.h>
#include <hang.h>
+#include <init.h>
+#include <log.h>
#include <spl.h>
#include <asm/smp.h>