1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#include <console/console.h>
22#include <device/device.h>
23#include <device/pci.h>
24#include <device/pci_ids.h>
25#include <device/pciexp.h>
26
27
28static void pciexp_tune_dev(device_t dev)
29{
30 unsigned cap;
31
32 cap = pci_find_capability(dev, PCI_CAP_ID_PCIE);
33 if (!cap) {
34
35 return;
36 }
37
38
39}
40
41unsigned int pciexp_scan_bus(struct bus *bus,
42 unsigned min_devfn, unsigned max_devfn,
43 unsigned int max)
44{
45 device_t child;
46 max = pci_scan_bus(bus, min_devfn, max_devfn, max);
47 for(child = bus->children; child; child = child->sibling) {
48 if ( (child->path.pci.devfn < min_devfn) ||
49 (child->path.pci.devfn > max_devfn))
50 {
51 continue;
52 }
53 pciexp_tune_dev(child);
54 }
55 return max;
56}
57
58
59unsigned int pciexp_scan_bridge(device_t dev, unsigned int max)
60{
61 return do_pci_scan_bridge(dev, max, pciexp_scan_bus);
62}
63
64
65static struct pci_operations pciexp_bus_ops_pci = {
66 .set_subsystem = 0,
67};
68
69struct device_operations default_pciexp_ops_bus = {
70 .read_resources = pci_bus_read_resources,
71 .set_resources = pci_dev_set_resources,
72 .enable_resources = pci_bus_enable_resources,
73 .init = 0,
74 .scan_bus = pciexp_scan_bridge,
75 .enable = 0,
76 .reset_bus = pci_bus_reset,
77 .ops_pci = &pciexp_bus_ops_pci,
78};
79