Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Chazi/i386/libsaio/pci_setup.c

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
11extern void set_eth_builtin(pci_dt_t *eth_dev);
12extern void notify_usb_dev(pci_dt_t *pci_dev);
13extern void force_enable_hpet(pci_dt_t *lpc_dev);
14
15extern pci_dt_t *dram_controller_dev;
16
17void setup_pci_devs(pci_dt_t *pci_dt)
18{
19bool do_eth_devprop, do_enable_hpet;
20pci_dt_t *current = pci_dt;
21
22do_eth_devprop = do_enable_hpet = false;
23
24getBoolForKey(kEthernetBuiltInKey, &do_eth_devprop, &bootInfo->bootConfig);
25getBoolForKey(kForceHPETKey, &do_enable_hpet, &bootInfo->bootConfig);
26
27while (current)
28{
29switch (current->class_id)
30{
31case PCI_CLASS_BRIDGE_HOST:
32dram_controller_dev = current;
33break;
34
35case PCI_CLASS_NETWORK_ETHERNET:
36if (do_eth_devprop)
37set_eth_builtin(current);
38break;
39
40case PCI_CLASS_DISPLAY_VGA:
41execute_hook(kGraphicsEnablerKey, current, NULL, NULL, NULL);
42break;
43
44case PCI_CLASS_SERIAL_USB:
45notify_usb_dev(current);
46break;
47
48case PCI_CLASS_BRIDGE_ISA:
49if (do_enable_hpet)
50force_enable_hpet(current);
51break;
52}
53
54setup_pci_devs(current->children);
55current = current->next;
56}
57}
58

Archive Download this file

Revision: 524