diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2018-05-30 12:29:52 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2018-07-16 09:22:19 -0400 |
commit | a4f9edb29d9c19f9f8dcd2df7ddfe4eb7ad58996 (patch) | |
tree | 538e0c5c70a2f711aacdcde60afebcfabf6612aa | |
parent | 38dd7c494cf604879e187e9b56690d25f876cf69 (diff) |
irqchip/gic-v3: Expose GICD_TYPER in the rdist structure
Instead of exposing the GIC distributor IntID field in the rdist
structure that is passed to the ITS, let's replace it with a
copy of the whole GICD_TYPER register. We are going to need
some of this information at a later time.
No functionnal change.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | drivers/irqchip/irq-gic-v3-its.c | 2 | ||||
-rw-r--r-- | drivers/irqchip/irq-gic-v3.c | 4 | ||||
-rw-r--r-- | include/linux/irqchip/arm-gic-v3.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 9c5b85577053..efe6d1a6c32e 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c | |||
@@ -1616,7 +1616,7 @@ static int __init its_alloc_lpi_tables(void) | |||
1616 | { | 1616 | { |
1617 | phys_addr_t paddr; | 1617 | phys_addr_t paddr; |
1618 | 1618 | ||
1619 | lpi_id_bits = gic_rdists->id_bits; | 1619 | lpi_id_bits = GICD_TYPER_ID_BITS(gic_rdists->gicd_typer); |
1620 | gic_rdists->prop_page = its_allocate_prop_table(GFP_NOWAIT); | 1620 | gic_rdists->prop_page = its_allocate_prop_table(GFP_NOWAIT); |
1621 | if (!gic_rdists->prop_page) { | 1621 | if (!gic_rdists->prop_page) { |
1622 | pr_err("Failed to allocate PROPBASE\n"); | 1622 | pr_err("Failed to allocate PROPBASE\n"); |
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 76ea56d779a1..e214181b77b7 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c | |||
@@ -877,7 +877,7 @@ static struct irq_chip gic_eoimode1_chip = { | |||
877 | .flags = IRQCHIP_SET_TYPE_MASKED, | 877 | .flags = IRQCHIP_SET_TYPE_MASKED, |
878 | }; | 878 | }; |
879 | 879 | ||
880 | #define GIC_ID_NR (1U << gic_data.rdists.id_bits) | 880 | #define GIC_ID_NR (1U << GICD_TYPER_ID_BITS(gic_data.rdists.gicd_typer)) |
881 | 881 | ||
882 | static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, | 882 | static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, |
883 | irq_hw_number_t hw) | 883 | irq_hw_number_t hw) |
@@ -1091,7 +1091,7 @@ static int __init gic_init_bases(void __iomem *dist_base, | |||
1091 | * The GIC only supports up to 1020 interrupt sources (SGI+PPI+SPI) | 1091 | * The GIC only supports up to 1020 interrupt sources (SGI+PPI+SPI) |
1092 | */ | 1092 | */ |
1093 | typer = readl_relaxed(gic_data.dist_base + GICD_TYPER); | 1093 | typer = readl_relaxed(gic_data.dist_base + GICD_TYPER); |
1094 | gic_data.rdists.id_bits = GICD_TYPER_ID_BITS(typer); | 1094 | gic_data.rdists.gicd_typer = typer; |
1095 | gic_irqs = GICD_TYPER_IRQS(typer); | 1095 | gic_irqs = GICD_TYPER_IRQS(typer); |
1096 | if (gic_irqs > 1020) | 1096 | if (gic_irqs > 1020) |
1097 | gic_irqs = 1020; | 1097 | gic_irqs = 1020; |
diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h index cbb872c1b607..396cd99af02f 100644 --- a/include/linux/irqchip/arm-gic-v3.h +++ b/include/linux/irqchip/arm-gic-v3.h | |||
@@ -576,8 +576,8 @@ struct rdists { | |||
576 | phys_addr_t phys_base; | 576 | phys_addr_t phys_base; |
577 | } __percpu *rdist; | 577 | } __percpu *rdist; |
578 | struct page *prop_page; | 578 | struct page *prop_page; |
579 | int id_bits; | ||
580 | u64 flags; | 579 | u64 flags; |
580 | u32 gicd_typer; | ||
581 | bool has_vlpis; | 581 | bool has_vlpis; |
582 | bool has_direct_lpi; | 582 | bool has_direct_lpi; |
583 | }; | 583 | }; |