diff options
-rw-r--r-- | xen/arch/x86/hpet.c | 8 | ||||
-rw-r--r-- | xen/include/asm-x86/hpet.h | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c index e72e8f94e4..d5e84f4ccd 100644 --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -276,9 +276,9 @@ u64 hpet_setup(void) set_fixmap_nocache(FIX_HPET_BASE, hpet_address); hpet_id = hpet_read32(HPET_ID); - if ( hpet_id == 0 ) + if ( (hpet_id & HPET_ID_REV) == 0 ) { - printk("BAD HPET vendor id.\n"); + printk("BAD HPET revision id.\n"); return 0; } @@ -296,9 +296,9 @@ u64 hpet_setup(void) for ( i = 0; i <= ((hpet_id >> 8) & 31); i++ ) { - cfg = hpet_read32(HPET_T0_CFG + i*0x20); + cfg = hpet_read32(HPET_Tn_CFG(i)); cfg &= ~HPET_TN_ENABLE; - hpet_write32(cfg & ~HPET_TN_ENABLE, HPET_T0_CFG); + hpet_write32(cfg, HPET_Tn_CFG(i)); } cfg = hpet_read32(HPET_CFG); diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h index b63f56805d..82c08bc3c5 100644 --- a/xen/include/asm-x86/hpet.h +++ b/xen/include/asm-x86/hpet.h @@ -24,6 +24,10 @@ #define HPET_T2_CMP 0x148 #define HPET_T2_ROUTE 0x150 +#define HPET_Tn_CFG(n) (HPET_T0_CFG + n * 0x20) +#define HPET_Tn_CMP(n) (HPET_T0_CMP + n * 0x20) +#define HPET_Tn_ROUTE(n) (HPET_T0_ROUTE + n * 0x20) + #define HPET_ID_VENDOR 0xffff0000 #define HPET_ID_LEGSUP 0x00008000 #define HPET_ID_NUMBER 0x00001f00 |