Skip to content

Commit 9cc5b7f

Browse files
committed
Merge tag 'irqchip-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core
Pull irqchip updates for Linux 5.4 from Marc Zyngier: - Large GICv3 updates to support new PPI and SPI ranges - Conver all alloc_fwnode() users to use PAs instead of VAs - Add support for Marvell's MMP3 irqchip - Add support for Amlogic Meson SM1 - Various cleanups and fixes
2 parents 101f85b + c9c96e3 commit 9cc5b7f

File tree

24 files changed

+529
-165
lines changed

24 files changed

+529
-165
lines changed

Documentation/arm64/silicon-errata.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ stable kernels.
115115
+----------------+-----------------+-----------------+-----------------------------+
116116
| Hisilicon | Hip0{6,7} | #161010701 | N/A |
117117
+----------------+-----------------+-----------------+-----------------------------+
118+
| Hisilicon | Hip0{6,7} | #161010803 | N/A |
119+
+----------------+-----------------+-----------------+-----------------------------+
118120
| Hisilicon | Hip07 | #161600802 | HISILICON_ERRATUM_161600802 |
119121
+----------------+-----------------+-----------------+-----------------------------+
120122
| Hisilicon | Hip08 SMMU PMCG | #162001800 | N/A |

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

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

Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ properties:
4444
be at least 4.
4545
4646
The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
47-
interrupts. Other values are reserved for future use.
47+
interrupts, 2 for interrupts in the Extended SPI range, 3 for the
48+
Extended PPI range. Other values are reserved for future use.
4849
4950
The 2nd cell contains the interrupt number for the interrupt type.
5051
SPI interrupts are in the range [0-987]. PPI interrupts are in the
51-
range [0-15].
52+
range [0-15]. Extented SPI interrupts are in the range [0-1023].
53+
Extended PPI interrupts are in the range [0-127].
5254
5355
The 3rd cell is the flags, encoded as follows:
5456
bits[3:0] trigger type and level flags.

arch/arm/mach-mmp/regs-icu.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#define ICU_VIRT_BASE (AXI_VIRT_BASE + 0x82000)
1212
#define ICU_REG(x) (ICU_VIRT_BASE + (x))
1313

14+
#define ICU2_VIRT_BASE (AXI_VIRT_BASE + 0x84000)
15+
#define ICU2_REG(x) (ICU2_VIRT_BASE + (x))
16+
1417
#define ICU_INT_CONF(n) ICU_REG((n) << 2)
1518
#define ICU_INT_CONF_MASK (0xf)
1619

