mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
HV: parse default pci mmcfg base
The default PCI mmcfg base is stored in ACPI MCFG table, when CONFIG_ACPI_PARSE_ENABLED is set, acpi_fixup() function will parse and fix up the platform mmcfg base in ACRN boot stage; when it is not set, platform mmcfg base will be initialized to DEFAULT_PCI_MMCFG_BASE which generated by acrn-config tool; Please note we will not support platform which has multiple PCI segment groups. Tracked-On: #4157 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -41,13 +41,27 @@
|
||||
#include <vtd.h>
|
||||
#include <bits.h>
|
||||
#include <board.h>
|
||||
#include <platform_acpi_info.h>
|
||||
|
||||
static spinlock_t pci_device_lock;
|
||||
static uint32_t num_pci_pdev;
|
||||
static struct pci_pdev pci_pdev_array[CONFIG_MAX_PCI_DEV_NUM];
|
||||
static uint64_t pci_mmcfg_base = DEFAULT_PCI_MMCFG_BASE;
|
||||
|
||||
static void init_pdev(uint16_t pbdf, uint32_t drhd_index);
|
||||
|
||||
#ifdef CONFIG_ACPI_PARSE_ENABLED
|
||||
void set_mmcfg_base(uint64_t mmcfg_base)
|
||||
{
|
||||
pci_mmcfg_base = mmcfg_base;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint64_t get_mmcfg_base(void)
|
||||
{
|
||||
return pci_mmcfg_base;
|
||||
}
|
||||
|
||||
/* @brief: Find the DRHD index corresponding to a PCI device
|
||||
* Runs through the pci_pdev_array and returns the value in drhd_idx
|
||||
* member from pdev structure that matches matches B:D.F
|
||||
|
Reference in New Issue
Block a user