ia64/xen-unstable

changeset 15245:c9d66baad22b

Remove 'hpet_force' option. Replace with 'clocksource' option to allow
forced selection of platform clocksource, overriding the default
priority ordering.

Usage: clocksource={pit,hpet,cyclone,acpi}

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed May 30 18:29:21 2007 +0100 (2007-05-30)
parents 2d7d33ac982a
children dc25aedfa4f3
files xen/arch/x86/time.c
line diff
     1.1 --- a/xen/arch/x86/time.c	Wed May 30 18:12:02 2007 +0100
     1.2 +++ b/xen/arch/x86/time.c	Wed May 30 18:29:21 2007 +0100
     1.3 @@ -31,10 +31,9 @@
     1.4  #include <asm/hpet.h>
     1.5  #include <io_ports.h>
     1.6  
     1.7 -/* opt_hpet_force: If true, force HPET configuration via PCI space. */
     1.8 -/* NB. This is a gross hack. Mainly useful for HPET testing. */
     1.9 -static int opt_hpet_force = 0;
    1.10 -boolean_param("hpet_force", opt_hpet_force);
    1.11 +/* opt_clocksource: Force clocksource to one of: pit, hpet, cyclone, acpi. */
    1.12 +static char opt_clocksource[10];
    1.13 +string_param("clocksource", opt_clocksource);
    1.14  
    1.15  #define EPOCH MILLISECS(1000)
    1.16  
    1.17 @@ -357,15 +356,6 @@ static int init_hpet(void)
    1.18      u32 hpet_id, hpet_period, cfg;
    1.19      int i;
    1.20  
    1.21 -    if ( (hpet_address == 0) && opt_hpet_force )
    1.22 -    {
    1.23 -        outl(0x800038a0, 0xcf8);
    1.24 -        outl(0xff000001, 0xcfc);
    1.25 -        outl(0x800038a0, 0xcf8);
    1.26 -        hpet_address = inl(0xcfc) & 0xfffffffe;
    1.27 -        printk("WARNING: Forcibly enabled HPET at %#lx.\n", hpet_address);
    1.28 -    }
    1.29 -
    1.30      if ( hpet_address == 0 )
    1.31          return 0;
    1.32  
    1.33 @@ -603,6 +593,27 @@ static void platform_time_calibration(vo
    1.34  
    1.35  static void init_platform_timer(void)
    1.36  {
    1.37 +    if ( opt_clocksource[0] != '\0' )
    1.38 +    {
    1.39 +        int rc = -1;
    1.40 +
    1.41 +        if ( !strcmp(opt_clocksource, "pit") )
    1.42 +            rc = (init_pit(), 1);
    1.43 +        else if ( !strcmp(opt_clocksource, "hpet") )
    1.44 +            rc = init_hpet();
    1.45 +        else if ( !strcmp(opt_clocksource, "cyclone") )
    1.46 +            rc = init_cyclone();
    1.47 +        else if ( !strcmp(opt_clocksource, "acpi") )
    1.48 +            rc = init_pmtimer();
    1.49 +
    1.50 +        if ( rc == 1 )
    1.51 +            return;
    1.52 +
    1.53 +        printk("WARNING: %s clocksource '%s'.\n",
    1.54 +               (rc == 0) ? "Could not initialise" : "Unrecognised",
    1.55 +               opt_clocksource);
    1.56 +    }
    1.57 +
    1.58      if ( !init_cyclone() && !init_hpet() && !init_pmtimer() )
    1.59          init_pit();
    1.60  }