From patchwork Wed Jun 13 11:43:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 138439 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp610217lji; Wed, 13 Jun 2018 04:46:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKU0m0eC7KuylHqcQO2CMFTMXPXFhoeDLEXlNshAGQaNmvA620l5n5YXpWYax+rbbCjQOKe X-Received: by 2002:a17:902:c3:: with SMTP id a61-v6mr4859748pla.149.1528890383910; Wed, 13 Jun 2018 04:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528890383; cv=none; d=google.com; s=arc-20160816; b=jYXidv0yXgL+/cdklPWuiqKjNplQNPYK1UBG8HesETnMR+zU+7kkTB9EO9Tf5EcKoy PSbKE282nKzRDnJ6WUhv8GSvOs1BYUZvvnvFbEKVllusoWF69MtO9dZkXPEnP26J/lyo DIftIWJZYfKbeqibn3Kjbq82geRnYDU71afMe/Op5Lq4LwpvZ5BVxHZcBMKkWCNP/3fC jBa0GlqUIVUUIC/uAJTf+uYqpeEeRyP/vEXeexsVgTdjB491BliMK9iXTHyLUZVNTekL 40e33qwsy8dI9R6fcLlzYwbcURYULLwrnllMEPnrAoe16rrGLwkEntLvZ7uqNOJ1eK0h kHyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=sI0+FLkmiCqSpUbIbrn55rttTo0qnAuxzXCOlSqz/NI=; b=l+xuoA2eO4dUVcy9l1BAXU11jguBHB2XTw+h1WnsNVxo15Xs7MkC8kBKMBjKnybV2J ZJM/l7e2CzVLTeCUIQDRkyO/R8gcNqCIzl9M6mZRF2PltN0PKd6/bKtPBaEXGYldUJOq UthdHM1Q/ie3s5C7952WKltcX1Df0AClvbvJJcVDVRd8cqRHrliCi2jfykuEqX4yPC5c ydhIqNNEa3T5SJXbsxXlaVEIZC4UFpTWk8LHjHseCtWnbYvhPGPQK7tT9lqm8FmVgAnT 5AWz0kev/Z91WGdNg/NU/KJZEGcGs+RTAC04RBxKe3HXiCTaffjY11U42GF53oO54ZNc +EgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PvnFWiGp; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6-v6si2676059pla.78.2018.06.13.04.46.23; Wed, 13 Jun 2018 04:46:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PvnFWiGp; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935234AbeFMLqW (ORCPT + 13 others); Wed, 13 Jun 2018 07:46:22 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:56087 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935205AbeFMLqV (ORCPT ); Wed, 13 Jun 2018 07:46:21 -0400 Received: by mail-wm0-f67.google.com with SMTP id v16-v6so4156832wmh.5 for ; Wed, 13 Jun 2018 04:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=hw6HcYrdBerBBzG8uUXVQFTjHBZcYlLTZR+2jAaINrw=; b=PvnFWiGp7ZEbq+NRZpMp6yuU4pimBsYbJvip7zGswUtUrk+Ap9Ka82ruRE94nAGOm1 Dzf1Cz6e9hv+XwZ5/FQYeE2gkA9gSXZicNSjQ0mHR5heDCGyb1XNng/B/XnESfNOXW0R fB56jnLPfdKwswvhMhgxYocJiOrtjgwZK0vQg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hw6HcYrdBerBBzG8uUXVQFTjHBZcYlLTZR+2jAaINrw=; b=MlkWEXA9aT5FwrEnocl7zmD+KRQ36XGWu+8rZIYeRDXzsb5yPcfSHCBoUm1kR9WB6y 9L7WTg0J+g0lZzt8fHDpnALFB7QZubDSCeWC52PHgmQNLmfgsGoCmKYonNiaIHIGSMRh lEbrxFJUwPbPU8YzIjLSdIYvIiE/180wbEOqajVMP0jLdFLTbyJQ9+VU8MtFb2Sjt6Gl PqGK71gch5voWyDZxGjMlTDvGpApbdrzzKHof8F0Tu5EVFs3ktT2CvGxVErPXaLNbwy1 2trKFsQDqMfXipNLNdE6yopMA9w+7qDASXOGJz1rtRBTGRHsuIXzZbVCCPQXyEoJMplU AQjQ== X-Gm-Message-State: APt69E1bIAgJ1haPy1NbYE1S+HD9pGuTqI4NnGEV6OEXv1clxb3hTl5k 5UZDlfEj6gCnW5SPIsawwkRcdA== X-Received: by 2002:a1c:bfce:: with SMTP id o75-v6mr3064515wmi.122.1528890379960; Wed, 13 Jun 2018 04:46:19 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id g11-v6sm3099215wrr.46.2018.06.13.04.46.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jun 2018 04:46:19 -0700 (PDT) From: Srinivas Kandagatla To: marc.zyngier@arm.com, sudeep.holla@arm.com, tglx@linutronix.de, jason@lakedaemon.net Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, rnayak@codeaurora.org, bjorn.andersson@linaro.org, sboyd@kernel.org, nicolas.dechesne@linaro.org, Srinivas Kandagatla Subject: [RFC PATCH] irqchip/gic-v3: Add quirk for msm8996 secured registers Date: Wed, 13 Jun 2018 12:43:40 +0100 Message-Id: <20180613114340.32550-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Access to GICR_WAKER is restricted on msm8996 SoC. Its been more than 2 years of wait for this to be fixed in firmware which is not going anywhere. So add a quirk to not write to this register. With this quirk MSM8996 can atleast boot out of mainline, which can help community to work with boards based on MSM8996. Without this patch Qualcomm DB820c board reboots when GICR_WAKER is written to. Signed-off-by: Srinivas Kandagatla --- drivers/irqchip/irq-gic-v3.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) -- 2.16.2 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 76ea56d779a1..d1bb2c0cce02 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -47,6 +47,8 @@ struct redist_region { bool single_redist; }; +#define GICV3_FLAGS_WORKAROUND_IW_GICR_WAKER (1ULL << 0) + struct gic_chip_data { struct fwnode_handle *fwnode; void __iomem *dist_base; @@ -55,6 +57,7 @@ struct gic_chip_data { struct irq_domain *domain; u64 redist_stride; u32 nr_redist_regions; + u64 flags; bool has_rss; unsigned int irq_nr; struct partition_desc *ppi_descs[16]; @@ -139,6 +142,9 @@ static void gic_enable_redist(bool enable) u32 count = 1000000; /* 1s! */ u32 val; + if (gic_data.flags & GICV3_FLAGS_WORKAROUND_IW_GICR_WAKER) + return; + rbase = gic_data_rdist_rd_base(); val = readl_relaxed(rbase + GICR_WAKER); @@ -1064,6 +1070,31 @@ static const struct irq_domain_ops partition_domain_ops = { .select = gic_irq_domain_select, }; +static bool __maybe_unused gicv3_enable_quirk_msm8996(void *data) +{ + struct gic_chip_data *d = data; + + d->flags |= GICV3_FLAGS_WORKAROUND_IW_GICR_WAKER; + + return true; +} + +static const struct gic_quirk gicv3_quirks[] = { + { + .desc = "GICV3: Qualcomm MSM8996 WAKER IW", + .iidr = 0x00001070, /* MSM8996 */ + .mask = 0x0000ffff, + .init = gicv3_enable_quirk_msm8996, + }, +}; + +static void gic_v3_enable_quirks(struct gic_chip_data *gic_data) +{ + u32 iidr = readl_relaxed(gic_data->dist_base + GICD_IIDR); + + gic_enable_quirks(iidr, gicv3_quirks, gic_data); +} + static int __init gic_init_bases(void __iomem *dist_base, struct redist_region *rdist_regs, u32 nr_redist_regions, @@ -1126,6 +1157,7 @@ static int __init gic_init_bases(void __iomem *dist_base, if (IS_ENABLED(CONFIG_ARM_GIC_V3_ITS) && gic_dist_supports_lpis()) its_init(handle, &gic_data.rdists, gic_data.domain); + gic_v3_enable_quirks(&gic_data); gic_smp_init(); gic_dist_init(); gic_cpu_init();