irqchip/gicv3: support config amp os irqs

Signed-off-by: Tony Xie <tony.xie@rock-chips.com>
Change-Id: I0abcf9fd44514b1aac06aa6977df2859ebd01459
This commit is contained in:
Tony Xie
2023-09-13 15:50:06 +08:00
committed by Tao Huang
parent bd99973c0a
commit 8f8a13a24d

View File

@@ -37,6 +37,10 @@
#include "irq-gic-common.h"
#ifdef CONFIG_ROCKCHIP_AMP
#include <soc/rockchip/rockchip_amp.h>
#endif
#define GICD_INT_NMI_PRI (GICD_INT_DEF_PRI & ~0x80)
#define FLAGS_WORKAROUND_GICR_WAKER_MSM8996 (1ULL << 0)
@@ -368,6 +372,10 @@ static void gic_poke_irq(struct irq_data *d, u32 offset)
static void gic_mask_irq(struct irq_data *d)
{
#ifdef CONFIG_ROCKCHIP_AMP
if (rockchip_amp_check_amp_irq(gic_irq(d)))
return;
#endif
gic_poke_irq(d, GICD_ICENABLER);
}
@@ -388,6 +396,10 @@ static void gic_eoimode1_mask_irq(struct irq_data *d)
static void gic_unmask_irq(struct irq_data *d)
{
#ifdef CONFIG_ROCKCHIP_AMP
if (rockchip_amp_check_amp_irq(gic_irq(d)))
return;
#endif
gic_poke_irq(d, GICD_ISENABLER);
}
@@ -565,6 +577,10 @@ static bool gic_arm64_erratum_2941627_needed(struct irq_data *d)
static void gic_eoi_irq(struct irq_data *d)
{
#ifdef CONFIG_ROCKCHIP_AMP
if (rockchip_amp_check_amp_irq(gic_irq(d)))
return;
#endif
write_gicreg(gic_irq(d), ICC_EOIR1_EL1);
isb();
@@ -849,8 +865,18 @@ static void __init gic_dist_init(void)
* enabled.
*/
affinity = gic_mpidr_to_affinity(cpu_logical_map(smp_processor_id()));
for (i = 32; i < GIC_LINE_NR; i++)
for (i = 32; i < GIC_LINE_NR; i++) {
#ifdef CONFIG_ROCKCHIP_AMP
u64 affinity_amp;
if (rockchip_amp_need_init_amp_irq(i)) {
affinity_amp = rockchip_amp_get_irq_aff(i);
gic_write_irouter(affinity_amp, base + GICD_IROUTER + i * 8);
continue;
}
#endif
gic_write_irouter(affinity, base + GICD_IROUTER + i * 8);
}
for (i = 0; i < GIC_ESPI_NR; i++)
gic_write_irouter(affinity, base + GICD_IROUTERnE + i * 8);
@@ -1281,6 +1307,10 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *mask_val,
int enabled;
u64 val;
#ifdef CONFIG_ROCKCHIP_AMP
if (rockchip_amp_check_amp_irq(gic_irq(d)))
return -EINVAL;
#endif
if (force)
cpu = cpumask_first(mask_val);
else
@@ -1880,6 +1910,9 @@ static int __init gic_init_bases(void __iomem *dist_base,
gic_update_rdist_properties();
#ifdef CONFIG_ROCKCHIP_AMP
rockchip_amp_get_gic_info(GIC_LINE_NR, GIC_V3);
#endif
gic_dist_init();
gic_cpu_init();
gic_smp_init();