summaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2020-10-22 14:36:47 -0400
committerTom Rini <[email protected]>2020-10-22 14:36:47 -0400
commitae4fdd7b0432bcb0bc2fe7d90b6d3e92001ab478 (patch)
treee933e67609989d0e4960f1464384e9ff40732b30 /drivers/serial
parentb90daf2743b38022bea8727ede867ad63e971db2 (diff)
parentdddfde5401ed5ad82c996b35b61dc4a45bb4e2b3 (diff)
Merge branch '2020-10-22-misc-changes'
- Assorted updates for Xen, IPQ40xx, ASpeed, Keymile - Assorted typo / documentation fixes - Fix default preboot cmd to act like before with USB_STORAGE set - A number of other bugfixes throughout the code
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/Kconfig14
-rw-r--r--drivers/serial/serial-uclass.c2
-rw-r--r--drivers/serial/serial.c2
-rw-r--r--drivers/serial/serial_xen.c22
4 files changed, 33 insertions, 7 deletions
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index b4805a2e4ea..b6ba702bd35 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -401,11 +401,19 @@ config DEBUG_UART_MTK
driver will be available until the real driver model serial is
running.
+config DEBUG_UART_XEN
+ bool "XEN Hypervisor Console"
+ depends on XEN_SERIAL
+ help
+ Select this to enable a debug UART using the serial_xen driver. You
+ will not have to provide any parameters to make this work. The driver
+ will be available until the real driver-model serial is running.
+
endchoice
config DEBUG_UART_BASE
hex "Base address of UART"
- depends on DEBUG_UART
+ depends on DEBUG_UART && !DEBUG_UART_XEN
default 0 if DEBUG_UART_SANDBOX
help
This is the base address of your UART for memory-mapped UARTs.
@@ -415,7 +423,7 @@ config DEBUG_UART_BASE
config DEBUG_UART_CLOCK
int "UART input clock"
- depends on DEBUG_UART
+ depends on DEBUG_UART && !DEBUG_UART_XEN
default 0 if DEBUG_UART_SANDBOX
help
The UART input clock determines the speed of the internal UART
@@ -427,7 +435,7 @@ config DEBUG_UART_CLOCK
config DEBUG_UART_SHIFT
int "UART register shift"
- depends on DEBUG_UART
+ depends on DEBUG_UART && !DEBUG_UART_XEN
default 0 if DEBUG_UART
help
Some UARTs (notably ns16550) support different register layouts
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 0027625ebfd..f3c25d42167 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -413,7 +413,7 @@ static int on_baudrate(const char *name, const char *value, enum env_op op,
if ((flags & H_INTERACTIVE) != 0)
while (1) {
- if (getc() == '\r')
+ if (getchar() == '\r')
break;
}
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index 53358acb81f..355659ba056 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -90,7 +90,7 @@ static int on_baudrate(const char *name, const char *value, enum env_op op,
if ((flags & H_INTERACTIVE) != 0)
while (1) {
- if (getc() == '\r')
+ if (getchar() == '\r')
break;
}
diff --git a/drivers/serial/serial_xen.c b/drivers/serial/serial_xen.c
index ba6504b9479..34c90ece40f 100644
--- a/drivers/serial/serial_xen.c
+++ b/drivers/serial/serial_xen.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
#include <cpu_func.h>
+#include <debug_uart.h>
#include <dm.h>
#include <serial.h>
#include <watchdog.h>
@@ -15,11 +16,14 @@
#include <xen/events.h>
#include <xen/interface/sched.h>
+#include <xen/interface/xen.h>
#include <xen/interface/hvm/hvm_op.h>
#include <xen/interface/hvm/params.h>
#include <xen/interface/io/console.h>
#include <xen/interface/io/ring.h>
+#include <asm/xen/hypercall.h>
+
DECLARE_GLOBAL_DATA_PTR;
u32 console_evtchn;
@@ -175,8 +179,22 @@ U_BOOT_DRIVER(serial_xen) = {
.priv_auto_alloc_size = sizeof(struct xen_uart_priv),
.probe = xen_serial_probe,
.ops = &xen_serial_ops,
-#if !CONFIG_IS_ENABLED(OF_CONTROL)
.flags = DM_FLAG_PRE_RELOC,
-#endif
};
+#if defined(CONFIG_DEBUG_UART_XEN)
+static inline void _debug_uart_init(void) {}
+
+static inline void _debug_uart_putc(int c)
+{
+#if CONFIG_IS_ENABLED(ARM)
+ xen_debug_putc(c);
+#else
+ /* the type cast should work on LE only */
+ HYPERVISOR_console_io(CONSOLEIO_write, 1, (char *)&ch);
+#endif
+}
+
+DEBUG_UART_FUNCS
+
+#endif