hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/irqchip/irq-gic-common.c
....@@ -10,6 +10,10 @@
1010
1111 #include "irq-gic-common.h"
1212
13
+#ifdef CONFIG_ROCKCHIP_AMP
14
+#include <soc/rockchip/rockchip_amp.h>
15
+#endif
16
+
1317 static DEFINE_RAW_SPINLOCK(irq_controller_lock);
1418
1519 static const struct gic_kvm_info *gic_kvm_info;
....@@ -112,8 +116,25 @@
112116 /*
113117 * Set priority on all global interrupts.
114118 */
119
+#ifdef CONFIG_ROCKCHIP_AMP
120
+ for (i = 32; i < gic_irqs; i += 4) {
121
+ u32 amp_pri, j;
122
+
123
+ amp_pri = 0;
124
+ for (j = 0; j < 4; j++) {
125
+ if (rockchip_amp_check_amp_irq(i + j)) {
126
+ amp_pri |= rockchip_amp_get_irq_prio(i + j) <<
127
+ (j * 8);
128
+ } else {
129
+ amp_pri |= GICD_INT_DEF_PRI << (j * 8);
130
+ }
131
+ }
132
+ writel_relaxed(amp_pri, base + GIC_DIST_PRI + i);
133
+ }
134
+#else
115135 for (i = 32; i < gic_irqs; i += 4)
116136 writel_relaxed(GICD_INT_DEF_PRI_X4, base + GIC_DIST_PRI + i);
137
+#endif
117138
118139 /*
119140 * Deactivate and disable all SPIs. Leave the PPI and SGIs