Skip to content

Commit 9c8114c

Browse files
Srinivas-KandagatlaMarc Zyngier
authored andcommitted
irqchip/gic-v3: Add quirk for msm8996 broken registers
Access to GICR_WAKER is restricted on msm8996 SoC in Hypervisor. Its been more than 2+ years of wait for this to be fixed, which has no hopes to be fixed. This change was introduced for the "lead device" on msm8996 platform. It looks like all publicly available msm8996 and other Qualcomm SoCs have this implementation. So add a quirk to not access this register on msm8996. With this quirk MSM8996 can at least boot out of mainline, which can help community to work with boards based on MSM8996 and other SoCs with have this restrictions. This Quirk is based on device tree compatible string. Without this patch Qualcomm DB820c board reboots when GICR_WAKER is accessed. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
1 parent f70fdb4 commit 9c8114c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/irqchip/irq-gic-v3.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141

4242
#include "irq-gic-common.h"
4343

44+
#define FLAGS_WORKAROUND_GICR_WAKER_MSM8996 (1ULL << 0)
45+
4446
struct redist_region {
4547
void __iomem *redist_base;
4648
phys_addr_t phys_base;
@@ -55,6 +57,7 @@ struct gic_chip_data {
5557
struct irq_domain *domain;
5658
u64 redist_stride;
5759
u32 nr_redist_regions;
60+
u64 flags;
5861
bool has_rss;
5962
unsigned int irq_nr;
6063
struct partition_desc *ppi_descs[16];
@@ -139,6 +142,9 @@ static void gic_enable_redist(bool enable)
139142
u32 count = 1000000; /* 1s! */
140143
u32 val;
141144

145+
if (gic_data.flags & FLAGS_WORKAROUND_GICR_WAKER_MSM8996)
146+
return;
147+
142148
rbase = gic_data_rdist_rd_base();
143149

144150
val = readl_relaxed(rbase + GICR_WAKER);
@@ -1067,6 +1073,15 @@ static const struct irq_domain_ops partition_domain_ops = {
10671073
.select = gic_irq_domain_select,
10681074
};
10691075

1076+
static bool gic_enable_quirk_msm8996(void *data)
1077+
{
1078+
struct gic_chip_data *d = data;
1079+
1080+
d->flags |= FLAGS_WORKAROUND_GICR_WAKER_MSM8996;
1081+
1082+
return true;
1083+
}
1084+
10701085
static int __init gic_init_bases(void __iomem *dist_base,
10711086
struct redist_region *rdist_regs,
10721087
u32 nr_redist_regions,
@@ -1272,6 +1287,11 @@ static void __init gic_of_setup_kvm_info(struct device_node *node)
12721287
}
12731288

12741289
static const struct gic_quirk gic_quirks[] = {
1290+
{
1291+
.desc = "GICv3: Qualcomm MSM8996 broken firmware",
1292+
.compatible = "qcom,msm8996-gic-v3",
1293+
.init = gic_enable_quirk_msm8996,
1294+
},
12751295
{
12761296
}
12771297
};

0 commit comments

Comments
 (0)