ia32: Add HPET timer initialization abstraction
Initializes the HPET timer if it is configured into the system. Change-Id: Ia9474e868101abe88e031266b956c6a559745d75 Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
parent
097a1a17dc
commit
bbb57b5f80
2 changed files with 13 additions and 0 deletions
|
@ -110,6 +110,7 @@ the 'ia32' platform.
|
|||
#define HPET_TIMER0_VEC (HPET_TIMER0_IRQ + INT_VEC_IRQ0)
|
||||
#define HPET_TIMER0_INT_PRI (4)
|
||||
#define HPET_TIMER0_IRQ (2)
|
||||
#define HPET_IOAPIC_FLAGS (IOAPIC_EDGE | IOAPIC_LOW)
|
||||
|
||||
/* serial port (aka COM port) information */
|
||||
|
||||
|
|
|
@ -81,6 +81,17 @@ static inline void ioapic_init(void)
|
|||
} while ((0))
|
||||
#endif /* CONFIG_IOAPIC */
|
||||
|
||||
#ifdef CONFIG_HPET_TIMER
|
||||
static inline void hpet_irq_set(void)
|
||||
{
|
||||
_ioapic_irq_set(HPET_TIMER0_IRQ, HPET_TIMER0_VEC, HPET_IOAPIC_FLAGS);
|
||||
}
|
||||
#else
|
||||
#define hpet_irq_set() \
|
||||
do { /* nothing */ \
|
||||
} while ((0))
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE)
|
||||
|
||||
/**
|
||||
|
@ -160,6 +171,7 @@ static int ia32_init(struct device *arg)
|
|||
loapic_init(); /* NOP if not needed */
|
||||
|
||||
ioapic_init(); /* NOP if not needed */
|
||||
hpet_irq_set(); /* NOP if not needed */
|
||||
console_init(); /* NOP if not needed */
|
||||
bluetooth_init(); /* NOP if not needed */
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue