[Linux-stm32] STM32MP1 level triggered interrupts

Marek Vasut marex at denx.de
Tue Jan 21 17:41:09 UTC 2020


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 ?

> 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.

> regards
> Alex

-- 
Best regards,
Marek Vasut



More information about the Linux-stm32 mailing list