hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
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;
....@@ -29,7 +33,13 @@
2933 const struct gic_quirk *quirks, void *data)
3034 {
3135 for (; quirks->desc; quirks++) {
32
- if (!of_device_is_compatible(np, quirks->compatible))
36
+ if (!quirks->compatible && !quirks->property)
37
+ continue;
38
+ if (quirks->compatible &&
39
+ !of_device_is_compatible(np, quirks->compatible))
40
+ continue;
41
+ if (quirks->property &&
42
+ !of_property_read_bool(np, quirks->property))
3343 continue;
3444 if (quirks->init(data))
3545 pr_info("GIC: enabling workaround for %s\n",
....@@ -41,7 +51,7 @@
4151 void *data)
4252 {
4353 for (; quirks->desc; quirks++) {
44
- if (quirks->compatible)
54
+ if (quirks->compatible || quirks->property)
4555 continue;
4656 if (quirks->iidr != (quirks->mask & iidr))
4757 continue;
....@@ -112,8 +122,25 @@
112122 /*
113123 * Set priority on all global interrupts.
114124 */
125
+#ifdef CONFIG_ROCKCHIP_AMP
126
+ for (i = 32; i < gic_irqs; i += 4) {
127
+ u32 amp_pri, j;
128
+
129
+ amp_pri = 0;
130
+ for (j = 0; j < 4; j++) {
131
+ if (rockchip_amp_need_init_amp_irq(i + j)) {
132
+ amp_pri |= rockchip_amp_get_irq_prio(i + j) <<
133
+ (j * 8);
134
+ } else {
135
+ amp_pri |= GICD_INT_DEF_PRI << (j * 8);
136
+ }
137
+ }
138
+ writel_relaxed(amp_pri, base + GIC_DIST_PRI + i);
139
+ }
140
+#else
115141 for (i = 32; i < gic_irqs; i += 4)
116142 writel_relaxed(GICD_INT_DEF_PRI_X4, base + GIC_DIST_PRI + i);
143
+#endif
117144
118145 /*
119146 * Deactivate and disable all SPIs. Leave the PPI and SGIs