diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/cpu/cpu.h | 2 | ||||
-rw-r--r-- | src/include/device/chip.h | 85 | ||||
-rw-r--r-- | src/include/device/device.h | 9 | ||||
-rw-r--r-- | src/include/device/path.h | 2 | ||||
-rw-r--r-- | src/include/device/pnp.h | 5 | ||||
-rw-r--r-- | src/include/device/smbus.h | 1 |
6 files changed, 12 insertions, 92 deletions
diff --git a/src/include/cpu/cpu.h b/src/include/cpu/cpu.h index 85603750b5..e211d990e0 100644 --- a/src/include/cpu/cpu.h +++ b/src/include/cpu/cpu.h @@ -5,7 +5,7 @@ struct device; #include <arch/cpu.h> void cpu_initialize(void); -void initialize_cpus(struct device *root); +void initialize_cpus(struct bus *cpu_bus); #define __cpu_driver __attribute__ ((used,__section__(".rodata.cpu_driver"))) /** start of compile time generated pci driver array */ diff --git a/src/include/device/chip.h b/src/include/device/chip.h deleted file mode 100644 index 5f4e36b87c..0000000000 --- a/src/include/device/chip.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef DEVICE_CHIP_H -#define DEVICE_CHIP_H - -#include <device/path.h> -#include <device/device.h> - -/* chips are arbitrary chips (superio, southbridge, etc.) - * They have private structures that define chip resources and default - * settings. They have four externally visible functions for control. - * They have a generic component which applies to all chips for - * path, etc. - */ - -/* some of the types of resources chips can control */ -#if CONFIG_CHIP_CONFIGURE == 1 -#define CONFIGURE(pass) chip_configure(&static_root, pass) -#else -#define CONFIGURE(pass) -#endif - -enum chip_pass { - CONF_PASS_PRE_CONSOLE, - CONF_PASS_PRE_PCI, - CONF_PASS_PRE_DEVICE_ENUMERATE, - CONF_PASS_PRE_DEVICE_CONFIGURE, - CONF_PASS_PRE_DEVICE_ENABLE, - CONF_PASS_PRE_DEVICE_INITIALIZE, - CONF_PASS_POST_PCI, - CONF_PASS_PRE_BOOT -}; - - -/* linkages from devices of a type (e.g. superio devices) - * to the actual physical PCI device. This type is used in an array of - * structs built by NLBConfig.py. We owe this idea to Plan 9. - */ - -struct chip; -struct device; - -/* there is one of these for each TYPE of chip */ -struct chip_control { - /* This is the print name for debugging */ - char *name; - void (*enable)(struct chip *, enum chip_pass); - void (*enumerate)(struct chip *chip); - void (*enable_dev)(struct device *dev); -}; - -struct chip_resource { - unsigned long flags; - unsigned long index; - unsigned long base; -}; - -struct chip_device_path { - struct device_path path; - unsigned channel; - int enabled; - struct chip_resource resource[MAX_RESOURCES]; -}; - -struct device; -struct bus; - -#ifndef MAX_CHIP_PATHS -#define MAX_CHIP_PATHS 16 -#endif -struct chip { - unsigned link; - struct chip_control *control; /* for this device */ - struct chip_device_path path[MAX_CHIP_PATHS]; /* can be 0, in which case the default is taken */ - char *configuration; /* can be 0. */ - struct chip *next, *children; - /* there is one of these for each INSTANCE of a chip */ - void *chip_info; /* the dreaded "void *" */ - /* bus and device links into the device tree */ - struct bus *bus; - struct device *dev; -}; - -extern struct chip static_root; -extern void chip_configure(struct chip *, enum chip_pass); -extern void chip_enumerate(struct chip *chip); -#endif /* DEVICE_CHIP_H */ diff --git a/src/include/device/device.h b/src/include/device/device.h index c5a18c298e..d5d2e8d946 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -5,11 +5,18 @@ #include <device/resource.h> #include <device/path.h> + struct device; typedef struct device * device_t; struct pci_operations; struct smbus_bus_operations; +/* Chip operations */ +struct chip_operations { + char *name; /* This is the print name for debugging */ + void (*enable_dev)(struct device *dev); +}; + struct device_operations { void (*read_resources)(device_t dev); void (*set_resources)(device_t dev); @@ -67,7 +74,7 @@ struct device { unsigned long rom_address; struct device_operations *ops; - struct chip_control *chip_control; + struct chip_operations *chip_ops; void *chip_info; }; diff --git a/src/include/device/path.h b/src/include/device/path.h index 9df1d9fa67..cdb98ee8a8 100644 --- a/src/include/device/path.h +++ b/src/include/device/path.h @@ -10,7 +10,7 @@ enum device_path_type { DEVICE_PATH_I2C, DEVICE_PATH_APIC, DEVICE_PATH_PCI_DOMAIN, - DEVICE_APIC_CLUSTER, + DEVICE_PATH_APIC_CLUSTER, }; struct pci_domain_path diff --git a/src/include/device/pnp.h b/src/include/device/pnp.h index 89c0a730f5..757b240c32 100644 --- a/src/include/device/pnp.h +++ b/src/include/device/pnp.h @@ -4,7 +4,6 @@ #include <stdint.h> #include <device/device.h> #include <device/pnp_def.h> -#include <device/chip.h> /* Primitive pnp resource manipulation */ void pnp_write_config(device_t dev, uint8_t reg, uint8_t value); @@ -45,7 +44,7 @@ struct pnp_info { struct io_info io0, io1, io2, io3; }; struct resource *pnp_get_resource(device_t dev, unsigned index); -void pnp_enumerate(struct chip *chip, unsigned functions, - struct device_operations *ops, struct pnp_info *info); +void pnp_enable_devices(struct device *dev, struct device_operations *ops, + unsigned functions, struct pnp_info *info); #endif /* DEVICE_PNP_H */ diff --git a/src/include/device/smbus.h b/src/include/device/smbus.h index 230f061900..40e49eefae 100644 --- a/src/include/device/smbus.h +++ b/src/include/device/smbus.h @@ -4,7 +4,6 @@ #include <stdint.h> #include <device/device.h> #include <device/path.h> -#include <device/chip.h> #include <device/smbus_def.h> /* Common smbus bus operations */ |