Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 380