device/pci_ops: Add ENV_PCI_SIMPLE_DEVICE
Source files including this may have locally defined __SIMPLE_DEVICE__ so this cannot be placed in <rules.h>. Change-Id: If700dd10fd5e082568cd6866bfd802fc2e021806 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35652 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
91f2f03759
commit
9d5af5b0c2
|
@ -39,7 +39,13 @@ static __always_inline pci_devfn_t pcidev_assert(const struct device *dev)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef __SIMPLE_DEVICE__
|
||||
#if defined(__SIMPLE_DEVICE__)
|
||||
#define ENV_PCI_SIMPLE_DEVICE 1
|
||||
#else
|
||||
#define ENV_PCI_SIMPLE_DEVICE 0
|
||||
#endif
|
||||
|
||||
#if ENV_PCI_SIMPLE_DEVICE
|
||||
|
||||
/* Avoid name collisions as different stages have different signature
|
||||
* for these functions. The _s_ stands for simple, fundamental IO or
|
||||
|
@ -91,7 +97,7 @@ void pci_write_config32(const struct device *dev, u16 reg, u32 val)
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef __SIMPLE_DEVICE__
|
||||
#if ENV_PCI_SIMPLE_DEVICE
|
||||
static __always_inline
|
||||
void pci_or_config8(pci_devfn_t dev, u16 reg, u8 ormask)
|
||||
#else
|
||||
|
@ -103,7 +109,7 @@ void pci_or_config8(const struct device *dev, u16 reg, u8 ormask)
|
|||
pci_write_config8(dev, reg, value | ormask);
|
||||
}
|
||||
|
||||
#ifdef __SIMPLE_DEVICE__
|
||||
#if ENV_PCI_SIMPLE_DEVICE
|
||||
static __always_inline
|
||||
void pci_or_config16(pci_devfn_t dev, u16 reg, u16 ormask)
|
||||
#else
|
||||
|
@ -115,7 +121,7 @@ void pci_or_config16(const struct device *dev, u16 reg, u16 ormask)
|
|||
pci_write_config16(dev, reg, value | ormask);
|
||||
}
|
||||
|
||||
#ifdef __SIMPLE_DEVICE__
|
||||
#if ENV_PCI_SIMPLE_DEVICE
|
||||
static __always_inline
|
||||
void pci_or_config32(pci_devfn_t dev, u16 reg, u32 ormask)
|
||||
#else
|
||||
|
@ -127,7 +133,7 @@ void pci_or_config32(const struct device *dev, u16 reg, u32 ormask)
|
|||
pci_write_config32(dev, reg, value | ormask);
|
||||
}
|
||||
|
||||
#ifdef __SIMPLE_DEVICE__
|
||||
#if ENV_PCI_SIMPLE_DEVICE
|
||||
static __always_inline
|
||||
void pci_update_config8(pci_devfn_t dev, u16 reg, u8 mask, u8 or)
|
||||
#else
|
||||
|
@ -143,7 +149,7 @@ void pci_update_config8(const struct device *dev, u16 reg, u8 mask, u8 or)
|
|||
pci_write_config8(dev, reg, reg8);
|
||||
}
|
||||
|
||||
#ifdef __SIMPLE_DEVICE__
|
||||
#if ENV_PCI_SIMPLE_DEVICE
|
||||
static __always_inline
|
||||
void pci_update_config16(pci_devfn_t dev, u16 reg, u16 mask, u16 or)
|
||||
#else
|
||||
|
@ -159,7 +165,7 @@ void pci_update_config16(const struct device *dev, u16 reg, u16 mask, u16 or)
|
|||
pci_write_config16(dev, reg, reg16);
|
||||
}
|
||||
|
||||
#ifdef __SIMPLE_DEVICE__
|
||||
#if ENV_PCI_SIMPLE_DEVICE
|
||||
static __always_inline
|
||||
void pci_update_config32(pci_devfn_t dev, u16 reg, u32 mask, u32 or)
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue