coreboot-kgpe-d16/src/include/device/pnp.h
Stefan Reinauer be7f79867e This, ladies and gentlement, is commit #4000.
Use the (almost) same strict CFLAGS in v2 that we use on v3. And fix a few
include files and missing prototypes. Also, fix up the Config-abuild.lb files
to properly work for cross compiling.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4000 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2009-03-13 15:42:27 +00:00

50 lines
1.4 KiB
C

#ifndef DEVICE_PNP_H
#define DEVICE_PNP_H
#include <stdint.h>
#include <device/device.h>
#include <device/pnp_def.h>
/* Primitive pnp resource manipulation */
void pnp_write_config(device_t dev, uint8_t reg, uint8_t value);
uint8_t pnp_read_config(device_t dev, uint8_t reg);
void pnp_set_logical_device(device_t dev);
void pnp_set_enable(device_t dev, int enable);
int pnp_read_enable(device_t dev);
void pnp_set_iobase(device_t dev, unsigned index, unsigned iobase);
void pnp_set_irq(device_t dev, unsigned index, unsigned irq);
void pnp_set_drq(device_t dev, unsigned index, unsigned drq);
/* PNP device operations */
void pnp_read_resources(device_t dev);
void pnp_set_resources(device_t dev);
void pnp_enable_resources(device_t dev);
void pnp_enable(device_t dev);
extern struct device_operations pnp_ops;
/* PNP helper operations */
struct io_info {
unsigned mask, set;
};
struct pnp_info {
struct device_operations *ops;
unsigned function;
unsigned flags;
#define PNP_IO0 0x01
#define PNP_IO1 0x02
#define PNP_IO2 0x04
#define PNP_IO3 0x08
#define PNP_IRQ0 0x10
#define PNP_IRQ1 0x20
#define PNP_DRQ0 0x40
#define PNP_DRQ1 0x80
struct io_info io0, io1, io2, io3;
};
struct resource *pnp_get_resource(device_t dev, unsigned index);
void pnp_enable_devices(struct device *dev, struct device_operations *ops,
unsigned functions, struct pnp_info *info);
#endif /* DEVICE_PNP_H */