include/stdint.h: Remove old reference to ROMCC
[coreboot.git] / util / sconfig / sconfig.h
blob60842f12a1d66fa396aff7fa3b37d7dacd2f1913
1 /*
2 * sconfig, coreboot device tree compiler
4 * Copyright (C) 2010 coresystems GmbH
5 * written by Patrick Georgi <patrick@georgi-clan.de>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <string.h>
20 #include <sys/types.h>
21 #include <unistd.h>
22 #include <errno.h>
24 struct resource;
25 struct resource {
26 int type;
27 int index;
28 int base;
29 struct resource *next;
32 struct reg;
33 struct reg {
34 char *key;
35 char *value;
36 struct reg *next;
39 struct pci_irq_info {
40 int ioapic_irq_pin;
41 int ioapic_dst_id;
44 struct chip;
45 struct chip_instance {
47 * Monotonically increasing ID for each newly allocated
48 * node(chip/device).
50 int id;
52 /* Pointer to registers for this chip. */
53 struct reg *reg;
55 /* Pointer to chip of which this is instance. */
56 struct chip *chip;
58 /* Pointer to next instance of the same chip. */
59 struct chip_instance *next;
62 * Reference count - Indicates how many devices hold pointer to this
63 * chip instance.
65 int ref_count;
68 struct chip {
69 /* Indicates if chip header exists for this chip. */
70 int chiph_exists;
72 /* Name of current chip. */
73 char *name;
75 /* Name of current chip normalized to _. */
76 char *name_underscore;
78 /* Pointer to first instance of this chip. */
79 struct chip_instance *instance;
81 /* Pointer to next chip. */
82 struct chip *next;
85 struct device;
86 struct bus {
87 /* Instance/ID of the bus under the device. */
88 int id;
90 /* Pointer to device to which this bus belongs. */
91 struct device *dev;
93 /* Pointer to list of children. */
94 struct device *children;
96 /* Pointer to next bus for the device. */
97 struct bus *next_bus;
100 struct device {
101 /* Monotonically increasing ID for the device. */
102 int id;
104 /* Indicates device status (enabled / hidden or not). */
105 int enabled;
106 int hidden;
107 /* non-zero if the device should be included in all cases */
108 int mandatory;
110 /* Subsystem IDs for the device. */
111 int subsystem_vendor;
112 int subsystem_device;
113 int inherit_subsystem;
115 /* Name of this device. */
116 char *name;
118 /* Path of this device. */
119 char *path;
120 int path_a;
121 int path_b;
123 /* Type of bus that exists under this device. */
124 int bustype;
126 /* PCI IRQ info. */
127 struct pci_irq_info pci_irq_info[4];
129 /* Pointer to bus of parent on which this device resides. */
130 struct bus *parent;
132 /* Pointer to next child under the same parent. */
133 struct device *sibling;
135 /* Pointer to resources for this device. */
136 struct resource *res;
138 /* Pointer to chip instance for this device. */
139 struct chip_instance *chip_instance;
141 /* Pointer to list of buses under this device. */
142 struct bus *bus;
143 /* Pointer to last bus under this device. */
144 struct bus *last_bus;
146 /* SMBIOS slot type */
147 char *smbios_slot_type;
149 /* SMBIOS slot data width */
150 char *smbios_slot_data_width;
152 /* SMBIOS slot description for reference designation */
153 char *smbios_slot_designation;
155 /* SMBIOS slot length */
156 char *smbios_slot_length;
159 extern struct bus *root_parent;
161 struct device *new_device(struct bus *parent,
162 struct chip_instance *chip_instance,
163 const int bustype, const char *devnum,
164 int status);
166 void add_resource(struct bus *bus, int type, int index, int base);
168 void add_pci_subsystem_ids(struct bus *bus, int vendor, int device,
169 int inherit);
171 void add_ioapic_info(struct bus *bus, int apicid, const char *_srcpin,
172 int irqpin);
174 void add_slot_desc(struct bus *bus, char *type, char *length, char *designation,
175 char *data_width);
177 void yyrestart(FILE *input_file);
179 /* Add chip data to tail of queue. */
180 void chip_enqueue_tail(void *data);
182 /* Retrieve chip data from tail of queue. */
183 void *chip_dequeue_tail(void);
185 struct chip_instance *new_chip_instance(char *path);
186 void add_register(struct chip_instance *chip, char *name, char *val);