lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
Last change
on this file since 1787e527 was fcbd1be, checked in by Lenka Trochtova <trochtova.lenka@…>, 16 years ago |
the name of the hierarchical driver was changed II
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | #include "pci.h"
|
---|
2 | #include "intel_piix3.h"
|
---|
3 | #include "isa.h"
|
---|
4 |
|
---|
5 | #define NAME "Intel PIIX3"
|
---|
6 |
|
---|
7 |
|
---|
8 | static int piix3_add_device(pci_dev_t *dev);
|
---|
9 | static void * piix3_absolutize(void *phys_addr);
|
---|
10 |
|
---|
11 | static pci_drv_ops_t piix3_pci_ops = {
|
---|
12 | .add_device = piix3_add_device
|
---|
13 | };
|
---|
14 |
|
---|
15 | static pci_drv_t piix3_drv = {
|
---|
16 | .name = NAME,
|
---|
17 | .link = { NULL, NULL },
|
---|
18 | .vendor_id = 0x8086,
|
---|
19 | .device_id = 0x7010,
|
---|
20 | .ops = &piix3_pci_ops
|
---|
21 | };
|
---|
22 |
|
---|
23 | static bridge_to_isa_ops_t piix3_bridge_ops = {
|
---|
24 | .absolutize = piix3_absolutize
|
---|
25 | };
|
---|
26 |
|
---|
27 | int intel_piix3_init()
|
---|
28 | {
|
---|
29 | pci_driver_register(&piix3_drv);
|
---|
30 | return 0;
|
---|
31 | }
|
---|
32 |
|
---|
33 |
|
---|
34 | static int piix3_add_device(pci_dev_t *dev)
|
---|
35 | {
|
---|
36 | printf(NAME " driver: new device %3d : %2d : %2d was added.\n", dev->bus->num, dev->dev, dev->fn);
|
---|
37 |
|
---|
38 | // register this device as a pci-to-isa bridge by the isa bus driver
|
---|
39 | bridge_to_isa_t *bridge_dev = isa_alloc_bridge();
|
---|
40 | isa_init_bridge(bridge_dev, &piix3_bridge_ops, dev);
|
---|
41 | isa_register_bridge(bridge_dev);
|
---|
42 |
|
---|
43 | return 1;
|
---|
44 | }
|
---|
45 |
|
---|
46 | // this might be more usable at different architectures
|
---|
47 | static void * piix3_absolutize(void *phys_addr)
|
---|
48 | {
|
---|
49 | return phys_addr;
|
---|
50 | }
|
---|
51 |
|
---|
52 |
|
---|
53 |
|
---|
54 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.