Skip to content

Commit 2a1ccd3

Browse files
committed
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq updates from Thomas Gleixner: "The irq departement provides the usual mixed bag: Core: - Further improvements to the irq timings code which aims to predict the next interrupt for power state selection to achieve better latency/power balance - Add interrupt statistics to the core NMI handlers - The usual small fixes and cleanups Drivers: - Support for Renesas RZ/A1, Annapurna Labs FIC, Meson-G12A SoC and Amazon Gravition AMR/GIC interrupt controllers. - Rework of the Renesas INTC controller driver - ACPI support for Socionext SoCs - Enhancements to the CSKY interrupt controller - The usual small fixes and cleanups" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits) irq/irqdomain: Fix comment typo genirq: Update irq stats from NMI handlers irqchip/gic-pm: Remove PM_CLK dependency irqchip/al-fic: Introduce Amazon's Annapurna Labs Fabric Interrupt Controller Driver dt-bindings: interrupt-controller: Add Amazon's Annapurna Labs FIC softirq: Use __this_cpu_write() in takeover_tasklets() irqchip/mbigen: Stop printing kernel addresses irqchip/gic: Add dependency for ARM_GIC_MAX_NR genirq/affinity: Remove unused argument from [__]irq_build_affinity_masks() genirq/timings: Add selftest for next event computation genirq/timings: Add selftest for irqs circular buffer genirq/timings: Add selftest for circular array genirq/timings: Encapsulate storing function genirq/timings: Encapsulate timings push genirq/timings: Optimize the period detection speed genirq/timings: Fix timings buffer inspection genirq/timings: Fix next event index function irqchip/qcom: Use struct_size() in devm_kzalloc() irqchip/irq-csky-mpintc: Remove unnecessary loop in interrupt handler dt-bindings: interrupt-controller: Update csky mpintc ...
2 parents e0e86b1 + 3a1d24c commit 2a1ccd3

32 files changed

Lines changed: 1528 additions & 192 deletions
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Amazon's Annapurna Labs Fabric Interrupt Controller
2+
3+
Required properties:
4+
5+
- compatible: should be "amazon,al-fic"
6+
- reg: physical base address and size of the registers
7+
- interrupt-controller: identifies the node as an interrupt controller
8+
- #interrupt-cells: must be 2.
9+
First cell defines the index of the interrupt within the controller.
10+
Second cell is used to specify the trigger type and must be one of the
11+
following:
12+
- bits[3:0] trigger type and level flags
13+
1 = low-to-high edge triggered
14+
4 = active high level-sensitive
15+
- interrupt-parent: specifies the parent interrupt controller.
16+
- interrupts: describes which input line in the interrupt parent, this
17+
fic's output is connected to. This field property depends on the parent's
18+
binding
19+
20+
Example:
21+
22+
amazon_fic: interrupt-controller@0xfd8a8500 {
23+
compatible = "amazon,al-fic";
24+
interrupt-controller;
25+
#interrupt-cells = <2>;
26+
reg = <0x0 0xfd8a8500 0x0 0x1000>;
27+
interrupt-parent = <&gic>;
28+
interrupts = <GIC_SPI 0x0 IRQ_TYPE_LEVEL_HIGH>;
29+
};

‎Documentation/devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Required properties:
1515
"amlogic,meson-gxbb-gpio-intc" for GXBB SoCs (S905) or
1616
"amlogic,meson-gxl-gpio-intc" for GXL SoCs (S905X, S912)
1717
"amlogic,meson-axg-gpio-intc" for AXG SoCs (A113D, A113X)
18+
"amlogic,meson-g12a-gpio-intc" for G12A SoCs (S905D2, S905X2, S905Y2)
1819
- reg : Specifies base physical address and size of the registers.
1920
- interrupt-controller : Identifies the node as an interrupt controller.
2021
- #interrupt-cells : Specifies the number of cells needed to encode an

‎Documentation/devicetree/bindings/interrupt-controller/csky,mpintc.txt‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ C-SKY Multi-processors Interrupt Controller is designed for ck807/ck810/ck860
66
SMP soc, and it also could be used in non-SMP system.
77

88
Interrupt number definition:
9-
109
0-15 : software irq, and we use 15 as our IPI_IRQ.
1110
16-31 : private irq, and we use 16 as the co-processor timer.
1211
31-1024: common irq for soc ip.
1312

