1 | ␊ |
2 | //#include "libsaio.h"␊ |
3 | //#include "bootstruct.h"␊ |
4 | #include "boot.h"␊ |
5 | #include "pci.h"␊ |
6 | #include "modules.h"␊ |
7 | //#include "nvidia.h"␊ |
8 | //#include "ati.h"␊ |
9 | //#include "gma.h" //Azi:autoresolution␊ |
10 | ␊ |
11 | extern void set_eth_builtin(pci_dt_t *eth_dev);␊ |
12 | extern void notify_usb_dev(pci_dt_t *pci_dev);␊ |
13 | extern void force_enable_hpet(pci_dt_t *lpc_dev);␊ |
14 | ␊ |
15 | extern pci_dt_t *dram_controller_dev;␊ |
16 | ␊ |
17 | void setup_pci_devs(pci_dt_t *pci_dt)␊ |
18 | {␊ |
19 | ␉bool do_eth_devprop, do_enable_hpet;␊ |
20 | ␉pci_dt_t *current = pci_dt;␊ |
21 | ␊ |
22 | ␉do_eth_devprop = do_enable_hpet = false;␊ |
23 | ␊ |
24 | ␉getBoolForKey(kEthernetBuiltInKey, &do_eth_devprop, &bootInfo->bootConfig);␊ |
25 | ␉getBoolForKey(kForceHPETKey, &do_enable_hpet, &bootInfo->bootConfig);␊ |
26 | ␊ |
27 | ␉while (current)␊ |
28 | ␉{␊ |
29 | ␉␉switch (current->class_id)␊ |
30 | ␉␉{␊ |
31 | ␉␉␉case PCI_CLASS_BRIDGE_HOST:␊ |
32 | ␉␉␉␉␉dram_controller_dev = current;␊ |
33 | ␉␉␉␉break;␊ |
34 | ␉␉␉␉␊ |
35 | ␉␉␉case PCI_CLASS_NETWORK_ETHERNET: ␊ |
36 | ␉␉␉␉if (do_eth_devprop)␊ |
37 | ␉␉␉␉␉set_eth_builtin(current);␊ |
38 | ␉␉␉␉break;␊ |
39 | ␉␉␉␉␊ |
40 | ␉␉␉case PCI_CLASS_DISPLAY_VGA:␊ |
41 | ␉␉␉␉execute_hook(kGraphicsEnablerKey, current, NULL, NULL, NULL);␊ |
42 | ␉␉␉␉break;␊ |
43 | ␊ |
44 | ␉␉␉case PCI_CLASS_SERIAL_USB:␊ |
45 | ␉␉␉␉notify_usb_dev(current);␊ |
46 | ␉␉␉␉break;␊ |
47 | ␊ |
48 | ␉␉␉case PCI_CLASS_BRIDGE_ISA:␊ |
49 | ␉␉␉␉if (do_enable_hpet)␊ |
50 | ␉␉␉␉␉force_enable_hpet(current);␊ |
51 | ␉␉␉␉break;␊ |
52 | ␉␉}␊ |
53 | ␉␉␊ |
54 | ␉␉setup_pci_devs(current->children);␊ |
55 | ␉␉current = current->next;␊ |
56 | ␉}␊ |
57 | }␊ |
58 | |