From patchwork Mon Dec 10 10:23:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 153251 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3395226ljp; Mon, 10 Dec 2018 02:23:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/UKVmm/mU0YtgWJX64fW24jLChjVCPfH6ORIRu0PxlLVgQR5qgy/rwTspPOS5qLM/smJLcZ X-Received: by 2002:a62:c28e:: with SMTP id w14mr11803364pfk.115.1544437401098; Mon, 10 Dec 2018 02:23:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544437401; cv=none; d=google.com; s=arc-20160816; b=iXkf7KLFWKOcpMf13vBBjJHhGYPI/MbD7PGvd1eh0u09/kc3eiMX9f6Te/y9voa+d0 +yjJhSPwAAJpyPApQoZBgibXPSOP1C1Af559PK6VSU/zopHQnDd38WjG7ozQ3f4IR3Fi sVeRwy0lUa5Cl7k5DOg668IxMa6Rh6zLaPhzStTgg7dCKx7bU6yfaX3aHgb3ntvA0swE wjJupoK5CCbesIVB2GrMDyxwCb5xGHKH6YfKzcOnjxbatMK0e4iJkXfpVNGw0D5fKEEv 19q+wLEwHb8bvT1s3DYx4gSh6CYOJkoOrRzTR6CtZ3gOYaPDWxpfQcgkwQCznpf+dHBr EL4A== 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=XZ8fgTNKEzlulFo0jglvRy93ay062mbv4LQ6PKEe/gQ=; b=Bf4agsgqOGZiDsFBLg8uIHrvIp8MMbzan7/ZTiX7jrA7VnR+enV1xdSFdpeBBSxH1Z 6lZeXbBlBZmTiilD+2po86yY6GNEpoRcsWa+9jwIR1ZpCJo+pJUPR0D/IDQt6q2L3YAD PsTp/0sjrhvk5YuP8xHcAP+vvIKCdXcNFqoiFY/U4tMOL7g6HseRQLSITin4whSKlqKK PnCYJIIG6AnU6Rv3ER75M+s0BMmVisFBqeFY48v1bY/20sxwUSfrmYq2FOvX0BnjIkbu O1l2z9ayLDAd47wuAT4oCzzhedA5i4RQf6Jq0O44+/6BoFIq2rEAe+KQ7S+CPUfk5wkr Z0ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZbBb58wW; 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.20; Mon, 10 Dec 2018 02:23:21 -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=ZbBb58wW; 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 S1727154AbeLJKXT (ORCPT + 15 others); Mon, 10 Dec 2018 05:23:19 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:41953 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727129AbeLJKXS (ORCPT ); Mon, 10 Dec 2018 05:23:18 -0500 Received: by mail-wr1-f68.google.com with SMTP id x10so9840750wrs.8 for ; Mon, 10 Dec 2018 02:23:16 -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=XZ8fgTNKEzlulFo0jglvRy93ay062mbv4LQ6PKEe/gQ=; b=ZbBb58wWhDv0MvwPZN9fA1XNugmo28nJATFNZ3SQPrwq7s88m8LANQ3JEoSlOuOpyw X3FR9ehnuEsgiJVknsxMyzK4p60EKVzrlbh+tXYTlGEqDKkvWs4eSih+mr8E2Jv+emdk dAUg2vdmhMtyEX2jigxj5+o8sYttCsDJOau7k= 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=XZ8fgTNKEzlulFo0jglvRy93ay062mbv4LQ6PKEe/gQ=; b=L3N3MqdzVg20i/SnkfBfFF0TjQ/W1J9+D4mxv1No+WMRuA74APINMttyQb2GfxuKFK mn+zlWNKiFGgS1T4E4fUcTAp16u5ZNosq/emdat6PXuOMAsXvXuTRBZlAggms0gbpkSC uHWQhMVQ9IG+ei+Q1qjdC8iZF+onXEJtlh9XqOvip5FfE9bGu6ArWJKsz2tirTjp+5Wm bPEPBQj6E1WXMnUTuf4G6E3TDEB2klfCKiiCOi/tAHmp0M5+xoKr8G5B8G5FZx35EMLr HUZeqFJgBWd0T49bPt1ysZdLhgW7Han7UVY7dCKEGjJnj6D52v5tpWwa4CfW8RSRAg1C dk3A== X-Gm-Message-State: AA+aEWZZwtFYmQlK6n7N/D4i9jFzjasCN/9dicE1xlqsdYXYqCDwgkzL AHyEa/iFSvo1TBJK8qKt8UNRLw== X-Received: by 2002:adf:ef50:: with SMTP id c16mr9299102wrp.198.1544437396064; Mon, 10 Dec 2018 02:23:16 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Dec 2018 02:23:15 -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 1/4] dt-bindings/gic-v3: Add msm8996 compatible string Date: Mon, 10 Dec 2018 10:23:06 +0000 Message-Id: <20181210102309.8207-2-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. There are many devices out there with this restriction in place and there has been no update to this firmware since last few years, making those devices totally unusable for upstream development. IIDR register value conflicts with other SoCs, using compatible seems to be the only way to apply quirks required for msm8996 based SoCs. Without this quirk many qcom SoCs (atleast 3 that I know) are unable to boot mainline. Signed-off-by: Srinivas Kandagatla --- .../devicetree/bindings/interrupt-controller/arm,gic-v3.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.19.2 diff --git a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt b/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt index 3ea78c4ef887..b83bb8249074 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt +++ b/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt @@ -7,7 +7,9 @@ Interrupts (LPI). Main node required properties: -- compatible : should at least contain "arm,gic-v3". +- compatible : should at least contain "arm,gic-v3" or either + "qcom,msm8996-gic-v3", "arm,gic-v3" for msm8996 SoCs + to address SoC specific bugs/quirks - interrupt-controller : Identifies the node as an interrupt controller - #interrupt-cells : Specifies the number of cells needed to encode an interrupt source. Must be a single cell with a value of at least 3. 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)