summaryrefslogtreecommitdiff
path: root/platform/generic/sifive_fu740.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform/generic/sifive_fu740.c')
-rw-r--r--platform/generic/sifive_fu740.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/platform/generic/sifive_fu740.c b/platform/generic/sifive_fu740.c
new file mode 100644
index 0000000..c8325d3
--- /dev/null
+++ b/platform/generic/sifive_fu740.c
@@ -0,0 +1,36 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2021 SiFive
+ *
+ * Authors:
+ * David Abdurachmanov <david.abdurachmanov@sifive.com>
+ */
+
+#include <platform_override.h>
+#include <sbi_utils/fdt/fdt_helper.h>
+#include <sbi_utils/fdt/fdt_fixup.h>
+
+static u64 sifive_fu740_tlbr_flush_limit(const struct fdt_match *match)
+{
+ /*
+ * Needed to address CIP-1200 errata on SiFive FU740
+ * Title: Instruction TLB can fail to respect a non-global SFENCE
+ * Workaround: Flush the TLB using SFENCE.VMA x0, x0
+ * See Errata_FU740-C000_20210205 from
+ * https://www.sifive.com/boards/hifive-unmatched
+ */
+ return 0;
+}
+
+static const struct fdt_match sifive_fu740_match[] = {
+ { .compatible = "sifive,fu740" },
+ { .compatible = "sifive,fu740-c000" },
+ { .compatible = "sifive,hifive-unmatched-a00" },
+ { },
+};
+
+const struct platform_override sifive_fu740 = {
+ .match_table = sifive_fu740_match,
+ .tlbr_flush_limit = sifive_fu740_tlbr_flush_limit,
+};