device/pci: Always define PCI_DEV()

This has uses outside ARCH_x86 and/or __PRE_RAM__.

Change-Id: I2eec674ec5ba4ffe03a20db0f73cf87e5e4b4d0d
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/31302
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Kyösti Mälkki 2019-01-23 16:02:28 +02:00
parent 06ea8f9b9a
commit 371f04811e
2 changed files with 7 additions and 6 deletions

View File

@ -205,11 +205,6 @@ static __always_inline void write64(volatile void *addr,
#ifdef __SIMPLE_DEVICE__ #ifdef __SIMPLE_DEVICE__
#define PCI_DEV(SEGBUS, DEV, FN) ( \
(((SEGBUS) & 0xFFF) << 20) | \
(((DEV) & 0x1F) << 15) | \
(((FN) & 0x07) << 12))
#define PCI_ID(VENDOR_ID, DEVICE_ID) \ #define PCI_ID(VENDOR_ID, DEVICE_ID) \
((((DEVICE_ID) & 0xFFFF) << 16) | ((VENDOR_ID) & 0xFFFF)) ((((DEVICE_ID) & 0xFFFF) << 16) | ((VENDOR_ID) & 0xFFFF))
@ -273,7 +268,6 @@ void pci_write_config32(pci_devfn_t dev, unsigned int where, uint32_t value)
pci_io_write_config32(dev, where, value); pci_io_write_config32(dev, where, value);
} }
#define PCI_DEV_INVALID (0xffffffffU)
static inline pci_devfn_t pci_io_locate_device(unsigned int pci_id, static inline pci_devfn_t pci_io_locate_device(unsigned int pci_id,
pci_devfn_t dev) pci_devfn_t dev)
{ {

View File

@ -19,4 +19,11 @@
typedef u32 pci_devfn_t; typedef u32 pci_devfn_t;
typedef u32 pnp_devfn_t; typedef u32 pnp_devfn_t;
#define PCI_DEV(SEGBUS, DEV, FN) ( \
(((SEGBUS) & 0xFFF) << 20) | \
(((DEV) & 0x1F) << 15) | \
(((FN) & 0x07) << 12))
#define PCI_DEV_INVALID (0xffffffffU)
#endif /* DEVICE_PCI_TYPE_H */ #endif /* DEVICE_PCI_TYPE_H */