Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1682981 > unrolled thread

[PATCH 5/8] irqchip: stm32: fix initial values

Started byLudovic Barre <ludovic.Barre@st.com>
First post2017-07-07 09:30 +0200
Last post2017-07-07 09:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 5/8] irqchip: stm32: fix initial values Ludovic Barre <ludovic.Barre@st.com> - 2017-07-07 09:30 +0200

#1682981 — [PATCH 5/8] irqchip: stm32: fix initial values

FromLudovic Barre <ludovic.Barre@st.com>
Date2017-07-07 09:30 +0200
Subject[PATCH 5/8] irqchip: stm32: fix initial values
Message-ID<u0vS9-Am-11@gated-at.bofh.it>
From: Ludovic Barre <ludovic.barre@st.com>

-after cold boot, imr default value depend of hw configuration
-after hot reboot the registers must be cleared to avoid residue

Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
---
 drivers/irqchip/irq-stm32-exti.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c
index 69ae09d..3c7077d 100644
--- a/drivers/irqchip/irq-stm32-exti.c
+++ b/drivers/irqchip/irq-stm32-exti.c
@@ -246,7 +246,16 @@ static int __init stm32_exti_init(struct stm32_exti_bank **stm32_exti_banks,
 		irqs_mask = readl_relaxed(base + stm32_bank->rtsr_ofst);
 		stm32_bank->irqs_mask = irqs_mask;
 		nr_exti = fls(readl_relaxed(base + stm32_bank->rtsr_ofst));
+
+		/*
+		 * This IP has no reset, so after hot reboot we should
+		 * clear registers to avoid residue
+		 */
+		writel_relaxed(0, base + stm32_bank->imr_ofst);
+		writel_relaxed(0, base + stm32_bank->emr_ofst);
 		writel_relaxed(0, base + stm32_bank->rtsr_ofst);
+		writel_relaxed(0, base + stm32_bank->ftsr_ofst);
+		writel_relaxed(~0UL, base + stm32_bank->pr_ofst);
 
 		pr_info("%s: bank%d, External IRQs available:%#x\n",
 			node->full_name, i, irqs_mask);
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web