Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/iFabio/Chameleon/i386/libsaio/pci_setup.c

Source at commit 310 created 12 years 11 months ago.
By ifabio, Some update and directory changes.
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
8
9extern bool setup_ati_devprop(pci_dt_t *ati_dev);
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;
21do_eth_devprop = do_gfx_devprop = do_enable_hpet = false;
22getBoolForKey(kEthernetBuiltIn, &do_eth_devprop, &bootInfo->bootConfig);
23getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
24getBoolForKey(kForceHPET, &do_enable_hpet, &bootInfo->bootConfig);
25
26while (current)
27{
28devicepath = get_pci_dev_path(current);
29switch (current->class_id)
30{
31case PCI_CLASS_BRIDGE_HOST:
32if (current->dev.addr == PCIADDR(0, 0, 0))
33dram_controller_dev = current;
34break;
35
36case PCI_CLASS_NETWORK_ETHERNET:
37if (do_eth_devprop)
38set_eth_builtin(current);
39break;
40
41case PCI_CLASS_DISPLAY_VGA:
42if (do_gfx_devprop)
43switch (current->vendor_id)
44{
45case PCI_VENDOR_ID_ATI:
46setup_ati_devprop(current);
47break;
48
49case PCI_VENDOR_ID_INTEL:
50/* message to be removed once support for these cards is added */
51verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n",
52current->vendor_id, current->device_id, devicepath);
53break;
54
55case PCI_VENDOR_ID_NVIDIA:
56setup_nvidia_devprop(current);
57break;
58}
59break;
60
61case PCI_CLASS_SERIAL_USB:
62notify_usb_dev(current);
63break;
64
65case PCI_CLASS_BRIDGE_ISA:
66if (do_enable_hpet)
67force_enable_hpet(current);
68break;
69}
70
71execute_hook("PCIDevice", current, NULL, NULL, NULL);
72
73setup_pci_devs(current->children);
74current = current->next;
75}
76}
77

Archive Download this file

Revision: 310