forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/lin…
…ux/kernel/git/tip/tip Pull core irq changes from Ingo Molnar: "The main changes: - generic-irqchip driver additions, cleanups and fixes - 3 new irqchip drivers: ARMv7-M NVIC, TB10x and Marvell Orion SoCs - irq_get_trigger_type() simplification and cross-arch cleanup - various cleanups, simplifications - documentation updates" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits) softirq: Use _RET_IP_ genirq: Add the generic chip to the genirq docbook genirq: generic-chip: Export some irq_gc_ functions genirq: Fix can_request_irq() for IRQs without an action irqchip: exynos-combiner: Staticize combiner_init irqchip: Add support for ARMv7-M NVIC irqchip: Add TB10x interrupt controller driver irqdomain: Use irq_get_trigger_type() to get IRQ flags MIPS: octeon: Use irq_get_trigger_type() to get IRQ flags arm: orion: Use irq_get_trigger_type() to get IRQ flags mfd: stmpe: use irq_get_trigger_type() to get IRQ flags mfd: twl4030-irq: Use irq_get_trigger_type() to get IRQ flags gpio: mvebu: Use irq_get_trigger_type() to get IRQ flags genirq: Add irq_get_trigger_type() to get IRQ flags genirq: Irqchip: document gcflags arg of irq_alloc_domain_generic_chips genirq: Set irq thread to RT priority on creation irqchip: Add support for Marvell Orion SoCs genirq: Add kerneldoc for irq_disable. genirq: irqchip: Add mask to block out invalid irqs genirq: Generic chip: Add linear irq domain support ...
- Loading branch information
Showing
21 changed files
with
988 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
Documentation/devicetree/bindings/interrupt-controller/abilis,tb10x-ictl.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
TB10x Top Level Interrupt Controller | ||
==================================== | ||
|
||
The Abilis TB10x SOC contains a custom interrupt controller. It performs | ||
one-to-one mapping of external interrupt sources to CPU interrupts and | ||
provides support for reconfigurable trigger modes. | ||
|
||
Required properties | ||
------------------- | ||
|
||
- compatible: Should be "abilis,tb10x-ictl" | ||
- reg: specifies physical base address and size of register range. | ||
- interrupt-congroller: Identifies the node as an interrupt controller. | ||
- #interrupt cells: Specifies the number of cells used to encode an interrupt | ||
source connected to this controller. The value shall be 2. | ||
- interrupt-parent: Specifies the parent interrupt controller. | ||
- interrupts: Specifies the list of interrupt lines which are handled by | ||
the interrupt controller in the parent controller's notation. Interrupts | ||
are mapped one-to-one to parent interrupts. | ||
|
||
Example | ||
------- | ||
|
||
intc: interrupt-controller { /* Parent interrupt controller */ | ||
interrupt-controller; | ||
#interrupt-cells = <1>; /* For example below */ | ||
/* ... */ | ||
}; | ||
|
||
tb10x_ictl: pic@2000 { /* TB10x interrupt controller */ | ||
compatible = "abilis,tb10x-ictl"; | ||
reg = <0x2000 0x20>; | ||
interrupt-controller; | ||
#interrupt-cells = <2>; | ||
interrupt-parent = <&intc>; | ||
interrupts = <5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ||
20 21 22 23 24 25 26 27 28 29 30 31>; | ||
}; |
48 changes: 48 additions & 0 deletions
48
Documentation/devicetree/bindings/interrupt-controller/marvell,orion-intc.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Marvell Orion SoC interrupt controllers | ||
|
||
* Main interrupt controller | ||
|
||
Required properties: | ||
- compatible: shall be "marvell,orion-intc" | ||
- reg: base address(es) of interrupt registers starting with CAUSE register | ||
- interrupt-controller: identifies the node as an interrupt controller | ||
- #interrupt-cells: number of cells to encode an interrupt source, shall be 1 | ||
|
||
The interrupt sources map to the corresponding bits in the interrupt | ||
registers, i.e. | ||
- 0 maps to bit 0 of first base address, | ||
- 1 maps to bit 1 of first base address, | ||
- 32 maps to bit 0 of second base address, and so on. | ||
|
||
Example: | ||
intc: interrupt-controller { | ||
compatible = "marvell,orion-intc"; | ||
interrupt-controller; | ||
#interrupt-cells = <1>; | ||
/* Dove has 64 first level interrupts */ | ||
reg = <0x20200 0x10>, <0x20210 0x10>; | ||
}; | ||
|
||
* Bridge interrupt controller | ||
|
||
Required properties: | ||
- compatible: shall be "marvell,orion-bridge-intc" | ||
- reg: base address of bridge interrupt registers starting with CAUSE register | ||
- interrupts: bridge interrupt of the main interrupt controller | ||
- interrupt-controller: identifies the node as an interrupt controller | ||
- #interrupt-cells: number of cells to encode an interrupt source, shall be 1 | ||
|
||
Optional properties: | ||
- marvell,#interrupts: number of interrupts provided by bridge interrupt | ||
controller, defaults to 32 if not set | ||
|
||
Example: | ||
bridge_intc: interrupt-controller { | ||
compatible = "marvell,orion-bridge-intc"; | ||
interrupt-controller; | ||
#interrupt-cells = <1>; | ||
reg = <0x20110 0x8>; | ||
interrupts = <0>; | ||
/* Dove bridge provides 5 interrupts */ | ||
marvell,#interrupts = <5>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* | ||
* drivers/irq/irq-nvic.c | ||
* | ||
* Copyright (C) 2008 ARM Limited, All Rights Reserved. | ||
* Copyright (C) 2013 Pengutronix | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* Support for the Nested Vectored Interrupt Controller found on the | ||
* ARMv7-M CPUs (Cortex-M3/M4) | ||
*/ | ||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
|
||
#include <linux/init.h> | ||
#include <linux/kernel.h> | ||
#include <linux/slab.h> | ||
#include <linux/err.h> | ||
#include <linux/io.h> | ||
#include <linux/of.h> | ||
#include <linux/of_address.h> | ||
#include <linux/irq.h> | ||
#include <linux/irqdomain.h> | ||
|
||
#include <asm/v7m.h> | ||
#include <asm/exception.h> | ||
|
||
#include "irqchip.h" | ||
|
||
#define NVIC_ISER 0x000 | ||
#define NVIC_ICER 0x080 | ||
#define NVIC_IPR 0x300 | ||
|
||
#define NVIC_MAX_BANKS 16 | ||
/* | ||
* Each bank handles 32 irqs. Only the 16th (= last) bank handles only | ||
* 16 irqs. | ||
*/ | ||
#define NVIC_MAX_IRQ ((NVIC_MAX_BANKS - 1) * 32 + 16) | ||
|
||
static struct irq_domain *nvic_irq_domain; | ||
|
||
asmlinkage void __exception_irq_entry | ||
nvic_handle_irq(irq_hw_number_t hwirq, struct pt_regs *regs) | ||
{ | ||
unsigned int irq = irq_linear_revmap(nvic_irq_domain, hwirq); | ||
|
||
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) | ||
{ | ||
unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; | ||
unsigned int irqs, i, ret, numbanks; | ||
void __iomem *nvic_base; | ||
|
||
numbanks = (readl_relaxed(V7M_SCS_ICTR) & | ||
V7M_SCS_ICTR_INTLINESNUM_MASK) + 1; | ||
|
||
nvic_base = of_iomap(node, 0); | ||
if (!nvic_base) { | ||
pr_warn("unable to map nvic registers\n"); | ||
return -ENOMEM; | ||
} | ||
|
||
irqs = numbanks * 32; | ||
if (irqs > NVIC_MAX_IRQ) | ||
irqs = NVIC_MAX_IRQ; | ||
|
||
nvic_irq_domain = | ||
irq_domain_add_linear(node, irqs, &irq_generic_chip_ops, NULL); | ||
if (!nvic_irq_domain) { | ||
pr_warn("Failed to allocate irq domain\n"); | ||
return -ENOMEM; | ||
} | ||
|
||
ret = irq_alloc_domain_generic_chips(nvic_irq_domain, 32, numbanks, | ||
"nvic_irq", handle_fasteoi_irq, | ||
clr, 0, IRQ_GC_INIT_MASK_CACHE); | ||
if (ret) { | ||
pr_warn("Failed to allocate irq chips\n"); | ||
irq_domain_remove(nvic_irq_domain); | ||
return ret; | ||
} | ||
|
||
for (i = 0; i < numbanks; ++i) { | ||
struct irq_chip_generic *gc; | ||
|
||
gc = irq_get_domain_generic_chip(nvic_irq_domain, 32 * i); | ||
gc->reg_base = nvic_base + 4 * i; | ||
gc->chip_types[0].regs.enable = NVIC_ISER; | ||
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; | ||
|
||
/* disable interrupts */ | ||
writel_relaxed(~0, gc->reg_base + NVIC_ICER); | ||
} | ||
|
||
/* Set priority on all interrupts */ | ||
for (i = 0; i < irqs; i += 4) | ||
writel_relaxed(0, nvic_base + NVIC_IPR + i); | ||
|
||
return 0; | ||
} | ||
IRQCHIP_DECLARE(armv7m_nvic, "arm,armv7m-nvic", nvic_of_init); |
Oops, something went wrong.