[Linux-stm32] STM32MP1 level triggered interrupts

Alexandre Torgue alexandre.torgue at st.com
Wed Jan 22 17:19:06 UTC 2020



On 1/21/20 6:41 PM, Marek Vasut wrote:
> On 1/21/20 6:12 PM, Alexandre Torgue wrote:
>> Hi Marek,
> 
> Hi,
> 
>> On 1/20/20 7:32 PM, Marek Vasut wrote:
>>> Hi,
>>>
>>> I have a device connected to STM32MP157C which requires active-low
>>> level-triggered interrupt sink. The device interrupt line is connected
>>> to the SoC gpio-C bank, which has it's interrupt line routed into EXTI,
>>> which can only handle edge triggered interrupts to my understanding.
>>
>> correct.
> 
> OK
> 
>>> However, ARM GIC should be able to do both and EXTI has this irqmux /
>>> EXTImux functionality, which -- if my understanding is correct -- is
>>> capable of routing a select GPIO line directly into the GIC as an EXTIn
>>> interrupt signal. Thus, this might permit handling active low
>>> level-triggered interrupts. Is there some DT binding to configure this
>>> yet ?
>>>
>>> Or is there some other, better, way ?
>>>
>>
>> For SPIs, GIC controller handles rising edge triggered interrupt and
>> active high level-sensitive. GIC integration in STM32MP157c makes that
>> only active high level-sensitive configuration for SPI interrupts is
>> supported.
> 
> So technically , there is a possibility to handle level-sensitive
> active-high interrupts. Can one such interrupt be routed through the
> EXTImux into a GIC SPI then ?

Not for external signals. Externals signals are routed to the EXTI 
block. Allowed configurations are: rising/falling/both. Following a 
rising or falling edge, EXTI will trig a other signal mapped to the GIC.
This GIC interrupt is configured as high level sensitive (and remains 
high until EXTI edge pending register is read).

> 
>> Concerning, your question:
>>
>> Setting your gpioC interruption as "falling edge" should be enough. On
>> gpioCx falling edge, a high-level signal is generated by exti and sent
>> to GIC (which triggers GIC interrupt). This signal remains high until
>> stm32_irq_ack is called.
>>
>> So you only need: (ex for gpioc 1).
>>
>> interrupt-parent = <&gpioc>;
>> interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
> 
> How does this deal with the case where the device holds the interrupt
> line low (since it's level-sensitive, active low) after the driver
> interrupt handler finishes ? Does such condition generate another
> interrupt and call the driver interrupt handler again ? I would expect
> the answer is no, because the interrupt is edge-triggered and there is
> no edge.

Your assumption is good. If your device continue to hold the line to low 
at the end of your interrupt handler, no more interrupt will be generated.

> 
>> regards
>> Alex
> 



More information about the Linux-stm32 mailing list