irq updates for 3.17
Subsystems (6)
Linus,
please pull the latest irq-core-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-core-for-linus
Nothing spectacular from the irq department this time:
* Overhaul of the crossbar chip driver
* Overhaul of the spear shirq chip driver
* Support for the atmel-aic chip
* Code move from arch to drivers
* The usual tiny fixlets
* Two reverts worth to mention which undo the too simple attempt of supporting wakeup interrupts on shared interrupt lines.
Thanks,
tglx
------------------>
Boris BREZILLON (6):
genirq: generic chip: Export irq_map_generic_chip function
irqchip: atmel-aic: Move binding doc to interrupt-controller directory
irqchip: atmel-aic: Add atmel AIC/AIC5 drivers
irqchip: atmel-aic: Add irq fixup infrastructure
irqchip: atmel-aic: Implement RTC irq fixup
irqchip: atmel-aic: Define irq fixups for atmel SoCs
Daniel Thompson (1):
irqchip: nvic: Use the generic noop function
Jiang Liu (1):
genirq: Export irq_domain_disassociate() to architecture interrupt drivers
Nishanth Menon (14):
irqchip: crossbar: Dont use '0' to mark reserved interrupts
irqchip: crossbar: Check for premapped crossbar before allocating
irqchip: crossbar: Introduce ti, irqs-skip to skip irqs that bypass crossbar
irqchip: crossbar: Initialise the crossbar with a safe value
irqchip: crossbar: Change allocation logic by reversing search for free irqs
irqchip: crossbar: Remove IS_ERR_VALUE check
irqchip: crossbar: Fix sparse and checkpatch warnings
irqchip: crossbar: Fix kerneldoc warning
irqchip: crossbar: Return proper error value
irqchip: crossbar: Change the goto naming
irqchip: crossbar: Introduce ti, max-crossbar-sources to identify valid crossbar mapping
irqchip: crossbar: Introduce centralized check for crossbar write
documentation: dt: omap: crossbar: Add description for interrupt consumer
irqchip: crossbar: Allow for quirky hardware with direct hardwiring of GIC
Peter Zijlstra (1):
irq: Warn when shared interrupts do not match on NO_SUSPEND
Rafael J. Wysocki (1):
PM / sleep / irq: Do not suspend wakeup interrupts
Sricharan R (2):
irqchip: crossbar: Set cb pointer to null in case of error
irqchip: crossbar: Add kerneldoc for crossbar_domain_unmap callback
Stefan Kristiansson (1):
irqchip: or1k-pic: Migrate from arch/openrisc/
Thomas Gleixner (14):
irqchip: spear_shirq: Kill pointless static
irqchip: spear_shirq: Move private structs to source
irqchip: spear_shirq: No point in storing the parent irq
irqchip: spear_shirq: Namespace cleanup
irqchip: spear_shirq: Reorder the spear320 ras blocks
irqchip: spear_shirq: Use the proper interfaces
irqchip: spear_shirq: Precalculate status mask
irqchip: spear_shirq: Kill the clear_reg nonsense
irqchip: spear_shirq: Simplify chained handler
irqchip: spear_shirq: Remove the parent irq "ack"/unmask
irqchip: spear_shirq: Use proper irq chips for the different SoCs
irqchip: spear_shirq: Simplify register access code Revert "PM / sleep / irq: Do not suspend wakeup interrupts" Revert "irq: Warn when shared interrupts do not match on NO_SUSPEND"
.../atmel-aic.txt | 42 - .../crossbar.txt | 36 + .../atmel,aic.txt | 42 + .../opencores,or1k-pic.txt | 23 arch/openrisc/Kconfig | 1 arch/openrisc/include/asm/irq.h | 3 arch/openrisc/kernel/irq.c | 146 ---- drivers/irqchip/Kconfig | 18 drivers/irqchip/Makefile | 3 drivers/irqchip/irq-atmel-aic-common.c | 254 +++++++ drivers/irqchip/irq-atmel-aic-common.h | 39 + drivers/irqchip/irq-atmel-aic.c | 262 +++++++ drivers/irqchip/irq-atmel-aic5.c | 353 ++++++++++ drivers/irqchip/irq-crossbar.c | 168 ++++ drivers/irqchip/irq-nvic.c | 13 drivers/irqchip/irq-or1k-pic.c | 182 +++++ drivers/irqchip/spear-shirq.c | 304 +++----- include/linux/irq.h | 2 include/linux/irqdomain.h | 2 kernel/irq/generic-chip.c | 5 kernel/irq/irqdomain.c | 2 include/linux/irqchip/spear-shirq.h | 64 - 22 files changed, 1521 insertions(+), 443 deletions(-)
Documentation/devicetree/bindings/arm/atmel-aic.txt deleted +0 -42
@@ -1,42 +0,0 @@ -* Advanced Interrupt Controller (AIC) - -Required properties: -- compatible: Should be "atmel,<chip>-aic" - <chip> can be "at91rm9200" or "sama5d3" -- interrupt-controller: Identifies the node as an interrupt controller. -- interrupt-parent: For single AIC system, it is an empty property. -- #interrupt-cells: The number of cells to define the interrupts. It should be 3. - The first cell is the IRQ number (aka "Peripheral IDentifier" on datasheet). - The second cell is used to specify flags: - bits[3:0] trigger type and level flags: - 1 = low-to-high edge triggered. - 2 = high-to-low edge triggered. - 4 = active high level-sensitive. - 8 = active low level-sensitive. - Valid combinations are 1, 2, 3, 4, 8. - Default flag for internal sources should be set to 4 (active high). - The third cell is used to specify the irq priority from 0 (lowest) to 7 - (highest). -- reg: Should contain AIC registers location and length -- atmel,external-irqs: u32 array of external irqs. - -Examples: - /* - * AIC - */ - aic: interrupt-controller@fffff000 { - compatible = "atmel,at91rm9200-aic"; - interrupt-controller; - interrupt-parent; - #interrupt-cells = <3>; - reg = <0xfffff000 0x200>; - }; - - /* - * An interrupt generating device that is wired to an AIC. - */ - dma: dma-controller@ffffec00 { - compatible = "atmel,at91sam9g45-dma"; - reg = <0xffffec00 0x200>; - interrupts = <21 4 5>; - };
Documentation/devicetree/bindings/arm/omap/crossbar.txt +36 -0
@@ -10,6 +10,7 @@ Required properties: - compatible : Should be "ti,irq-crossbar" - reg: Base address and the size of the crossbar registers. - ti,max-irqs: Total number of irqs available at the interrupt controller. +- ti,max-crossbar-sources: Maximum number of crossbar sources that can be routed. - ti,reg-size: Size of a individual register in bytes. Every individual register is assumed to be of same size. Valid sizes are 1, 2, 4. - ti,irqs-reserved: List of the reserved irq lines that are not muxed using
@@ -17,11 +18,46 @@ Required properties: so crossbar bar driver should not consider them as free lines. +Optional properties: +- ti,irqs-skip: This is similar to "ti,irqs-reserved", but these are for + SOC-specific hard-wiring of those irqs which unexpectedly bypasses the + crossbar. These irqs have a crossbar register, but still cannot be used. + +- ti,irqs-safe-map: integer which maps to a safe configuration to use + when the interrupt controller irq is unused (when not provided, default is 0) + Examples: crossbar_mpu: @4a020000 { compatible = "ti,irq-crossbar"; reg = <0x4a002a48 0x130>; ti,max-irqs = <160>; + ti,max-crossbar-sources = <400>; ti,reg-size = <2>; ti,irqs-reserved = <0 1 2 3 5 6 131 132 139 140>; + ti,irqs-skip = <10 133 139 140>; }; + +Consumer: +======== +See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt and +Documentation/devicetree/bindings/arm/gic.txt for further details. + +An interrupt consumer on an SoC using crossbar will use: + interrupts = <GIC_SPI request_number interrupt_level> +When the request number is between 0 to that described by +"ti,max-crossbar-sources", it is assumed to be a crossbar mapping. If the +request_number is greater than "ti,max-crossbar-sources", then it is mapped as a +quirky hardware mapping direct to GIC. + +Example: + device_x@0x4a023000 { + /* Crossbar 8 used */ + interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; + ... + }; + + device_y@0x4a033000 { + /* Direct mapped GIC SPI 1 used */ + interrupts = <GIC_SPI DIRECT_IRQ(1) IRQ_TYPE_LEVEL_HIGH>; + ... + };
Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt new file +42 -0
42 lines not on this page · raw message
Documentation/devicetree/bindings/interrupt-controller/opencores,or1k-pic.txt new file +23 -0
@@ -0,0 +1,23 @@ +OpenRISC 1000 Programmable Interrupt Controller + +Required properties: + +- compatible : should be "opencores,or1k-pic-level" for variants with + level triggered interrupt lines, "opencores,or1k-pic-edge" for variants with + edge triggered interrupt lines or "opencores,or1200-pic" for machines + with the non-spec compliant or1200 type implementation. + + "opencores,or1k-pic" is also provided as an alias to "opencores,or1200-pic", + but this is only for backwards compatibility. + +- interrupt-controller : Identifies the node as an interrupt controller +- #interrupt-cells : Specifies the number of cells needed to encode an + interrupt source. The value shall be 1. + +Example: + +intc: interrupt-controller { + compatible = "opencores,or1k-pic-level"; + interrupt-controller; + #interrupt-cells = <1>; +};
arch/openrisc/Kconfig +1 -0
@@ -22,6 +22,7 @@ config OPENRISC select GENERIC_STRNLEN_USER select MODULES_USE_ELF_RELA select HAVE_DEBUG_STACKOVERFLOW + select OR1K_PIC config MMU def_bool y
arch/openrisc/include/asm/irq.h +3 -0
@@ -24,4 +24,7 @@#define NO_IRQ (-1) +void handle_IRQ (unsigned int ,struct pt_regs *); +extern void set_handle_irq (void (*handle_irq)(struct pt_regs *)); +#endif /* __ASM_OPENRISC_IRQ_H__ */
arch/openrisc/kernel/irq.c +13 -133
174 lines not on this page · raw message
drivers/irqchip/Kconfig +18 -0
@@ -35,6 +35,20 @@ config ARM_VIC_NR The maximum number of VICs available in the system, for power management. +config ATMEL_AIC_IRQ + bool + select GENERIC_IRQ_CHIP + select IRQ_DOMAIN + select MULTI_IRQ_HANDLER + select SPARSE_IRQ + +config ATMEL_AIC5_IRQ + bool + select GENERIC_IRQ_CHIP + select IRQ_DOMAIN + select MULTI_IRQ_HANDLER + select SPARSE_IRQ + config BRCMSTB_L2_IRQ bool depends on ARM
@@ -58,6 +72,10 @@ config CLPS711X_IRQCHIP select SPARSE_IRQ default y +config OR1K_PIC + bool + select IRQ_DOMAIN + config ORION_IRQCHIP bool select IRQ_DOMAIN
drivers/irqchip/Makefile +3 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_METAG) += irq-metag-ext.o obj-$(CONFIG_METAG_PERFCOUNTER_IRQS) += irq-metag.o obj-$(CONFIG_ARCH_MOXART) += irq-moxart.o obj-$(CONFIG_CLPS711X_IRQCHIP) += irq-clps711x.o +obj-$(CONFIG_OR1K_PIC) += irq-or1k-pic.o obj-$(CONFIG_ORION_IRQCHIP) += irq-orion.o obj-$(CONFIG_ARCH_SUNXI) += irq-sun4i.o obj-$(CONFIG_ARCH_SUNXI) += irq-sunxi-nmi.o
@@ -19,6 +20,8 @@ obj-$(CONFIG_ARM_GIC) += irq-gic.o irq-gic-common.o obj-$(CONFIG_ARM_GIC_V3) += irq-gic-v3.o irq-gic-common.o obj-$(CONFIG_ARM_NVIC) += irq-nvic.o obj-$(CONFIG_ARM_VIC) += irq-vic.o +obj-$(CONFIG_ATMEL_AIC_IRQ) += irq-atmel-aic-common.o irq-atmel-aic.o +obj-$(CONFIG_ATMEL_AIC5_IRQ) += irq-atmel-aic-common.o irq-atmel-aic5.o obj-$(CONFIG_IMGPDC_IRQ) += irq-imgpdc.o obj-$(CONFIG_SIRF_IRQ) += irq-sirfsoc.o obj-$(CONFIG_RENESAS_INTC_IRQPIN) += irq-renesas-intc-irqpin.o
drivers/irqchip/irq-atmel-aic-common.c new file +254 -0
254 lines not on this page · raw message
drivers/irqchip/irq-atmel-aic-common.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* Atmel AT91 common AIC (Advanced Interrupt Controller) header file +* +* Copyright (C) 2004 SAN People +* Copyright (C) 2004 ATMEL +* Copyright (C) Rick Bronson +* Copyright (C) 2014 Free Electrons +* +* Author: Boris BREZILLON <[email protected]> +* +* This file is licensed under the terms of the GNU General Public +* License version 2. This program is licensed "as is" without any +* warranty of any kind, whether express or implied. +*/ + +#ifndef __IRQ_ATMEL_AIC_COMMON_H +#define __IRQ_ATMEL_AIC_COMMON_H + + +int aic_common_set_type (struct irq_data *d,unsigned type,unsigned *val); + +int aic_common_set_priority (int priority,unsigned *val); + +int aic_common_irq_domain_xlate (struct irq_domain *d, +struct device_node *ctrlr, +const u32 *intspec, +unsigned int intsize, +irq_hw_number_t *out_hwirq, +unsigned int *out_type); + +struct irq_domain *__init aic_common_of_init (struct device_node *node, +const struct irq_domain_ops *ops, +const char *name,int nirqs); + +void __init aic_common_rtc_irq_fixup (struct device_node *root); + +void __init aic_common_irq_fixup (const struct of_device_id *matches); + +#endif /* __IRQ_ATMEL_AIC_COMMON_H */
drivers/irqchip/irq-atmel-aic.c new file +262 -0
262 lines not on this page · raw message
drivers/irqchip/irq-atmel-aic5.c new file +353 -0
353 lines not on this page · raw message
drivers/irqchip/irq-crossbar.c +143 -25
282 lines not on this page · raw message
drivers/irqchip/irq-nvic.c +4 -9
@@ -49,14 +49,6 @@ nvic_handle_irq(irq_hw_number_t hwirq, struct pt_regs *regs)handle_IRQ (irq, regs); } -static void nvic_eoi (struct irq_data *d) -{ -/* -* This is a no-op as end of interrupt is signaled by the exception -* return sequence. -*/ -} -static int __init nvic_of_init (struct device_node *node,struct device_node *parent) {
@@ -102,7 +94,10 @@ static int __init nvic_of_init(struct device_node *node, gc->chip_types[0 ].regs.disable =NVIC_ICER ; gc->chip_types[0 ].chip.irq_mask = irq_gc_mask_disable_reg; gc->chip_types[0 ].chip.irq_unmask = irq_gc_unmask_enable_reg; - gc->chip_types[0 ].chip.irq_eoi = nvic_eoi; +/* This is a no-op as end of interrupt is signaled by the +* exception return sequence. +*/ + gc->chip_types[0 ].chip.irq_eoi = irq_gc_noop;/* disable interrupts */ writel_relaxed (~0 , gc->reg_base +NVIC_ICER );
drivers/irqchip/irq-or1k-pic.c new file +182 -0
182 lines not on this page · raw message
drivers/irqchip/spear-shirq.c +137 -167
417 lines not on this page · raw message
include/linux/irq.h +2 -0
@@ -771,6 +771,8 @@ void irq_gc_eoi(struct irq_data *d);int irq_gc_set_wake (struct irq_data *d,unsigned int on);/* Setup functions for irq_chip_generic */ +int irq_map_generic_chip (struct irq_domain *d,unsigned int virq, +irq_hw_number_t hw_irq);struct irq_chip_generic *irq_alloc_generic_chip (const char *name,int nr_ct,unsigned int irq_base,void __iomem *reg_base,irq_flow_handler_t handler);
include/linux/irqchip/spear-shirq.h deleted +0 -64
64 lines not on this page · raw message
include/linux/irqdomain.h +2 -0
@@ -172,6 +172,8 @@ extern int irq_domain_associate(struct irq_domain *domain, unsigned int irq,extern void irq_domain_associate_many (struct irq_domain *domain,unsigned int irq_base,irq_hw_number_t hwirq_base,int count); +extern void irq_domain_disassociate (struct irq_domain *domain, +unsigned int irq);extern unsigned int irq_create_mapping (struct irq_domain *host,irq_hw_number_t hwirq);
kernel/irq/generic-chip.c +3 -2
@@ -341,8 +341,8 @@ static struct lock_class_key irq_nested_lock_class;/* * irq_map_generic_chip - Map a generic chip for an irq domain */ -static int irq_map_generic_chip (struct irq_domain *d,unsigned int virq, -irq_hw_number_t hw_irq) +int irq_map_generic_chip (struct irq_domain *d,unsigned int virq, +irq_hw_number_t hw_irq) {struct irq_data *data =irq_get_irq_data (virq);struct irq_domain_chip_generic *dgc = d->gc;
@@ -394,6 +394,7 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,irq_modify_status (virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);return 0 ; } +EXPORT_SYMBOL_GPL (irq_map_generic_chip);struct irq_domain_ops irq_generic_chip_ops = { .map = irq_map_generic_chip,
kernel/irq/irqdomain.c +1 -1
@@ -231,7 +231,7 @@ void irq_set_default_host(struct irq_domain *domain) }EXPORT_SYMBOL_GPL (irq_set_default_host); -static void irq_domain_disassociate (struct irq_domain *domain,unsigned int irq) +void irq_domain_disassociate (struct irq_domain *domain,unsigned int irq) {struct irq_data *irq_data =irq_get_irq_data (irq);irq_hw_number_t hwirq;