HV: pci-vuart: pci based vuart emulation
Add emulation for pci based vuart device mcs9900 at hv land.
add struct pci_vdev_ops vuart_pci_ops, the vdev callbalks for vuart.
How to use
In misc/vm_configs/scenarios/<SCENARIO>/<BOARD>/pci_dev.c, add pci
vuart config to vm_pci_devs[] array. For example:
struct acrn_vm_pci_dev_config vm0_pci_devs[] = {
/* console vuart setting*/
{
.emu_type = PCI_DEV_TYPE_HVEMUL,
.vbdf.bits = {.b = 0x00U, .d = 0x04U, .f = 0x00U},
.vdev_ops = &vmcs_ops,
.vbar_base[0] = 0x80001000, /* mmio bar */
.vbar_base[1] = 0x80002000, /* msix bar */
.vuart_idx = 0,
},
/* communication vuart setting */
{
.emu_type = PCI_DEV_TYPE_HVEMUL,
.vbdf.bits = {.b = 0x00U, .d = 0x05U, .f = 0x00U},
.vdev_ops = &vmcs_ops,
.vbar_base[0] = 0x80003000,
.vbar_base[1] = 0x80004000,
.vuart_idx = 1,
.t_vuart.vm_id = 1U,
.t_vuart.vuart_id = 1U,
},
}
Tracked-On: #5394
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2020-09-21 18:06:21 +08:00
|
|
|
/*
|
2022-07-13 09:21:24 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation.
|
HV: pci-vuart: pci based vuart emulation
Add emulation for pci based vuart device mcs9900 at hv land.
add struct pci_vdev_ops vuart_pci_ops, the vdev callbalks for vuart.
How to use
In misc/vm_configs/scenarios/<SCENARIO>/<BOARD>/pci_dev.c, add pci
vuart config to vm_pci_devs[] array. For example:
struct acrn_vm_pci_dev_config vm0_pci_devs[] = {
/* console vuart setting*/
{
.emu_type = PCI_DEV_TYPE_HVEMUL,
.vbdf.bits = {.b = 0x00U, .d = 0x04U, .f = 0x00U},
.vdev_ops = &vmcs_ops,
.vbar_base[0] = 0x80001000, /* mmio bar */
.vbar_base[1] = 0x80002000, /* msix bar */
.vuart_idx = 0,
},
/* communication vuart setting */
{
.emu_type = PCI_DEV_TYPE_HVEMUL,
.vbdf.bits = {.b = 0x00U, .d = 0x05U, .f = 0x00U},
.vdev_ops = &vmcs_ops,
.vbar_base[0] = 0x80003000,
.vbar_base[1] = 0x80004000,
.vuart_idx = 1,
.t_vuart.vm_id = 1U,
.t_vuart.vuart_id = 1U,
},
}
Tracked-On: #5394
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2020-09-21 18:06:21 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VMCS9900_H
|
|
|
|
#define VMCS9900_H
|
|
|
|
|
|
|
|
#define MCS9900_VENDOR 0x9710U
|
|
|
|
#define MCS9900_DEV 0x9900U
|
|
|
|
|
|
|
|
extern const struct pci_vdev_ops vmcs9900_ops;
|
2020-10-12 23:29:04 +08:00
|
|
|
void trigger_vmcs9900_msix(struct pci_vdev *vdev);
|
2021-07-07 17:23:40 +08:00
|
|
|
int32_t create_vmcs9900_vdev(struct acrn_vm *vm, struct acrn_vdev *dev);
|
2020-10-24 05:43:45 +08:00
|
|
|
int32_t destroy_vmcs9900_vdev(struct pci_vdev *vdev);
|
HV: pci-vuart: pci based vuart emulation
Add emulation for pci based vuart device mcs9900 at hv land.
add struct pci_vdev_ops vuart_pci_ops, the vdev callbalks for vuart.
How to use
In misc/vm_configs/scenarios/<SCENARIO>/<BOARD>/pci_dev.c, add pci
vuart config to vm_pci_devs[] array. For example:
struct acrn_vm_pci_dev_config vm0_pci_devs[] = {
/* console vuart setting*/
{
.emu_type = PCI_DEV_TYPE_HVEMUL,
.vbdf.bits = {.b = 0x00U, .d = 0x04U, .f = 0x00U},
.vdev_ops = &vmcs_ops,
.vbar_base[0] = 0x80001000, /* mmio bar */
.vbar_base[1] = 0x80002000, /* msix bar */
.vuart_idx = 0,
},
/* communication vuart setting */
{
.emu_type = PCI_DEV_TYPE_HVEMUL,
.vbdf.bits = {.b = 0x00U, .d = 0x05U, .f = 0x00U},
.vdev_ops = &vmcs_ops,
.vbar_base[0] = 0x80003000,
.vbar_base[1] = 0x80004000,
.vuart_idx = 1,
.t_vuart.vm_id = 1U,
.t_vuart.vuart_id = 1U,
},
}
Tracked-On: #5394
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Reviewed-by: Wang, Yu1 <yu1.wang@intel.com>
Acked-by: Eddie Dong <eddie.dong@Intel.com>
2020-09-21 18:06:21 +08:00
|
|
|
|
|
|
|
#endif
|