14 struct pci_operations;
19 struct usb_bus_operations;
32 #define CHIP_NAME(X) .name = X,
48 #if CONFIG(GENERATE_SMBIOS_TABLES)
50 unsigned long *current);
53 #if CONFIG(HAVE_ACPI_TABLES)
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);
60 const char *(*acpi_hid)(
const struct device *dev);
146 #if CONFIG(GENERATE_SMBIOS_TABLES)
148 u8 smbios_slot_data_width;
149 u8 smbios_slot_length;
150 const char *smbios_slot_designation;
152 #if CONFIG(SMBIOS_TYPE41_PROVIDED_BY_DEVTREE)
158 bool smbios_instance_id_valid;
159 u8 smbios_instance_id;
160 const char *smbios_refdes;
214 const struct bus *parent,
217 const struct bus *parent,
219 size_t nested_path_length);
231 unsigned int package,
unsigned int core,
unsigned int thread);
233 #define amd_cpu_topology(cpu, node, core) \
234 set_cpu_topology(cpu, node, 0, core, 0)
236 #define intel_cpu_topology(cpu, package, core, thread) \
237 set_cpu_topology(cpu, 0, package, core, thread)
268 #if CONFIG(DEBUG_RESOURCES)
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)
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)
281 #define LOG_MEM_RESOURCE(type, dev, index, base_kb, size_kb)
282 #define LOG_IO_RESOURCE(type, dev, index, base, size)
285 #if CONFIG(DEBUG_FUNC)
287 #define DEV_FUNC_ENTER(dev) \
288 printk(BIOS_SPEW, "%s:%s:%d: ENTER (dev: %s)\n", \
289 __FILE__, __func__, __LINE__, dev_path(dev))
291 #define DEV_FUNC_EXIT(dev) \
292 printk(BIOS_SPEW, "%s:%s:%d: EXIT (dev: %s)\n", __FILE__, \
293 __func__, __LINE__, dev_path(dev))
295 #define DEV_FUNC_ENTER(dev)
296 #define DEV_FUNC_EXIT(dev)
302 #define DEVICE_IO_ALIGN 16
303 #define DEVICE_MEM_ALIGN 4096
311 unsigned long base,
unsigned long size);
314 unsigned long basek,
unsigned long sizek,
unsigned long type);
321 #define ram_resource(dev, idx, basek, sizek) \
322 fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_CACHEABLE)
324 #define reserved_ram_resource(dev, idx, basek, sizek) \
325 fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_CACHEABLE \
326 | IORESOURCE_RESERVE)
328 #define bad_ram_resource(dev, idx, basek, sizek) \
329 reserved_ram_resource((dev), (idx), (basek), (sizek))
331 #define uma_resource(dev, idx, basek, sizek) \
332 fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE)
334 #define mmio_resource(dev, idx, basek, sizek) \
335 fixed_mem_resource(dev, idx, basek, sizek, IORESOURCE_RESERVE)
337 #define io_resource(dev, idx, base, size) \
338 fixed_io_resource(dev, idx, base, size)
394 #define config_of_soc() __pci_0_00_0_config
403 #define DEV_PTR(_alias) _dev_##_alias##_ptr
407 #define WEAK_DEV_PTR(_alias) \
408 __weak DEVTREE_CONST struct device *const DEV_PTR(_alias)
unsigned long write_acpi_tables(unsigned long start)
int get_smbios_data(struct device *dev, int *handle, unsigned long *current)
void dev_enable(void)
Enable devices on the device tree.
DEVTREE_CONST struct bus * pci_root_bus(void)
void dev_finalize_chips(void)
Finalize all chips of statically known devices.
void run_bios(struct device *dev, unsigned long addr)
bool dev_is_active_bridge(struct device *dev)
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.
void fixed_io_resource(struct device *dev, unsigned long index, unsigned long base, unsigned long size)
void dev_set_enabled(struct device *dev, int enable)
void show_all_devs_resources(int debug_level, const char *msg)
void scan_static_bus(struct device *bus)
const char * dev_name(const struct device *dev)
struct resource * free_resources
Linked list of free resources.
void show_all_devs(int debug_level, const char *msg)
void disable_children(struct bus *bus)
void show_devs_subtree(struct device *root, int debug_level, const char *msg)
struct device * dev_find_lapic(unsigned int apic_id)
Given a Local APIC ID, find the device structure.
void fixed_mem_resource(struct device *dev, unsigned long index, unsigned long basek, unsigned long sizek, unsigned long type)
void dev_finalize(void)
Finalize all devices in the global device tree.
void scan_bridges(struct bus *bus)
void dev_initialize_chips(void)
Initialize all chips of statically known devices.
void set_cpu_topology(struct device *cpu, unsigned int node, unsigned int package, unsigned int core, unsigned int thread)
struct device * alloc_dev(struct bus *parent, struct device_path *path)
static void noop_read_resources(struct device *dev)
Standard device operations function pointers shims.
static void noop_set_resources(struct device *dev)
void assign_resources(struct bus *bus)
Assign the computed resources to the devices on the bus.
void __noreturn devtree_die(void)
void dev_configure(void)
Configure devices on the devices tree.
void scan_generic_bus(struct device *bus)
void scan_smbus(struct device *bus)
struct device * dev_find_device(u16 vendor, u16 device, struct device *from)
Find a device of a given vendor and type.
void show_devs_tree(const struct device *dev, int debug_level, int depth)
static void mp_cpu_bus_init(struct device *dev)
void enable_static_device(struct device *dev)
struct device_operations default_dev_ops_root
Default device operation for root device.
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.
void show_all_devs_tree(int debug_level, const char *msg)
const char * bus_path(struct bus *bus)
void mmconf_resource(struct device *dev, unsigned long index)
void show_one_resource(int debug_level, struct device *dev, struct resource *resource, const char *comment)
void tolm_test(void *gp, struct device *dev, struct resource *new)
struct device * dev_find_class(unsigned int class, struct device *from)
Find a device of a given class.
void pci_domain_read_resources(struct device *dev)
void devfn_disable(const struct bus *bus, unsigned int devfn)
static DEVTREE_CONST void * config_of(const struct device *dev)
DEVTREE_CONST struct device * pcidev_path_on_root_debug(pci_devfn_t devfn, const char *func)
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,.
DEVTREE_CONST struct device * pcidev_path_behind(const struct bus *parent, pci_devfn_t devfn)
bool is_devfn_enabled(unsigned int devfn)
DEVTREE_CONST struct device dev_root
This is the root of the device tree.
u32 find_pci_tolm(struct bus *bus)
void print_resource_tree(const struct device *root, int debug_level, const char *msg)
const char mainboard_name[]
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.
void devtree_bug(const char *func, pci_devfn_t devfn)
void pci_domain_set_resources(struct device *dev)
DEVTREE_CONST struct device * dev_find_slot_pnp(u16 port, u16 device)
Given a PnP port and a device number, find the device structure.
DEVTREE_CONST struct device * pcidev_path_behind_pci2pci_bridge(const struct device *bridge, pci_devfn_t devfn)
int reset_bus(struct bus *bus)
Reset all of the devices on a bus and clear the bus's reset_needed flag.
struct device * add_cpu_device(struct bus *cpu_bus, unsigned int apic_id, int enabled)
DEVTREE_CONST struct device * find_dev_path(const struct bus *parent, const struct device_path *path)
See if a device structure exists for path.
struct device * alloc_find_dev(struct bus *parent, struct device_path *path)
See if a device structure already exists and if not allocate it.
DEVTREE_CONST struct device *DEVTREE_CONST all_devices
Linked list of ALL devices.
void enable_static_devices(struct device *bus)
Enable devices on static buses.
void dev_enumerate(void)
Determine the existence of devices and extend the device tree.
DEVTREE_CONST struct device * dev_find_next_pci_device(DEVTREE_CONST struct device *previous_dev)
Given a device pointer, find the next PCI device.
const char * dev_path(const struct device *dev)
void dev_initialize(void)
Initialize all devices in the global device tree.
void pci_domain_scan_bus(struct device *dev)
Scan a PCI domain.
bool is_dev_enabled(const struct device *const dev)
DEVTREE_CONST struct device * pcidev_path_on_root(pci_devfn_t devfn)
DEVTREE_CONST struct device * pcidev_on_root(uint8_t dev, uint8_t fn)
void add_more_links(struct device *dev, unsigned int total_links)
Ensure the device has a minimum number of bus links.
DEVTREE_CONST struct device * pcidev_path_on_bus(unsigned int bus, pci_devfn_t devfn)
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.
static const PCI_SUBCLASS bridge[]
DEVTREE_CONST struct bus * next
unsigned int reset_needed
unsigned int disable_relaxed_ordering
DEVTREE_CONST struct device * children
DEVTREE_CONST struct device * dev
void(* init)(void *chip_info)
void(* enable_dev)(struct device *dev)
void(* init)(struct device *dev)
const struct spi_bus_operations * ops_spi_bus
void(* read_resources)(struct device *dev)
const struct smbus_bus_operations * ops_smbus_bus
const struct pnp_mode_ops * ops_pnp_mode
void(* enable_resources)(struct device *dev)
const struct gpio_operations * ops_gpio
void(* reset_bus)(struct bus *bus)
const struct i2c_bus_operations * ops_i2c_bus
void(* vga_disable)(struct device *dev)
void(* enable)(struct device *dev)
void(* set_resources)(struct device *dev)
void(* scan_bus)(struct device *bus)
const struct pci_operations * ops_pci
struct chip_operations * chip_ops
DEVTREE_CONST struct device * sibling
DEVTREE_CONST struct fw_config * probe_list
struct device_operations * ops
DEVTREE_CONST struct bus * bus
unsigned int on_mainboard
DEVTREE_CONST struct bus * link_list
DEVTREE_CONST struct device * next
DEVTREE_CONST struct resource * resource_list
DEVTREE_CONST void * chip_info
unsigned int disable_pcie_aspm
struct fw_config - Firmware configuration field and option.
unsigned int ioapic_dst_id
unsigned int ioapic_src_pin
unsigned int ioapic_flags
unsigned int ioapic_irq_pin
typedef void(X86APIP X86EMU_intrFuncs)(int num)