diff options
author | Peng Fan <peng.fan@nxp.com> | 2018-06-12 16:00:23 +0800 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2020-05-27 15:12:53 +0800 |
commit | 8ece41f15c8d9c407ab0946fa28ba7365419c030 (patch) | |
tree | c13cda5c02c108f8d025e4202656b542329165dc /arch/arm/cpu | |
parent | f0a0afa7740fac0a7ec26d4e77135ac10bd0318f (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)
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/armv8/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/cpu/armv8/xen/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/cpu/armv8/xen/hypercall.S | 14 | ||||
-rw-r--r-- | arch/arm/cpu/armv8/xen/print.c | 29 |
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; +} |