irqchip: irq-bcm2835: Calc. FIQ_START at boot-time
authorPhil Elwell <phil@raspberrypi.org>
Thu, 14 Jun 2018 10:21:04 +0000 (11:21 +0100)
committerpopcornmix <popcornmix@gmail.com>
Mon, 13 May 2019 23:08:02 +0000 (00:08 +0100)
commitd88d1b587aefbaee2415d5f8d25652a6c07e6a9d
treefa0b5d0b9ec7e35c856ba89dbce9ce5d41268e4a
parent98d8c39dadcee8c56233310412ac79f3b55ba501
irqchip: irq-bcm2835: Calc. FIQ_START at boot-time

ad83c7cb2f37 ("irqchip/irq-bcm2836: Add support for DT interrupt polarity")
changed the way that the BCM2836/7 local interrupts are mapped; instead
of being pre-mapped they are now mapped on-demand. A side effect of this
change is that the call to irq_of_parse_and_map from armctrl_of_init
creates a new mapping, forming a gap between the IRQs and the FIQs. This
 gap breaks the FIQ<->IRQ mapping which up to now has been done by assuming:

1) that the value of FIQ_START is the same as the number of normal IRQs
that will be mapped (still true), and

2) that this value is also the offset between an IRQ and its equivalent
FIQ (which is no longer the case).

Remove both assumptions by measuring the interval between the last IRQ
and the last FIQ, passing it as the parameter to init_FIQ().

Fixes: https://github.com/raspberrypi/linux/issues/2432

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/irqchip/irq-bcm2835.c