Skip to content

Commit

Permalink
drivers: serial: add missed binding for xen dom0 consoleio driver
Browse files Browse the repository at this point in the history
Add missed binding and appropriate changes for Xen Dom0/Dom0less
UART driver.

Signed-off-by: Mykola Kvach <[email protected]>
  • Loading branch information
xakep-amatop authored and nashif committed Jan 30, 2024
1 parent 651ffb1 commit 739ec30
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/serial/Kconfig.xen
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ config UART_XEN_HVC
config UART_XEN_HVC_CONSOLEIO
bool "Xen hypervisor consoleio UART driver"
select SERIAL_HAS_DRIVER
depends on XEN_DOM0 || XEN_DOM0LESS
depends on DT_HAS_XEN_HVC_CONSOLEIO_ENABLED && (XEN_DOM0 || XEN_DOM0LESS)
default y
help
Enable Xen hypervisor console driver. Used for Zephyr as
Expand Down
6 changes: 4 additions & 2 deletions drivers/serial/uart_hvc_xen_consoleio.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <zephyr/init.h>
#include <zephyr/kernel.h>

#define DT_DRV_COMPAT xen_hvc_consoleio

static int xen_consoleio_poll_in(const struct device *dev,
unsigned char *c)
{
Expand Down Expand Up @@ -44,12 +46,12 @@ static const struct uart_driver_api xen_consoleio_hvc_api = {
.poll_out = xen_consoleio_poll_out,
};

int xen_consoleio_init(const struct device *dev)
static int xen_consoleio_init(const struct device *dev)
{
/* Nothing to do, but still needed for device API */
return 0;
}

DEVICE_DT_DEFINE(DT_NODELABEL(xen_consoleio_hvc), xen_consoleio_init, NULL, NULL,
DEVICE_DT_INST_DEFINE(0, xen_consoleio_init, NULL, NULL,
NULL, PRE_KERNEL_1, CONFIG_XEN_HVC_INIT_PRIORITY,
&xen_consoleio_hvc_api);
5 changes: 5 additions & 0 deletions dts/bindings/serial/xen,hvc-consoleio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Xen Dom0/Dom0less Platform HVC ConsoleIO

compatible: "xen,hvc-consoleio"

include: uart-controller.yaml
2 changes: 1 addition & 1 deletion snippets/xen_dom0/xen_dom0.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
};

xen_consoleio_hvc: hvc {
compatible = "xen,uart_hvc";
compatible = "xen,hvc-consoleio";
status = "okay";
};
};

0 comments on commit 739ec30

Please sign in to comment.