mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
irqchip: irq-bcm2835: Calc. FIQ_START at boot-time
ad83c7cb2f ("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>
This commit is contained in:
@@ -75,8 +75,6 @@
|
|||||||
#define NR_BANKS 3
|
#define NR_BANKS 3
|
||||||
#define IRQS_PER_BANK 32
|
#define IRQS_PER_BANK 32
|
||||||
#define NUMBER_IRQS MAKE_HWIRQ(NR_BANKS, 0)
|
#define NUMBER_IRQS MAKE_HWIRQ(NR_BANKS, 0)
|
||||||
#undef FIQ_START
|
|
||||||
#define FIQ_START (NR_IRQS_BANK0 + MAKE_HWIRQ(NR_BANKS - 1, 0))
|
|
||||||
|
|
||||||
static const int reg_pending[] __initconst = { 0x00, 0x04, 0x08 };
|
static const int reg_pending[] __initconst = { 0x00, 0x04, 0x08 };
|
||||||
static const int reg_enable[] __initconst = { 0x18, 0x10, 0x14 };
|
static const int reg_enable[] __initconst = { 0x18, 0x10, 0x14 };
|
||||||
@@ -205,7 +203,7 @@ static int __init armctrl_of_init(struct device_node *node,
|
|||||||
bool is_2836)
|
bool is_2836)
|
||||||
{
|
{
|
||||||
void __iomem *base;
|
void __iomem *base;
|
||||||
int irq, b, i;
|
int irq = 0, last_irq, b, i;
|
||||||
u32 reg;
|
u32 reg;
|
||||||
|
|
||||||
base = of_iomap(node, 0);
|
base = of_iomap(node, 0);
|
||||||
@@ -245,6 +243,8 @@ static int __init armctrl_of_init(struct device_node *node,
|
|||||||
pr_err(FW_BUG "Bootloader left fiq enabled\n");
|
pr_err(FW_BUG "Bootloader left fiq enabled\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
last_irq = irq;
|
||||||
|
|
||||||
if (is_2836) {
|
if (is_2836) {
|
||||||
int parent_irq = irq_of_parse_and_map(node, 0);
|
int parent_irq = irq_of_parse_and_map(node, 0);
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ static int __init armctrl_of_init(struct device_node *node,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef CONFIG_ARM64
|
#ifndef CONFIG_ARM64
|
||||||
init_FIQ(FIQ_START);
|
init_FIQ(irq - last_irq);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user