[coreboot-gerrit] Patch set updated for coreboot: soc/intel/apollolake: Enable ACPI PM1 timer emulation

Andrey Petrov (andrey.petrov@intel.com) gerrit at coreboot.org
Wed May 18 03:29:42 CEST 2016


Andrey Petrov (andrey.petrov at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14821

-gerrit

commit c0e8bf7f85c536b3bdad98183f10032c20c961e1
Author: Andrey Petrov <andrey.petrov at intel.com>
Date:   Tue Mar 29 14:19:53 2016 -0700

    soc/intel/apollolake: Enable ACPI PM1 timer emulation
    
    Enable emulation for ACPI PM1 timer. This is needed by FSP-M
    MemoryInit.
    
    Change-Id: I7a441f5f1673e6430697615ae7251da948e77548
    Signed-off-by: Andrey Petrov <andrey.petrov at intel.com>
---
 src/soc/intel/apollolake/bootblock/bootblock.c | 14 ++++++++++++++
 src/soc/intel/apollolake/include/soc/cpu.h     |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/src/soc/intel/apollolake/bootblock/bootblock.c b/src/soc/intel/apollolake/bootblock/bootblock.c
index 833f531..cd23f59 100644
--- a/src/soc/intel/apollolake/bootblock/bootblock.c
+++ b/src/soc/intel/apollolake/bootblock/bootblock.c
@@ -20,6 +20,7 @@
 #include <device/pci.h>
 #include <lib.h>
 #include <soc/bootblock.h>
+#include <soc/iomap.h>
 #include <soc/cpu.h>
 #include <soc/gpio.h>
 #include <soc/northbridge.h>
@@ -36,6 +37,17 @@ static void tpm_enable(void)
 	gpio_configure_pads(tpm_spi_configs, ARRAY_SIZE(tpm_spi_configs));
 }
 
+static void enable_pm_timer(void)
+{
+	/* ACPI PM timer emulation */
+	msr_t msr;
+	/* Multiplier value that somehow 3.579545MHz freq */
+	msr.hi = 0x2FBA2E25;
+	/* Set PM1 timer IO port and enable*/
+	msr.lo = EMULATE_PM_TMR_EN | (ACPI_PMIO_BASE + R_ACPI_PM1_TMR);
+	wrmsr(MSR_EMULATE_PM_TMR, msr);
+}
+
 void asmlinkage bootblock_c_entry(void)
 {
 	device_t dev = NB_DEV_ROOT;
@@ -80,5 +92,7 @@ void bootblock_soc_early_init(void)
 	if (IS_ENABLED(CONFIG_TPM_ON_FAST_SPI))
 		tpm_enable();
 
+	enable_pm_timer();
+
 	cache_bios_region();
 }
diff --git a/src/soc/intel/apollolake/include/soc/cpu.h b/src/soc/intel/apollolake/include/soc/cpu.h
index aaa2001..b731d4f 100644
--- a/src/soc/intel/apollolake/include/soc/cpu.h
+++ b/src/soc/intel/apollolake/include/soc/cpu.h
@@ -32,6 +32,8 @@ void apollolake_init_cpus(struct device *dev);
 #define MSR_POWER_MISC		0x120
 #define MSR_CORE_THREAD_COUNT	0x35
 #define MSR_EVICT_CTL		0x2e0
+#define MSR_EMULATE_PM_TMR	0x121
+#define   EMULATE_PM_TMR_EN	(1 << 16)
 
 #define BASE_CLOCK_MHZ		100
 



More information about the coreboot-gerrit mailing list