From patchwork Mon Dec 10 10:23:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 153253 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3395269ljp; Mon, 10 Dec 2018 02:23:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/V3e21irBjse225+jVPHWrPWx8owlOBG/Nl3JKz3kGQvesFIvPO4XpD9syrBxvcWsifzS3R X-Received: by 2002:a63:db02:: with SMTP id e2mr10403219pgg.419.1544437402950; Mon, 10 Dec 2018 02:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544437402; cv=none; d=google.com; s=arc-20160816; b=uj9tzFHafuB+hjXHCjkyI3bbJtcV/gQu3J2LrKbUdKRziTrNHVcX3OtgGhulrztYKN FSN8A80eFfrg2N1QhCbc+c3nOVrMsHeluYrVuoIkvbGKbR1M3dsLpt81qCIgxSXlRbOY 4JRGAVIlDocTwX8zCnWtHDkldx6sFGquc2hM3b6f14kx/ydc/IUa2J1HC14KQEAuiv0V MNbTC44fRXpHl9CaUK+wiX6I0P3yfIXI8zg1TjRTaT8cLHYD3WaYqR5mirNofV1HBKW9 o7z8jXnInlChuBhTCwGvREfzLSSQ4DQpfvGV8HwTLlnTGVTbGnazeQC1VLfhx4vaaeNQ S6VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wJ2Cn4k6E7T0u8595f7z3MaJbxaC6NuPtJSaZjeLi0E=; b=Rp0L6fiM7sh4gC3cmd1Dm+c7+MQ3cKFw9UCfm08tfjQjcayvP+ze4E0yJCycd1GrdK N22SyYpBWz/FrXYKY53F5KJPNk3dtRfh0968+xiyGYoA+8Jni0ceZG+eWaICvSR1qMqM HBeqFxiSxrBXKkJjA0dlpsaCwDoNYS2qknUKB22WISrgyauuae4jzrRZS73SwmTHIYTq 5Xuq49ffM7YiKmMDp/lPj2icNUnMxJ7zVVdM/kBEt7uZv4VVN26/x1WLbyjDaNl8PEI4 KhIoXlUfFaZk3l8ueCCvr+2lI4nQ1sPyioPQTCaZQDSYaNR3foRieTd+bAMOcdtCm41q wLxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dSn5vvXE; 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=pass (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 n30si9389533pgb.406.2018.12.10.02.23.22; Mon, 10 Dec 2018 02:23:22 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=dSn5vvXE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727159AbeLJKXW (ORCPT + 15 others); Mon, 10 Dec 2018 05:23:22 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45067 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727129AbeLJKXV (ORCPT ); Mon, 10 Dec 2018 05:23:21 -0500 Received: by mail-wr1-f66.google.com with SMTP id b14so9830378wru.12 for ; Mon, 10 Dec 2018 02:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wJ2Cn4k6E7T0u8595f7z3MaJbxaC6NuPtJSaZjeLi0E=; b=dSn5vvXEXYOsHlKdEyF5XjlnYlMqVpFj/xfnKbODR8yt0ol1TPKP1Gag+cM/GaExEU YV23Bf9307NEYI9EA89w3gGCY+kYPBArXFeiOXPRjWW8f1utg/b3bgER/3X1LwLEmzIS 2BQqUkJCA892pSR2RIqYFR1ajXcfunAt8oiu8= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=wJ2Cn4k6E7T0u8595f7z3MaJbxaC6NuPtJSaZjeLi0E=; b=LWQHmsGeKN+H2hZ53lRjF2NIZ3M0Hczz1a/sEoSgg9uxnA30JOdUyfkFeXWMImpn4S XRxiNn4+bx+nW+75+UVkOifEBc+75PtVgGbImhr6sGZG/0TtHSCd48uSe1a/mlIMBH0R 9XIkYKudizRbzn8oBHAjPY09Pc/Qp4WqVtgxqvA5RqWUHv/l8U0qul++B2U+uCZBMoBY LiAMx/MBhm0lrlosZjM/rcZLK/UFhrUOpS6hSyCcJDTgdB1f6HkTEx2SMx+k+/ncvv7M hszU4ey99B4lnR8IiJNCliXlFrYAQ5wApxKYDdcVO/MEzxLVoZaUZegKzxoa/yuE9eK/ hiWw== X-Gm-Message-State: AA+aEWbaXWmrXTjWLzLS2KkWsXUXZ9D8qnzv9C8WzsYTAkOr40VLP/0Y B09pF0scIpFtzf8stUSsRd/N+Q== X-Received: by 2002:adf:d4c9:: with SMTP id w9mr9258048wrk.119.1544437398603; Mon, 10 Dec 2018 02:23:18 -0800 (PST) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id r64sm12266664wmg.5.2018.12.10.02.23.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Dec 2018 02:23:17 -0800 (PST) From: Srinivas Kandagatla To: marc.zyngier@arm.com Cc: sudeep.holla@arm.com, tglx@linutronix.de, jason@lakedaemon.net, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, rnayak@codeaurora.org, sboyd@kernel.org, bjorn.andersson@linaro.org, nicolas.dechesne@linaro.org, ctatlor97@gmail.com, vkoul@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v4 3/4] irqchip: gic-v3: Add quirk for msm8996 secured registers Date: Mon, 10 Dec 2018 10:23:08 +0000 Message-Id: <20181210102309.8207-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181210102309.8207-1-srinivas.kandagatla@linaro.org> References: <20181210102309.8207-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 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 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 --- drivers/irqchip/irq-gic-v3.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.19.2 diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index c95796fa4de6..1a2fa62a52f0 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -41,6 +41,8 @@ #include "irq-gic-common.h" +#define FLAGS_WORKAROUND_GICR_WAKER_MSM8996 (1ULL << 0) + struct redist_region { void __iomem *redist_base; phys_addr_t phys_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 & FLAGS_WORKAROUND_GICR_WAKER_MSM8996) + return; + rbase = gic_data_rdist_rd_base(); val = readl_relaxed(rbase + GICR_WAKER); @@ -1067,6 +1073,15 @@ static const struct irq_domain_ops partition_domain_ops = { .select = gic_irq_domain_select, }; +static bool gic_enable_quirk_msm8996(void *data) +{ + struct gic_chip_data *d = data; + + d->flags |= FLAGS_WORKAROUND_GICR_WAKER_MSM8996; + + return true; +} + static int __init gic_init_bases(void __iomem *dist_base, struct redist_region *rdist_regs, u32 nr_redist_regions, @@ -1272,6 +1287,11 @@ static void __init gic_of_setup_kvm_info(struct device_node *node) } static const struct gic_quirk gic_quirks[] = { + { + .desc = "GICv3: Qualcomm MSM8996 broken firmware", + .compatible = "qcom,msm8996-gic-v3", + .init = gic_enable_quirk_msm8996, + } }; static int __init gic_of_init(struct device_node *node, struct device_node *parent)