@@ -34,14 +34,14 @@ struct stm32_exti_bank {
34
34
u32 swier_ofst ;
35
35
u32 rpr_ofst ;
36
36
u32 fpr_ofst ;
37
+ u32 trg_ofst ;
37
38
};
38
39
39
40
#define UNDEF_REG ~0
40
41
41
42
struct stm32_desc_irq {
42
43
u32 exti ;
43
44
u32 irq_parent ;
44
- struct irq_chip * chip ;
45
45
};
46
46
47
47
struct stm32_exti_drv_data {
@@ -78,6 +78,7 @@ static const struct stm32_exti_bank stm32f4xx_exti_b1 = {
78
78
.swier_ofst = 0x10 ,
79
79
.rpr_ofst = 0x14 ,
80
80
.fpr_ofst = UNDEF_REG ,
81
+ .trg_ofst = UNDEF_REG ,
81
82
};
82
83
83
84
static const struct stm32_exti_bank * stm32f4xx_exti_banks [] = {
@@ -97,6 +98,7 @@ static const struct stm32_exti_bank stm32h7xx_exti_b1 = {
97
98
.swier_ofst = 0x08 ,
98
99
.rpr_ofst = 0x88 ,
99
100
.fpr_ofst = UNDEF_REG ,
101
+ .trg_ofst = UNDEF_REG ,
100
102
};
101
103
102
104
static const struct stm32_exti_bank stm32h7xx_exti_b2 = {
@@ -107,6 +109,7 @@ static const struct stm32_exti_bank stm32h7xx_exti_b2 = {
107
109
.swier_ofst = 0x28 ,
108
110
.rpr_ofst = 0x98 ,
109
111
.fpr_ofst = UNDEF_REG ,
112
+ .trg_ofst = UNDEF_REG ,
110
113
};
111
114
112
115
static const struct stm32_exti_bank stm32h7xx_exti_b3 = {
@@ -117,6 +120,7 @@ static const struct stm32_exti_bank stm32h7xx_exti_b3 = {
117
120
.swier_ofst = 0x48 ,
118
121
.rpr_ofst = 0xA8 ,
119
122
.fpr_ofst = UNDEF_REG ,
123
+ .trg_ofst = UNDEF_REG ,
120
124
};
121
125
122
126
static const struct stm32_exti_bank * stm32h7xx_exti_banks [] = {
@@ -138,6 +142,7 @@ static const struct stm32_exti_bank stm32mp1_exti_b1 = {
138
142
.swier_ofst = 0x08 ,
139
143
.rpr_ofst = 0x0C ,
140
144
.fpr_ofst = 0x10 ,
145
+ .trg_ofst = 0x3EC ,
141
146
};
142
147
143
148
static const struct stm32_exti_bank stm32mp1_exti_b2 = {
@@ -148,6 +153,7 @@ static const struct stm32_exti_bank stm32mp1_exti_b2 = {
148
153
.swier_ofst = 0x28 ,
149
154
.rpr_ofst = 0x2C ,
150
155
.fpr_ofst = 0x30 ,
156
+ .trg_ofst = 0x3E8 ,
151
157
};
152
158
153
159
static const struct stm32_exti_bank stm32mp1_exti_b3 = {
@@ -158,6 +164,7 @@ static const struct stm32_exti_bank stm32mp1_exti_b3 = {
158
164
.swier_ofst = 0x48 ,
159
165
.rpr_ofst = 0x4C ,
160
166
.fpr_ofst = 0x50 ,
167
+ .trg_ofst = 0x3E4 ,
161
168
};
162
169
163
170
static const struct stm32_exti_bank * stm32mp1_exti_banks [] = {
@@ -170,90 +177,90 @@ static struct irq_chip stm32_exti_h_chip;
170
177
static struct irq_chip stm32_exti_h_chip_direct ;
171
178
172
179
static const struct stm32_desc_irq stm32mp1_desc_irq [] = {
173
- { .exti = 0 , .irq_parent = 6 , . chip = & stm32_exti_h_chip },
174
- { .exti = 1 , .irq_parent = 7 , . chip = & stm32_exti_h_chip },
175
- { .exti = 2 , .irq_parent = 8 , . chip = & stm32_exti_h_chip },
176
- { .exti = 3 , .irq_parent = 9 , . chip = & stm32_exti_h_chip },
177
- { .exti = 4 , .irq_parent = 10 , . chip = & stm32_exti_h_chip },
178
- { .exti = 5 , .irq_parent = 23 , . chip = & stm32_exti_h_chip },
179
- { .exti = 6 , .irq_parent = 64 , . chip = & stm32_exti_h_chip },
180
- { .exti = 7 , .irq_parent = 65 , . chip = & stm32_exti_h_chip },
181
- { .exti = 8 , .irq_parent = 66 , . chip = & stm32_exti_h_chip },
182
- { .exti = 9 , .irq_parent = 67 , . chip = & stm32_exti_h_chip },
183
- { .exti = 10 , .irq_parent = 40 , . chip = & stm32_exti_h_chip },
184
- { .exti = 11 , .irq_parent = 42 , . chip = & stm32_exti_h_chip },
185
- { .exti = 12 , .irq_parent = 76 , . chip = & stm32_exti_h_chip },
186
- { .exti = 13 , .irq_parent = 77 , . chip = & stm32_exti_h_chip },
187
- { .exti = 14 , .irq_parent = 121 , . chip = & stm32_exti_h_chip },
188
- { .exti = 15 , .irq_parent = 127 , . chip = & stm32_exti_h_chip },
189
- { .exti = 16 , .irq_parent = 1 , . chip = & stm32_exti_h_chip },
190
- { .exti = 19 , .irq_parent = 3 , . chip = & stm32_exti_h_chip_direct },
191
- { .exti = 21 , .irq_parent = 31 , . chip = & stm32_exti_h_chip_direct },
192
- { .exti = 22 , .irq_parent = 33 , . chip = & stm32_exti_h_chip_direct },
193
- { .exti = 23 , .irq_parent = 72 , . chip = & stm32_exti_h_chip_direct },
194
- { .exti = 24 , .irq_parent = 95 , . chip = & stm32_exti_h_chip_direct },
195
- { .exti = 25 , .irq_parent = 107 , . chip = & stm32_exti_h_chip_direct },
196
- { .exti = 26 , .irq_parent = 37 , . chip = & stm32_exti_h_chip_direct },
197
- { .exti = 27 , .irq_parent = 38 , . chip = & stm32_exti_h_chip_direct },
198
- { .exti = 28 , .irq_parent = 39 , . chip = & stm32_exti_h_chip_direct },
199
- { .exti = 29 , .irq_parent = 71 , . chip = & stm32_exti_h_chip_direct },
200
- { .exti = 30 , .irq_parent = 52 , . chip = & stm32_exti_h_chip_direct },
201
- { .exti = 31 , .irq_parent = 53 , . chip = & stm32_exti_h_chip_direct },
202
- { .exti = 32 , .irq_parent = 82 , . chip = & stm32_exti_h_chip_direct },
203
- { .exti = 33 , .irq_parent = 83 , . chip = & stm32_exti_h_chip_direct },
204
- { .exti = 47 , .irq_parent = 93 , . chip = & stm32_exti_h_chip_direct },
205
- { .exti = 48 , .irq_parent = 138 , . chip = & stm32_exti_h_chip_direct },
206
- { .exti = 50 , .irq_parent = 139 , . chip = & stm32_exti_h_chip_direct },
207
- { .exti = 52 , .irq_parent = 140 , . chip = & stm32_exti_h_chip_direct },
208
- { .exti = 53 , .irq_parent = 141 , . chip = & stm32_exti_h_chip_direct },
209
- { .exti = 54 , .irq_parent = 135 , . chip = & stm32_exti_h_chip_direct },
210
- { .exti = 61 , .irq_parent = 100 , . chip = & stm32_exti_h_chip_direct },
211
- { .exti = 65 , .irq_parent = 144 , . chip = & stm32_exti_h_chip },
212
- { .exti = 68 , .irq_parent = 143 , . chip = & stm32_exti_h_chip },
213
- { .exti = 70 , .irq_parent = 62 , . chip = & stm32_exti_h_chip_direct },
214
- { .exti = 73 , .irq_parent = 129 , . chip = & stm32_exti_h_chip },
180
+ { .exti = 0 , .irq_parent = 6 },
181
+ { .exti = 1 , .irq_parent = 7 },
182
+ { .exti = 2 , .irq_parent = 8 },
183
+ { .exti = 3 , .irq_parent = 9 },
184
+ { .exti = 4 , .irq_parent = 10 },
185
+ { .exti = 5 , .irq_parent = 23 },
186
+ { .exti = 6 , .irq_parent = 64 },
187
+ { .exti = 7 , .irq_parent = 65 },
188
+ { .exti = 8 , .irq_parent = 66 },
189
+ { .exti = 9 , .irq_parent = 67 },
190
+ { .exti = 10 , .irq_parent = 40 },
191
+ { .exti = 11 , .irq_parent = 42 },
192
+ { .exti = 12 , .irq_parent = 76 },
193
+ { .exti = 13 , .irq_parent = 77 },
194
+ { .exti = 14 , .irq_parent = 121 },
195
+ { .exti = 15 , .irq_parent = 127 },
196
+ { .exti = 16 , .irq_parent = 1 },
197
+ { .exti = 19 , .irq_parent = 3 },
198
+ { .exti = 21 , .irq_parent = 31 },
199
+ { .exti = 22 , .irq_parent = 33 },
200
+ { .exti = 23 , .irq_parent = 72 },
201
+ { .exti = 24 , .irq_parent = 95 },
202
+ { .exti = 25 , .irq_parent = 107 },
203
+ { .exti = 26 , .irq_parent = 37 },
204
+ { .exti = 27 , .irq_parent = 38 },
205
+ { .exti = 28 , .irq_parent = 39 },
206
+ { .exti = 29 , .irq_parent = 71 },
207
+ { .exti = 30 , .irq_parent = 52 },
208
+ { .exti = 31 , .irq_parent = 53 },
209
+ { .exti = 32 , .irq_parent = 82 },
210
+ { .exti = 33 , .irq_parent = 83 },
211
+ { .exti = 47 , .irq_parent = 93 },
212
+ { .exti = 48 , .irq_parent = 138 },
213
+ { .exti = 50 , .irq_parent = 139 },
214
+ { .exti = 52 , .irq_parent = 140 },
215
+ { .exti = 53 , .irq_parent = 141 },
216
+ { .exti = 54 , .irq_parent = 135 },
217
+ { .exti = 61 , .irq_parent = 100 },
218
+ { .exti = 65 , .irq_parent = 144 },
219
+ { .exti = 68 , .irq_parent = 143 },
220
+ { .exti = 70 , .irq_parent = 62 },
221
+ { .exti = 73 , .irq_parent = 129 },
215
222
};
216
223
217
224
static const struct stm32_desc_irq stm32mp13_desc_irq [] = {
218
- { .exti = 0 , .irq_parent = 6 , . chip = & stm32_exti_h_chip },
219
- { .exti = 1 , .irq_parent = 7 , . chip = & stm32_exti_h_chip },
220
- { .exti = 2 , .irq_parent = 8 , . chip = & stm32_exti_h_chip },
221
- { .exti = 3 , .irq_parent = 9 , . chip = & stm32_exti_h_chip },
222
- { .exti = 4 , .irq_parent = 10 , . chip = & stm32_exti_h_chip },
223
- { .exti = 5 , .irq_parent = 24 , . chip = & stm32_exti_h_chip },
224
- { .exti = 6 , .irq_parent = 65 , . chip = & stm32_exti_h_chip },
225
- { .exti = 7 , .irq_parent = 66 , . chip = & stm32_exti_h_chip },
226
- { .exti = 8 , .irq_parent = 67 , . chip = & stm32_exti_h_chip },
227
- { .exti = 9 , .irq_parent = 68 , . chip = & stm32_exti_h_chip },
228
- { .exti = 10 , .irq_parent = 41 , . chip = & stm32_exti_h_chip },
229
- { .exti = 11 , .irq_parent = 43 , . chip = & stm32_exti_h_chip },
230
- { .exti = 12 , .irq_parent = 77 , . chip = & stm32_exti_h_chip },
231
- { .exti = 13 , .irq_parent = 78 , . chip = & stm32_exti_h_chip },
232
- { .exti = 14 , .irq_parent = 106 , . chip = & stm32_exti_h_chip },
233
- { .exti = 15 , .irq_parent = 109 , . chip = & stm32_exti_h_chip },
234
- { .exti = 16 , .irq_parent = 1 , . chip = & stm32_exti_h_chip },
235
- { .exti = 19 , .irq_parent = 3 , . chip = & stm32_exti_h_chip_direct },
236
- { .exti = 21 , .irq_parent = 32 , . chip = & stm32_exti_h_chip_direct },
237
- { .exti = 22 , .irq_parent = 34 , . chip = & stm32_exti_h_chip_direct },
238
- { .exti = 23 , .irq_parent = 73 , . chip = & stm32_exti_h_chip_direct },
239
- { .exti = 24 , .irq_parent = 93 , . chip = & stm32_exti_h_chip_direct },
240
- { .exti = 25 , .irq_parent = 114 , . chip = & stm32_exti_h_chip_direct },
241
- { .exti = 26 , .irq_parent = 38 , . chip = & stm32_exti_h_chip_direct },
242
- { .exti = 27 , .irq_parent = 39 , . chip = & stm32_exti_h_chip_direct },
243
- { .exti = 28 , .irq_parent = 40 , . chip = & stm32_exti_h_chip_direct },
244
- { .exti = 29 , .irq_parent = 72 , . chip = & stm32_exti_h_chip_direct },
245
- { .exti = 30 , .irq_parent = 53 , . chip = & stm32_exti_h_chip_direct },
246
- { .exti = 31 , .irq_parent = 54 , . chip = & stm32_exti_h_chip_direct },
247
- { .exti = 32 , .irq_parent = 83 , . chip = & stm32_exti_h_chip_direct },
248
- { .exti = 33 , .irq_parent = 84 , . chip = & stm32_exti_h_chip_direct },
249
- { .exti = 44 , .irq_parent = 96 , . chip = & stm32_exti_h_chip_direct },
250
- { .exti = 47 , .irq_parent = 92 , . chip = & stm32_exti_h_chip_direct },
251
- { .exti = 48 , .irq_parent = 116 , . chip = & stm32_exti_h_chip_direct },
252
- { .exti = 50 , .irq_parent = 117 , . chip = & stm32_exti_h_chip_direct },
253
- { .exti = 52 , .irq_parent = 118 , . chip = & stm32_exti_h_chip_direct },
254
- { .exti = 53 , .irq_parent = 119 , . chip = & stm32_exti_h_chip_direct },
255
- { .exti = 68 , .irq_parent = 63 , . chip = & stm32_exti_h_chip_direct },
256
- { .exti = 70 , .irq_parent = 98 , . chip = & stm32_exti_h_chip_direct },
225
+ { .exti = 0 , .irq_parent = 6 },
226
+ { .exti = 1 , .irq_parent = 7 },
227
+ { .exti = 2 , .irq_parent = 8 },
228
+ { .exti = 3 , .irq_parent = 9 },
229
+ { .exti = 4 , .irq_parent = 10 },
230
+ { .exti = 5 , .irq_parent = 24 },
231
+ { .exti = 6 , .irq_parent = 65 },
232
+ { .exti = 7 , .irq_parent = 66 },
233
+ { .exti = 8 , .irq_parent = 67 },
234
+ { .exti = 9 , .irq_parent = 68 },
235
+ { .exti = 10 , .irq_parent = 41 },
236
+ { .exti = 11 , .irq_parent = 43 },
237
+ { .exti = 12 , .irq_parent = 77 },
238
+ { .exti = 13 , .irq_parent = 78 },
239
+ { .exti = 14 , .irq_parent = 106 },
240
+ { .exti = 15 , .irq_parent = 109 },
241
+ { .exti = 16 , .irq_parent = 1 },
242
+ { .exti = 19 , .irq_parent = 3 },
243
+ { .exti = 21 , .irq_parent = 32 },
244
+ { .exti = 22 , .irq_parent = 34 },
245
+ { .exti = 23 , .irq_parent = 73 },
246
+ { .exti = 24 , .irq_parent = 93 },
247
+ { .exti = 25 , .irq_parent = 114 },
248
+ { .exti = 26 , .irq_parent = 38 },
249
+ { .exti = 27 , .irq_parent = 39 },
250
+ { .exti = 28 , .irq_parent = 40 },
251
+ { .exti = 29 , .irq_parent = 72 },
252
+ { .exti = 30 , .irq_parent = 53 },
253
+ { .exti = 31 , .irq_parent = 54 },
254
+ { .exti = 32 , .irq_parent = 83 },
255
+ { .exti = 33 , .irq_parent = 84 },
256
+ { .exti = 44 , .irq_parent = 96 },
257
+ { .exti = 47 , .irq_parent = 92 },
258
+ { .exti = 48 , .irq_parent = 116 },
259
+ { .exti = 50 , .irq_parent = 117 },
260
+ { .exti = 52 , .irq_parent = 118 },
261
+ { .exti = 53 , .irq_parent = 119 },
262
+ { .exti = 68 , .irq_parent = 63 },
263
+ { .exti = 70 , .irq_parent = 98 },
257
264
};
258
265
259
266
static const struct stm32_exti_drv_data stm32mp1_drv_data = {
@@ -711,6 +718,8 @@ static int stm32_exti_h_domain_alloc(struct irq_domain *dm,
711
718
struct irq_fwspec p_fwspec ;
712
719
irq_hw_number_t hwirq ;
713
720
int bank ;
721
+ u32 event_trg ;
722
+ struct irq_chip * chip ;
714
723
715
724
hwirq = fwspec -> param [0 ];
716
725
if (hwirq >= host_data -> drv_data -> bank_nr * IRQS_PER_BANK )
@@ -724,8 +733,11 @@ static int stm32_exti_h_domain_alloc(struct irq_domain *dm,
724
733
if (!desc )
725
734
return - EINVAL ;
726
735
727
- irq_domain_set_hwirq_and_chip (dm , virq , hwirq , desc -> chip ,
728
- chip_data );
736
+ event_trg = readl_relaxed (host_data -> base + chip_data -> reg_bank -> trg_ofst );
737
+ chip = (event_trg & BIT (hwirq % IRQS_PER_BANK )) ?
738
+ & stm32_exti_h_chip : & stm32_exti_h_chip_direct ;
739
+
740
+ irq_domain_set_hwirq_and_chip (dm , virq , hwirq , chip , chip_data );
729
741
if (desc -> irq_parent ) {
730
742
p_fwspec .fwnode = dm -> parent -> fwnode ;
731
743
p_fwspec .param_count = 3 ;
0 commit comments