Files
acrn-hypervisor/hypervisor/include/common/vuart_config.h
Wei6 Zhang b919e3d155 misc: add the SBI uart type for RISC-V
Tracked-On: #8842
Signed-off-by: Wei6 Zhang <wei6.zhang@intel.com>
2025-11-04 14:44:49 +08:00

40 lines
919 B
C

/*
* Copyright (C) 2025-2025 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef VUART_CONFIG_H_
#define VUART_CONFIG_H_
#include <types.h>
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 */
VUART_SBI, /* RISC-V SBI vuart */
};
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_ */