diff options
author | Simon Glass <sjg@chromium.org> | 2019-10-20 21:37:47 -0600 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2019-11-03 07:20:27 +0800 |
commit | a478a26cd00bbe14d51952b9ae3620415fbdf2b2 (patch) | |
tree | 1032cb4ead808bfe33fc84ed63fdf4886115eb20 /arch | |
parent | 096c71e34bac7551aa228bbcb9e1c867ad9e5d07 (diff) | |
download | u-boot-a478a26cd00bbe14d51952b9ae3620415fbdf2b2.tar.gz u-boot-a478a26cd00bbe14d51952b9ae3620415fbdf2b2.tar.xz u-boot-a478a26cd00bbe14d51952b9ae3620415fbdf2b2.zip |
x86: timer: Use a separate flag for whether timer is inited
At present the value of the timer base is used to determine whether the
timer has been set up or not. It is true that the timer is essentially
never exactly 0 when it is read. However 'time 0' may indicate the time
that the machine was reset so it is useful to be able to denote that.
Update the code to use a separate flag instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Aiden Park <aiden.park@intel.com>
Reviewed-by: Aiden Park <aiden.park@intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/global_data.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/global_data.h b/arch/x86/include/asm/global_data.h index 17a4d34491..7f3ada06f6 100644 --- a/arch/x86/include/asm/global_data.h +++ b/arch/x86/include/asm/global_data.h @@ -76,6 +76,7 @@ struct arch_global_data { uint8_t x86_mask; uint32_t x86_device; uint64_t tsc_base; /* Initial value returned by rdtsc() */ + bool tsc_inited; /* true if tsc is ready for use */ unsigned long clock_rate; /* Clock rate of timer in Hz */ void *new_fdt; /* Relocated FDT */ uint32_t bist; /* Built-in self test value */ |