[PATCH] ARM: plat-versatile: move FPGA irq driver to drivers/irqchip
From: Linus Walleij <hidden>
Date: 2012-11-01 18:33:58
Also in:
lkml
On Thu, Nov 1, 2012 at 10:12 AM, Thomas Petazzoni [off-list ref] wrote:
On Thu, 1 Nov 2012 10:00:19 +0100, Linus Walleij wrote:quoted
Sounds like a separate patch but surely we can do this. Is Thomas' stuff on a branch somewhere that I can then rebase upon to get it upstream? I was planning to get this series as such to the ARM SoC maintainers soon-ish.Not at the moment. But do you want me to put that in a branch, and agglomerate all the related patches (posted by Rob for GIC/VIC and by you for the FPGA IRQ controller), and then later send a pull request to Arnd with those changes?
Whatever I can base on ... I would just push the stuff you consider stable to ARM SoC as quickly as possible so we can grab it from there and base development on it. Then each of us can just request the ARM SoC people to pull it and state that it is based on that branch so they need to pull it into the same place.
Also, again, the whole point of the initial infrastructure in drivers/irqchip/ was to avoid adding per-driver header files in include/linux/irqchip/, so there should at least be a long term plan on how to remove those headers file, either by moving more platforms to DT, or my extending the irqchip infrastructure to cover more features.
So the header in this case looks like this:
#ifndef PLAT_FPGA_IRQ_H
#define PLAT_FPGA_IRQ_H
struct device_node;
struct pt_regs;
void fpga_handle_irq(struct pt_regs *regs);
void fpga_irq_init(void __iomem *, const char *, int, int, u32,
struct device_node *node);
int fpga_irq_of_init(struct device_node *node,
struct device_node *parent);
#endif
So this is the stuff that needs to be called from the machine
descriptor, nothing else.
Example:
MACHINE_START(INTEGRATOR, "ARM-Integrator")
/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
.atag_offset = 0x100,
.reserve = integrator_reserve,
.map_io = ap_map_io,
.init_early = ap_init_early,
.init_irq = ap_init_irq,
.handle_irq = fpga_handle_irq,
.timer = &ap_timer,
.init_machine = ap_init,
.restart = integrator_restart,
MACHINE_END
The .init_irq hooks above contain some other stuff apart from just
calling these directly, but the problem remains: how to cross-call
these functions from the machine start since the IRQs are needed
by say the timer and everything else.
include/linux/irqchip/bcm2835.h look exactly the same (just one
function instead of separete DT/non-DT versions) so
there isn't exactly a precedent on how to solve this in an
elegant way.
But maybe your patch set contains the silver bullet that will decouple
this and fix everything?
Then I can do a patch to convert this and the BCM2835 too
probably...
Yours,
Linus Walleij