summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2018-06-12 16:00:23 +0800
committerPeng Fan <peng.fan@nxp.com>2020-05-27 15:37:53 +0800
commit7b3604d96fab188446bf9bfcf70b6dcc420cc8c7 (patch)
treec13cda5c02c108f8d025e4202656b542329165dc /arch/arm
parent77c8c40a60542f1a12e81f24e37ad4a5e5cf6623 (diff)
MLK-18577-3 armv8: xen: add console write hypercall
Introduce console write hypercall to let Uboot could directly output with xen console, this needs CONFIG_VERBOSE_DEBUG enabled in xen. Because input is not a must requirement in android VM, and develop pvconsole needs more efforts, so let's use this hypercall first. Signed-off-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 8836c3104a1edfe542e0c1cef6690bc9d3d842a0) (cherry picked from commit aea71150857d4617009730683c95d858acb43392) (cherry picked from commit 3173d3ac39bed27a3197829ea13ffce5a89b07ac) (cherry picked from commit 8ece41f15c8d9c407ab0946fa28ba7365419c030)
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/cpu/armv8/Makefile1
-rw-r--r--arch/arm/cpu/armv8/xen/Makefile1
-rw-r--r--arch/arm/cpu/armv8/xen/hypercall.S14
-rw-r--r--arch/arm/cpu/armv8/xen/print.c29
4 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/Makefile b/arch/arm/cpu/armv8/Makefile
index b349b13f49..454715fd92 100644
--- a/arch/arm/cpu/armv8/Makefile
+++ b/arch/arm/cpu/armv8/Makefile
@@ -35,3 +35,4 @@ obj-$(CONFIG_S32V234) += s32v234/
obj-$(CONFIG_TARGET_HIKEY) += hisilicon/
obj-$(CONFIG_ARMV8_PSCI) += psci.o
obj-$(CONFIG_ARCH_SUNXI) += lowlevel_init.o
+obj-$(CONFIG_XEN) += xen/
diff --git a/arch/arm/cpu/armv8/xen/Makefile b/arch/arm/cpu/armv8/xen/Makefile
new file mode 100644
index 0000000000..c501809559
--- /dev/null
+++ b/arch/arm/cpu/armv8/xen/Makefile
@@ -0,0 +1 @@
+obj-y += hypercall.o print.o
diff --git a/arch/arm/cpu/armv8/xen/hypercall.S b/arch/arm/cpu/armv8/xen/hypercall.S
new file mode 100644
index 0000000000..fb8d05ac27
--- /dev/null
+++ b/arch/arm/cpu/armv8/xen/hypercall.S
@@ -0,0 +1,14 @@
+/*
+ * Copyright 2018 NXP
+
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <xen.h>
+
+.globl HYPERVISOR_console_io;
+.align 4;
+HYPERVISOR_console_io:
+ mov x16, __HYPERVISOR_console_io;
+ hvc 0xEA1;
+ ret;
diff --git a/arch/arm/cpu/armv8/xen/print.c b/arch/arm/cpu/armv8/xen/print.c
new file mode 100644
index 0000000000..5194d3661a
--- /dev/null
+++ b/arch/arm/cpu/armv8/xen/print.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2018 NXP
+ *
+ * Peng Fan <peng.fan@nxp.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <hypercall.h>
+#include <linux/types.h>
+#include <linux/string.h>
+#include <linux/ctype.h>
+#include <xen.h>
+
+/*
+ * To non privileged domain, need CONFIG_VERBOSE_DEBUG in XEN to
+ * get output.
+ */
+void xenprintf(const char *buf)
+{
+ (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(buf), buf);
+ return;
+}
+
+void xenprintc(const char c)
+{
+ (void)HYPERVISOR_console_io(CONSOLEIO_write, 1, &c);
+ return;
+}