| 1 |
|
| 2 |
|
| 3 |
#include <types.h> |
| 4 |
#include <arch/io.h> |
| 5 |
#include <device/pci_ops.h> |
| 6 |
#include <console/console.h> |
| 7 |
#include <device/pci_def.h> |
| 8 |
#include <cpu/intel/em64t101_save_state.h> |
| 9 |
#include <cpu/intel/model_2065x/model_2065x.h> |
| 10 |
#include <gpio.h> |
| 11 |
#include <southbridge/intel/common/finalize.h> |
| 12 |
#include <southbridge/intel/common/pmbase.h> |
| 13 |
#include <southbridge/intel/ibexpeak/me.h> |
| 14 |
#include "pch.h" |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#include <northbridge/intel/ironlake/ironlake.h> |
| 21 |
#include <southbridge/intel/common/pmutil.h> |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
void southbridge_gate_memory_reset(void) |
| 30 |
{ |
| 31 |
|
| 32 |
gpio_output(CONFIG_DRAM_RESET_GATE_GPIO, 0); |
| 33 |
} |
| 34 |
|
| 35 |
void southbridge_smi_monitor(void) |
| 36 |
{ |
| 37 |
#define IOTRAP(x) (trap_sts & (1 << x)) |
| 38 |
u32 trap_sts, trap_cycle; |
| 39 |
u32 data, mask = 0; |
| 40 |
int i; |
| 41 |
|
| 42 |
trap_sts = RCBA32(0x1e00); |
| 43 |
RCBA32(0x1e00) = trap_sts; |
| 44 |
|
| 45 |
trap_cycle = RCBA32(0x1e10); |
| 46 |
for (i = 16; i < 20; i++) { |
| 47 |
if (trap_cycle & (1 << i)) |
| 48 |
mask |= (0xff << ((i - 16) << 3)); |
| 49 |
} |
| 50 |
|
| 51 |
|
| 52 |
if (IOTRAP(3)) { |
| 53 |
return; |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
if (IOTRAP(0)) { |
| 61 |
if (!(trap_cycle & (1 << 24))) { |
| 62 |
printk(BIOS_DEBUG, "SMI1 command\n"); |
| 63 |
data = RCBA32(0x1e18); |
| 64 |
data &= mask; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
} |
| 69 |
|
| 70 |
} |
| 71 |
|
| 72 |
printk(BIOS_DEBUG, " trapped io address = 0x%x\n", trap_cycle & 0xfffc); |
| 73 |
for (i = 0; i < 4; i++) { |
| 74 |
if (IOTRAP(i)) |
| 75 |
printk(BIOS_DEBUG, " TRAP = %d\n", i); |
| 76 |
} |
| 77 |
printk(BIOS_DEBUG, " AHBE = %x\n", (trap_cycle >> 16) & 0xf); |
| 78 |
printk(BIOS_DEBUG, " MASK = 0x%08x\n", mask); |
| 79 |
printk(BIOS_DEBUG, " read/write: %s\n", (trap_cycle & (1 << 24)) ? "read" : "write"); |
| 80 |
|
| 81 |
if (!(trap_cycle & (1 << 24))) { |
| 82 |
|
| 83 |
data = RCBA32(0x1e18); |
| 84 |
printk(BIOS_DEBUG, " iotrap written data = 0x%08x\n", data); |
| 85 |
} |
| 86 |
#undef IOTRAP |
| 87 |
} |
| 88 |
|
| 89 |
void southbridge_finalize_all(void) |
| 90 |
{ |
| 91 |
|
| 92 |
intel_pch_finalize_smm(); |
| 93 |
intel_ironlake_finalize_smm(); |
| 94 |
intel_model_2065x_finalize_smm(); |
| 95 |
} |