coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pci.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <device/device.h>
4 #include <device/pci.h>
5 #include <device/pci_ids.h>
6 #include "hudson.h"
8 #include <bootstate.h>
9 
10 /*
11  * Update the PCI devices with a valid IRQ number
12  * that is set in the mainboard PCI_IRQ structures.
13  */
14 static void set_pci_irqs(void *unused)
15 {
16  /* Write PCI_INTR regs 0xC00/0xC01 */
18 
19  /* Write IRQs for all devicetree enabled devices */
21 }
22 
23 /*
24  * Hook this function into the PCI state machine
25  * on entry into BS_DEV_ENABLE.
26  */
28 
29 static struct pci_operations lops_pci = {
30  .set_subsystem = 0,
31 };
32 
33 static struct device_operations pci_ops = {
35  .set_resources = pci_dev_set_resources,
36  .enable_resources = pci_bus_enable_resources,
37  .scan_bus = pci_scan_bridge,
38  .reset_bus = pci_bus_reset,
39  .ops_pci = &lops_pci,
40 };
41 
42 static const struct pci_driver pci_driver __pci_driver = {
43  .ops = &pci_ops,
44  .vendor = PCI_VID_AMD,
45  .device = PCI_DID_AMD_SB900_PCI,
46 };
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, set_pci_irqs, NULL)
static struct pci_operations lops_pci
Definition: pci.c:29
static struct device_operations pci_ops
Definition: pci.c:33
static void set_pci_irqs(void *unused)
Definition: pci.c:14
static const struct pci_driver pci_driver __pci_driver
Definition: pci.c:42
@ BS_DEV_ENABLE
Definition: bootstate.h:82
@ BS_ON_ENTRY
Definition: bootstate.h:95
void pci_bus_enable_resources(struct device *dev)
Definition: pci_device.c:758
void pci_bus_read_resources(struct device *dev)
Definition: pci_device.c:540
void pci_bus_reset(struct bus *bus)
Definition: pci_device.c:777
void pci_scan_bridge(struct device *dev)
Scan a PCI bridge and the buses behind the bridge.
Definition: pci_device.c:1598
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
#define PCI_VID_AMD
Definition: pci_ids.h:496
#define PCI_DID_AMD_SB900_PCI
Definition: pci_ids.h:525
void write_pci_cfg_irqs(void)
Definition: amd_pci_util.c:84
void write_pci_int_table(void)
Definition: amd_pci_util.c:41
#define NULL
Definition: stddef.h:19
void(* read_resources)(struct device *dev)
Definition: device.h:39