summaryrefslogtreecommitdiff
path: root/src/cpu/intel/model_2065x/tsc_freq.c
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2013-11-12 21:59:10 +0100
committerMarc Jones <marc.jones@se-eng.com>2013-11-13 00:38:45 +0100
commitd8cfd23f6ab37ae68366625e144136392384638f (patch)
treec2ce69e57c35dad907d78d84d4eaf8a1063327c8 /src/cpu/intel/model_2065x/tsc_freq.c
parentc5e947ef17d98722d27a67d65a84a28fd5861dbd (diff)
intel/2065x: Use TSC for udelay()
For the ram init of Intel Nehalem ram init we need a udelay implementation. Use common TSC framework for it as Intel Haswell already does. Change-Id: I360a6db1ec1ba32c92698a7d6f6968c93ead5c52 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/4043 Reviewed-by: Aaron Durbin <adurbin@google.com> Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'src/cpu/intel/model_2065x/tsc_freq.c')
-rw-r--r--src/cpu/intel/model_2065x/tsc_freq.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/cpu/intel/model_2065x/tsc_freq.c b/src/cpu/intel/model_2065x/tsc_freq.c
new file mode 100644
index 0000000000..7d388bef38
--- /dev/null
+++ b/src/cpu/intel/model_2065x/tsc_freq.c
@@ -0,0 +1,31 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2013 Google, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+#include <cpu/x86/msr.h>
+#include <cpu/x86/tsc.h>
+#include "model_2065x.h"
+
+unsigned long tsc_freq_mhz(void)
+{
+ msr_t platform_info;
+
+ platform_info = rdmsr(MSR_PLATFORM_INFO);
+ return SANDYBRIDGE_BCLK * ((platform_info.lo >> 8) & 0xff);
+}