aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2020-04-10 10:47:05 +0800
committerPetr Štetiar <ynezz@true.cz>2020-05-07 12:53:06 +0200
commitcddd4591404fb4c53dc0b3c0b15b942cdbed4356 (patch)
tree392c1179de46b0f804e3789edca19069b64e6b44 /target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch
parentd1d2c0b5579ea4f69a42246c9318539d61ba1999 (diff)
downloadupstream-cddd4591404fb4c53dc0b3c0b15b942cdbed4356.tar.gz
upstream-cddd4591404fb4c53dc0b3c0b15b942cdbed4356.tar.bz2
upstream-cddd4591404fb4c53dc0b3c0b15b942cdbed4356.zip
layerscape: add patches-5.4
Add patches for linux-5.4. The patches are from NXP LSDK-20.04 release which was tagged LSDK-20.04-V5.4. https://source.codeaurora.org/external/qoriq/qoriq-components/linux/ For boards LS1021A-IOT, and Traverse-LS1043 which are not involved in LSDK, port the dts patches from 4.14. The patches are sorted into the following categories: 301-arch-xxxx 302-dts-xxxx 303-core-xxxx 701-net-xxxx 801-audio-xxxx 802-can-xxxx 803-clock-xxxx 804-crypto-xxxx 805-display-xxxx 806-dma-xxxx 807-gpio-xxxx 808-i2c-xxxx 809-jailhouse-xxxx 810-keys-xxxx 811-kvm-xxxx 812-pcie-xxxx 813-pm-xxxx 814-qe-xxxx 815-sata-xxxx 816-sdhc-xxxx 817-spi-xxxx 818-thermal-xxxx 819-uart-xxxx 820-usb-xxxx 821-vfio-xxxx Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Diffstat (limited to 'target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch')
-rw-r--r--target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch164
1 files changed, 164 insertions, 0 deletions
diff --git a/target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch b/target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch
new file mode 100644
index 0000000000..85ea96184e
--- /dev/null
+++ b/target/linux/layerscape/patches-5.4/809-jailhouse-0020-jailhouse-Add-simple-debug-console-via-the-hyperviso.patch
@@ -0,0 +1,164 @@
+From 58d058f1fe1cc5981c57be8b48d3b2f74f25c0d6 Mon Sep 17 00:00:00 2001
+From: Jan Kiszka <jan.kiszka@siemens.com>
+Date: Sun, 11 Sep 2016 23:30:04 +0200
+Subject: [PATCH] jailhouse: Add simple debug console via the hypervisor
+
+Jailhouse allows explicitly enabled cells to write character-wise
+messages to the hypervisor debug console. Make use of this for a
+platform-agnostic boot diagnosis channel, specifically for non-root
+cells. This also comes with earlycon support.
+
+Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
+(cherry picked from commit 60685bd589aef4972d20724863079edf2039eaa2)
+From http://git.kiszka.org/?p=linux.git;a=shortlog;h=refs/heads/queues/jailhouse
+---
+ MAINTAINERS | 1 +
+ drivers/virt/Kconfig | 11 +++++
+ drivers/virt/Makefile | 1 +
+ drivers/virt/jailhouse_dbgcon.c | 103 ++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 116 insertions(+)
+ create mode 100644 drivers/virt/jailhouse_dbgcon.c
+
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -8772,6 +8772,7 @@ L: jailhouse-dev@googlegroups.com
+ S: Maintained
+ F: arch/x86/kernel/jailhouse.c
+ F: arch/x86/include/asm/jailhouse_para.h
++F: drivers/virt/jailhouse_dbgcon.c
+
+ JC42.4 TEMPERATURE SENSOR DRIVER
+ M: Guenter Roeck <linux@roeck-us.net>
+--- a/drivers/virt/Kconfig
++++ b/drivers/virt/Kconfig
+@@ -31,5 +31,16 @@ config FSL_HV_MANAGER
+ 4) A kernel interface for receiving callbacks when a managed
+ partition shuts down.
+
++config JAILHOUSE_DBGCON
++ tristate "Jailhouse console driver"
++ depends on X86 || ARM || ARM64
++ help
++ The Jailhouse hypervisor provides a simple write-only console for
++ debugging the bootstrap process of its cells. This driver registers
++ a console with the kernel to make use of it.
++
++ Note that Jailhouse has to be configured to permit a cell the usage
++ of the console interface.
++
+ source "drivers/virt/vboxguest/Kconfig"
+ endif
+--- a/drivers/virt/Makefile
++++ b/drivers/virt/Makefile
+@@ -4,4 +4,5 @@
+ #
+
+ obj-$(CONFIG_FSL_HV_MANAGER) += fsl_hypervisor.o
++obj-$(CONFIG_JAILHOUSE_DBGCON) += jailhouse_dbgcon.o
+ obj-y += vboxguest/
+--- /dev/null
++++ b/drivers/virt/jailhouse_dbgcon.c
+@@ -0,0 +1,103 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++/*
++ * Console driver for running over the Jailhouse partitioning hypervisor
++ *
++ * Copyright (c) Siemens AG, 2016-2018
++ *
++ * Authors:
++ * Jan Kiszka <jan.kiszka@siemens.com>
++ */
++
++#include <linux/console.h>
++#include <linux/hypervisor.h>
++#include <linux/module.h>
++#include <linux/serial_core.h>
++#ifdef CONFIG_X86
++#include <asm/alternative.h>
++#endif
++#ifdef CONFIG_ARM
++#include <asm/opcodes-virt.h>
++#endif
++
++#define JAILHOUSE_HC_DEBUG_CONSOLE_PUTC 8
++
++static void hypervisor_putc(char c)
++{
++#if defined(CONFIG_X86)
++ int result;
++
++ asm volatile(
++ ALTERNATIVE(".byte 0x0f,0x01,0xc1", ".byte 0x0f,0x01,0xd9",
++ X86_FEATURE_VMMCALL)
++ : "=a" (result)
++ : "a" (JAILHOUSE_HC_DEBUG_CONSOLE_PUTC), "D" (c)
++ : "memory");
++#elif defined(CONFIG_ARM)
++ register u32 num_res asm("r0") = JAILHOUSE_HC_DEBUG_CONSOLE_PUTC;
++ register u32 arg1 asm("r1") = c;
++
++ asm volatile(
++ __HVC(0x4a48)
++ : "=r" (num_res)
++ : "r" (num_res), "r" (arg1)
++ : "memory");
++#elif defined(CONFIG_ARM64)
++ register u64 num_res asm("x0") = JAILHOUSE_HC_DEBUG_CONSOLE_PUTC;
++ register u64 arg1 asm("x1") = c;
++
++ asm volatile(
++ "hvc #0x4a48\n\t"
++ : "=r" (num_res)
++ : "r" (num_res), "r" (arg1)
++ : "memory");
++#else
++#error Unsupported architecture.
++#endif
++}
++
++static void jailhouse_dbgcon_write(struct console *con, const char *s,
++ unsigned count)
++{
++ while (count > 0) {
++ hypervisor_putc(*s);
++ count--;
++ s++;
++ }
++}
++
++static int __init early_jailhouse_dbgcon_setup(struct earlycon_device *device,
++ const char *options)
++{
++ device->con->write = jailhouse_dbgcon_write;
++ return 0;
++}
++
++EARLYCON_DECLARE(jailhouse, early_jailhouse_dbgcon_setup);
++
++static struct console jailhouse_dbgcon = {
++ .name = "jailhouse",
++ .write = jailhouse_dbgcon_write,
++ .flags = CON_PRINTBUFFER | CON_ANYTIME,
++ .index = -1,
++};
++
++static int __init jailhouse_dbgcon_init(void)
++{
++ if (!jailhouse_paravirt())
++ return -ENODEV;
++
++ register_console(&jailhouse_dbgcon);
++ return 0;
++}
++
++static void __exit jailhouse_dbgcon_exit(void)
++{
++ unregister_console(&jailhouse_dbgcon);
++}
++
++module_init(jailhouse_dbgcon_init);
++module_exit(jailhouse_dbgcon_exit);
++
++MODULE_LICENSE("GPL v2");
++MODULE_DESCRIPTION("Jailhouse debug console driver");
++MODULE_AUTHOR("Jan Kiszka <jan.kiszka@siemens.com>");