| 1 |
|
| 2 |
|
| 3 |
#include <device/device.h> |
| 4 |
#include <device/pci.h> |
| 5 |
#include <device/pci_ops.h> |
| 6 |
#include <device/pci_ids.h> |
| 7 |
#include "i82801gx.h" |
| 8 |
|
| 9 |
static void pci_init(struct device *dev) |
| 10 |
{ |
| 11 |
u16 reg16; |
| 12 |
|
| 13 |
|
| 14 |
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER); |
| 15 |
|
| 16 |
|
| 17 |
pci_write_config8(dev, INTR, 0xff); |
| 18 |
|
| 19 |
|
| 20 |
pci_and_config16(dev, PCI_BRIDGE_CONTROL, |
| 21 |
~(PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_SERR)); |
| 22 |
|
| 23 |
|
| 24 |
pci_update_config8(dev, SMLT, 0x07, 0x04 << 3); |
| 25 |
|
| 26 |
|
| 27 |
reg16 = pci_read_config16(dev, PSTS); |
| 28 |
|
| 29 |
pci_write_config16(dev, PSTS, reg16); |
| 30 |
|
| 31 |
reg16 = pci_read_config16(dev, SECSTS); |
| 32 |
|
| 33 |
pci_write_config16(dev, SECSTS, reg16); |
| 34 |
} |
| 35 |
|
| 36 |
static struct device_operations device_ops = { |
| 37 |
.read_resources = pci_bus_read_resources, |
| 38 |
.set_resources = pci_dev_set_resources, |
| 39 |
.enable_resources = pci_bus_enable_resources, |
| 40 |
.init = pci_init, |
| 41 |
.scan_bus = pci_scan_bridge, |
| 42 |
.ops_pci = &pci_dev_ops_pci, |
| 43 |
}; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
static const struct pci_driver i82801g_pci __pci_driver = { |
| 48 |
.ops = &device_ops, |
| 49 |
.vendor = PCI_VID_INTEL, |
| 50 |
.device = 0x244e, |
| 51 |
}; |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
static const struct pci_driver i82801gmu_pci __pci_driver = { |
| 56 |
.ops = &device_ops, |
| 57 |
.vendor = PCI_VID_INTEL, |
| 58 |
.device = 0x2448, |
| 59 |
}; |