Skip to content

Commit dee2340

Browse files
author
Marc Zyngier
committed
irqchip/gic: Drop support for board files
With the last non-OF, non-ACPI user of the GIC being removed in e73307b ("ARM: cns3xxx: remove entire platform"), we can finally drop the entry point and do some minor cleanup. We also make the driver depend on CONFIG_OF, which is required even when CONFIG_ACPI is selected. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20230315130218.3212033-1-maz@kernel.org
1 parent e8d018d commit dee2340

3 files changed

Lines changed: 4 additions & 63 deletions

File tree

drivers/irqchip/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config IRQCHIP
77

88
config ARM_GIC
99
bool
10+
depends on OF
1011
select IRQ_DOMAIN_HIERARCHY
1112
select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
1213

drivers/irqchip/irq-gic.c

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,10 +1081,6 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
10811081
return 0;
10821082
}
10831083

1084-
static void gic_irq_domain_unmap(struct irq_domain *d, unsigned int irq)
1085-
{
1086-
}
1087-
10881084
static int gic_irq_domain_translate(struct irq_domain *d,
10891085
struct irq_fwspec *fwspec,
10901086
unsigned long *hwirq,
@@ -1167,11 +1163,6 @@ static const struct irq_domain_ops gic_irq_domain_hierarchy_ops = {
11671163
.free = irq_domain_free_irqs_top,
11681164
};
11691165

1170-
static const struct irq_domain_ops gic_irq_domain_ops = {
1171-
.map = gic_irq_domain_map,
1172-
.unmap = gic_irq_domain_unmap,
1173-
};
1174-
11751166
static int gic_init_bases(struct gic_chip_data *gic,
11761167
struct fwnode_handle *handle)
11771168
{
@@ -1219,30 +1210,9 @@ static int gic_init_bases(struct gic_chip_data *gic,
12191210
gic_irqs = 1020;
12201211
gic->gic_irqs = gic_irqs;
12211212

1222-
if (handle) { /* DT/ACPI */
1223-
gic->domain = irq_domain_create_linear(handle, gic_irqs,
1224-
&gic_irq_domain_hierarchy_ops,
1225-
gic);
1226-
} else { /* Legacy support */
1227-
/*
1228-
* For primary GICs, skip over SGIs.
1229-
* No secondary GIC support whatsoever.
1230-
*/
1231-
int irq_base;
1232-
1233-
gic_irqs -= 16; /* calculate # of irqs to allocate */
1234-
1235-
irq_base = irq_alloc_descs(16, 16, gic_irqs,
1236-
numa_node_id());
1237-
if (irq_base < 0) {
1238-
WARN(1, "Cannot allocate irq_descs @ IRQ16, assuming pre-allocated\n");
1239-
irq_base = 16;
1240-
}
1241-
1242-
gic->domain = irq_domain_add_legacy(NULL, gic_irqs, irq_base,
1243-
16, &gic_irq_domain_ops, gic);
1244-
}
1245-
1213+
gic->domain = irq_domain_create_linear(handle, gic_irqs,
1214+
&gic_irq_domain_hierarchy_ops,
1215+
gic);
12461216
if (WARN_ON(!gic->domain)) {
12471217
ret = -ENODEV;
12481218
goto error;
@@ -1297,23 +1267,6 @@ static int __init __gic_init_bases(struct gic_chip_data *gic,
12971267
return ret;
12981268
}
12991269

1300-
void __init gic_init(void __iomem *dist_base, void __iomem *cpu_base)
1301-
{
1302-
struct gic_chip_data *gic;
1303-
1304-
/*
1305-
* Non-DT/ACPI systems won't run a hypervisor, so let's not
1306-
* bother with these...
1307-
*/
1308-
static_branch_disable(&supports_deactivate_key);
1309-
1310-
gic = &gic_data[0];
1311-
gic->raw_dist_base = dist_base;
1312-
gic->raw_cpu_base = cpu_base;
1313-
1314-
__gic_init_bases(gic, NULL);
1315-
}
1316-
13171270
static void gic_teardown(struct gic_chip_data *gic)
13181271
{
13191272
if (WARN_ON(!gic))
@@ -1325,7 +1278,6 @@ static void gic_teardown(struct gic_chip_data *gic)
13251278
iounmap(gic->raw_cpu_base);
13261279
}
13271280

1328-
#ifdef CONFIG_OF
13291281
static int gic_cnt __initdata;
13301282
static bool gicv2_force_probe;
13311283

@@ -1570,12 +1522,6 @@ IRQCHIP_DECLARE(cortex_a7_gic, "arm,cortex-a7-gic", gic_of_init);
15701522
IRQCHIP_DECLARE(msm_8660_qgic, "qcom,msm-8660-qgic", gic_of_init);
15711523
IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init);
15721524
IRQCHIP_DECLARE(pl390, "arm,pl390", gic_of_init);
1573-
#else
1574-
int gic_of_init_child(struct device *dev, struct gic_chip_data **gic, int irq)
1575-
{
1576-
return -ENOTSUPP;
1577-
}
1578-
#endif
15791525

15801526
#ifdef CONFIG_ACPI
15811527
static struct

include/linux/irqchip/arm-gic.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,6 @@ int gic_of_init(struct device_node *node, struct device_node *parent);
151151
*/
152152
int gic_of_init_child(struct device *dev, struct gic_chip_data **gic, int irq);
153153

154-
/*
155-
* Legacy platforms not converted to DT yet must use this to init
156-
* their GIC
157-
*/
158-
void gic_init(void __iomem *dist , void __iomem *cpu);
159-
160154
void gic_send_sgi(unsigned int cpu_id, unsigned int irq);
161155
int gic_get_cpu_id(unsigned int cpu);
162156
void gic_migrate_target(unsigned int new_cpu_id);

0 commit comments

Comments
 (0)