diff options
author | Mark Rutland <mark.rutland@arm.com> | 2024-06-17 13:18:39 +0200 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2024-06-24 19:16:44 +0200 |
commit | a6156e70316b322b61739468e465bfb1345b7ae2 (patch) | |
tree | ebeac9658dff5888f3b1a7042aaba5e95df68980 /drivers/irqchip/irq-gic-common.c | |
parent | irqchip/gic-common: Remove sync_access callback (diff) | |
download | linux-a6156e70316b322b61739468e465bfb1345b7ae2.tar.xz linux-a6156e70316b322b61739468e465bfb1345b7ae2.zip |
irqchip/gic-v3: Make distributor priorities variables
In subsequent patches the GICv3 driver will choose the regular interrupt
priority at boot time.
In preparation for using dynamic priorities, place the priorities in
variables and update the code to pass these as parameters. Users of
GICD_INT_DEF_PRI_X4 are modified to replicate the priority byte using
REPEAT_BYTE_U32().
There should be no functional change as a result of this patch.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Tested-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240617111841.2529370-4-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/irqchip/irq-gic-common.c')
-rw-r--r-- | drivers/irqchip/irq-gic-common.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c index 4ed17620dc4d..c776f9142610 100644 --- a/drivers/irqchip/irq-gic-common.c +++ b/drivers/irqchip/irq-gic-common.c @@ -7,6 +7,7 @@ #include <linux/io.h> #include <linux/irq.h> #include <linux/irqchip/arm-gic.h> +#include <linux/kernel.h> #include "irq-gic-common.h" @@ -87,7 +88,7 @@ int gic_configure_irq(unsigned int irq, unsigned int type, return ret; } -void gic_dist_config(void __iomem *base, int gic_irqs) +void gic_dist_config(void __iomem *base, int gic_irqs, u8 priority) { unsigned int i; @@ -102,7 +103,8 @@ void gic_dist_config(void __iomem *base, int gic_irqs) * Set priority on all global interrupts. */ for (i = 32; i < gic_irqs; i += 4) - writel_relaxed(GICD_INT_DEF_PRI_X4, base + GIC_DIST_PRI + i); + writel_relaxed(REPEAT_BYTE_U32(priority), + base + GIC_DIST_PRI + i); /* * Deactivate and disable all SPIs. Leave the PPI and SGIs @@ -116,7 +118,7 @@ void gic_dist_config(void __iomem *base, int gic_irqs) } } -void gic_cpu_config(void __iomem *base, int nr) +void gic_cpu_config(void __iomem *base, int nr, u8 priority) { int i; @@ -135,6 +137,6 @@ void gic_cpu_config(void __iomem *base, int nr) * Set priority on PPI and SGI interrupts */ for (i = 0; i < nr; i += 4) - writel_relaxed(GICD_INT_DEF_PRI_X4, + writel_relaxed(REPEAT_BYTE_U32(priority), base + GIC_DIST_PRI + i * 4 / 4); } |