timer: hpet: make legacy interrupt routing optional
On some platforms, HPET is not wired to trigger IRQ 2. This would make HPET non-functional if the legacy interrupt routing bit is set in the global config register. This adds a DTS flag so the driver won't set the bit to enable legacy interrupt. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
1d3c710eaf
commit
44462723f5
2 changed files with 12 additions and 2 deletions
|
@ -435,14 +435,19 @@ static int sys_clock_driver_init(const struct device *dev)
|
||||||
cyc_per_tick = hz / CONFIG_SYS_CLOCK_TICKS_PER_SEC;
|
cyc_per_tick = hz / CONFIG_SYS_CLOCK_TICKS_PER_SEC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
reg = hpet_gconf_get();
|
||||||
|
reg |= GCONF_ENABLE;
|
||||||
|
|
||||||
|
#if (DT_INST_PROP(0, no_legacy_irq) == 0)
|
||||||
/* Note: we set the legacy routing bit, because otherwise
|
/* Note: we set the legacy routing bit, because otherwise
|
||||||
* nothing in Zephyr disables the PIT which then fires
|
* nothing in Zephyr disables the PIT which then fires
|
||||||
* interrupts into the same IRQ. But that means we're then
|
* interrupts into the same IRQ. But that means we're then
|
||||||
* forced to use IRQ2 contra the way the kconfig IRQ selection
|
* forced to use IRQ2 contra the way the kconfig IRQ selection
|
||||||
* is supposed to work. Should fix this.
|
* is supposed to work. Should fix this.
|
||||||
*/
|
*/
|
||||||
reg = hpet_gconf_get();
|
reg |= GCONF_LR;
|
||||||
reg |= GCONF_LR | GCONF_ENABLE;
|
#endif
|
||||||
|
|
||||||
hpet_gconf_set(reg);
|
hpet_gconf_set(reg);
|
||||||
|
|
||||||
last_count = hpet_counter_get();
|
last_count = hpet_counter_get();
|
||||||
|
|
|
@ -13,3 +13,8 @@ properties:
|
||||||
|
|
||||||
interrupts:
|
interrupts:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
no-legacy-irq:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
description: Do not set legacy IRQ bit
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue