From 9d5af5b0c2dd2c9455f8094f10e649b92094c4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 27 Sep 2019 12:01:15 +0300 Subject: [PATCH] device/pci_ops: Add ENV_PCI_SIMPLE_DEVICE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Source files including this may have locally defined __SIMPLE_DEVICE__ so this cannot be placed in . Change-Id: If700dd10fd5e082568cd6866bfd802fc2e021806 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/35652 Reviewed-by: Furquan Shaikh Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/include/device/pci_ops.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h index 5371e07419..9d64f037f6 100644 --- a/src/include/device/pci_ops.h +++ b/src/include/device/pci_ops.h @@ -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