x86/platform: Add a wallclock_init func to x86_init.timers ops
authorFeng Tang <feng.tang@intel.com>
Mon, 14 Feb 2011 16:13:31 +0000 (00:13 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 14 Feb 2011 17:20:43 +0000 (18:20 +0100)
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, which is usually
in early kernel boot phase.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/include/asm/x86_init.h
arch/x86/kernel/setup.c
arch/x86/kernel/x86_init.c

index 64642ad019fb78e14ce26416db13c3d340d6507c..643ebf2e2ad8733ddbec5ca884ee21bf405c0226 100644 (file)
@@ -83,11 +83,13 @@ struct x86_init_paging {
  *                             boot cpu
  * @tsc_pre_init:              platform function called before TSC init
  * @timer_init:                        initialize the platform timer (default PIT/HPET)
+ * @wallclock_init:            init the wallclock device
  */
 struct x86_init_timers {
        void (*setup_percpu_clockev)(void);
        void (*tsc_pre_init)(void);
        void (*timer_init)(void);
+       void (*wallclock_init)(void);
 };
 
 /**
index 21c6746338afef0949e89f8b2c0442654401546e..68d535a77df09c113004a408d81a636e4ed7ce27 100644 (file)
@@ -1059,6 +1059,8 @@ void __init setup_arch(char **cmdline_p)
 #endif
        x86_init.oem.banner();
 
+       x86_init.timers.wallclock_init();
+
        mcheck_init();
 
        local_irq_save(flags);
index ceb2911aa439dcb87ac0ef07a8d700f4a5a274e7..c11514e9128b53cf0b6ad66d844c7703a6a8523a 100644 (file)
@@ -70,6 +70,7 @@ struct x86_init_ops x86_init __initdata = {
                .setup_percpu_clockev   = setup_boot_APIC_clock,
                .tsc_pre_init           = x86_init_noop,
                .timer_init             = hpet_time_init,
+               .wallclock_init         = x86_init_noop,
        },
 
        .iommu = {