summaryrefslogtreecommitdiff
path: root/arch/x86/lib
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2014-11-09 22:19:35 +0800
committerSimon Glass <sjg@chromium.org>2014-11-21 07:24:10 +0100
commit258b1357c6b324b0a45ca0c1cf3dfd1ef1b4c5c4 (patch)
tree1fbefc848bea5ef4a4c29be6957fe85b49c52572 /arch/x86/lib
parent80de049561f4d560c50341562b7e93ff45a1d8a0 (diff)
downloadu-boot-imx-258b1357c6b324b0a45ca0c1cf3dfd1ef1b4c5c4.zip
u-boot-imx-258b1357c6b324b0a45ca0c1cf3dfd1ef1b4c5c4.tar.gz
u-boot-imx-258b1357c6b324b0a45ca0c1cf3dfd1ef1b4c5c4.tar.bz2
x86: Save TSC frequency in the global data
Return the saved TSC frequency in get_tbclk_mhz(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/lib')
-rw-r--r--arch/x86/lib/tsc_timer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/lib/tsc_timer.c b/arch/x86/lib/tsc_timer.c
index ceff60c..f091c91 100644
--- a/arch/x86/lib/tsc_timer.c
+++ b/arch/x86/lib/tsc_timer.c
@@ -293,6 +293,9 @@ unsigned __attribute__((no_instrument_function)) long get_tbclk_mhz(void)
{
unsigned long fast_calibrate;
+ if (gd->arch.tsc_mhz)
+ return gd->arch.tsc_mhz;
+
fast_calibrate = try_msr_calibrate_tsc();
if (fast_calibrate)
return fast_calibrate;
@@ -301,6 +304,7 @@ unsigned __attribute__((no_instrument_function)) long get_tbclk_mhz(void)
if (!fast_calibrate)
panic("TSC frequency is ZERO");
+ gd->arch.tsc_mhz = fast_calibrate;
return fast_calibrate;
}