diff options
Diffstat (limited to 'src/arch/x86/include/arch/pci_mmio_cfg.h')
-rw-r--r-- | src/arch/x86/include/arch/pci_mmio_cfg.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/arch/x86/include/arch/pci_mmio_cfg.h b/src/arch/x86/include/arch/pci_mmio_cfg.h index dd00d376cb..545be236c2 100644 --- a/src/arch/x86/include/arch/pci_mmio_cfg.h +++ b/src/arch/x86/include/arch/pci_mmio_cfg.h @@ -37,7 +37,7 @@ static inline __attribute__ ((always_inline)) u16 pcie_read_config16(device_t dev, unsigned int where) { unsigned long addr; - addr = DEFAULT_PCIEXBAR | dev | where; + addr = DEFAULT_PCIEXBAR | dev | (where & ~1); return read16(addr); } @@ -45,7 +45,7 @@ static inline __attribute__ ((always_inline)) u32 pcie_read_config32(device_t dev, unsigned int where) { unsigned long addr; - addr = DEFAULT_PCIEXBAR | dev | where; + addr = DEFAULT_PCIEXBAR | dev | (where & ~3); return read32(addr); } @@ -61,7 +61,7 @@ static inline __attribute__ ((always_inline)) void pcie_write_config16(device_t dev, unsigned int where, u16 value) { unsigned long addr; - addr = DEFAULT_PCIEXBAR | dev | where; + addr = DEFAULT_PCIEXBAR | dev | (where & ~1); write16(addr, value); } @@ -69,7 +69,7 @@ static inline __attribute__ ((always_inline)) void pcie_write_config32(device_t dev, unsigned int where, u32 value) { unsigned long addr; - addr = DEFAULT_PCIEXBAR | dev | where; + addr = DEFAULT_PCIEXBAR | dev | (where & ~3); write32(addr, value); } @@ -94,5 +94,23 @@ void pcie_or_config32(device_t dev, unsigned int where, u32 ormask) pcie_write_config32(dev, where, value | ormask); } +#define pci_mmio_read_config8 pcie_read_config8 +#define pci_mmio_read_config16 pcie_read_config16 +#define pci_mmio_read_config32 pcie_read_config32 + +#define pci_mmio_write_config8 pcie_write_config8 +#define pci_mmio_write_config16 pcie_write_config16 +#define pci_mmio_write_config32 pcie_write_config32 + +#if CONFIG_MMCONF_SUPPORT_DEFAULT +#define pci_read_config8 pcie_read_config8 +#define pci_read_config16 pcie_read_config16 +#define pci_read_config32 pcie_read_config32 + +#define pci_write_config8 pcie_write_config8 +#define pci_write_config16 pcie_write_config16 +#define pci_write_config32 pcie_write_config32 +#endif + #endif /* CONFIG_MMCONF_SUPPORT */ #endif /* _PCI_MMIO_CFG_H */ |