Skip to content

Commit 2ca6b9b

Browse files
ludovicbarreMarc Zyngier
authored andcommitted
irqchip/stm32: Fix initial values
-After cold boot, imr default value depends on hardware configuration. -After hot reboot the registers must be cleared to avoid residue. Signed-off-by: Ludovic Barre <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 539c603 commit 2ca6b9b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/irqchip/irq-stm32-exti.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,16 @@ __init stm32_exti_init(const struct stm32_exti_bank **stm32_exti_banks,
258258
writel_relaxed(~0UL, base + stm32_bank->rtsr_ofst);
259259
irqs_mask = readl_relaxed(base + stm32_bank->rtsr_ofst);
260260
nr_exti = fls(readl_relaxed(base + stm32_bank->rtsr_ofst));
261+
262+
/*
263+
* This IP has no reset, so after hot reboot we should
264+
* clear registers to avoid residue
265+
*/
266+
writel_relaxed(0, base + stm32_bank->imr_ofst);
267+
writel_relaxed(0, base + stm32_bank->emr_ofst);
261268
writel_relaxed(0, base + stm32_bank->rtsr_ofst);
269+
writel_relaxed(0, base + stm32_bank->ftsr_ofst);
270+
writel_relaxed(~0UL, base + stm32_bank->pr_ofst);
262271

263272
pr_info("%s: bank%d, External IRQs available:%#x\n",
264273
node->full_name, i, irqs_mask);

0 commit comments

Comments
 (0)