model_2065x: Use common i945-ivy TSEG SMM init.

Change-Id: I0302cbaeb45a55a4cfee94692eb7372f2b6b206d
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/10468
Tested-by: build bot (Jenkins)
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
diff --git a/src/cpu/intel/model_2065x/model_2065x_init.c b/src/cpu/intel/model_2065x/model_2065x_init.c
index 8e6970e..991bab8 100644
--- a/src/cpu/intel/model_2065x/model_2065x_init.c
+++ b/src/cpu/intel/model_2065x/model_2065x_init.c
@@ -35,6 +35,7 @@
 #include <pc80/mc146818rtc.h>
 #include "model_2065x.h"
 #include "chip.h"
+#include <cpu/intel/smm/gen1/smi.h>
 
 /*
  * List of supported C-states in this processor
@@ -113,6 +114,28 @@
 	{ 0 }
 };
 
+int cpu_get_apic_id_map(int *apic_id_map)
+{
+	int i;
+	struct cpuid_result result;
+	unsigned threads_per_package, threads_per_core;
+
+	/* Logical processors (threads) per core */
+	result = cpuid_ext(0xb, 0);
+	threads_per_core = result.ebx & 0xffff;
+
+	/* Logical processors (threads) per package */
+	result = cpuid_ext(0xb, 1);
+	threads_per_package = result.ebx & 0xffff;
+
+	for (i = 0; i < threads_per_package && i < CONFIG_MAX_CPUS; ++i) {
+		apic_id_map[i] = (i % threads_per_core)
+			+ ((i / threads_per_core) << 2);
+	}
+
+	return threads_per_package;
+}
+
 static void enable_vmx(void)
 {
 	struct cpuid_result regs;