| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <device/pci.h> |
| 6 |
#include <device/pci_ids.h> |
| 7 |
#include "pch.h" |
| 8 |
#include <device/mmio.h> |
| 9 |
|
| 10 |
static void thermal_init(struct device *dev) |
| 11 |
{ |
| 12 |
struct resource *res; |
| 13 |
u8 *base; |
| 14 |
printk(BIOS_DEBUG, "Thermal init start.\n"); |
| 15 |
|
| 16 |
res = probe_resource(dev, PCI_BASE_ADDRESS_0); |
| 17 |
if (!res) |
| 18 |
return; |
| 19 |
|
| 20 |
base = res2mmio(res, 0, 0); |
| 21 |
write32(base + 4, 0x3a2b); |
| 22 |
write8(base + 0xe, 0x40); |
| 23 |
write16(base + 0x56, 0xffff); |
| 24 |
write16(base + 0x64, 0xffff); |
| 25 |
write16(base + 0x66, 0xffff); |
| 26 |
write16(base + 0x68, 0xfa); |
| 27 |
|
| 28 |
write8(base + 1, 0xb8); |
| 29 |
|
| 30 |
printk(BIOS_DEBUG, "Thermal init done.\n"); |
| 31 |
} |
| 32 |
|
| 33 |
static struct device_operations thermal_ops = { |
| 34 |
.read_resources = pci_dev_read_resources, |
| 35 |
.set_resources = pci_dev_set_resources, |
| 36 |
.enable_resources = pci_dev_enable_resources, |
| 37 |
.init = thermal_init, |
| 38 |
.ops_pci = &pci_dev_ops_pci, |
| 39 |
}; |
| 40 |
|
| 41 |
static const struct pci_driver pch_thermal __pci_driver = { |
| 42 |
.ops = &thermal_ops, |
| 43 |
.vendor = PCI_VID_INTEL, |
| 44 |
.device = PCI_DID_INTEL_IBEXPEAK_THERMAL, |
| 45 |
}; |