coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
device.h
Go to the documentation of this file.
1 #ifndef DEVICE_H
2 
3 #define DEVICE_H
4 
5 #include <device/resource.h>
6 #include <device/path.h>
7 #include <device/pci_type.h>
8 #include <smbios.h>
9 #include <static.h>
10 #include <types.h>
11 
12 struct fw_config;
13 struct device;
14 struct pci_operations;
15 struct i2c_bus_operations;
17 struct pnp_mode_ops;
18 struct spi_bus_operations;
19 struct usb_bus_operations;
20 struct gpio_operations;
21 
22 /* Chip operations */
24  void (*enable_dev)(struct device *dev);
25  void (*init)(void *chip_info);
26  void (*final)(void *chip_info);
27  unsigned int initialized : 1;
28  unsigned int finalized : 1;
29  const char *name;
30 };
31 
32 #define CHIP_NAME(X) .name = X,
33 
34 struct bus;
35 
36 struct acpi_rsdp;
37 
39  void (*read_resources)(struct device *dev);
40  void (*set_resources)(struct device *dev);
41  void (*enable_resources)(struct device *dev);
42  void (*init)(struct device *dev);
43  void (*final)(struct device *dev);
44  void (*scan_bus)(struct device *bus);
45  void (*enable)(struct device *dev);
46  void (*vga_disable)(struct device *dev);
47  void (*reset_bus)(struct bus *bus);
48 #if CONFIG(GENERATE_SMBIOS_TABLES)
49  int (*get_smbios_data)(struct device *dev, int *handle,
50  unsigned long *current);
51  void (*get_smbios_strings)(struct device *dev, struct smbios_type11 *t);
52 #endif
53 #if CONFIG(HAVE_ACPI_TABLES)
54  unsigned long (*write_acpi_tables)(const struct device *dev,
55  unsigned long start, struct acpi_rsdp *rsdp);
56  void (*acpi_fill_ssdt)(const struct device *dev);
57  void (*acpi_inject_dsdt)(const struct device *dev);
58  const char *(*acpi_name)(const struct device *dev);
59  /* Returns the optional _HID (Hardware ID) */
60  const char *(*acpi_hid)(const struct device *dev);
61 #endif
62  const struct pci_operations *ops_pci;
66  const struct pnp_mode_ops *ops_pnp_mode;
67  const struct gpio_operations *ops_gpio;
68 };
69 
70 /**
71  * Standard device operations function pointers shims.
72  */
73 static inline void noop_read_resources(struct device *dev) {}
74 static inline void noop_set_resources(struct device *dev) {}
75 
76 struct bus {
77 
78  DEVTREE_CONST struct device *dev; /* This bridge device */
79  DEVTREE_CONST struct device *children; /* devices behind this bridge */
80  DEVTREE_CONST struct bus *next; /* The next bridge on this device */
81  unsigned int bridge_ctrl; /* Bridge control register */
82  uint16_t bridge_cmd; /* Bridge command register */
83  unsigned char link_num; /* The index of this link */
84  uint16_t secondary; /* secondary bus number */
85  uint16_t subordinate; /* max subordinate bus number */
86  unsigned char cap; /* PCi capability offset */
87  uint32_t hcdn_reg; /* For HyperTransport link */
88 
89  unsigned int reset_needed : 1;
90  unsigned int disable_relaxed_ordering : 1;
91  unsigned int ht_link_up : 1;
92  unsigned int no_vga16 : 1; /* No support for 16-bit VGA decoding */
93 };
94 
95 /*
96  * There is one device structure for each slot-number/function-number
97  * combination:
98  */
99 
100 struct pci_irq_info {
101  unsigned int ioapic_irq_pin;
102  unsigned int ioapic_src_pin;
103  unsigned int ioapic_dst_id;
104  unsigned int ioapic_flags;
105 };
106 
107 struct device {
108  DEVTREE_CONST struct bus *bus; /* bus this device is on, for bridge
109  * devices, it is the up stream bus */
110 
111  DEVTREE_CONST struct device *sibling; /* next device on this bus */
112 
113  DEVTREE_CONST struct device *next; /* chain of all devices */
114 
115  struct device_path path;
116  unsigned int vendor;
117  unsigned int device;
120  unsigned int class; /* 3 bytes: (base, sub, prog-if) */
121  unsigned int hdr_type; /* PCI header type */
122  unsigned int enabled : 1; /* set if we should enable the device */
123  unsigned int initialized : 1; /* 1 if we have initialized the device */
124  unsigned int on_mainboard : 1;
125  unsigned int disable_pcie_aspm : 1;
126  /* set if we should hide from UI */
127  unsigned int hidden : 1;
128  /* set if this device is used even in minimum PCI cases */
129  unsigned int mandatory : 1;
131  uint16_t hotplug_buses; /* Number of hotplug buses to allocate */
132 
133  /* Base registers for this device. I/O, MEM and Expansion ROM */
135 
136  /* links are (downstream) buses attached to the device, usually a leaf
137  * device with no children has 0 buses attached and a bridge has 1 bus
138  */
140 
141 #if !DEVTREE_EARLY
142  struct pci_irq_info pci_irq_info[4];
145  const char *name;
146 #if CONFIG(GENERATE_SMBIOS_TABLES)
147  u8 smbios_slot_type;
148  u8 smbios_slot_data_width;
149  u8 smbios_slot_length;
150  const char *smbios_slot_designation;
151 
152 #if CONFIG(SMBIOS_TYPE41_PROVIDED_BY_DEVTREE)
153  /*
154  * These fields are intentionally guarded so that attempts to use
155  * the corresponding devicetree syntax without selecting the Kconfig
156  * option result in build-time errors. Smaller size is a side effect.
157  */
158  bool smbios_instance_id_valid;
159  u8 smbios_instance_id;
160  const char *smbios_refdes;
161 #endif
162 #endif
163 #endif
165 
166  /* Zero-terminated array of fields and options to probe. */
168 };
169 
170 /**
171  * This is the root of the device tree. The device tree is defined in the
172  * static.c file and is generated by the config tool at compile time.
173  */
174 extern DEVTREE_CONST struct device dev_root;
175 /* list of all devices */
177 extern struct resource *free_resources;
178 extern struct bus *free_links;
179 
180 extern const char mainboard_name[];
181 
182 /* Generic device interface functions */
183 struct device *alloc_dev(struct bus *parent, struct device_path *path);
184 void dev_initialize_chips(void);
185 void dev_enumerate(void);
186 void dev_configure(void);
187 void dev_enable(void);
188 void dev_initialize(void);
189 void dev_finalize(void);
190 void dev_finalize_chips(void);
191 /* Function used to override device state */
192 void devfn_disable(const struct bus *bus, unsigned int devfn);
193 
194 /* Generic device helper functions */
195 int reset_bus(struct bus *bus);
196 void scan_bridges(struct bus *bus);
197 void assign_resources(struct bus *bus);
198 const char *dev_name(const struct device *dev);
199 const char *dev_path(const struct device *dev);
200 u32 dev_path_encode(const struct device *dev);
201 const char *bus_path(struct bus *bus);
202 void dev_set_enabled(struct device *dev, int enable);
203 void disable_children(struct bus *bus);
204 bool dev_is_active_bridge(struct device *dev);
205 void add_more_links(struct device *dev, unsigned int total_links);
206 bool is_dev_enabled(const struct device *const dev);
207 bool is_devfn_enabled(unsigned int devfn);
208 
209 /* Option ROM helper functions */
210 void run_bios(struct device *dev, unsigned long addr);
211 
212 /* Helper functions */
214  const struct bus *parent,
215  const struct device_path *path);
217  const struct bus *parent,
218  const struct device_path nested_path[],
219  size_t nested_path_length);
220 struct device *alloc_find_dev(struct bus *parent, struct device_path *path);
221 struct device *dev_find_device(u16 vendor, u16 device, struct device *from);
222 struct device *dev_find_class(unsigned int class, struct device *from);
224  DEVTREE_CONST struct device *prev_match,
225  enum device_path_type path_type);
226 struct device *dev_find_lapic(unsigned int apic_id);
227 int dev_count_cpu(void);
228 struct device *add_cpu_device(struct bus *cpu_bus, unsigned int apic_id,
229  int enabled);
230 void set_cpu_topology(struct device *cpu, unsigned int node,
231  unsigned int package, unsigned int core, unsigned int thread);
232 
233 #define amd_cpu_topology(cpu, node, core) \
234  set_cpu_topology(cpu, node, 0, core, 0)
235 
236 #define intel_cpu_topology(cpu, package, core, thread) \
237  set_cpu_topology(cpu, 0, package, core, thread)
238 
239 void mp_init_cpus(DEVTREE_CONST struct bus *cpu_bus);
240 static inline void mp_cpu_bus_init(struct device *dev)
241 {
242  /*
243  * When no LAPIC device is specified in the devietree inside the CPU cluster device,
244  * neither a LAPIC device nor the link/bus between the CPU cluster and the LAPIC device
245  * will be present in the static device tree and the link_list struct element of the
246  * CPU cluster device will be NULL. In this case add one link, so that the
247  * alloc_find_dev calls in init_bsp and allocate_cpu_devices will be able to add a
248  * LAPIC device for the BSP and the APs on this link/bus.
249  */
250  if (!dev->link_list)
251  add_more_links(dev, 1);
252 
253  mp_init_cpus(dev->link_list);
254 }
255 
256 /* Debug functions */
257 void print_resource_tree(const struct device *root, int debug_level,
258  const char *msg);
259 void show_devs_tree(const struct device *dev, int debug_level, int depth);
260 void show_devs_subtree(struct device *root, int debug_level, const char *msg);
261 void show_all_devs(int debug_level, const char *msg);
262 void show_all_devs_tree(int debug_level, const char *msg);
263 void show_one_resource(int debug_level, struct device *dev,
264  struct resource *resource, const char *comment);
265 void show_all_devs_resources(int debug_level, const char *msg);
266 
267 /* Debug macros */
268 #if CONFIG(DEBUG_RESOURCES)
269 #include <console/console.h>
270 #define LOG_MEM_RESOURCE(type, dev, index, base_kb, size_kb) \
271  printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \
272  "end: 0x%llx, size_kb: 0x%llx\n", \
273  __func__, __LINE__, type, dev_path(dev), index, (base_kb << 10), \
274  (base_kb << 10) + (size_kb << 10) - 1, size_kb)
275 
276 #define LOG_IO_RESOURCE(type, dev, index, base, size) \
277  printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%x, base: 0x%llx, " \
278  "end: 0x%llx, size: 0x%llx\n", \
279  __func__, __LINE__, type, dev_path(dev), index, base, base + size - 1, size)
280 #else /* DEBUG_RESOURCES*/
281 #define LOG_MEM_RESOURCE(type, dev, index, base_kb, size_kb)
282 #define LOG_IO_RESOURCE(type, dev, index, base, size)
283 #endif /* DEBUG_RESOURCES*/
284 
285 #if CONFIG(DEBUG_FUNC)
286 #include <console/console.h>
287 #define DEV_FUNC_ENTER(dev) \
288  printk(BIOS_SPEW, "%s:%s:%d: ENTER (dev: %s)\n", \
289  __FILE__, __func__, __LINE__, dev_path(dev))
290 
291 #define DEV_FUNC_EXIT(dev) \
292  printk(BIOS_SPEW, "%s:%s:%d: EXIT (dev: %s)\n", __FILE__, \
293  __func__, __LINE__, dev_path(dev))
294 #else /* DEBUG_FUNC */
295 #define DEV_FUNC_ENTER(dev)
296 #define DEV_FUNC_EXIT(dev)
297 #endif /* DEBUG_FUNC */
298 
299 /* Rounding for boundaries.
300  * Due to some chip bugs, go ahead and round IO to 16
301  */
302 #define DEVICE_IO_ALIGN 16
303 #define DEVICE_MEM_ALIGN 4096
304 
306 void pci_domain_read_resources(struct device *dev);
307 void pci_domain_set_resources(struct device *dev);
308 void pci_domain_scan_bus(struct device *dev);
309 
310 void fixed_io_resource(struct device *dev, unsigned long index,
311  unsigned long base, unsigned long size);
312 
313 void fixed_mem_resource(struct device *dev, unsigned long index,
314  unsigned long basek, unsigned long sizek, unsigned long type);
315 
316 void mmconf_resource(struct device *dev, unsigned long index);
317 
318 /* It is the caller's responsibility to adjust regions such that ram_resource()
319  * and mmio_resource() do not overlap.
320  */
321 #define ram_resource(dev, idx, basek, sizek) \
322  fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_CACHEABLE)
323 
324 #define reserved_ram_resource(dev, idx, basek, sizek) \
325  fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_CACHEABLE \
326  | IORESOURCE_RESERVE)
327 
328 #define bad_ram_resource(dev, idx, basek, sizek) \
329  reserved_ram_resource((dev), (idx), (basek), (sizek))
330 
331 #define uma_resource(dev, idx, basek, sizek) \
332  fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE)
333 
334 #define mmio_resource(dev, idx, basek, sizek) \
335  fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE)
336 
337 #define io_resource(dev, idx, base, size) \
338  fixed_io_resource(dev, idx, base, size)
339 
340 void tolm_test(void *gp, struct device *dev, struct resource *new);
341 u32 find_pci_tolm(struct bus *bus);
342 
344  DEVTREE_CONST struct device *previous_dev);
345 DEVTREE_CONST struct device *dev_find_slot_on_smbus(unsigned int bus,
346  unsigned int addr);
348 DEVTREE_CONST struct device *dev_bus_each_child(const struct bus *parent,
349  DEVTREE_CONST struct device *prev_child);
350 
351 DEVTREE_CONST struct device *pcidev_path_behind(const struct bus *parent,
352  pci_devfn_t devfn);
354 DEVTREE_CONST struct device *pcidev_path_on_bus(unsigned int bus, pci_devfn_t devfn);
356 DEVTREE_CONST struct bus *pci_root_bus(void);
357 /* Find PCI device with given D#:F# sitting behind the given PCI-to-PCI bridge device. */
359  const struct device *bridge,
360  pci_devfn_t devfn);
361 
362 /* To be deprecated, avoid using.
363  *
364  * Note that this function can return the incorrect device prior
365  * to PCI enumeration because the secondary field of the bus object
366  * is 0. The failing scenario is determined by the order of the
367  * devices in all_devices singly-linked list as well as the time
368  * when this function is called (secondary reflecting topology).
369  */
370 DEVTREE_CONST struct device *pcidev_path_on_root_debug(pci_devfn_t devfn, const char *func);
371 
372 /* Robust discovery of chip_info. */
373 void devtree_bug(const char *func, pci_devfn_t devfn);
374 void __noreturn devtree_die(void);
375 
376 /*
377  * Dies if `dev` or `dev->chip_info` are NULL. Returns `dev->chip_info` otherwise.
378  *
379  * Only use if missing `chip_info` is fatal and we can't boot. If it's
380  * not fatal, please handle the NULL case gracefully.
381  */
382 static inline DEVTREE_CONST void *config_of(const struct device *dev)
383 {
384  if (dev && dev->chip_info)
385  return dev->chip_info;
386 
387  devtree_die();
388 }
389 
390 /*
391  * Returns pointer to config structure of root device (B:D:F = 0:00:0) defined by
392  * sconfig in static.{h/c}.
393  */
394 #define config_of_soc() __pci_0_00_0_config
395 
396 void enable_static_device(struct device *dev);
397 void enable_static_devices(struct device *bus);
398 void scan_smbus(struct device *bus);
399 void scan_generic_bus(struct device *bus);
400 void scan_static_bus(struct device *bus);
401 
402 /* Macro to generate `struct device *` name that points to a device with the given alias. */
403 #define DEV_PTR(_alias) _dev_##_alias##_ptr
404 
405 /* Macro to generate weak `struct device *` definition that points to a device with the given
406  alias. */
407 #define WEAK_DEV_PTR(_alias) \
408  __weak DEVTREE_CONST struct device *const DEV_PTR(_alias)
409 
410 #endif /* DEVICE_H */
unsigned long write_acpi_tables(unsigned long start)
Definition: acpi.c:1592
int vendor
Definition: cpu.c:91
int get_smbios_data(struct device *dev, int *handle, unsigned long *current)
Definition: smbios.c:1261
static u32 addr
Definition: cirrus.c:14
#define __noreturn
Definition: compiler.h:31
port
Definition: i915.h:29
void dev_enable(void)
Enable devices on the device tree.
Definition: device.c:492
DEVTREE_CONST struct bus * pci_root_bus(void)
Definition: device_const.c:239
void dev_finalize_chips(void)
Finalize all chips of statically known devices.
Definition: device.c:60
void run_bios(struct device *dev, unsigned long addr)
Definition: x86.c:409
bool dev_is_active_bridge(struct device *dev)
Definition: device_util.c:622
void mp_init_cpus(DEVTREE_CONST struct bus *cpu_bus)
u32 dev_path_encode(const struct device *dev)
Encode the device path into 3 bytes for logging to CMOS.
Definition: device_util.c:83
void fixed_io_resource(struct device *dev, unsigned long index, unsigned long base, unsigned long size)
Definition: device_util.c:843
void dev_set_enabled(struct device *dev, int enable)
Definition: device_util.c:594
void show_all_devs_resources(int debug_level, const char *msg)
Definition: device_util.c:809
void scan_static_bus(struct device *bus)
Definition: root_device.c:89
const char * dev_name(const struct device *dev)
Definition: device_util.c:233
struct resource * free_resources
Linked list of free resources.
Definition: device.c:23
void show_all_devs(int debug_level, const char *msg)
Definition: device_util.c:781
void disable_children(struct bus *bus)
Definition: device_util.c:606
void show_devs_subtree(struct device *root, int debug_level, const char *msg)
Definition: device_util.c:771
struct device * dev_find_lapic(unsigned int apic_id)
Given a Local APIC ID, find the device structure.
Definition: device_util.c:17
void fixed_mem_resource(struct device *dev, unsigned long index, unsigned long basek, unsigned long sizek, unsigned long type)
Definition: device_util.c:825
void dev_finalize(void)
Finalize all devices in the global device tree.
Definition: device.c:625
struct bus * free_links
void scan_bridges(struct bus *bus)
Definition: device.c:383
void dev_initialize_chips(void)
Initialize all chips of statically known devices.
Definition: device.c:38
void set_cpu_topology(struct device *cpu, unsigned int node, unsigned int package, unsigned int core, unsigned int thread)
Definition: cpu_device.c:31
struct device * alloc_dev(struct bus *parent, struct device_path *path)
Definition: device.c:122
static void noop_read_resources(struct device *dev)
Standard device operations function pointers shims.
Definition: device.h:73
static void noop_set_resources(struct device *dev)
Definition: device.h:74
void assign_resources(struct bus *bus)
Assign the computed resources to the devices on the bus.
Definition: device.c:268
void __noreturn devtree_die(void)
Definition: device_const.c:295
void dev_configure(void)
Configure devices on the devices tree.
Definition: device.c:453
void scan_generic_bus(struct device *bus)
Definition: root_device.c:52
void scan_smbus(struct device *bus)
Definition: root_device.c:74
struct device * dev_find_device(u16 vendor, u16 device, struct device *from)
Find a device of a given vendor and type.
Definition: device_util.c:42
void show_devs_tree(const struct device *dev, int debug_level, int depth)
Definition: device_util.c:742
static void mp_cpu_bus_init(struct device *dev)
Definition: device.h:240
void enable_static_device(struct device *dev)
Definition: root_device.c:10
struct device_operations default_dev_ops_root
Default device operation for root device.
Definition: root_device.c:123
DEVTREE_CONST struct device * dev_find_slot_on_smbus(unsigned int bus, unsigned int addr)
Given an SMBus bus and a device number, find the device structure.
Definition: device_const.c:307
void show_all_devs_tree(int debug_level, const char *msg)
Definition: device_util.c:763
const char * bus_path(struct bus *bus)
Definition: device_util.c:243
void mmconf_resource(struct device *dev, unsigned long index)
Definition: device_util.c:857
void show_one_resource(int debug_level, struct device *dev, struct resource *resource, const char *comment)
Definition: device_util.c:794
void tolm_test(void *gp, struct device *dev, struct resource *new)
Definition: device_util.c:870
struct device * dev_find_class(unsigned int class, struct device *from)
Find a device of a given class.
Definition: device_util.c:64
void pci_domain_read_resources(struct device *dev)
Definition: pci_device.c:547
void devfn_disable(const struct bus *bus, unsigned int devfn)
Definition: device.c:25
static DEVTREE_CONST void * config_of(const struct device *dev)
Definition: device.h:382
DEVTREE_CONST struct device * pcidev_path_on_root_debug(pci_devfn_t devfn, const char *func)
Definition: device_const.c:278
DEVTREE_CONST struct device * find_dev_nested_path(const struct bus *parent, const struct device_path nested_path[], size_t nested_path_length)
Find the device structure given an array of nested device paths,.
Definition: device_const.c:193
DEVTREE_CONST struct device * pcidev_path_behind(const struct bus *parent, pci_devfn_t devfn)
Definition: device_const.c:211
bool is_devfn_enabled(unsigned int devfn)
Definition: device_const.c:382
DEVTREE_CONST struct device dev_root
This is the root of the device tree.
u32 find_pci_tolm(struct bus *bus)
Definition: device_util.c:890
void print_resource_tree(const struct device *root, int debug_level, const char *msg)
Definition: device_util.c:725
const char mainboard_name[]
Definition: root_device.c:8
DEVTREE_CONST struct device * dev_find_path(DEVTREE_CONST struct device *prev_match, enum device_path_type path_type)
Given a Device Path Type, find the device structure.
Definition: device_const.c:53
void devtree_bug(const char *func, pci_devfn_t devfn)
Definition: device_const.c:290
void pci_domain_set_resources(struct device *dev)
Definition: pci_device.c:564
DEVTREE_CONST struct device * dev_find_slot_pnp(u16 port, u16 device)
Given a PnP port and a device number, find the device structure.
Definition: device_const.c:331
DEVTREE_CONST struct device * pcidev_path_behind_pci2pci_bridge(const struct device *bridge, pci_devfn_t devfn)
Definition: device_const.c:265
int reset_bus(struct bus *bus)
Reset all of the devices on a bus and clear the bus's reset_needed flag.
Definition: device.c:329
struct device * add_cpu_device(struct bus *cpu_bus, unsigned int apic_id, int enabled)
Definition: cpu_device.c:6
DEVTREE_CONST struct device * find_dev_path(const struct bus *parent, const struct device_path *path)
See if a device structure exists for path.
Definition: device_const.c:166
struct device * alloc_find_dev(struct bus *parent, struct device_path *path)
See if a device structure already exists and if not allocate it.
Definition: device.c:138
DEVTREE_CONST struct device *DEVTREE_CONST all_devices
Linked list of ALL devices.
Definition: device_const.c:13
void enable_static_devices(struct device *bus)
Enable devices on static buses.
Definition: root_device.c:40
void dev_enumerate(void)
Determine the existence of devices and extend the device tree.
Definition: device.c:416
DEVTREE_CONST struct device * dev_find_next_pci_device(DEVTREE_CONST struct device *previous_dev)
Given a device pointer, find the next PCI device.
Definition: device_const.c:79
const char * dev_path(const struct device *dev)
Definition: device_util.c:149
void dev_initialize(void)
Initialize all devices in the global device tree.
Definition: device.c:563
int dev_count_cpu(void)
Definition: device_util.c:907
void pci_domain_scan_bus(struct device *dev)
Scan a PCI domain.
Definition: pci_device.c:1610
bool is_dev_enabled(const struct device *const dev)
Definition: device_const.c:369
DEVTREE_CONST struct device * pcidev_path_on_root(pci_devfn_t devfn)
Definition: device_const.c:255
DEVTREE_CONST struct device * pcidev_on_root(uint8_t dev, uint8_t fn)
Definition: device_const.c:260
void add_more_links(struct device *dev, unsigned int total_links)
Ensure the device has a minimum number of bus links.
Definition: device_util.c:652
DEVTREE_CONST struct device * pcidev_path_on_bus(unsigned int bus, pci_devfn_t devfn)
Definition: device_const.c:221
DEVTREE_CONST struct device * dev_bus_each_child(const struct bus *parent, DEVTREE_CONST struct device *prev_child)
Given a device and previous match iterate through all the children.
Definition: device_const.c:353
unsigned int type
Definition: edid.c:57
device_path_type
Definition: path.h:6
static const PCI_SUBCLASS bridge[]
Definition: pci_class.c:72
u32 pci_devfn_t
Definition: pci_type.h:8
uintptr_t base
Definition: uart.c:17
#define DEVTREE_CONST
Definition: stddef.h:30
unsigned short uint16_t
Definition: stdint.h:11
unsigned int uint32_t
Definition: stdint.h:14
uint32_t u32
Definition: stdint.h:51
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
unsigned char uint8_t
Definition: stdint.h:8
Definition: acpi.h:82
Definition: device.h:76
uint32_t hcdn_reg
Definition: device.h:87
DEVTREE_CONST struct bus * next
Definition: device.h:80
unsigned int ht_link_up
Definition: device.h:91
unsigned int reset_needed
Definition: device.h:89
unsigned int bridge_ctrl
Definition: device.h:81
unsigned int disable_relaxed_ordering
Definition: device.h:90
unsigned char cap
Definition: device.h:86
DEVTREE_CONST struct device * children
Definition: device.h:79
unsigned char link_num
Definition: device.h:83
uint16_t subordinate
Definition: device.h:85
DEVTREE_CONST struct device * dev
Definition: device.h:78
unsigned int no_vga16
Definition: device.h:92
uint16_t secondary
Definition: device.h:84
uint16_t bridge_cmd
Definition: device.h:82
unsigned int finalized
Definition: device.h:28
const char * name
Definition: device.h:29
unsigned int initialized
Definition: device.h:27
void(* init)(void *chip_info)
Definition: device.h:25
void(* enable_dev)(struct device *dev)
Definition: device.h:24
void(* init)(struct device *dev)
Definition: device.h:42
const struct spi_bus_operations * ops_spi_bus
Definition: device.h:64
void(* read_resources)(struct device *dev)
Definition: device.h:39
const struct smbus_bus_operations * ops_smbus_bus
Definition: device.h:65
const struct pnp_mode_ops * ops_pnp_mode
Definition: device.h:66
void(* enable_resources)(struct device *dev)
Definition: device.h:41
const struct gpio_operations * ops_gpio
Definition: device.h:67
void(* reset_bus)(struct bus *bus)
Definition: device.h:47
const struct i2c_bus_operations * ops_i2c_bus
Definition: device.h:63
void(* vga_disable)(struct device *dev)
Definition: device.h:46
void(* enable)(struct device *dev)
Definition: device.h:45
void(* set_resources)(struct device *dev)
Definition: device.h:40
void(* scan_bus)(struct device *bus)
Definition: device.h:44
const struct pci_operations * ops_pci
Definition: device.h:62
Definition: device.h:107
unsigned int hidden
Definition: device.h:127
struct chip_operations * chip_ops
Definition: device.h:144
DEVTREE_CONST struct device * sibling
Definition: device.h:111
unsigned int initialized
Definition: device.h:123
const char * name
Definition: device.h:145
u16 subsystem_device
Definition: device.h:119
unsigned int vendor
Definition: device.h:116
DEVTREE_CONST struct fw_config * probe_list
Definition: device.h:167
struct device_path path
Definition: device.h:115
struct device_operations * ops
Definition: device.h:143
DEVTREE_CONST struct bus * bus
Definition: device.h:108
unsigned int hdr_type
Definition: device.h:121
unsigned int device
Definition: device.h:117
unsigned int on_mainboard
Definition: device.h:124
u16 subsystem_vendor
Definition: device.h:118
uint16_t hotplug_buses
Definition: device.h:131
unsigned int mandatory
Definition: device.h:129
DEVTREE_CONST struct bus * link_list
Definition: device.h:139
DEVTREE_CONST struct device * next
Definition: device.h:113
DEVTREE_CONST struct resource * resource_list
Definition: device.h:134
DEVTREE_CONST void * chip_info
Definition: device.h:164
unsigned int enabled
Definition: device.h:122
unsigned int disable_pcie_aspm
Definition: device.h:125
u8 command
Definition: device.h:130
struct fw_config - Firmware configuration field and option.
Definition: fw_config.h:20
unsigned int ioapic_dst_id
Definition: device.h:103
unsigned int ioapic_src_pin
Definition: device.h:102
unsigned int ioapic_flags
Definition: device.h:104
unsigned int ioapic_irq_pin
Definition: device.h:101
typedef void(X86APIP X86EMU_intrFuncs)(int num)