13+
Interrupt triger mode: (Defined in dt-bindings/interrupt-controller/irq.h)
14+
IRQ_TYPE_LEVEL_HIGH (default)
15+
IRQ_TYPE_LEVEL_LOW
16+
IRQ_TYPE_EDGE_RISING
17+
IRQ_TYPE_EDGE_FALLING
18+
1419
=============================
1520
intc node bindings definition
1621
=============================
@@ -26,15 +31,22 @@ intc node bindings definition
2631
- #interrupt-cells
2732
Usage: required
2833
Value type: <u32>
29-
Definition: must be <1>
34+
Definition: <2>
3035
- interrupt-controller:
3136
Usage: required
3237

33-
Examples:
38+
Examples: ("interrupts = <irq_num IRQ_TYPE_XXX>")
3439
---------
40+
#include <dt-bindings/interrupt-controller/irq.h>
3541

3642
intc: interrupt-controller {
3743
compatible = "csky,mpintc";
38-
#interrupt-cells = <1>;
44+
#interrupt-cells = <2>;
3945
interrupt-controller;
4046
};
47+
48+
device: device-example {
49+
...
50+
interrupts = <34 IRQ_TYPE_EDGE_RISING>;
51+
interrupt-parent = <&intc>;
52+
};
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
DT bindings for the Renesas RZ/A1 Interrupt Controller
2+
3+
The RZ/A1 Interrupt Controller is a front-end for the GIC found on Renesas
4+
RZ/A1 and RZ/A2 SoCs:
5+
- IRQ sense select for 8 external interrupts, 1:1-mapped to 8 GIC SPI
6+
interrupts,
7+
- NMI edge select.
8+
9+
Required properties:
10+
- compatible: Must be "renesas,<soctype>-irqc", and "renesas,rza1-irqc" as
11+
fallback.
12+
Examples with soctypes are:
13+
- "renesas,r7s72100-irqc" (RZ/A1H)
14+
- "renesas,r7s9210-irqc" (RZ/A2M)
15+
- #interrupt-cells: Must be 2 (an interrupt index and flags, as defined
16+
in interrupts.txt in this directory)
17+
- #address-cells: Must be zero
18+
- interrupt-controller: Marks the device as an interrupt controller
19+
- reg: Base address and length of the memory resource used by the interrupt
20+
controller
21+
- interrupt-map: Specifies the mapping from external interrupts to GIC
22+
interrupts
23+
- interrupt-map-mask: Must be <7 0>
24+
25+
Example:
26+
27+
irqc: interrupt-controller@fcfef800 {
28+
compatible = "renesas,r7s72100-irqc", "renesas,rza1-irqc";
29+
#interrupt-cells = <2>;
30+
#address-cells = <0>;
31+
interrupt-controller;
32+
reg = <0xfcfef800 0x6>;
33+
interrupt-map =
34+
<0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
35+
<1 0 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
36+
<2 0 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
37+
<3 0 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
38+
<4 0 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
39+
<5 0 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
40+
<6 0 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
41+
<7 0 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
42+
interrupt-map-mask = <7 0>;
43+
};

‎MAINTAINERS‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,12 @@ S: Maintained
13061306
F: Documentation/devicetree/bindings/interrupt-controller/arm,vic.txt
13071307
F: drivers/irqchip/irq-vic.c
13081308

1309+
AMAZON ANNAPURNA LABS FIC DRIVER
1310+
M: Talel Shenhar <talel@amazon.com>
1311+
S: Maintained
1312+
F: Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt
1313+
F: drivers/irqchip/irq-al-fic.c
1314+
13091315
ARM SMMU DRIVERS
13101316
M: Will Deacon <will@kernel.org>
13111317
R: Robin Murphy <robin.murphy@arm.com>

‎drivers/acpi/irq.c‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,3 +292,29 @@ void __init acpi_set_irq_model(enum acpi_irq_model_id model,
292292
acpi_irq_model = model;
293293
acpi_gsi_domain_id = fwnode;
294294
}
295+
296+
/**
297+
* acpi_irq_create_hierarchy - Create a hierarchical IRQ domain with the default
298+
* GSI domain as its parent.
299+
* @flags: Irq domain flags associated with the domain
300+
* @size: Size of the domain.
301+
* @fwnode: Optional fwnode of the interrupt controller
302+
* @ops: Pointer to the interrupt domain callbacks
303+
* @host_data: Controller private data pointer
304+
*/
305+
struct irq_domain *acpi_irq_create_hierarchy(unsigned int flags,
306+
unsigned int size,
307+
struct fwnode_handle *fwnode,
308+
const struct irq_domain_ops *ops,
309+
void *host_data)
310+
{
311+
struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
312+
DOMAIN_BUS_ANY);
313+
314+
if (!d)
315+
return NULL;
316+
317+
return irq_domain_create_hierarchy(d, flags, size, fwnode, ops,
318+
host_data);
319+
}
320+
EXPORT_SYMBOL_GPL(acpi_irq_create_hierarchy);

