aboutsummaryrefslogtreecommitdiffstats
path: root/roms/opensbi/include/sbi_utils/sys
diff options
context:
space:
mode:
Diffstat (limited to 'roms/opensbi/include/sbi_utils/sys')
-rw-r--r--roms/opensbi/include/sbi_utils/sys/clint.h51
-rw-r--r--roms/opensbi/include/sbi_utils/sys/htif.h21
-rw-r--r--roms/opensbi/include/sbi_utils/sys/sifive_test.h21
3 files changed, 93 insertions, 0 deletions
diff --git a/roms/opensbi/include/sbi_utils/sys/clint.h b/roms/opensbi/include/sbi_utils/sys/clint.h
new file mode 100644
index 000000000..b07cf62ef
--- /dev/null
+++ b/roms/opensbi/include/sbi_utils/sys/clint.h
@@ -0,0 +1,51 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2019 Western Digital Corporation or its affiliates.
+ *
+ * Authors:
+ * Anup Patel <anup.patel@wdc.com>
+ */
+
+#ifndef __SYS_CLINT_H__
+#define __SYS_CLINT_H__
+
+#include <sbi/sbi_types.h>
+
+struct clint_data {
+ /* Public details */
+ unsigned long addr;
+ u32 first_hartid;
+ u32 hart_count;
+ bool has_64bit_mmio;
+ /* Private details (initialized and used by CLINT library)*/
+ u32 *ipi;
+ struct clint_data *time_delta_reference;
+ unsigned long time_delta_computed;
+ u64 time_delta;
+ u64 *time_val;
+ u64 *time_cmp;
+ u64 (*time_rd)(volatile u64 *addr);
+ void (*time_wr)(u64 value, volatile u64 *addr);
+};
+
+void clint_ipi_send(u32 target_hart);
+
+void clint_ipi_clear(u32 target_hart);
+
+int clint_warm_ipi_init(void);
+
+int clint_cold_ipi_init(struct clint_data *clint);
+
+u64 clint_timer_value(void);
+
+void clint_timer_event_stop(void);
+
+void clint_timer_event_start(u64 next_event);
+
+int clint_warm_timer_init(void);
+
+int clint_cold_timer_init(struct clint_data *clint,
+ struct clint_data *reference);
+
+#endif
diff --git a/roms/opensbi/include/sbi_utils/sys/htif.h b/roms/opensbi/include/sbi_utils/sys/htif.h
new file mode 100644
index 000000000..a43172348
--- /dev/null
+++ b/roms/opensbi/include/sbi_utils/sys/htif.h
@@ -0,0 +1,21 @@
+/*
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 2010-2020, The Regents of the University of California
+ * (Regents). All Rights Reserved.
+ */
+
+#ifndef __SYS_HTIF_H__
+#define __SYS_HTIF_H__
+
+#include <sbi/sbi_types.h>
+
+void htif_putc(char ch);
+
+int htif_getc(void);
+
+int htif_system_reset_check(u32 type, u32 reason);
+
+void htif_system_reset(u32 type, u32 reason);
+
+#endif
diff --git a/roms/opensbi/include/sbi_utils/sys/sifive_test.h b/roms/opensbi/include/sbi_utils/sys/sifive_test.h
new file mode 100644
index 000000000..958622e6a
--- /dev/null
+++ b/roms/opensbi/include/sbi_utils/sys/sifive_test.h
@@ -0,0 +1,21 @@
+/*
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 2020 Western Digital Corporation or its affiliates.
+ *
+ * Authors:
+ * Anup Patel <anup.patel@wdc.com>
+ */
+
+#ifndef __SYS_SIFIVE_TEST_H__
+#define __SYS_SIFIVE_TEST_H__
+
+#include <sbi/sbi_types.h>
+
+int sifive_test_system_reset_check(u32 type, u32 reason);
+
+void sifive_test_system_reset(u32 type, u32 reason);
+
+int sifive_test_init(unsigned long base);
+
+#endif