Skip to content

Commit 539c603

Browse files
ludovicbarreMarc Zyngier
authored andcommitted
irqchip/stm32: Add stm32h7 support
stm32h7 has up to 96 inputs (3 banks of 32 inputs max). Signed-off-by: Ludovic Barre <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent ce0b7e3 commit 539c603

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

drivers/irqchip/irq-stm32-exti.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,39 @@ static const struct stm32_exti_bank *stm32f4xx_exti_banks[] = {
3838
&stm32f4xx_exti_b1,
3939
};
4040

41+
static const struct stm32_exti_bank stm32h7xx_exti_b1 = {
42+
.imr_ofst = 0x80,
43+
.emr_ofst = 0x84,
44+
.rtsr_ofst = 0x00,
45+
.ftsr_ofst = 0x04,
46+
.swier_ofst = 0x08,
47+
.pr_ofst = 0x88,
48+
};
49+
50+
static const struct stm32_exti_bank stm32h7xx_exti_b2 = {
51+
.imr_ofst = 0x90,
52+
.emr_ofst = 0x94,
53+
.rtsr_ofst = 0x20,
54+
.ftsr_ofst = 0x24,
55+
.swier_ofst = 0x28,
56+
.pr_ofst = 0x98,
57+
};
58+
59+
static const struct stm32_exti_bank stm32h7xx_exti_b3 = {
60+
.imr_ofst = 0xA0,
61+
.emr_ofst = 0xA4,
62+
.rtsr_ofst = 0x40,
63+
.ftsr_ofst = 0x44,
64+
.swier_ofst = 0x48,
65+
.pr_ofst = 0xA8,
66+
};
67+
68+
static const struct stm32_exti_bank *stm32h7xx_exti_banks[] = {
69+
&stm32h7xx_exti_b1,
70+
&stm32h7xx_exti_b2,
71+
&stm32h7xx_exti_b3,
72+
};
73+
4174
static unsigned long stm32_exti_pending(struct irq_chip_generic *gc)
4275
{
4376
const struct stm32_exti_bank *stm32_bank = gc->private;
@@ -256,3 +289,12 @@ static int __init stm32f4_exti_of_init(struct device_node *np,
256289
}
257290

258291
IRQCHIP_DECLARE(stm32f4_exti, "st,stm32-exti", stm32f4_exti_of_init);
292+
293+
static int __init stm32h7_exti_of_init(struct device_node *np,
294+
struct device_node *parent)
295+
{
296+
return stm32_exti_init(stm32h7xx_exti_banks,
297+
ARRAY_SIZE(stm32h7xx_exti_banks), np);
298+
}
299+
300+
IRQCHIP_DECLARE(stm32h7_exti, "st,stm32h7-exti", stm32h7_exti_of_init);

0 commit comments

Comments
 (0)