hv: more cleanup for pci.h

Don't have any logical changes.
- add more common PCI macros
- remove redundant definitions in dmar_parse.c
- move all the common mascos from vpci.h to pci.h

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Zide Chen
2018-10-23 10:05:06 -07:00
committed by lijinxia
parent e24899d9c9
commit bc4f82d1d1
4 changed files with 105 additions and 39 deletions

View File

@@ -6,13 +6,10 @@
#ifdef CONFIG_DMAR_PARSE_ENABLED
#include <hypervisor.h>
#include "pci.h"
#include "vtd.h"
#include "acpi.h"
#define PCI_CONFIG_ADDRESS 0xcf8
#define PCI_CONFIG_DATA 0xcfc
#define PCI_CONFIG_ACCESS_EN 0x80000000
enum acpi_dmar_type {
ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
@@ -148,8 +145,8 @@ static uint8_t get_secondary_bus(uint8_t bus, uint8_t dev, uint8_t func)
{
uint32_t data;
pio_write32(PCI_CONFIG_ACCESS_EN | (bus << 16) | (dev << 11) |
(func << 8) | 0x18, PCI_CONFIG_ADDRESS);
pio_write32(PCI_CFG_ENABLE | (bus << 16) | (dev << 11) |
(func << 8) | 0x18, PCI_CONFIG_ADDR);
data = pio_read32(PCI_CONFIG_DATA);