Browse Source

add starfive_vic7100 support in generic

Tekkaman Ninja 3 years ago
parent
commit
fb50238d6e
3 changed files with 41 additions and 0 deletions
  1. 1 0
      platform/generic/objects.mk
  2. 2 0
      platform/generic/platform.c
  3. 38 0
      platform/generic/starfive_vic7100.c

+ 1 - 0
platform/generic/objects.mk

@@ -8,4 +8,5 @@
 #
 
 platform-objs-y += platform.o
+platform-objs-y += starfive_vic7100.o
 platform-objs-y += sifive_fu540.o

+ 2 - 0
platform/generic/platform.c

@@ -23,9 +23,11 @@
 #include <sbi_utils/reset/fdt_reset.h>
 
 extern const struct platform_override sifive_fu540;
+extern const struct platform_override starfive_vic7100;
 
 static const struct platform_override *special_platforms[] = {
 	&sifive_fu540,
+	&starfive_vic7100,
 };
 
 static const struct platform_override *generic_plat = NULL;

+ 38 - 0
platform/generic/starfive_vic7100.c

@@ -0,0 +1,38 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2020 Western Digital Corporation or its affiliates.
+ *
+ * Authors:
+ *   Anup Patel <anup.patel@wdc.com>
+ */
+
+#include <sbi/sbi_domain.h>
+#include <sbi/sbi_math.h>
+#include <platform_override.h>
+#include <sbi_utils/fdt/fdt_helper.h>
+#include <sbi_utils/fdt/fdt_fixup.h>
+
+static u64 starfive_vic7100_tlbr_flush_limit(const struct fdt_match *match)
+{
+	return 0;
+}
+
+static int starfive_vic7100_fdt_fixup(void *fdt, const struct fdt_match *match)
+{
+	fdt_reserved_memory_nomap_fixup(fdt);
+
+	return 0;
+}
+
+static const struct fdt_match starfive_vic7100_match[] = {
+	{ .compatible = "starfive,fu74-g000" },
+	{ .compatible = "sifive,freedom-u74-arty" },
+	{ },
+};
+
+const struct platform_override starfive_vic7100 = {
+	.match_table = starfive_vic7100_match,
+	.tlbr_flush_limit = starfive_vic7100_tlbr_flush_limit,
+	.fdt_fixup = starfive_vic7100_fdt_fixup,
+};