descriptor for chips
[coreboot.git] / src / include / device / chip.h
1 /* chips are arbitrary chips (superio, southbridge, etc.)
2  * They have private structures that define chip resources and default 
3  * settings. They have four externally visible functions for control. 
4  * new settings are provided as ascii strings. 
5  */
6
7 /* some of the types of resources chips can control */
8
9 struct com_ports {
10   unsigned int enable,baud, base, irq;
11 };
12
13 /* lpt port description. 
14  * Note that for many chips you only really need to define the 
15  * enable. 
16  */
17 struct lpt_ports {
18         unsigned int enable, // 1 if this port is enabled
19                      mode,   // pp mode
20                      base,   // IO base of the parallel port 
21                      irq;    // irq
22 };
23
24
25
26 /* linkages from devices of a type (e.g. superio devices) 
27  * to the actual physical PCI device. This type is used in an array of 
28  * structs built by NLBConfig.py. We owe this idea to Plan 9.
29  */
30
31 struct chip;
32
33 struct chip_control {
34   void (*alloc)(struct chip *s);
35   void (*pre_pci_init)(struct chip *s);
36   void (*init)(struct chip *s);
37   void (*finishup)(struct chip *s);
38   char *path;     /* the default path. Can be overridden
39                    * by commands in config
40                    */
41   // This is the print name for debugging
42   char *name;
43 };
44
45 struct chip {
46   struct chip_control *control; /* for this device */
47   char *path; /* can be 0, in which case the default is taken */
48   char *configuration; /* can be 0. */
49 };
50