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> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35653 Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
9d5af5b0c2
commit
0f639750a1
|
@ -4,9 +4,10 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
#include <device/pnp_def.h>
|
#include <device/pnp_def.h>
|
||||||
|
#include <device/pnp_type.h>
|
||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
|
|
||||||
#ifndef __SIMPLE_DEVICE__
|
#if !ENV_PNP_SIMPLE_DEVICE
|
||||||
|
|
||||||
/* Primitive PNP resource manipulation */
|
/* Primitive PNP resource manipulation */
|
||||||
void pnp_write_config(struct device *dev, u8 reg, u8 value);
|
void pnp_write_config(struct device *dev, u8 reg, u8 value);
|
||||||
|
@ -18,7 +19,7 @@ void pnp_set_iobase(struct device *dev, u8 index, u16 iobase);
|
||||||
void pnp_set_irq(struct device *dev, u8 index, u8 irq);
|
void pnp_set_irq(struct device *dev, u8 index, u8 irq);
|
||||||
void pnp_set_drq(struct device *dev, u8 index, u8 drq);
|
void pnp_set_drq(struct device *dev, u8 index, u8 drq);
|
||||||
|
|
||||||
#endif /* __SIMPLE_DEVICE */
|
#endif
|
||||||
|
|
||||||
/* PNP device operations */
|
/* PNP device operations */
|
||||||
void pnp_read_resources(struct device *dev);
|
void pnp_read_resources(struct device *dev);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
#include <device/pnp_type.h>
|
#include <device/pnp_type.h>
|
||||||
|
|
||||||
#ifdef __SIMPLE_DEVICE__
|
#if ENV_PNP_SIMPLE_DEVICE
|
||||||
|
|
||||||
static __always_inline void pnp_write_config(
|
static __always_inline void pnp_write_config(
|
||||||
pnp_devfn_t dev, uint8_t reg, uint8_t value)
|
pnp_devfn_t dev, uint8_t reg, uint8_t value)
|
||||||
|
@ -82,6 +82,6 @@ void pnp_set_drq(pnp_devfn_t dev, unsigned int index, unsigned int drq)
|
||||||
pnp_write_config(dev, index, drq & 0xff);
|
pnp_write_config(dev, index, drq & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __SIMPLE_DEVICE__ */
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,4 +20,10 @@ typedef u32 pnp_devfn_t;
|
||||||
|
|
||||||
#define PNP_DEV(PORT, FUNC) (((PORT) << 8) | (FUNC))
|
#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__ */
|
#endif /* __DEVICE_PNP_TYPE_H__ */
|
||||||
|
|
Loading…
Reference in New Issue