1 | #include "libsaio.h"␊ |
2 | #include "boot.h"␊ |
3 | #include "bootstruct.h"␊ |
4 | #include "pci.h"␊ |
5 | #include "nvidia.h"␊ |
6 | #include "ati.h"␊ |
7 | ␊ |
8 | extern void set_eth_builtin(pci_dt_t *eth_dev);␊ |
9 | extern void notify_usb_dev(pci_dt_t *pci_dev);␊ |
10 | extern void force_enable_hpet(pci_dt_t *lpc_dev);␊ |
11 | ␊ |
12 | void setup_pci_devs(pci_dt_t *pci_dt)␊ |
13 | {␊ |
14 | ␉char *devicepath;␊ |
15 | ␉bool do_eth_devprop, do_gfx_devprop, do_enable_hpet;␊ |
16 | ␉pci_dt_t *current = pci_dt;␊ |
17 | ␊ |
18 | ␉do_eth_devprop = do_gfx_devprop = do_enable_hpet = false;␊ |
19 | ␊ |
20 | ␉getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);␊ |
21 | ␉getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);␊ |
22 | ␉getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);␊ |
23 | ␊ |
24 | ␉while (current)␊ |
25 | ␉{␊ |
26 | ␉␉devicepath = get_pci_dev_path(current);␊ |
27 | ␊ |
28 | ␉␉switch (current->class_id)␊ |
29 | ␉␉{␊ |
30 | ␉␉␉case PCI_CLASS_NETWORK_ETHERNET: ␊ |
31 | ␉␉␉␉if (do_eth_devprop)␊ |
32 | ␉␉␉␉␉set_eth_builtin(current);␊ |
33 | ␉␉␉␉break;␊ |
34 | ␉␉␉␉␊ |
35 | ␉␉␉case PCI_CLASS_DISPLAY_VGA:␊ |
36 | ␉␉␉␉if (do_gfx_devprop)␊ |
37 | ␉␉␉␉␉switch (current->vendor_id)␊ |
38 | ␉␉␉␉␉{␊ |
39 | ␉␉␉␉␉␉case PCI_VENDOR_ID_ATI:␊ |
40 | ␉␉␉␉␉␉␉verbose("ATI VGA Controller [%04x:%04x] :: %s \n", ␊ |
41 | ␉␉␉␉␉␉␉current->vendor_id, current->device_id, devicepath);␊ |
42 | ␉␉␉␉␉␉␉setup_ati_devprop(current); ␊ |
43 | ␉␉␉␉␉␉␉break;␊ |
44 | ␉␉␉␉␉␊ |
45 | ␉␉␉␉␉␉case PCI_VENDOR_ID_INTEL: ␊ |
46 | ␉␉␉␉␉␉␉/* message to be removed once support for these cards is added */␊ |
47 | ␉␉␉␉␉␉␉verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n", ␊ |
48 | ␉␉␉␉␉␉␉␉current->vendor_id, current->device_id, devicepath);␊ |
49 | ␉␉␉␉␉␉␉break;␊ |
50 | ␉␉␉␉␉␊ |
51 | ␉␉␉␉␉␉case PCI_VENDOR_ID_NVIDIA: ␊ |
52 | ␉␉␉␉␉␉␉setup_nvidia_devprop(current);␊ |
53 | ␉␉␉␉␉␉␉break;␊ |
54 | ␉␉␉␉␉}␊ |
55 | ␉␉␉␉break;␊ |
56 | ␊ |
57 | ␉␉␉case PCI_CLASS_SERIAL_USB:␊ |
58 | ␉␉␉␉notify_usb_dev(current);␊ |
59 | ␉␉␉␉break;␊ |
60 | ␊ |
61 | ␉␉␉case PCI_CLASS_BRIDGE_ISA:␊ |
62 | ␉␉␉␉if (do_enable_hpet)␊ |
63 | ␉␉␉␉␉force_enable_hpet(current);␊ |
64 | ␉␉␉␉break;␊ |
65 | ␉␉}␊ |
66 | ␉␉␊ |
67 | ␉␉setup_pci_devs(current->children);␊ |
68 | ␉␉current = current->next;␊ |
69 | ␉}␊ |
70 | }␊ |
71 | |