| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#include <bootstate.h> |
| 10 |
#include <commonlib/console/post_codes.h> |
| 11 |
#include <console/console.h> |
| 12 |
#include <cpu/x86/smm.h> |
| 13 |
#include <device/mmio.h> |
| 14 |
#include <device/pci.h> |
| 15 |
#include <intelblocks/cse.h> |
| 16 |
#include <intelblocks/lpc_lib.h> |
| 17 |
#include <intelblocks/pcr.h> |
| 18 |
#include <intelblocks/pmclib.h> |
| 19 |
#include <intelblocks/systemagent.h> |
| 20 |
#include <intelblocks/tco.h> |
| 21 |
#include <soc/p2sb.h> |
| 22 |
#include <soc/pci_devs.h> |
| 23 |
#include <soc/pcr_ids.h> |
| 24 |
#include <soc/pm.h> |
| 25 |
#include <soc/smbus.h> |
| 26 |
#include <soc/soc_chip.h> |
| 27 |
#include <soc/systemagent.h> |
| 28 |
#include <spi-generic.h> |
| 29 |
|
| 30 |
static void pch_finalize(void) |
| 31 |
{ |
| 32 |
|
| 33 |
tco_lockdown(); |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
pmc_clear_pmcon_sts(); |
| 38 |
} |
| 39 |
|
| 40 |
static void tbt_finalize(void) |
| 41 |
{ |
| 42 |
int i; |
| 43 |
const struct device *dev; |
| 44 |
|
| 45 |
|
| 46 |
for (i = 0; i < NUM_TBT_FUNCTIONS; i++) { |
| 47 |
dev = pcidev_path_on_root(SA_DEVFN_TBT(i)); |
| 48 |
if (dev) |
| 49 |
pci_dev_disable_bus_master(dev); |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
static void soc_finalize(void *unused) |
| 54 |
{ |
| 55 |
printk(BIOS_DEBUG, "Finalizing chipset.\n"); |
| 56 |
|
| 57 |
pch_finalize(); |
| 58 |
apm_control(APM_CNT_FINALIZE); |
| 59 |
tbt_finalize(); |
| 60 |
if (CONFIG(DISABLE_HECI1_AT_PRE_BOOT)) |
| 61 |
heci1_disable(); |
| 62 |
|
| 63 |
|
| 64 |
post_code(POSTCODE_OS_BOOT); |
| 65 |
} |
| 66 |
|
| 67 |
BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, soc_finalize, NULL); |
| 68 |
BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, soc_finalize, NULL); |