Commit cf8ff6b6 authored by Feng Tang's avatar Feng Tang Committed by Ingo Molnar

x86/platform: Add a wallclock_init func to x86_platforms ops

Some wall clock devices use MMIO based HW register, this new
function will give them a chance to do some initialization work
before their get/set_time service get called.
Signed-off-by: default avatarFeng Tang <feng.tang@intel.com>
Signed-off-by: default avatarJacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarDirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 66f5ddf3
...@@ -152,6 +152,7 @@ struct x86_cpuinit_ops { ...@@ -152,6 +152,7 @@ struct x86_cpuinit_ops {
/** /**
* struct x86_platform_ops - platform specific runtime functions * struct x86_platform_ops - platform specific runtime functions
* @calibrate_tsc: calibrate TSC * @calibrate_tsc: calibrate TSC
* @wallclock_init: init the wallclock device
* @get_wallclock: get time from HW clock like RTC etc. * @get_wallclock: get time from HW clock like RTC etc.
* @set_wallclock: set time back to HW clock * @set_wallclock: set time back to HW clock
* @is_untracked_pat_range exclude from PAT logic * @is_untracked_pat_range exclude from PAT logic
...@@ -160,6 +161,7 @@ struct x86_cpuinit_ops { ...@@ -160,6 +161,7 @@ struct x86_cpuinit_ops {
*/ */
struct x86_platform_ops { struct x86_platform_ops {
unsigned long (*calibrate_tsc)(void); unsigned long (*calibrate_tsc)(void);
void (*wallclock_init)(void);
unsigned long (*get_wallclock)(void); unsigned long (*get_wallclock)(void);
int (*set_wallclock)(unsigned long nowtime); int (*set_wallclock)(unsigned long nowtime);
void (*iommu_shutdown)(void); void (*iommu_shutdown)(void);
......
...@@ -1045,6 +1045,8 @@ void __init setup_arch(char **cmdline_p) ...@@ -1045,6 +1045,8 @@ void __init setup_arch(char **cmdline_p)
x86_init.timers.wallclock_init(); x86_init.timers.wallclock_init();
x86_platform.wallclock_init();
mcheck_init(); mcheck_init();
arch_init_ideal_nops(); arch_init_ideal_nops();
......
...@@ -27,6 +27,7 @@ void __init x86_init_uint_noop(unsigned int unused) { } ...@@ -27,6 +27,7 @@ void __init x86_init_uint_noop(unsigned int unused) { }
void __init x86_init_pgd_noop(pgd_t *unused) { } void __init x86_init_pgd_noop(pgd_t *unused) { }
int __init iommu_init_noop(void) { return 0; } int __init iommu_init_noop(void) { return 0; }
void iommu_shutdown_noop(void) { } void iommu_shutdown_noop(void) { }
void wallclock_init_noop(void) { }
/* /*
* The platform setup functions are preset with the default functions * The platform setup functions are preset with the default functions
...@@ -97,6 +98,7 @@ static int default_i8042_detect(void) { return 1; }; ...@@ -97,6 +98,7 @@ static int default_i8042_detect(void) { return 1; };
struct x86_platform_ops x86_platform = { struct x86_platform_ops x86_platform = {
.calibrate_tsc = native_calibrate_tsc, .calibrate_tsc = native_calibrate_tsc,
.wallclock_init = wallclock_init_noop,
.get_wallclock = mach_get_cmos_time, .get_wallclock = mach_get_cmos_time,
.set_wallclock = mach_set_rtc_mmss, .set_wallclock = mach_set_rtc_mmss,
.iommu_shutdown = iommu_shutdown_noop, .iommu_shutdown = iommu_shutdown_noop,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment