/* * Copyright (C) 2025-2025 Intel Corporation. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef VUART_CONFIG_H_ #define VUART_CONFIG_H_ #include struct target_vuart { uint8_t vm_id; /* target VM id */ uint8_t vuart_id; /* target vuart index in a VM */ }; enum vuart_type { VUART_LEGACY_PIO = 0, /* legacy PIO vuart */ VUART_PCI, /* PCI vuart, may removed */ }; union vuart_addr { uint16_t port_base; /* addr for legacy type */ struct { /* addr for pci type */ uint8_t f : 3; /* BITs 0-2 */ uint8_t d : 5; /* BITs 3-7 */ uint8_t b; /* BITs 8-15 */ } bdf; }; struct vuart_config { enum vuart_type type; /* legacy PIO or PCI */ union vuart_addr addr; /* port addr if in legacy type, or bdf addr if in pci type */ uint16_t irq; struct target_vuart t_vuart; /* target vuart */ } __aligned(8); #endif /* VUART_CONFIG_H_ */