Skip to content

Commit 739ec30

Browse files
xakep-amatopnashif
authored andcommitted
drivers: serial: add missed binding for xen dom0 consoleio driver
Add missed binding and appropriate changes for Xen Dom0/Dom0less UART driver. Signed-off-by: Mykola Kvach <[email protected]>
1 parent 651ffb1 commit 739ec30

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

drivers/serial/Kconfig.xen

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ config UART_XEN_HVC
1818
config UART_XEN_HVC_CONSOLEIO
1919
bool "Xen hypervisor consoleio UART driver"
2020
select SERIAL_HAS_DRIVER
21-
depends on XEN_DOM0 || XEN_DOM0LESS
21+
depends on DT_HAS_XEN_HVC_CONSOLEIO_ENABLED && (XEN_DOM0 || XEN_DOM0LESS)
2222
default y
2323
help
2424
Enable Xen hypervisor console driver. Used for Zephyr as

drivers/serial/uart_hvc_xen_consoleio.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <zephyr/init.h>
1818
#include <zephyr/kernel.h>
1919

20+
#define DT_DRV_COMPAT xen_hvc_consoleio
21+
2022
static int xen_consoleio_poll_in(const struct device *dev,
2123
unsigned char *c)
2224
{
@@ -44,12 +46,12 @@ static const struct uart_driver_api xen_consoleio_hvc_api = {
4446
.poll_out = xen_consoleio_poll_out,
4547
};
4648

47-
int xen_consoleio_init(const struct device *dev)
49+
static int xen_consoleio_init(const struct device *dev)
4850
{
4951
/* Nothing to do, but still needed for device API */
5052
return 0;
5153
}
5254

53-
DEVICE_DT_DEFINE(DT_NODELABEL(xen_consoleio_hvc), xen_consoleio_init, NULL, NULL,
55+
DEVICE_DT_INST_DEFINE(0, xen_consoleio_init, NULL, NULL,
5456
NULL, PRE_KERNEL_1, CONFIG_XEN_HVC_INIT_PRIORITY,
5557
&xen_consoleio_hvc_api);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Xen Dom0/Dom0less Platform HVC ConsoleIO
2+
3+
compatible: "xen,hvc-consoleio"
4+
5+
include: uart-controller.yaml

snippets/xen_dom0/xen_dom0.overlay

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
};
2020

2121
xen_consoleio_hvc: hvc {
22-
compatible = "xen,uart_hvc";
22+
compatible = "xen,hvc-consoleio";
2323
status = "okay";
2424
};
2525
};

0 commit comments

Comments
 (0)