]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
xen: add a separate platform file for Versal
authorStefano Stabellini <sstabellini@xilinx.com>
Mon, 15 Jul 2019 19:39:59 +0000 (12:39 -0700)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 4 Dec 2019 23:58:10 +0000 (15:58 -0800)
Let all the EEMI calls to go through for Dom0. Block access for domUs.

Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
xen/arch/arm/platforms/Makefile
xen/arch/arm/platforms/xilinx-versal.c [new file with mode: 0644]

index 8632f4115fbb124635dcaad2c11c53e782ab0ee4..0aeb8d17b461c8514640c110db4acaf43899fd10 100644 (file)
@@ -9,5 +9,6 @@ obj-$(CONFIG_ALL_PLAT)   += sunxi.o
 obj-$(CONFIG_ALL64_PLAT) += thunderx.o
 obj-$(CONFIG_ALL64_PLAT) += xgene-storm.o
 obj-$(CONFIG_ALL64_PLAT) += brcm-raspberry-pi.o
+obj-$(CONFIG_ALL64_PLAT) += xilinx-versal.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp.o
 obj-$(CONFIG_MPSOC_PLATFORM)  += xilinx-zynqmp-eemi.o
diff --git a/xen/arch/arm/platforms/xilinx-versal.c b/xen/arch/arm/platforms/xilinx-versal.c
new file mode 100644 (file)
index 0000000..aae3253
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * xen/arch/arm/platforms/xilinx-versal.c
+ *
+ * Xilinx Versal setup
+ *
+ * Copyright (c) 2019 Xilinx Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include <asm/platform.h>
+#include <asm/platforms/xilinx-zynqmp-eemi.h>
+
+static const char * const versal_dt_compat[] __initconst =
+{
+    "xlnx,versal",
+    NULL
+};
+
+static bool versal_smc(struct cpu_user_regs *regs)
+{
+    struct arm_smccc_res res;
+
+    if ( !cpus_have_const_cap(ARM_SMCCC_1_1) )
+    {
+        printk_once(XENLOG_WARNING
+                    "ZynqMP firmware Error: no SMCCC 1.1 support. Disabling firmware calls\n");
+
+        return false;
+    }
+
+    if ( !is_hardware_domain(current->domain) )
+        return false;
+
+    arm_smccc_1_1_smc(get_user_reg(regs, 0),
+                      get_user_reg(regs, 1),
+                      get_user_reg(regs, 2),
+                      get_user_reg(regs, 3),
+                      get_user_reg(regs, 4),
+                      get_user_reg(regs, 5),
+                      get_user_reg(regs, 6),
+                      get_user_reg(regs, 7),
+                      &res);
+
+    set_user_reg(regs, 0, res.a0);
+    set_user_reg(regs, 1, res.a1);
+    set_user_reg(regs, 2, res.a2);
+    set_user_reg(regs, 3, res.a3);
+    return true;
+}
+
+PLATFORM_START(xilinx_versal, "Xilinx Versal")
+    .compatible = versal_dt_compat,
+    .smc = versal_smc,
+PLATFORM_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */