Chameleon

Chameleon Svn Source Tree

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

1#include "libsaio.h"
2#include "boot.h"
3#include "bootstruct.h"
4#include "pci.h"
5#include "nvidia.h"
6#include "modules.h"
7#include "gma.h" //Azi:autoresolution
8
9
10extern bool setup_ati_devprop(pci_dt_t *ati_dev);
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{
19char *devicepath;
20bool do_eth_devprop, do_gfx_devprop, do_enable_hpet;
21pci_dt_t *current = pci_dt;
22
23do_eth_devprop = do_gfx_devprop = do_enable_hpet = false;
24
25getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);
26getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
27getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);
28
29while (current)
30{
31devicepath = get_pci_dev_path(current);
32
33switch (current->class_id)
34{
35case PCI_CLASS_BRIDGE_HOST:
36if (current->dev.addr == PCIADDR(0, 0, 0))
37dram_controller_dev = current;
38break;
39
40case PCI_CLASS_NETWORK_ETHERNET:
41if (do_eth_devprop)
42set_eth_builtin(current);
43break;
44
45case PCI_CLASS_DISPLAY_VGA:
46if (do_gfx_devprop)
47switch (current->vendor_id)
48{
49case PCI_VENDOR_ID_ATI:
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
79execute_hook("PCIDevice", current, NULL, NULL, NULL);
80
81setup_pci_devs(current->children);
82current = current->next;
83}
84}
85

Archive Download this file

Revision: 946