diff --git a/hw/hpet.c b/hw/hpet.c index 93fc399169dada99b2b88908a67c85525323adcc..e9b585c69bd6102ab3c394f7c7a74d4fed65e198 100644 --- a/hw/hpet.c +++ b/hw/hpet.c @@ -648,10 +648,6 @@ static void hpet_reset(DeviceState *d) s->hpet_counter = 0ULL; s->hpet_offset = 0ULL; - /* 64-bit main counter; LegacyReplacementRoute. */ - s->capability = 0x8086a001ULL; - s->capability |= (s->num_timers - 1) << HPET_ID_NUM_TIM_SHIFT; - s->capability |= ((HPET_CLK_PERIOD) << 32); s->config = 0ULL; if (count > 0) { /* we don't enable pit when hpet_reset is first called (by hpet_init) @@ -696,6 +692,11 @@ static int hpet_init(SysBusDevice *dev) timer->state = s; } + /* 64-bit main counter; LegacyReplacementRoute. */ + s->capability = 0x8086a001ULL; + s->capability |= (s->num_timers - 1) << HPET_ID_NUM_TIM_SHIFT; + s->capability |= ((HPET_CLK_PERIOD) << 32); + isa_reserve_irq(RTC_ISA_IRQ); qdev_init_gpio_in(&dev->qdev, hpet_handle_rtc_irq, 1);