summaryrefslogtreecommitdiffstats
path: root/src/northbridge/intel/gm45/northbridge.c
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2018-01-25 00:33:45 +0100
committerPatrick Georgi <pgeorgi@google.com>2018-07-30 19:11:00 +0000
commitaade90e68d26a90fbea0dccdaae3493bdf31829a (patch)
tree5e31d203c4beecb94250a458e67cc7d639f0b250 /src/northbridge/intel/gm45/northbridge.c
parent6cd2c2f6ff792d1a170cd090e3347cfe2e14ac15 (diff)
downloadcoreboot-aade90e68d26a90fbea0dccdaae3493bdf31829a.tar.gz
coreboot-aade90e68d26a90fbea0dccdaae3493bdf31829a.tar.bz2
coreboot-aade90e68d26a90fbea0dccdaae3493bdf31829a.zip
nb/intel/gm45: Use common code for SMM in TSEG
This makes i82801ix use the common smm southbridge code to set up smm relocation and smi handler setup. This is needed in this change for the the smm relocation code relies on some southbridge functions provided in the common code. Some of the old code is kept for the Q35 qemu target. This also caches the TSEG region and therefore increases MTRR usage a little in some cases. Currently SMRR msr's are not set on model_1067x and model_6fx since this needs the MSRR enable bit and lock set in IA32_FEATURE_CONTROL. This will be handled properly in the subsequent parallel mp init patchset. Tested on Thinkpad X200: boots and going to and resuming from S3 still works fine. Change-Id: Ic80c65ea42fcf554ea5695772e8828d2f3b00b98 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/23419 Reviewed-by: Patrick Rudolph <siro@das-labor.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/northbridge/intel/gm45/northbridge.c')
-rw-r--r--src/northbridge/intel/gm45/northbridge.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/northbridge/intel/gm45/northbridge.c b/src/northbridge/intel/gm45/northbridge.c
index 663a9ff5794a..da37e33145c8 100644
--- a/src/northbridge/intel/gm45/northbridge.c
+++ b/src/northbridge/intel/gm45/northbridge.c
@@ -25,6 +25,7 @@
#include <boot/tables.h>
#include <arch/acpi.h>
#include <cbmem.h>
+#include <cpu/intel/smm/gen1/smi.h>
#include "chip.h"
#include "gm45.h"
#include "arch/acpi.h"
@@ -207,6 +208,43 @@ static const char *northbridge_acpi_name(const struct device *dev)
return NULL;
}
+u32 northbridge_get_tseg_base(void)
+{
+ return (u32)smm_region_start();
+}
+
+u32 northbridge_get_tseg_size(void)
+{
+ const u8 esmramc = pci_read_config8(dev_find_slot(0, PCI_DEVFN(0, 0)),
+ D0F0_ESMRAMC);
+ return decode_tseg_size(esmramc) << 10;
+}
+
+void northbridge_write_smram(u8 smram)
+{
+ pci_write_config8(dev_find_slot(0, PCI_DEVFN(0, 0)), D0F0_SMRAM, smram);
+}
+
+/*
+ * Really doesn't belong here but will go away with parallel mp init,
+ * so let it be here for a while...
+ */
+int cpu_get_apic_id_map(int *apic_id_map)
+{
+ unsigned int i;
+
+ /* Logical processors (threads) per core */
+ const struct cpuid_result cpuid1 = cpuid(1);
+ /* Read number of cores. */
+ const char cores = (cpuid1.ebx >> 16) & 0xf;
+
+ /* TODO in parallel MP cpuid(1).ebx */
+ for (i = 0; i < cores; i++)
+ apic_id_map[i] = i;
+
+ return cores;
+}
+
static struct device_operations pci_domain_ops = {
.read_resources = mch_domain_read_resources,
.set_resources = mch_domain_set_resources,