Chameleon

Chameleon Svn Source Tree

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

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

Archive Download this file

Revision: 495