drivers/gpio/gpio-ixp4xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
400400
g->fwnode = of_node_to_fwnode(np);
401401
} else {
402402
parent = ixp4xx_get_irq_domain();
403-
g->fwnode = irq_domain_alloc_fwnode(g->base);
403+
g->fwnode = irq_domain_alloc_fwnode(&res->start);
404404
if (!g->fwnode) {
405405
dev_err(dev, "no domain base\n");
406406
return -ENODEV;

drivers/irqchip/irq-gic-common.c

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
4141
void *data)
4242
{
4343
for (; quirks->desc; quirks++) {
44+
if (quirks->compatible)
45+
continue;
4446
if (quirks->iidr != (quirks->mask & iidr))
4547
continue;
4648
if (quirks->init(data))
@@ -63,7 +65,7 @@ int gic_configure_irq(unsigned int irq, unsigned int type,
6365
* for "irq", depending on "type".
6466
*/
6567
raw_spin_lock_irqsave(&irq_controller_lock, flags);
66-
val = oldval = readl_relaxed(base + GIC_DIST_CONFIG + confoff);
68+
val = oldval = readl_relaxed(base + confoff);
6769
if (type & IRQ_TYPE_LEVEL_MASK)
6870
val &= ~confmask;
6971
else if (type & IRQ_TYPE_EDGE_BOTH)
@@ -83,14 +85,10 @@ int gic_configure_irq(unsigned int irq, unsigned int type,
8385
* does not allow us to set the configuration or we are in a
8486
* non-secure mode, and hence it may not be catastrophic.
8587
*/
86-
writel_relaxed(val, base + GIC_DIST_CONFIG + confoff);
87-
if (readl_relaxed(base + GIC_DIST_CONFIG + confoff) != val) {
88-
if (WARN_ON(irq >= 32))
89-
ret = -EINVAL;
90-
else
91-
pr_warn("GIC: PPI%d is secure or misconfigured\n",
92-
irq - 16);
93-
}
88+
writel_relaxed(val, base + confoff);
89+
if (readl_relaxed(base + confoff) != val)
90+
ret = -EINVAL;
91+
9492
raw_spin_unlock_irqrestore(&irq_controller_lock, flags);
9593

9694
if (sync_access)
@@ -132,26 +130,31 @@ void gic_dist_config(void __iomem *base, int gic_irqs,
132130
sync_access();
133131
}
134132

135-
void gic_cpu_config(void __iomem *base, void (*sync_access)(void))
133+
void gic_cpu_config(void __iomem *base, int nr, void (*sync_access)(void))
136134
{
137135
int i;
138136

139137
/*
140138
* Deal with the banked PPI and SGI interrupts - disable all
141-
* PPI interrupts, ensure all SGI interrupts are enabled.
142-
* Make sure everything is deactivated.
139+
* private interrupts. Make sure everything is deactivated.
143140
*/
144-
writel_relaxed(GICD_INT_EN_CLR_X32, base + GIC_DIST_ACTIVE_CLEAR);
145-
writel_relaxed(GICD_INT_EN_CLR_PPI, base + GIC_DIST_ENABLE_CLEAR);
146-
writel_relaxed(GICD_INT_EN_SET_SGI, base + GIC_DIST_ENABLE_SET);
141+
for (i = 0; i < nr; i += 32) {
142+
writel_relaxed(GICD_INT_EN_CLR_X32,
143+
base + GIC_DIST_ACTIVE_CLEAR + i / 8);
144+
writel_relaxed(GICD_INT_EN_CLR_X32,
145+
base + GIC_DIST_ENABLE_CLEAR + i / 8);
146+
}
147147

148148
/*
149149
* Set priority on PPI and SGI interrupts
150150
*/
151-
for (i = 0; i < 32; i += 4)
151+
for (i = 0; i < nr; i += 4)
152152
writel_relaxed(GICD_INT_DEF_PRI_X4,
153153
base + GIC_DIST_PRI + i * 4 / 4);
154154

155+
/* Ensure all SGI interrupts are now enabled */
156+
writel_relaxed(GICD_INT_EN_SET_SGI, base + GIC_DIST_ENABLE_SET);
157+
155158
if (sync_access)
156159
sync_access();
157160
}

drivers/irqchip/irq-gic-common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int gic_configure_irq(unsigned int irq, unsigned int type,
2222
void __iomem *base, void (*sync_access)(void));
2323
void gic_dist_config(void __iomem *base, int gic_irqs,
2424
void (*sync_access)(void));
25-
void gic_cpu_config(void __iomem *base, void (*sync_access)(void));
25+
void gic_cpu_config(void __iomem *base, int nr, void (*sync_access)(void));
2626
void gic_enable_quirks(u32 iidr, const struct gic_quirk *quirks,
2727
void *data);
2828
void gic_enable_of_quirks(const struct device_node *np,

drivers/irqchip/irq-gic-v2m.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ acpi_parse_madt_msi(union acpi_subtable_headers *header,
525525
spi_start, nr_spis);
526526
}
527527

528-
fwnode = irq_domain_alloc_fwnode((void *)m->base_address);
528+
fwnode = irq_domain_alloc_fwnode(&res.start);
529529
if (!fwnode) {
530530
pr_err("Unable to allocate GICv2m domain token\n");
531531
return -EINVAL;

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,14 +2464,14 @@ static int its_alloc_device_irq(struct its_device *dev, int nvecs, irq_hw_number
24642464
{
24652465
int idx;
24662466

2467+
/* Find a free LPI region in lpi_map and allocate them. */
24672468
idx = bitmap_find_free_region(dev->event_map.lpi_map,
24682469
dev->event_map.nr_lpis,
24692470
get_count_order(nvecs));
24702471
if (idx < 0)
24712472
return -ENOSPC;
24722473

24732474
*hwirq = dev->event_map.lpi_base + idx;
2474-
set_bit(idx, dev->event_map.lpi_map);
24752475

24762476
return 0;
24772477
}
@@ -2641,14 +2641,13 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq,
26412641
struct its_node *its = its_dev->its;
26422642
int i;
26432643

2644+
bitmap_release_region(its_dev->event_map.lpi_map,
2645+
its_get_event_id(irq_domain_get_irq_data(domain, virq)),
2646+
get_count_order(nr_irqs));
2647+
26442648
for (i = 0; i < nr_irqs; i++) {
26452649
struct irq_data *data = irq_domain_get_irq_data(domain,
26462650
virq + i);
2647-
u32 event = its_get_event_id(data);
2648-
2649-
/* Mark interrupt index as unused */
2650-
clear_bit(event, its_dev->event_map.lpi_map);
2651-
26522651
/* Nuke the entry in the domain */
26532652
irq_domain_reset_irq_data(data);
26542653
}
@@ -3921,7 +3920,7 @@ static int __init gic_acpi_parse_madt_its(union acpi_subtable_headers *header,
39213920
res.end = its_entry->base_address + ACPI_GICV3_ITS_MEM_SIZE - 1;
39223921
res.flags = IORESOURCE_MEM;
39233922

3924-
dom_handle = irq_domain_alloc_fwnode((void *)its_entry->base_address);
3923+
dom_handle = irq_domain_alloc_fwnode(&res.start);
39253924
if (!dom_handle) {
39263925
pr_err("ITS@%pa: Unable to allocate GICv3 ITS domain token\n",
39273926
&res.start);

0 commit comments

Comments
 (0)