Skip to content

Commit

Permalink
drivers/timer: Use DTS interrupt info for XEC driver
Browse files Browse the repository at this point in the history
irq and irq priority must be taken from DTS generated configuration
macros.

Seems like driver requires the priority to be set to 1, thus setting it
to 1 in the relevant dtsi file.

Fixes zephyrproject-rtos#17775

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
  • Loading branch information
Tomasz Bursztyka committed Aug 27, 2019
1 parent 002c48e commit 5219ee1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions drivers/timer/mchp_xec_rtos_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,17 @@ int z_clock_driver_init(struct device *device)

RTMR_REGS->CTRL = 0U;
GIRQ23_REGS->SRC = MCHP_RTMR_GIRQ_VAL;
NVIC_ClearPendingIRQ(RTMR_IRQn);
NVIC_ClearPendingIRQ(DT_INST_0_MICROCHIP_XEC_RTOS_TIMER_IRQ_0);

timer_restart(cached_icr);

IRQ_CONNECT(RTMR_IRQn, 1, xec_rtos_timer_isr, 0, 0);
IRQ_CONNECT(DT_INST_0_MICROCHIP_XEC_RTOS_TIMER_IRQ_0,
DT_INST_0_MICROCHIP_XEC_RTOS_TIMER_IRQ_0_PRIORITY,
xec_rtos_timer_isr, NULL, 0);
GIRQ23_REGS->EN_SET = MCHP_RTMR_GIRQ_VAL;

RTMR_REGS->CTRL = TIMER_START_VAL;
irq_enable(RTMR_IRQn);
irq_enable(DT_INST_0_MICROCHIP_XEC_RTOS_TIMER_IRQ_0);

return 0;
}
2 changes: 1 addition & 1 deletion dts/arm/microchip/mec1501hsz.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
rtimer: timer@40007400 {
compatible = "microchip,xec-rtos-timer";
reg = <0x40007400 0x10>;
interrupts = <111 0>;
interrupts = <111 1>;
label = "RTIMER";
};
uart0: uart@400f2400 {
Expand Down

0 comments on commit 5219ee1

Please sign in to comment.