Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35653 )
Change subject: device/pnp_ops: Add ENV_PNP_SIMPLE_DEVICE ......................................................................
device/pnp_ops: Add ENV_PNP_SIMPLE_DEVICE
Source files including this may have locally defined __SIMPLE_DEVICE__ so this cannot be placed in <rules.h>.
Change-Id: I2336111b871203f1628c3c47027d4052c37899dc Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/include/device/pnp.h M src/include/device/pnp_ops.h M src/include/device/pnp_type.h 3 files changed, 11 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/35653/1
diff --git a/src/include/device/pnp.h b/src/include/device/pnp.h index ee92a32..69a06674 100644 --- a/src/include/device/pnp.h +++ b/src/include/device/pnp.h @@ -4,9 +4,10 @@ #include <stdint.h> #include <device/device.h> #include <device/pnp_def.h> +#include <device/pnp_type.h> #include <arch/io.h>
-#ifndef __SIMPLE_DEVICE__ +#if !ENV_PNP_SIMPLE_DEVICE
/* Primitive PNP resource manipulation */ void pnp_write_config(struct device *dev, u8 reg, u8 value); @@ -18,7 +19,7 @@ void pnp_set_irq(struct device *dev, u8 index, u8 irq); void pnp_set_drq(struct device *dev, u8 index, u8 drq);
-#endif /* __SIMPLE_DEVICE */ +#endif
/* PNP device operations */ void pnp_read_resources(struct device *dev); diff --git a/src/include/device/pnp_ops.h b/src/include/device/pnp_ops.h index 9086fdf..61d05a8 100644 --- a/src/include/device/pnp_ops.h +++ b/src/include/device/pnp_ops.h @@ -19,7 +19,7 @@ #include <arch/io.h> #include <device/pnp_type.h>
-#ifdef __SIMPLE_DEVICE__ +#if ENV_PNP_SIMPLE_DEVICE
static __always_inline void pnp_write_config( pnp_devfn_t dev, uint8_t reg, uint8_t value) @@ -82,6 +82,6 @@ pnp_write_config(dev, index, drq & 0xff); }
-#endif /* __SIMPLE_DEVICE__ */ +#endif
#endif diff --git a/src/include/device/pnp_type.h b/src/include/device/pnp_type.h index db26f2f..dc2d27c 100644 --- a/src/include/device/pnp_type.h +++ b/src/include/device/pnp_type.h @@ -20,4 +20,10 @@
#define PNP_DEV(PORT, FUNC) (((PORT) << 8) | (FUNC))
+#if defined(__SIMPLE_DEVICE__) +#define ENV_PNP_SIMPLE_DEVICE 1 +#else +#define ENV_PNP_SIMPLE_DEVICE 0 +#endif + #endif /* __DEVICE_PNP_TYPE_H__ */