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 | #include "gma.h" //Azi:autoresolution␊ |
8 | ␊ |
9 | extern void set_eth_builtin(pci_dt_t *eth_dev);␊ |
10 | extern void notify_usb_dev(pci_dt_t *pci_dev);␊ |
11 | extern void force_enable_hpet(pci_dt_t *lpc_dev);␊ |
12 | ␊ |
13 | extern pci_dt_t *dram_controller_dev;␊ |
14 | ␊ |
15 | void setup_pci_devs(pci_dt_t *pci_dt)␊ |
16 | {␊ |
17 | ␉char *devicepath;␊ |
18 | ␉bool do_eth_devprop, do_gfx_devprop, do_enable_hpet;␊ |
19 | ␉pci_dt_t *current = pci_dt;␊ |
20 | ␊ |
21 | ␉do_eth_devprop = do_gfx_devprop = do_enable_hpet = false;␊ |
22 | ␊ |
23 | ␉getBoolForKey(kEthernetBuiltInKey, &do_eth_devprop, &bootInfo->bootConfig);␊ |
24 | ␉getBoolForKey(kGraphicsEnablerKey, &do_gfx_devprop, &bootInfo->bootConfig);␊ |
25 | ␉getBoolForKey(kForceHPETKey, &do_enable_hpet, &bootInfo->bootConfig);␊ |
26 | ␊ |
27 | ␉while (current)␊ |
28 | ␉{␊ |
29 | ␉␉devicepath = get_pci_dev_path(current);␊ |
30 | ␊ |
31 | ␉␉switch (current->class_id)␊ |
32 | ␉␉{␊ |
33 | ␉␉␉case PCI_CLASS_BRIDGE_HOST:␊ |
34 | ␉␉␉␉␉dram_controller_dev = current;␊ |
35 | ␉␉␉␉break;␊ |
36 | ␉␉␉␉␊ |
37 | ␉␉␉case PCI_CLASS_NETWORK_ETHERNET: ␊ |
38 | ␉␉␉␉if (do_eth_devprop)␊ |
39 | ␉␉␉␉␉set_eth_builtin(current);␊ |
40 | ␉␉␉␉break;␊ |
41 | ␉␉␉␉␊ |
42 | ␉␉␉case PCI_CLASS_DISPLAY_VGA:␊ |
43 | ␉␉␉␉if (do_gfx_devprop)␊ |
44 | ␉␉␉␉␉switch (current->vendor_id)␊ |
45 | ␉␉␉␉␉{␊ |
46 | ␉␉␉␉␉␉case PCI_VENDOR_ID_ATI:␊ |
47 | ␉␉␉␉␉␉␉verbose("ATI VGA Controller [%04x:%04x] :: %s \n", ␊ |
48 | ␉␉␉␉␉␉␉current->vendor_id, current->device_id, devicepath);␊ |
49 | ␉␉␉␉␉␉␉setup_ati_devprop(current); ␊ |
50 | ␉␉␉␉␉␉␉break;␊ |
51 | ␉␉␉␉␉␊ |
52 | ␉␉␉␉␉␉case PCI_VENDOR_ID_INTEL: //Azi:autoresolution␊ |
53 | ␉␉␉␉␉␉␉verbose("Intel Graphics Controller [%04x:%04x] :: %s \n",␊ |
54 | ␉␉␉␉␉␉␉current->vendor_id, current->device_id, devicepath);␊ |
55 | ␉␉␉␉␉␉␉setup_gma_devprop(current);␊ |
56 | ␉␉␉␉␉␉␉break;␊ |
57 | ␉␉␉␉␉␉␉/* message to be removed once support for these cards is added ␊ |
58 | ␉␉␉␉␉␉␉verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n", ␊ |
59 | ␉␉␉␉␉␉␉␉current->vendor_id, current->device_id, devicepath);␊ |
60 | ␉␉␉␉␉␉␉break;*/␊ |
61 | ␉␉␉␉␉␊ |
62 | ␉␉␉␉␉␉case PCI_VENDOR_ID_NVIDIA: ␊ |
63 | ␉␉␉␉␉␉␉setup_nvidia_devprop(current);␊ |
64 | ␉␉␉␉␉␉␉break;␊ |
65 | ␉␉␉␉␉}␊ |
66 | ␉␉␉␉break;␊ |
67 | ␊ |
68 | ␉␉␉case PCI_CLASS_SERIAL_USB:␊ |
69 | ␉␉␉␉notify_usb_dev(current);␊ |
70 | ␉␉␉␉break;␊ |
71 | ␊ |
72 | ␉␉␉case PCI_CLASS_BRIDGE_ISA:␊ |
73 | ␉␉␉␉if (do_enable_hpet)␊ |
74 | ␉␉␉␉␉force_enable_hpet(current);␊ |
75 | ␉␉␉␉break;␊ |
76 | ␉␉}␊ |
77 | ␉␉␊ |
78 | ␉␉setup_pci_devs(current->children);␊ |
79 | ␉␉current = current->next;␊ |
80 | ␉}␊ |
81 | }␊ |
82 | |