‎drivers/gpio/gpio-mb86s7x.c‎

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Copyright (C) 2015 Linaro Ltd.
77
*/
88

9+
#include <linux/acpi.h>
910
#include <linux/io.h>
1011
#include <linux/init.h>
1112
#include <linux/clk.h>
@@ -19,6 +20,8 @@
1920
#include <linux/spinlock.h>
2021
#include <linux/slab.h>
2122

23+
#include "gpiolib.h"
24+
2225
/*
2326
* Only first 8bits of a register correspond to each pin,
2427
* so there are 4 registers for 32 pins.
@@ -135,6 +138,20 @@ static void mb86s70_gpio_set(struct gpio_chip *gc, unsigned gpio, int value)
135138
spin_unlock_irqrestore(&gchip->lock, flags);
136139
}
137140

141+
static int mb86s70_gpio_to_irq(struct gpio_chip *gc, unsigned int offset)
142+
{
143+
int irq, index;
144+
145+
for (index = 0;; index++) {
146+
irq = platform_get_irq(to_platform_device(gc->parent), index);
147+
if (irq <= 0)
148+
break;
149+
if (irq_get_irq_data(irq)->hwirq == offset)
150+
return irq;
151+
}
152+
return -EINVAL;
153+
}
154+
138155
static int mb86s70_gpio_probe(struct platform_device *pdev)
139156
{
140157
struct mb86s70_gpio_chip *gchip;
@@ -150,13 +167,15 @@ static int mb86s70_gpio_probe(struct platform_device *pdev)
150167
if (IS_ERR(gchip->base))
151168
return PTR_ERR(gchip->base);
152169

153-
gchip->clk = devm_clk_get(&pdev->dev, NULL);
154-
if (IS_ERR(gchip->clk))
155-
return PTR_ERR(gchip->clk);
170+
if (!has_acpi_companion(&pdev->dev)) {
171+
gchip->clk = devm_clk_get(&pdev->dev, NULL);
172+
if (IS_ERR(gchip->clk))
173+
return PTR_ERR(gchip->clk);
156174

157-
ret = clk_prepare_enable(gchip->clk);
158-
if (ret)
159-
return ret;
175+
ret = clk_prepare_enable(gchip->clk);
176+
if (ret)
177+
return ret;
178+
}
160179

161180
spin_lock_init(&gchip->lock);
162181

@@ -172,19 +191,28 @@ static int mb86s70_gpio_probe(struct platform_device *pdev)
172191
gchip->gc.parent = &pdev->dev;
173192
gchip->gc.base = -1;
174193

194+
if (has_acpi_companion(&pdev->dev))
195+
gchip->gc.to_irq = mb86s70_gpio_to_irq;
196+
175197
ret = gpiochip_add_data(&gchip->gc, gchip);
176198
if (ret) {
177199
dev_err(&pdev->dev, "couldn't register gpio driver\n");
178200
clk_disable_unprepare(gchip->clk);
201+
return ret;
179202
}
180203

181-
return ret;
204+
if (has_acpi_companion(&pdev->dev))
205+
acpi_gpiochip_request_interrupts(&gchip->gc);
206+
207+
return 0;
182208
}
183209

184210
static int mb86s70_gpio_remove(struct platform_device *pdev)
185211
{
186212
struct mb86s70_gpio_chip *gchip = platform_get_drvdata(pdev);
187213

214+
if (has_acpi_companion(&pdev->dev))
215+
acpi_gpiochip_free_interrupts(&gchip->gc);
188216
gpiochip_remove(&gchip->gc);
189217
clk_disable_unprepare(gchip->clk);
190218

@@ -197,10 +225,19 @@ static const struct of_device_id mb86s70_gpio_dt_ids[] = {
197225
};
198226
MODULE_DEVICE_TABLE(of, mb86s70_gpio_dt_ids);
199227

228+
#ifdef CONFIG_ACPI
229+
static const struct acpi_device_id mb86s70_gpio_acpi_ids[] = {
230+
{ "SCX0007" },
231+
{ /* sentinel */ }
232+
};
233+
MODULE_DEVICE_TABLE(acpi, mb86s70_gpio_acpi_ids);
234+
#endif
235+
200236
static struct platform_driver mb86s70_gpio_driver = {
201237
.driver = {
202238
.name = "mb86s70-gpio",
203239
.of_match_table = mb86s70_gpio_dt_ids,
240+
.acpi_match_table = ACPI_PTR(mb86s70_gpio_acpi_ids),
204241
},
205242
.probe = mb86s70_gpio_probe,
206243
.remove = mb86s70_gpio_remove,

‎drivers/irqchip/Kconfig‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ config ARM_GIC_PM
1515
bool
1616
depends on PM
1717
select ARM_GIC
18-
select PM_CLK
1918

2019
config ARM_GIC_MAX_NR
2120
int
21+
depends on ARM_GIC
2222
default 2 if ARCH_REALVIEW
2323
default 1
2424

@@ -87,6 +87,14 @@ config ALPINE_MSI
8787
select PCI_MSI
8888
select GENERIC_IRQ_CHIP
8989

90+
config AL_FIC
91+
bool "Amazon's Annapurna Labs Fabric Interrupt Controller"
92+
depends on OF || COMPILE_TEST
93+
select GENERIC_IRQ_CHIP
94+
select IRQ_DOMAIN
95+
help
96+
Support Amazon's Annapurna Labs Fabric Interrupt Controller.
97+
9098
config ATMEL_AIC_IRQ
9199
bool
92100
select GENERIC_IRQ_CHIP
@@ -217,13 +225,26 @@ config RDA_INTC
217225
select IRQ_DOMAIN
218226

219227
config RENESAS_INTC_IRQPIN
220-
bool
228+
bool "Renesas INTC External IRQ Pin Support" if COMPILE_TEST
221229
select IRQ_DOMAIN
230+
help
231+
Enable support for the Renesas Interrupt Controller for external
232+
interrupt pins, as found on SH/R-Mobile and R-Car Gen1 SoCs.
222233

223234
config RENESAS_IRQC
224-
bool
235+
bool "Renesas R-Mobile APE6 and R-Car IRQC support" if COMPILE_TEST
225236
select GENERIC_IRQ_CHIP
226237
select IRQ_DOMAIN
238+
help
239+
Enable support for the Renesas Interrupt Controller for external
240+
devices, as found on R-Mobile APE6, R-Car Gen2, and R-Car Gen3 SoCs.
241+
242+
config RENESAS_RZA1_IRQC
243+
bool "Renesas RZ/A1 IRQC support" if COMPILE_TEST
244+
select IRQ_DOMAIN_HIERARCHY
245+
help
246+
Enable support for the Renesas RZ/A1 Interrupt Controller, to use up
247+
to 8 external interrupts with configurable sense select.
227248

228249
config ST_IRQCHIP
229250
bool
@@ -299,8 +320,11 @@ config RENESAS_H8300H_INTC
299320
select IRQ_DOMAIN
300321

301322
config RENESAS_H8S_INTC
302-
bool
323+
bool "Renesas H8S Interrupt Controller Support" if COMPILE_TEST
303324
select IRQ_DOMAIN
325+
help
326+
Enable support for the Renesas H8/300 Interrupt Controller, as found
327+
on Renesas H8S SoCs.
304328

305329
config IMX_GPCV2
306330
bool

‎drivers/irqchip/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
obj-$(CONFIG_IRQCHIP) += irqchip.o
33

4+
obj-$(CONFIG_AL_FIC) += irq-al-fic.o
45
obj-$(CONFIG_ALPINE_MSI) += irq-alpine-msi.o
56
obj-$(CONFIG_ATH79) += irq-ath79-cpu.o
67
obj-$(CONFIG_ATH79) += irq-ath79-misc.o
@@ -49,6 +50,7 @@ obj-$(CONFIG_JCORE_AIC) += irq-jcore-aic.o
4950
obj-$(CONFIG_RDA_INTC) += irq-rda-intc.o
5051
obj-$(CONFIG_RENESAS_INTC_IRQPIN) += irq-renesas-intc-irqpin.o
5152
obj-$(CONFIG_RENESAS_IRQC) += irq-renesas-irqc.o
53+
obj-$(CONFIG_RENESAS_RZA1_IRQC) += irq-renesas-rza1.o
5254
obj-$(CONFIG_VERSATILE_FPGA_IRQ) += irq-versatile-fpga.o
5355
obj-$(CONFIG_ARCH_NSPIRE) += irq-zevio.o
5456
obj-$(CONFIG_ARCH_VT8500) += irq-vt8500.o

0 commit comments

Comments
 (0)