| .. | .. |
|---|
| 10 | 10 | |
|---|
| 11 | 11 | #include "irq-gic-common.h" |
|---|
| 12 | 12 | |
|---|
| 13 | +#ifdef CONFIG_ROCKCHIP_AMP |
|---|
| 14 | +#include <soc/rockchip/rockchip_amp.h> |
|---|
| 15 | +#endif |
|---|
| 16 | + |
|---|
| 13 | 17 | static DEFINE_RAW_SPINLOCK(irq_controller_lock); |
|---|
| 14 | 18 | |
|---|
| 15 | 19 | static const struct gic_kvm_info *gic_kvm_info; |
|---|
| .. | .. |
|---|
| 29 | 33 | const struct gic_quirk *quirks, void *data) |
|---|
| 30 | 34 | { |
|---|
| 31 | 35 | 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)) |
|---|
| 33 | 43 | continue; |
|---|
| 34 | 44 | if (quirks->init(data)) |
|---|
| 35 | 45 | pr_info("GIC: enabling workaround for %s\n", |
|---|
| .. | .. |
|---|
| 41 | 51 | void *data) |
|---|
| 42 | 52 | { |
|---|
| 43 | 53 | for (; quirks->desc; quirks++) { |
|---|
| 44 | | - if (quirks->compatible) |
|---|
| 54 | + if (quirks->compatible || quirks->property) |
|---|
| 45 | 55 | continue; |
|---|
| 46 | 56 | if (quirks->iidr != (quirks->mask & iidr)) |
|---|
| 47 | 57 | continue; |
|---|
| .. | .. |
|---|
| 112 | 122 | /* |
|---|
| 113 | 123 | * Set priority on all global interrupts. |
|---|
| 114 | 124 | */ |
|---|
| 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 |
|---|
| 115 | 141 | for (i = 32; i < gic_irqs; i += 4) |
|---|
| 116 | 142 | writel_relaxed(GICD_INT_DEF_PRI_X4, base + GIC_DIST_PRI + i); |
|---|
| 143 | +#endif |
|---|
| 117 | 144 | |
|---|
| 118 | 145 | /* |
|---|
| 119 | 146 | * Deactivate and disable all SPIs. Leave the PPI and SGIs |
|---|