| 1 |
|
| 2 |
|
| 3 |
#include <device/mmio.h> |
| 4 |
#include <device/pci_ops.h> |
| 5 |
#include "pch.h" |
| 6 |
#include "cpu/intel/model_2065x/model_2065x.h" |
| 7 |
#include <cpu/x86/msr.h> |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
void early_thermal_init(void) |
| 12 |
{ |
| 13 |
pci_devfn_t dev; |
| 14 |
msr_t msr; |
| 15 |
|
| 16 |
dev = PCI_DEV(0x0, 0x1f, 0x6); |
| 17 |
|
| 18 |
|
| 19 |
pci_write_config32(dev, 0x40, 0x40000000); |
| 20 |
pci_write_config32(dev, 0x44, 0x0); |
| 21 |
|
| 22 |
|
| 23 |
pci_write_config32(dev, 0x40, |
| 24 |
pci_read_config32(dev, 0x40) | 5); |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
msr = rdmsr(MSR_TEMPERATURE_TARGET); |
| 29 |
write16((u16 *)0x40000012, ((msr.lo >> 16) & 0xff) << 6); |
| 30 |
|
| 31 |
write16((u16 *)0x40000016, 0x7746); |
| 32 |
|
| 33 |
write16((u16 *)0x4000001a, |
| 34 |
(read16((u16 *)0x4000001a) & ~0xf) | 0x10f0); |
| 35 |
|
| 36 |
|
| 37 |
pci_write_config32(dev, 0x40, |
| 38 |
pci_read_config32(dev, 0x40) & ~1); |
| 39 |
pci_write_config32(dev, 0x40, 0); |
| 40 |
} |