Marc Zyngier
c48ed51c0d
irqchip: GICv3: ITS: irqchip implementation
...
The usual methods that are used to present an irqchip to the rest
of the kernel
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
Link: https://lkml.kernel.org/r/1416839720-18400-6-git-send-email-marc.zyngier@arm.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-26 15:55:13 +00:00
Marc Zyngier
cc2d3216f5
irqchip: GICv3: ITS command queue
...
The ITS is configured through a number commands that the driver
issues to the HW using a memory-based circular buffer.
This patch implements the subset of commands that are required
for Linux.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
Link: https://lkml.kernel.org/r/1416839720-18400-5-git-send-email-marc.zyngier@arm.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-26 15:55:12 +00:00
Marc Zyngier
f5c1434c21
irqchip: GICv3: rework redistributor structure
...
The basic GICv3 driver has almost no use for the redistributor
(other than the basic per-CPU interrupts), but the ITS needs
a lot more from them.
As such, rework the set of data structures. The behaviour of the
GICv3 driver is otherwise unaffected.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
Link: https://lkml.kernel.org/r/1416839720-18400-4-git-send-email-marc.zyngier@arm.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-26 15:55:12 +00:00
Marc Zyngier
443acc4f37
irqchip: GICv3: Convert to domain hierarchy
...
In order to start supporting stacked domains, convert the GICv3
code base to the new domain hierarchy framework, which mostly
amounts to supporting the new alloc/free callbacks.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com >
Link: https://lkml.kernel.org/r/1416839720-18400-3-git-send-email-marc.zyngier@arm.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-26 15:55:11 +00:00
Jason Cooper
377df64a16
Merge branch 'irqchip/atmel' into irqchip/core
2014-11-26 07:02:27 +00:00
Dmitry Torokhov
d99ba4465a
irqchip: brcmstb-l2: Fix error handling of irq_of_parse_and_map
...
Return value of irq_of_parse_and_map() is unsigned int, with 0
indicating failure, so testing for negative result never works.
Signed-off-by: Dmitry Torokhov <dtor@chromium.org >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Tested-by: Kevin Cernekee <cernekee@gmail.com >
Link: https://lkml.kernel.org/r/20141114221642.GA37468@dtor-ws
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-26 06:28:42 +00:00
Dmitry Torokhov
714710e1a2
irqchip: bcm7120-l2: Fix error handling of irq_of_parse_and_map
...
Return value of irq_of_parse_and_map() is unsigned int, with 0
indicating failure, so testing for negative result never works.
Signed-off-by: Dmitry Torokhov <dtor@chromium.org >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Tested-by: Kevin Cernekee <cernekee@gmail.com >
Link: https://lkml.kernel.org/r/20141114221614.GA37395@dtor-ws
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-26 06:26:38 +00:00
Andrew Bresticker
a7057270c2
irqchip: mips-gic: Add device-tree support
...
Add device-tree support for the MIPS GIC. Update the GIC irqdomain's
xlate() callback to handle the three-cell specifier described in the
MIPS GIC binding document.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: Pawel Moll <pawel.moll@arm.com >
Cc: Mark Rutland <mark.rutland@arm.com >
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk >
Cc: Kumar Gala <galak@codeaurora.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: James Hogan <james.hogan@imgtec.com >
Cc: linux-mips@linux-mips.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8422/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:45:30 +01:00
Andrew Bresticker
b085451453
clocksource: mips-gic: Move gic_frequency to clocksource driver
...
There's no reason for gic_frequency to be global any more and it
certainly doesn't belong in the GIC irqchip driver, so move it to
the GIC clocksource driver.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8137/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:45:15 +01:00
Andrew Bresticker
a331ce63c8
clocksource: mips-gic: Combine with GIC clockevent driver
...
Combine the GIC clocksource driver with the GIC clockevent driver from
arch/mips/kernel/cevt-gic.c and remove the clockevent driver's separate
Kconfig symbol.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Andrew Bresticker <abrestic@chromium.org >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8132/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:45:15 +01:00
Andrew Bresticker
fa5635a277
MIPS: Move GIC clocksource driver to drivers/clocksource/
...
Move the GIC clocksource driver to drivers/clocksource/mips-gic-timer.c.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8133/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:45:14 +01:00
Andrew Bresticker
53a7bc815a
irqchip: mips-gic: Use GIC_SH_WEDGE_{SET,CLR} macros
...
Use the GIC_SH_WEDGE_{SET,CLR} macros provided by mips-gic.h.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8134/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:45:14 +01:00
Andrew Bresticker
8f5ee79c92
irqchip: mips-gic: Remove gic_{pending,itrmask}_regs
...
There's no reason for the pending and masked interrupt bitmasks
to be global. Just declare them on the stack in gic_get_int()
since they only consume (256*2)/8 = 64 bytes.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8131/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:45:14 +01:00
Andrew Bresticker
fb8f7be129
irqchip: mips-gic: Clean up #includes
...
Sort the #includes and remove those which are unnecessary.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8130/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:45:14 +01:00
Andrew Bresticker
824f3f7fa2
irqchip: mips-gic: Clean up header file
...
Remove duplicate #defines and unnecessary #includes, fix parenthesization,
and re-order register definitions in ascending order.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8128/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:45:13 +01:00
Andrew Bresticker
4060bbe993
MIPS: Move gic.h to include/linux/irqchip/mips-gic.h
...
Now that the MIPS GIC irqchip lives in drivers/irqchip/, move
its header over to include/linux/irqchip/.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8129/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:59 +01:00
Andrew Bresticker
5f68fea09e
irqchip: mips-gic: Use proper iomem accessors
...
Get rid of the ugly GICREAD/GICWRITE/GICBIS macros and use proper
iomem accessors instead. Since the GIC registers are not directly
accessed outside of the GIC driver any more, make gic_base static
and move all the GIC register manipulation macros out of gic.h,
converting them to static inline functions.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8127/
Patchwork: https://patchwork.linux-mips.org/patch/8229/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:58 +01:00
Andrew Bresticker
387904ff84
irqchip: mips-gic: Export function to read counter width
...
Export the function gic_get_count_width to read the width of
the GIC global counter from GIC_SH_CONFIG. Update the GIC
clocksource driver to use this new function.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Cc: Daniel Lezcano <daniel.lezcano@linaro.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Qais Yousef <qais.yousef@imgtec.com >
Cc: John Crispin <blogic@openwrt.org >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/8124/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:57 +01:00
Andrew Bresticker
3263d085ab
irqchip: mips-gic: Remove unnecessary globals
...
Now that all GIC interrupt routing and handling logic is in the GIC
driver itself, un-export variables/functions which are no longer used
outside the GIC driver. This also allows us to remove gic_compare_int
and combine gic_get_int_mask with gic_get_int since these interfaces
are no longer used.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7820/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:57 +01:00
Andrew Bresticker
e9de688dac
irqchip: mips-gic: Support local interrupts
...
The MIPS GIC supports 7 local interrupts, 2 of which are the GIC
local watchdog and count/compare timer. The remainder are CPU
interrupts which may optionally be re-routed through the GIC.
GIC hardware IRQs 0-6 are now used for local interrupts while
hardware IRQs 7+ are used for external (shared) interrupts.
Note that the 5 CPU interrupts may not be re-routable through
the GIC. In that case mapping will fail and the vectors reported
in C0_IntCtl should be used instead. gic_get_c0_compare_int() and
gic_get_c0_perfcount_int() will return the correct IRQ number to
use for the C0 timer and perfcounter interrupts based on the
routability of those interrupts through the GIC.
A separate irq_chip, with callbacks that mask/unmask the local
interrupt on all CPUs, is used for the C0 timer and performance
counter interrupts since all other platforms do not use the percpu
IRQ API for those interrupts.
Malta, SEAD-3, and the GIC clockevent driver have been updated
to use local interrupts and the R4K clockevent driver has been
updated to poll for C0 timer interrupts through the GIC when
the GIC is present.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7819/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:56 +01:00
Andrew Bresticker
4a6a3ea392
irqchip: mips-gic: Use separate edge/level irq_chips
...
GIC edge-triggered interrupts must be acknowledged by clearing the edge
detector via a write to GIC_SH_WEDGE. Create a separate edge-triggered
irq_chip with the appropriate irq_ack() callback. This also allows us
to get rid of gic_irq_flags.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7818/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:56 +01:00
Andrew Bresticker
fbd552417b
irqchip: mips-gic: Probe for number of external interrupts
...
Instead of requiring platforms to define the correct GIC_NUM_INTRS,
use the value reported in GIC_SH_CONFIG.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7817/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:56 +01:00
Andrew Bresticker
18743d2781
irqchip: mips-gic: Stop using per-platform mapping tables
...
Now that the GIC properly uses IRQ domains, kill off the per-platform
routing tables that were used to make the GIC appear transparent.
This includes:
- removing the mapping tables and the support for applying them,
- moving GIC IPI support to the GIC driver,
- properly routing the i8259 through the GIC on Malta, and
- updating IRQ assignments on SEAD-3 when the GIC is present.
Platforms no longer will pass an interrupt mapping table to gic_init.
Instead, they will pass the CPU interrupt vector (2 - 7) that they
expect the GIC to route interrupts to. Note that in EIC mode this
value is ignored and all GIC interrupts are routed to EIC vector 1.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7816/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:56 +01:00
Andrew Bresticker
c49581a4df
irqchip: mips-gic: Use IRQ domains
...
Use a simple IRQ domain for the MIPS GIC. Remove the gic_platform_init
callback as it's no longer necessary for it to set the irqchip.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7811/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:55 +01:00
Andrew Bresticker
14d160ab72
irqchip: mips-gic: Fix gic_set_affinity() return value
...
If the online CPU check in gic_set_affinity() fails, return a proper
errno value instead of -1.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7814/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:55 +01:00
Andrew Bresticker
95150ae8b3
irqchip: mips-gic: Implement irq_set_type callback
...
Implement an irq_set_type callback for the GIC which is used to set
the polarity and trigger type of GIC interrupts.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7810/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:55 +01:00
Andrew Bresticker
5561c9e467
irqchip: mips-gic: Remove platform irq_ack/irq_eoi callbacks
...
There's no need for platforms to have their own GIC irq_ack/irq_eoi
callbacks. irq_ack need only clear the GIC's edge detector on
edge-triggered interrupts and there's no need at all for irq_eoi.
Also get rid of the mask_ack callback since it's not necessary either.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7809/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:55 +01:00
Andrew Bresticker
8a19b8f194
MIPS: Move GIC to drivers/irqchip/
...
Move GIC irqchip support to drivers/irqchip/ and rename the Kconfig
option from IRQ_GIC to MIPS_GIC to avoid confusion with the ARM GIC.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org >
Acked-by: Jason Cooper <jason@lakedaemon.net >
Reviewed-by: Qais Yousef <qais.yousef@imgtec.com >
Tested-by: Qais Yousef <qais.yousef@imgtec.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jeffrey Deans <jeffrey.deans@imgtec.com >
Cc: Markos Chandras <markos.chandras@imgtec.com >
Cc: Paul Burton <paul.burton@imgtec.com >
Cc: Jonas Gorski <jogo@openwrt.org >
Cc: John Crispin <blogic@openwrt.org >
Cc: David Daney <ddaney.cavm@gmail.com >
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/7812/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org >
2014-11-24 07:44:54 +01:00
Thomas Gleixner
280510f106
PCI/MSI: Rename mask/unmask_msi_irq treewide
...
The PCI/MSI irq chip callbacks mask/unmask_msi_irq have been renamed
to pci_msi_mask/unmask_irq to mark them PCI specific. Rename all usage
sites. The conversion helper functions are kept around to avoid
conflicts in next and will be removed after merging into mainline.
Coccinelle assisted conversion. No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Russell King <linux@arm.linux.org.uk >
Cc: Ralf Baechle <ralf@linux-mips.org >
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org >
Cc: Heiko Carstens <heiko.carstens@de.ibm.com >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Chris Metcalf <cmetcalf@tilera.com >
Cc: x86@kernel.org
Cc: Jiang Liu <jiang.liu@linux.intel.com >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: Murali Karicheri <m-karicheri2@ti.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Mohit Kumar <mohit.kumar@st.com >
Cc: Simon Horman <horms@verge.net.au >
Cc: Michal Simek <michal.simek@xilinx.com >
Cc: Yijing Wang <wangyijing@huawei.com >
2014-11-23 13:01:45 +01:00
Jiang Liu
83a18912b0
PCI/MSI: Rename write_msi_msg() to pci_write_msi_msg()
...
Rename write_msi_msg() to pci_write_msi_msg() to mark it as PCI
specific.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com >
Cc: Bjorn Helgaas <bhelgaas@google.com >
Cc: Grant Likely <grant.likely@linaro.org >
Cc: Marc Zyngier <marc.zyngier@arm.com >
Cc: Yingjoe Chen <yingjoe.chen@mediatek.com >
Cc: Yijing Wang <wangyijing@huawei.com >
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
2014-11-23 13:01:45 +01:00
Yijing Wang
c2791b8069
PCI/MSI: Rename "struct msi_chip" to "struct msi_controller"
...
"msi_chip" isn't very descriptive, so rename it to "msi_controller". That
tells a little more about what it does and is already used in device tree
bindings.
No functional change.
[bhelgaas: changelog, change *only* the struct name so it's reviewable]
Suggested-by: Bjorn Helgaas <bhelgaas@google.com >
Signed-off-by: Yijing Wang <wangyijing@huawei.com >
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
2014-11-12 07:49:38 -07:00
Boris Brezillon
45977fe35b
irqchip: atmel-aic: Fix irqdomain initialization
...
First of all IRQCHIP_SKIP_SET_WAKE is not a valid irq_gc_flags and thus
should not be passed as the last argument of
irq_alloc_domain_generic_chips.
Then pass the correct handler (handle_fasteoi_irq) to
irq_alloc_domain_generic_chips instead of manually re-setting it in the
initialization loop.
And eventually initialize default irq flags to the pseudo standard:
IRQ_REQUEST | IRQ_PROBE | IRQ_AUTOEN.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com >
Tested-by: Kevin Hilman <khilman@linaro.org >
Fixes: b1479ebb77 ("irqchip: atmel-aic: Add atmel AIC/AIC5 drivers")
Cc: <stable@vger.kernel.org > # v3.17+
Link: https://lkml.kernel.org/r/1415712816-9202-1-git-send-email-boris.brezillon@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-11 22:34:48 +00:00
Boris BREZILLON
25963dbd07
irqchip: atmel-aic: Add missing entry for rm9200 irq fixups
...
The at91rm9200 have an RTT block and thus must at91rm9200_aic_irq_fixup
has to be called when initializing the irqchip.
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com >
Link: https://lkml.kernel.org/r/1415003464-29239-6-git-send-email-boris.brezillon@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:37:47 +00:00
Boris BREZILLON
624cba5726
irqchip: atmel-aic: Rename at91sam9_aic_irq_fixup for naming consistency
...
Rename at91sam9_aic_irq_fixup into at91rm9200_aic_irq_fixup to be
consistent with other fixup functions.
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com >
Link: https://lkml.kernel.org/r/1415003464-29239-5-git-send-email-boris.brezillon@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:37:16 +00:00
Boris BREZILLON
f3b7bf1bd7
irqchip: atmel-aic: Add specific irq fixup function for sam9g45 and sam9rl
...
The at91sam9g45 and at91sam9rl SoCs embed one RTT (Real Time Timer) and one
RTC block and thus need to call both rtt and rtc fixup functions.
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com >
Link: https://lkml.kernel.org/r/1415003464-29239-4-git-send-email-boris.brezillon@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:37:03 +00:00
Boris BREZILLON
ae25eac251
irqchip: atmel-aic: Add irq fixups for at91sam926x SoCs
...
The at91sam9260, at91sam9261, at91sam9263 and at91sam9g20 embed an RTT
(Real Time Timer) block and thus need to call the aic_common_rtt_irq_fixup
function.
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com >
Link: https://lkml.kernel.org/r/1415003464-29239-3-git-send-email-boris.brezillon@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:36:53 +00:00
Boris BREZILLON
4185315a9a
irqchip: atmel-aic: Add irq fixup for RTT block
...
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com >
Link: https://lkml.kernel.org/r/1415003464-29239-2-git-send-email-boris.brezillon@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:36:38 +00:00
Kevin Cernekee
1abbdbac36
irqchip: brcmstb-l2: Convert driver to use irq_reg_{readl,writel}
...
This effectively converts the __raw_ accessors to the non-__raw_
equivalents. To handle BE, we pass IRQ_GC_BE_IO, similar to what was
done in irq-bcm7120-l2.c.
Since irq_reg_writel now takes an irq_chip_generic argument, writel must
be used for the initial hardware reset in the probe function. But that
operation never needs endian swapping, so it's probably not a big deal.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/1415342669-30640-15-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:03:35 +00:00
Kevin Cernekee
c17261fac3
irqchip: bcm7120-l2: Convert driver to use irq_reg_{readl,writel}
...
On BE MIPS systems this needs to use the new IRQ_GC_BE_IO gc_flag. In
all other cases it will use the standard readl/writel accessors.
The initial irq_fwd_mask setup runs before "gc" is initialized, so it
is unchanged for now. This could potentially be a problem on an ARM
system that boots in LE mode but runs a BE kernel, but currently none
of the supported ARM platforms are ever expected to run BE.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/1415342669-30640-14-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:03:27 +00:00
Kevin Cernekee
a4fcbb8614
irqchip: bcm7120-l2: Decouple driver from brcmstb-l2
...
Some chips, such as BCM6328, only require bcm7120-l2. Some BCM7xxx STB
configurations only require brcmstb-l2. Treat them as two separate
entities, and update the mach-bcm dependencies to reflect the change.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Link: https://lkml.kernel.org/r/1415342669-30640-13-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:03:17 +00:00
Kevin Cernekee
c76acf4dff
irqchip: bcm7120-l2: Extend driver to support 64+ bit controllers
...
Most implementations of the bcm7120-l2 controller only have a single
32-bit enable word + 32-bit status word. But some instances have added
more enable/status pairs in order to support 64+ IRQs (which are all
ORed into one parent IRQ input). Make the following changes to allow
the driver to support this:
- Extend DT bindings so that multiple words can be specified for the
reg property, various masks, etc.
- Add loops to the probe/handle functions to deal with each word
separately
- Allocate 1 generic-chip for every 32 IRQs, so we can still use the
clr/set helper functions
- Update the documentation
This uses one domain per bcm7120-l2 DT node. If the DT node defines
multiple enable/status pairs (i.e. >=64 IRQs) then the driver will
create a single IRQ domain with 2+ generic chips. Multiple generic chips
are required because the generic-chip code can only handle one
enable/status register pair per instance.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/1415342669-30640-12-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:03:13 +00:00
Kevin Cernekee
05b8ce8260
irqchip: bcm7120-l2: Use gc->mask_cache to simplify suspend/resume functions
...
The cached value already incorporates irq_fwd_mask, and was saved the
last time an IRQ was enabled/disabled.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/1415342669-30640-11-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:02:59 +00:00
Kevin Cernekee
0b5cb32ca5
irqchip: bcm7120-l2: Fix missing nibble in gc->unused mask
...
This mask should have been 0xffff_ffff, not 0x0fff_ffff.
The change should not have an effect on current users (STB) because bits
31:27 are unused.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Link: https://lkml.kernel.org/r/1415342669-30640-10-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:02:49 +00:00
Kevin Cernekee
38e3a6e819
irqchip: bcm7120-l2: Make sure all register accesses use base+offset
...
A couple of accesses to IRQEN (base+0x00) just used "base" directly, so
they would break if IRQEN ever became nonzero. Make sure that all
reads/writes specify the register offset constant.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/1415342669-30640-9-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:02:45 +00:00
Kevin Cernekee
60b2a29e1a
irqchip: bcm7120-l2, brcmstb-l2: Remove ARM Kconfig dependency
...
This can compile for MIPS (or anything else) now.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Link: https://lkml.kernel.org/r/1415342669-30640-8-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:02:34 +00:00
Kevin Cernekee
f668f074ff
irqchip: bcm7120-l2: Eliminate bad IRQ check
...
This check may be prone to race conditions, e.g.
1) Some external event (e.g. GPIO level) causes an IRQ to become pending
2) Peripheral asserts the L2 IRQ
3) CPU takes an interrupt
4) The event from #1 goes away
5) bcm7120_l2_intc_irq_handle() reads back a 0 status
Unlike the hardware supported by brcmstb-l2, the bcm7120-l2 controller
does not latch the IRQ status. Bits can change if the inputs to the
controller change. Also, do_bad_IRQ() is an ARM-specific macro.
So let's just nuke it.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/1415342669-30640-7-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:02:29 +00:00
Kevin Cernekee
05f1275745
irqchip: brcmstb-l2: Eliminate dependency on ARM code
...
The irq-brcmstb-l2 driver has a single dependency on the ARM code, the
do_bad_IRQ macro. Expand this macro in-place so that the driver can be
built on non-ARM platforms.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Arnd Bergmann <arnd@arndb.de >
Acked-by: Florian Fainelli <f.fainelli@gmail.com >
Link: https://lkml.kernel.org/r/1415342669-30640-6-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:02:10 +00:00
Kevin Cernekee
332fd7c4fe
genirq: Generic chip: Change irq_reg_{readl,writel} arguments
...
Pass in the irq_chip_generic struct so we can use different readl/writel
settings for each irqchip driver, when appropriate. Compute
(gc->reg_base + reg_offset) in the helper function because this is pretty
much what all callers want to do anyway.
Compile-tested using the following configurations:
at91_dt_defconfig (CONFIG_ATMEL_AIC_IRQ=y)
sama5_defconfig (CONFIG_ATMEL_AIC5_IRQ=y)
sunxi_defconfig (CONFIG_ARCH_SUNXI=y)
tb10x (ARC) is untested.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com >
Acked-by: Thomas Gleixner <tglx@linutronix.de >
Acked-by: Acked-by: Arnd Bergmann <arnd@arndb.de >
Link: https://lkml.kernel.org/r/1415342669-30640-3-git-send-email-cernekee@gmail.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 04:01:22 +00:00
Thomas Petazzoni
1dacf194b1
irqchip: irq-armada-370-xp: Use proper return value for ->set_affinity()
...
The ->set_affinity() hook of 'struct irq_chip' is supposed to return
one of IRQ_SET_MASK_OK or IRQ_SET_MASK_OK_NOCOPY. However, the code
currently simply returns 0. This patch fixes that by using
IRQ_SET_MASK_OK, which tells the IRQ core that it is responsible for
updating irq_data.affinity.
Note that this patch does not cause any change to the compiled code,
as IRQ_SET_MASK_OK has the value 0. This is therefore just a simple
cleanup.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Jason Cooper <jason@lakedaemon.net >
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Gregory CLEMENT <gregory.clement@free-electrons.com >
Link: https://lkml.kernel.org/r/1414151970-6626-4-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-09 03:56:37 +00:00
Jisheng Zhang
e158849089
irqchip: dw-apb-ictl: Select GENERIC_IRQ_CHIP
...
The dw-apb-ictl driver uses the generic-chip functions.
Thus it needs to select GENERIC_IRQ_CHIP in Kconfig.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com >
Link: https://lkml.kernel.org/r/1413982750-832-1-git-send-email-jszhang@marvell.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net >
2014-11-02 02:22:07 +00:00