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>
diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h
index 5371e07..9d64f03 100644
--- a/src/include/device/pci_ops.h
+++ b/src/include/device/pci_ops.h
@@ -39,7 +39,13 @@
 }
 #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 @@
 
 #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 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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