Skip to content

Commit b38040f

Browse files
Alexandre TorgueMarc Zyngier
authored andcommitted
irqchip/stm32-exti: Tag emr register as undefined for stm32mp15
The reference manual RM0436 of stm32mp15 till version v4.0 was erroneously reporting the Event Mask Registers (EMR) for the Cortex-A CPUs. These registers have been removed from v5.0 of the manual and the corresponding offsets have been marked as 'Reserved'. Prevent accessing these reserved addresses by tagging the EMR offsets as UNDEF_REG and modifying the code to handle this case. Signed-off-by: Alexandre Torgue <[email protected]> Signed-off-by: Antonio Borneo <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c16ae60 commit b38040f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/irqchip/irq-stm32-exti.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static const struct stm32_exti_drv_data stm32h7xx_drv_data = {
132132

133133
static const struct stm32_exti_bank stm32mp1_exti_b1 = {
134134
.imr_ofst = 0x80,
135-
.emr_ofst = 0x84,
135+
.emr_ofst = UNDEF_REG,
136136
.rtsr_ofst = 0x00,
137137
.ftsr_ofst = 0x04,
138138
.swier_ofst = 0x08,
@@ -142,7 +142,7 @@ static const struct stm32_exti_bank stm32mp1_exti_b1 = {
142142

143143
static const struct stm32_exti_bank stm32mp1_exti_b2 = {
144144
.imr_ofst = 0x90,
145-
.emr_ofst = 0x94,
145+
.emr_ofst = UNDEF_REG,
146146
.rtsr_ofst = 0x20,
147147
.ftsr_ofst = 0x24,
148148
.swier_ofst = 0x28,
@@ -152,7 +152,7 @@ static const struct stm32_exti_bank stm32mp1_exti_b2 = {
152152

153153
static const struct stm32_exti_bank stm32mp1_exti_b3 = {
154154
.imr_ofst = 0xA0,
155-
.emr_ofst = 0xA4,
155+
.emr_ofst = UNDEF_REG,
156156
.rtsr_ofst = 0x40,
157157
.ftsr_ofst = 0x44,
158158
.swier_ofst = 0x48,
@@ -795,7 +795,8 @@ stm32_exti_chip_data *stm32_exti_chip_init(struct stm32_exti_host_data *h_data,
795795
* clear registers to avoid residue
796796
*/
797797
writel_relaxed(0, base + stm32_bank->imr_ofst);
798-
writel_relaxed(0, base + stm32_bank->emr_ofst);
798+
if (stm32_bank->emr_ofst != UNDEF_REG)
799+
writel_relaxed(0, base + stm32_bank->emr_ofst);
799800

800801
pr_info("%pOF: bank%d\n", node, bank_idx);
801802

0 commit comments

Comments
 (0)