1 /* sconfig, coreboot device tree compiler */
2 /* SPDX-License-Identifier: GPL-2.0-only */
17 struct resource
*next
;
32 struct fw_config_option
;
33 struct fw_config_option
{
36 struct fw_config_option
*next
;
38 struct fw_config_field
;
39 struct fw_config_field
{
41 unsigned int start_bit
;
43 struct fw_config_field
*next
;
44 struct fw_config_option
*options
;
46 struct fw_config_probe
;
47 struct fw_config_probe
{
50 struct fw_config_probe
*next
;
54 struct chip_instance
{
55 /* Monotonically increasing ID for each chip instance. */
58 /* Pointer to registers for this chip. */
61 /* Pointer to references for this chip. */
64 /* Pointer to chip of which this is instance. */
67 /* Pointer to next instance of the same chip. */
68 struct chip_instance
*next
;
71 * Pointer to corresponding chip instance in base devicetree.
72 * a) If the chip instance belongs to the base devicetree, then this pointer is set to
74 * b) If the chip instance belongs to override tree, then this pointer is set to its
75 * corresponding chip instance in base devicetree (if it exists), else to NULL.
77 * This is useful when generating chip instances and chip_ops for a device to determine
78 * if this is the instance to emit or if there is a base chip instance to use instead.
80 struct chip_instance
*base_chip_instance
;
84 /* Indicates if chip header exists for this chip. */
87 /* Name of current chip. */
90 /* Name of current chip normalized to _. */
91 char *name_underscore
;
93 /* Pointer to first instance of this chip. */
94 struct chip_instance
*instance
;
96 /* Pointer to next chip. */
102 /* Instance/ID of the bus under the device. */
105 /* Pointer to device to which this bus belongs. */
108 /* Pointer to list of children. */
109 struct device
*children
;
111 /* Pointer to next bus for the device. */
112 struct bus
*next_bus
;
116 /* Indicates device status (enabled / hidden or not). */
119 /* non-zero if the device should be included in all cases */
122 /* Subsystem IDs for the device. */
123 int subsystem_vendor
;
124 int subsystem_device
;
125 int inherit_subsystem
;
127 /* Name of this device. */
130 /* Alias of this device (for internal references) */
133 /* Path of this device. */
138 /* Type of bus that exists under this device. */
142 struct pci_irq_info pci_irq_info
[4];
144 /* Pointer to bus of parent on which this device resides. */
147 /* Pointer to next child under the same parent. */
148 struct device
*sibling
;
150 /* Pointer to resources for this device. */
151 struct resource
*res
;
153 /* Pointer to chip instance for this device. */
154 struct chip_instance
*chip_instance
;
156 /* Pointer to list of buses under this device. */
158 /* Pointer to last bus under this device. */
159 struct bus
*last_bus
;
161 /* SMBIOS slot type */
162 char *smbios_slot_type
;
164 /* SMBIOS slot data width */
165 char *smbios_slot_data_width
;
167 /* SMBIOS slot description for reference designation */
168 char *smbios_slot_designation
;
170 /* SMBIOS slot length */
171 char *smbios_slot_length
;
173 /* List of field+option to probe. */
174 struct fw_config_probe
*probe
;
177 extern struct bus
*root_parent
;
179 struct device
*new_device_raw(struct bus
*parent
,
180 struct chip_instance
*chip_instance
,
181 const int bustype
, const char *devnum
,
182 char *alias
, int status
);
184 struct device
*new_device_reference(struct bus
*parent
,
185 struct chip_instance
*chip_instance
,
186 const char *reference
, int status
);
188 void add_resource(struct bus
*bus
, int type
, int index
, int base
);
190 void add_pci_subsystem_ids(struct bus
*bus
, int vendor
, int device
,
193 void add_ioapic_info(struct bus
*bus
, int apicid
, const char *_srcpin
,
196 void add_slot_desc(struct bus
*bus
, char *type
, char *length
, char *designation
,
199 void yyrestart(FILE *input_file
);
201 /* Add chip data to tail of queue. */
202 void chip_enqueue_tail(void *data
);
204 /* Retrieve chip data from tail of queue. */
205 void *chip_dequeue_tail(void);
207 struct chip_instance
*new_chip_instance(char *path
);
208 void add_register(struct chip_instance
*chip
, char *name
, char *val
);
209 void add_reference(struct chip_instance
*chip
, char *name
, char *alias
);
211 struct fw_config_field
*get_fw_config_field(const char *name
);
213 struct fw_config_field
*new_fw_config_field(const char *name
,
214 unsigned int start_bit
, unsigned int end_bit
);
216 void add_fw_config_option(struct fw_config_field
*field
, const char *name
,
219 void add_fw_config_probe(struct bus
*bus
, const char *field
, const char *option
);