1# Copyright (c) 2025 Antmicro <www.antmicro.com>
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig UART_VIRTIO_CONSOLE
5	bool "VIRTIO console paravirtualization device driver"
6	default y
7	depends on VIRTIO && DT_HAS_VIRTIO_CONSOLE_ENABLED && \
8		!(X86_VERY_EARLY_CONSOLE || EARLY_CONSOLE || BOOT_BANNER)
9
10if UART_VIRTIO_CONSOLE
11
12config UART_VIRTIO_CONSOLE_RX_BUFSIZE
13	int "VIRTIO console receive buffer length"
14	default 1
15
16config UART_VIRTIO_CONSOLE_TX_BUFSIZE
17	int "VIRTIO console transmit buffer length"
18	default 2
19
20config UART_VIRTIO_CONSOLE_F_MULTIPORT
21	bool "Support multiple VIRTIO console ports"
22	default n
23	help
24	  The VIRTIO console device can support multiple i/o ports simultaneously
25	  (up to 31 in the case of QEMU). Select to enable this feature. Otherwise
26	  only one will be used.
27
28if UART_VIRTIO_CONSOLE_F_MULTIPORT
29
30config UART_VIRTIO_CONSOLE_RX_CONTROL_BUFSIZE
31	int "VIRTIO console receive buffer length (for control messages)"
32	default 16
33	help
34	  This will set the size of the control receive buffer and its corresponding
35	  virtqueue. Keep in mind that control messages are sent in quick succession
36	  and thus some may never be received if this value is too low. Try increasing
37	  this value if you're experiencing issues with the multiport feature.
38
39config UART_VIRTIO_CONSOLE_TX_CONTROL_BUFSIZE
40	int "VIRTIO console transmit buffer length (for control messages)"
41	default 8
42	help
43	  This will set the size of the control transmit buffer and its corresponding
44	  virtqueue. Keep in mind that control messages are sent in quick succession
45	  and this buffer may fill up fast if this value is too low. Try increasing
46	  this value if you're experiencing issues with the multiport feature.
47
48endif
49
50config UART_VIRTIO_CONSOLE_NAME_BUFSIZE
51	int "VIRTIO console maximum port name length"
52	default 0 if UART_LOG_LEVEL < 3
53	default 16
54	help
55	  Ports can be assigned human-readable names, which are then printed in logs.
56
57endif
58