2019-04-02 12:41:45 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <vm_config.h>
|
|
|
|
#include <pci_devices.h>
|
2019-08-07 23:29:18 +08:00
|
|
|
#include <vpci.h>
|
2019-04-02 12:41:45 +08:00
|
|
|
|
2019-07-16 16:52:23 +08:00
|
|
|
/* The vbar_base info of pt devices is included in device MACROs which defined in
|
|
|
|
* arch/x86/configs/$(CONFIG_BOARD)/pci_devices.h.
|
|
|
|
* The memory range of vBAR should exactly match with the e820 layout of VM.
|
|
|
|
*/
|
|
|
|
|
2019-08-07 22:06:11 +08:00
|
|
|
struct acrn_vm_pci_dev_config vm0_pci_devs[VM0_CONFIG_PCI_DEV_NUM] = {
|
2019-04-02 12:41:45 +08:00
|
|
|
{
|
2019-08-02 08:17:02 +08:00
|
|
|
.emu_type = PCI_DEV_TYPE_HVEMUL,
|
2019-04-02 12:41:45 +08:00
|
|
|
.vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x00U},
|
2019-08-07 23:29:18 +08:00
|
|
|
.vdev_ops = &vhostbridge_ops,
|
2019-04-02 12:41:45 +08:00
|
|
|
},
|
|
|
|
{
|
2019-08-02 08:17:02 +08:00
|
|
|
.emu_type = PCI_DEV_TYPE_PTDEV,
|
2019-04-02 12:41:45 +08:00
|
|
|
.vbdf.bits = {.b = 0x00U, .d = 0x01U, .f = 0x00U},
|
2019-04-25 11:11:30 +08:00
|
|
|
VM0_STORAGE_CONTROLLER
|
2019-04-02 12:41:45 +08:00
|
|
|
},
|
|
|
|
{
|
2019-08-02 08:17:02 +08:00
|
|
|
.emu_type = PCI_DEV_TYPE_PTDEV,
|
2019-04-02 12:41:45 +08:00
|
|
|
.vbdf.bits = {.b = 0x00U, .d = 0x02U, .f = 0x00U},
|
2019-04-25 11:11:30 +08:00
|
|
|
VM0_NETWORK_CONTROLLER
|
2019-04-02 12:41:45 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2019-08-07 22:06:11 +08:00
|
|
|
struct acrn_vm_pci_dev_config vm1_pci_devs[VM1_CONFIG_PCI_DEV_NUM] = {
|
2019-04-02 12:41:45 +08:00
|
|
|
{
|
2019-08-02 08:17:02 +08:00
|
|
|
.emu_type = PCI_DEV_TYPE_HVEMUL,
|
2019-04-02 12:41:45 +08:00
|
|
|
.vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x00U},
|
2019-08-07 23:29:18 +08:00
|
|
|
.vdev_ops = &vhostbridge_ops,
|
2019-04-02 12:41:45 +08:00
|
|
|
},
|
|
|
|
{
|
2019-08-02 08:17:02 +08:00
|
|
|
.emu_type = PCI_DEV_TYPE_PTDEV,
|
2019-04-02 12:41:45 +08:00
|
|
|
.vbdf.bits = {.b = 0x00U, .d = 0x01U, .f = 0x00U},
|
2019-04-25 11:11:30 +08:00
|
|
|
VM1_STORAGE_CONTROLLER
|
2019-04-02 12:41:45 +08:00
|
|
|
},
|
2019-04-25 11:11:30 +08:00
|
|
|
#if defined(VM1_NETWORK_CONTROLLER)
|
2019-04-02 12:41:45 +08:00
|
|
|
{
|
2019-08-02 08:17:02 +08:00
|
|
|
.emu_type = PCI_DEV_TYPE_PTDEV,
|
2019-04-02 12:41:45 +08:00
|
|
|
.vbdf.bits = {.b = 0x00U, .d = 0x02U, .f = 0x00U},
|
2019-04-25 11:11:30 +08:00
|
|
|
VM1_NETWORK_CONTROLLER
|
2019-04-02 12:41:45 +08:00
|
|
|
},
|
2019-04-25 11:11:30 +08:00
|
|
|
#endif
|
2019-04-02 12:41:45 +08:00
|
|
|
};
|