From patchwork Tue Sep 8 15:18:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11763493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22C00746 for ; Tue, 8 Sep 2020 15:19:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D690420738 for ; Tue, 8 Sep 2020 15:19:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AL5RNpyI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="wDOiidQ2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D690420738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=19YGkhovvHk7MaCHcn8U7uMnGQ4xM+I/eAjoiFai7BQ=; b=AL5RNpyIWgjDX75PVrYCWWxdv yZZlH+UKsrHIMp+aJFN3+z4yH7Wvbv+z5QiHN1+XiDUpCjK1X4kIST5UaMivjLQkJYcsC+p4iRfpq /GUARRA+GH9k5Z/FPs0FqLzac/xVK78SwC++/RUT0WmAlEr9Egd2365AW2G19zD+zyWS/Hxksslt6 O9WADj9PN/yYf5v+JP2lh7dUxiPG14JCFiwxjsnNO1yo3CJklWvoiRQQXGChfe7PuLDF0LDnIHCk3 4qfvn8vsKXTCjcik0xoe3dHldbWEq7UwuLnRolMt39PlzwilmaEhA+z5h4Y+zdnds1ibpZ1UL3Xk0 CWA5flsWg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfP5-0001cE-Fs; Tue, 08 Sep 2020 15:19:27 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfOe-0001PO-I0 for linux-amlogic@lists.infradead.org; Tue, 08 Sep 2020 15:19:01 +0000 Received: by mail-wr1-x441.google.com with SMTP id a17so19519430wrn.6 for ; Tue, 08 Sep 2020 08:19:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3z8ewx/ZRDSN9alYRV1GNbpM8nlpU8ozO9MS5G5Yh6E=; b=wDOiidQ2OMXWHXErJkSC//k9rNMkPjKCsh0kCoDcDQ7I4wBdVBmw/53WjBfmc0S/zF z4+bOBwfdB8CG/d120sIqdXklHCLwSYlSIsddndpa6bQPyUsudOnAWIy7HJ3r5dQJqUr sfCrz+fpUMMCk6ymbFmsi65sR17m7gOVYc6J7EIfwrROdKShHKqA7kPwc6qfFCoIKQcm zbhPZJjteaQq6e7RKBO1qIBR4l/Ff78YdM9SDoXiRPNCsBwiPgv+2i/YhAq2NBbSoTzy b8v3s9TzVTGmhE6Tp1CEtFAu4+Znw3cdD45XPKL/uP80PpXi+CI7AJIL1C4MNSs9Crik p2ng== 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=3z8ewx/ZRDSN9alYRV1GNbpM8nlpU8ozO9MS5G5Yh6E=; b=Y4RC1o7n68XvjEkgO0N4NRMntaoXdIEph49Y0qpndik7+Nlz8T0hCGIeaKDwRHBSEF O0fk/wzEqqu01VQrEx57bFu/MeKRZNNHWuuYccdXO/Oc7aree8sKxym2TgbaS3DFlygX 7Fu6WLgpdw/eJtzLWC7Fi24XQ+SqqSBC85Z0fSW5NGa91vxuSakZn5xhGWlVbOqG35mU rJVBypyIa1wnxi2innZuInIftxxLE9pxPXMDzShmpCJY0cxizTlaWfkZcdffNvGMEsia T3820h4Y1VH33QeUyk9572fZzOs4tM2bzDVYbD9F9WOKfiQTb6W284y3+1hiUn27IDlC WkWQ== X-Gm-Message-State: AOAM530jOUHx+Ozt/dI8oyVHDOG5/mF9CYN5i5w9ZSM+mpQGDVTfZ7fI HXeaaHSC9WX+WUCUQPlW67n73A== X-Google-Smtp-Source: ABdhPJw9PhMfql/HCXy219kI4xjVlQ2JDvbSsD9uFg37fWGjczy3ofVC8EMawYpaXn0CvZsQro+EIQ== X-Received: by 2002:adf:ec0a:: with SMTP id x10mr128489wrn.47.1599578339377; Tue, 08 Sep 2020 08:18:59 -0700 (PDT) Received: from bender.baylibre.local ([2a01:e35:2ec0:82b0:5405:9623:e2f1:b2ac]) by smtp.gmail.com with ESMTPSA id d25sm10004886wra.25.2020.09.08.08.18.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 08:18:58 -0700 (PDT) From: Neil Armstrong To: robh@kernel.org, tomeu.vizoso@collabora.com, steven.price@arm.com, alyssa.rosenzweig@collabora.com Subject: [PATCH 1/5] iommu/io-pgtable-arm: Add BROKEN_NS quirk to disable shareability on ARM LPAE Date: Tue, 8 Sep 2020 17:18:49 +0200 Message-Id: <20200908151853.4837-2-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200908151853.4837-1-narmstrong@baylibre.com> References: <20200908151853.4837-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200908_111900_644437_B688492A X-CRM114-Status: GOOD ( 15.90 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Neil Armstrong , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org The coherency integration of the IOMMU in the Mali-G52 found in the Amlogic G12B SoCs is broken and leads to constant and random faults from the IOMMU. Disabling shareability completely fixes the issue. Signed-off-by: Neil Armstrong --- drivers/iommu/io-pgtable-arm.c | 7 ++++--- include/linux/io-pgtable.h | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index dc7bcf858b6d..d2d48dc86556 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -440,7 +440,9 @@ static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable *data, << ARM_LPAE_PTE_ATTRINDX_SHIFT); } - if (prot & IOMMU_CACHE) + if (data->iop.cfg.quirks & IO_PGTABLE_QUIRK_ARM_BROKEN_SH) + pte |= ARM_LPAE_PTE_SH_NS; + else if (prot & IOMMU_CACHE) pte |= ARM_LPAE_PTE_SH_IS; else pte |= ARM_LPAE_PTE_SH_OS; @@ -1005,8 +1007,7 @@ arm_mali_lpae_alloc_pgtable(struct io_pgtable_cfg *cfg, void *cookie) { struct arm_lpae_io_pgtable *data; - /* No quirks for Mali (hopefully) */ - if (cfg->quirks) + if (cfg->quirks & ~(IO_PGTABLE_QUIRK_ARM_BROKEN_SH)) return NULL; if (cfg->ias > 48 || cfg->oas > 40) diff --git a/include/linux/io-pgtable.h b/include/linux/io-pgtable.h index 23285ba645db..efb9c8f20909 100644 --- a/include/linux/io-pgtable.h +++ b/include/linux/io-pgtable.h @@ -86,6 +86,9 @@ struct io_pgtable_cfg { * * IO_PGTABLE_QUIRK_ARM_TTBR1: (ARM LPAE format) Configure the table * for use in the upper half of a split address space. + * + * IO_PGTABLE_QUIRK_ARM_BROKEN_SH: (ARM LPAE format) Disables shareability + * when coherency integration is broken. */ #define IO_PGTABLE_QUIRK_ARM_NS BIT(0) #define IO_PGTABLE_QUIRK_NO_PERMS BIT(1) @@ -93,6 +96,7 @@ struct io_pgtable_cfg { #define IO_PGTABLE_QUIRK_ARM_MTK_EXT BIT(3) #define IO_PGTABLE_QUIRK_NON_STRICT BIT(4) #define IO_PGTABLE_QUIRK_ARM_TTBR1 BIT(5) + #define IO_PGTABLE_QUIRK_ARM_BROKEN_SH BIT(6) unsigned long quirks; unsigned long pgsize_bitmap; unsigned int ias; From patchwork Tue Sep 8 15:18:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11763495 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8DC2618 for ; Tue, 8 Sep 2020 15:19:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB0AA222E7 for ; Tue, 8 Sep 2020 15:19:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pZGJMHya"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="ORyY4Zqf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB0AA222E7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=thTtwp41YeWkFQ035ayLw1Yup8Ud8ApPRR2rIY0yB9o=; b=pZGJMHyatJr8rMkX8A7BWoeAQ 2nExguDttCx7XBgyAurLBN8ou2Ty5+E/lXbz4jCBMLs9HzycFOtAXpcQ+AcqXGDPpY2o6rXHVS/64 +J+tVBMB7m1rlN7xq6M6NmYDb25R40LPXhpppDsypjBEN9Nncp00jST4gbjCiUtYbOaAHnrs9Cfwl yJXVV9l4p/eCgvgEqoElNaNHQEpHu3suI44Puh5ZFR5lcTANyB+fuhw0a22HJMjBIBPTVYZOtJ1/A VSL+cjPc8TB0wFe5IG7CK0MSy+MzaM4hxRb3ucwIN8Z5XcV9fi4IEQJoJSpnr0iKX0EX3X3foSd1C 2OEVQhJSg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfP7-0001cr-D3; Tue, 08 Sep 2020 15:19:29 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfOf-0001Q7-RR for linux-amlogic@lists.infradead.org; Tue, 08 Sep 2020 15:19:03 +0000 Received: by mail-wr1-x442.google.com with SMTP id z1so19590429wrt.3 for ; Tue, 08 Sep 2020 08:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O5HUPZey23fpZ7O0ISBcnmoDeQoSvAOa5PK6DE6zp90=; b=ORyY4ZqfDcrdXYjsjTXTEtrUaQe1RJldbGO+pqANb858Ya+JjB4iH1ncEJwkByFE3d cvYPX+8JBt8+2Wov00EdDqAMHvKSEsRwmOVae7HKFzAi8a9LM7+VE9WE6w4pARa9Ox1x /ahRnbLC4gcZoGEORtUuxneW2DLP1pdu8Ol/m53qs6fnlTkDYEodVKtywKTDBQzApoU1 GQlb0LTW7BmwiHtiu2r/3kR4FFdu4bFblA3jYjH2vVIAP3WNcxTFgYY3IKzl4j7ojkEK mYooRqXepx9HdE+veBwBnbnNIubUixtUQd1iCTaBJhk1jxmYyWfkQCIc1ZTaHlMQiRg+ ITOg== 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=O5HUPZey23fpZ7O0ISBcnmoDeQoSvAOa5PK6DE6zp90=; b=SFmfKH1JMhRdijRsGB/1HyVlj+6QT374z1Gs1IH+lKPZEU7itGuPGS7ONbr7Tg1QHi LWB20OJU4Op9smYzgx7WFmVjdAmMW0cddwrswliziTQ6QucuNQ68ePPViUMhG1xyIdLm yMOpkFLI5RJl0o+xpJtjaNRA2FuiZYbpVjeVApQV1/R+atrvdx3NQq4FAbje0zU2LwI7 vOlxZEumDHn/80F2XjeL8/MM/y8pMwS4WIfwLkDvv2bXPTnmJuxHPLixyRU/pK7Tsqyr hcHt+RX5ubW2mSnz6E6nTeqGPtvJmjg58J0UOTrKQcvTU2bUdiMGd+otvsfC2ic/0Oc2 pphQ== X-Gm-Message-State: AOAM530gF65XWqwS7Sn8uJqL8zkKSZb+07TV/NaSV/k/3/RI1x0qx2Aq +9IMltsFngX8xh4+XwpV3nQSnQ== X-Google-Smtp-Source: ABdhPJzcrzBmN5nUV5nRaVbaFFXi/hKg4wRQw/mW6OU7rGvxpIpYuoFbrS9YqopA0v/jdvJCmxWXjQ== X-Received: by 2002:a5d:67d2:: with SMTP id n18mr119063wrw.223.1599578340777; Tue, 08 Sep 2020 08:19:00 -0700 (PDT) Received: from bender.baylibre.local ([2a01:e35:2ec0:82b0:5405:9623:e2f1:b2ac]) by smtp.gmail.com with ESMTPSA id d25sm10004886wra.25.2020.09.08.08.18.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 08:19:00 -0700 (PDT) From: Neil Armstrong To: robh@kernel.org, tomeu.vizoso@collabora.com, steven.price@arm.com, alyssa.rosenzweig@collabora.com Subject: [PATCH 2/5] drm/panfrost: add support specifying pgtbl quirks Date: Tue, 8 Sep 2020 17:18:50 +0200 Message-Id: <20200908151853.4837-3-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200908151853.4837-1-narmstrong@baylibre.com> References: <20200908151853.4837-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200908_111901_978189_455E7922 X-CRM114-Status: GOOD ( 13.37 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Neil Armstrong , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org Add a pgtbl_quirks entry in the compatible specific table to permit specyfying IOMMU quirks for platforms. Signed-off-by: Neil Armstrong Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.h | 3 +++ drivers/gpu/drm/panfrost/panfrost_mmu.c | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index 953f7536a773..2cf1a6a13af8 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -70,6 +70,9 @@ struct panfrost_compatible { int num_pm_domains; /* Only required if num_pm_domains > 1. */ const char * const *pm_domain_names; + + /* IOMMU quirks flags */ + unsigned long pgtbl_quirks; }; struct panfrost_device { diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index e8f7b11352d2..55a846c70e46 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -368,6 +368,7 @@ int panfrost_mmu_pgtable_alloc(struct panfrost_file_priv *priv) mmu->as = -1; mmu->pgtbl_cfg = (struct io_pgtable_cfg) { + .quirks = pfdev->comp ? pfdev->comp->pgtbl_quirks : 0, .pgsize_bitmap = SZ_4K | SZ_2M, .ias = FIELD_GET(0xff, pfdev->features.mmu_features), .oas = FIELD_GET(0xff00, pfdev->features.mmu_features), From patchwork Tue Sep 8 15:18:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11763499 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 30DF5618 for ; Tue, 8 Sep 2020 15:19:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01B3120738 for ; Tue, 8 Sep 2020 15:19:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bRvAwJ7z"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="1fRpOHn2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01B3120738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vD/jLhcwMa3GWtUYQpCEBGMgFEQGm/gsvfZQcIGTQDU=; b=bRvAwJ7z499RwhAo5R8PFztvA jo6UE85KWEl42xo9KRxHYgTsXpVlyl4QWJ8ouHrnEMULV33qE0hEoxRy0z8cIe+Jwgzsu+KVZAbwa bQUGP1y/YdJfSATwYU4vx7lMhewfXC90IFyuvgkjEvdzzR4aSYYmtPyDyY6mbEESGXr87YRoFYtpb feHYc3Zm4VViNPs9eAcHb1NEvzf3b3+nENxseeTnfx3srnhk8FfkDAJFj4u4vHLMRUiGyQfEfCOe3 gIAJHTL68u2JrPv5J84WuFN1bDEO/LsI5BQN2P7ejr9KgS8skHc8ammNCV5drhjbhDzNltQLAOAHM +fWTfMJRg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfPG-0001gK-ED; Tue, 08 Sep 2020 15:19:38 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfOh-0001R4-7k for linux-amlogic@lists.infradead.org; Tue, 08 Sep 2020 15:19:07 +0000 Received: by mail-wr1-x442.google.com with SMTP id c18so19508637wrm.9 for ; Tue, 08 Sep 2020 08:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EjvSHXG3RI2RmufIBrYIZQgGCbPKahWO302cZe4SW9Q=; b=1fRpOHn2lUTg/rLqc5FK572t6QTaVx2cYu+zLDiJpPqs8Msd6mxRGNwuQj7o/RemeB lp9id7bzG8bubb29ko3iwRYgZzddu8jc1z5ySmEpJQbi81n/gngRijw8+0G4Hmtjajt3 VkvFnYnB70FT/9x3O7OLKvsN8UDOhKP5dcVjqfmkLO3lasTdS+d5yCZZxHw7Ga9Zja2n 1y6vyBkEwXn/0qvCvQTQjk71wPIDCn2g6OnC0vEEUSS8gU1hzC2FE/iYN4+XkIbnAbOg otF3YD6EqWDUDKMsSqkb8xASmC62YkldJ00uUh8OxuTRQbumbWBoRkx7YxQGBkWdFmmm Szvw== 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=EjvSHXG3RI2RmufIBrYIZQgGCbPKahWO302cZe4SW9Q=; b=ifMhibGXlWYmiGiWSRU612v4nrQ2L/IMQlP4zlhFDIrXxBSyIZrBjq023vh3uxgexI x6Qo8riOxViCib7NglECZ+4BusTCyXViRxQbiGcwKg3T5RRwi3tnMM2qT0fb7yIw0cXb Gnzzc/V5bFwvnpIeqwoXNQOp3pLLiFTGmxpR7lsZTauq62S+LKFQp3gAHTFMFJ1IAGLy +gzncr1hHDzhMvyLxzCdc2XHVx8ZKVeXiOrTfxGJVDrw+HJjnTRMUIba9t8BrBDjuGKD b14zNyX2Cs0a+mQK2rE3VCO01/WpkYUMpl+/G0tLRTe5I+jxkKGYENtpy5a4kVX1lqdk wAHQ== X-Gm-Message-State: AOAM5326K8b4UKxjXeBn+6f+nu7BvjNVsaYchklHAXUgwdnhtqOOKwqe NiBF+POgmPj+k1BIt8hRRpTdQQ== X-Google-Smtp-Source: ABdhPJyN+wVgZwcIGrsQVVJMowKAn9fgE7m5lBvFEuTQvke5O9KsubvDObKWcbTu0XD7mkbW64TA/Q== X-Received: by 2002:adf:f50a:: with SMTP id q10mr110043wro.319.1599578342220; Tue, 08 Sep 2020 08:19:02 -0700 (PDT) Received: from bender.baylibre.local ([2a01:e35:2ec0:82b0:5405:9623:e2f1:b2ac]) by smtp.gmail.com with ESMTPSA id d25sm10004886wra.25.2020.09.08.08.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 08:19:01 -0700 (PDT) From: Neil Armstrong To: robh@kernel.org, tomeu.vizoso@collabora.com, steven.price@arm.com, alyssa.rosenzweig@collabora.com Subject: [PATCH 3/5] drm/panfrost: add support for reset quirk Date: Tue, 8 Sep 2020 17:18:51 +0200 Message-Id: <20200908151853.4837-4-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200908151853.4837-1-narmstrong@baylibre.com> References: <20200908151853.4837-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200908_111903_386537_F33A626F X-CRM114-Status: GOOD ( 14.10 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Neil Armstrong , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org The T820, G31 & G52 GPUs integratewd by Amlogic in the respective GXM, G12A/SM1 & G12B SoCs needs a quirk in the PWR registers at the GPU reset time. This adds a callback in the device compatible struct of permit this. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/panfrost/panfrost_device.h | 3 +++ drivers/gpu/drm/panfrost/panfrost_gpu.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index 2cf1a6a13af8..4c9cd5452ba5 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -73,6 +73,9 @@ struct panfrost_compatible { /* IOMMU quirks flags */ unsigned long pgtbl_quirks; + + /* Vendor implementation quirks at reset time callback */ + void (*vendor_reset_quirk)(struct panfrost_device *pfdev); }; struct panfrost_device { diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index e0f190e43813..c129aaf77790 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -62,6 +62,10 @@ int panfrost_gpu_soft_reset(struct panfrost_device *pfdev) gpu_write(pfdev, GPU_INT_CLEAR, GPU_IRQ_RESET_COMPLETED); gpu_write(pfdev, GPU_CMD, GPU_CMD_SOFT_RESET); + /* The Amlogic GPU integration needs quirks at this stage */ + if (pfdev->comp->vendor_reset_quirk) + pfdev->comp->vendor_reset_quirk(pfdev); + ret = readl_relaxed_poll_timeout(pfdev->iomem + GPU_INT_RAWSTAT, val, val & GPU_IRQ_RESET_COMPLETED, 100, 10000); From patchwork Tue Sep 8 15:18:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11763503 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F20A6618 for ; Tue, 8 Sep 2020 15:19:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8E34A20738 for ; Tue, 8 Sep 2020 15:19:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="20akc1Uv"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="GG9m4KU7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E34A20738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i63y/eWcfI6GKi8yNC7ntzasdQCV1bZgXWlsahFkPMo=; b=20akc1UvUUbLSLGu7BYtwQLVj 0Y/S5r1vOeYQ+IwRHHNCxypE+uqfbo+Bmg1tx/NuLExRzWbMMdKKi/GFO5iVgVMfHBGyRoHN2MYdK DqS4Kx0PC9JTaA4cPzjUQMGVzx6qadgZ/2Lf0PqF9HV16NftreXv5yR1kfatlzfOhDH/gKVFENu/N K8ROHxSWcXXccuqHJ+mg2LAGZ7NwjLJi1a6QuXNBYSTHukDu4YKwgORJQYryX1q4mJIFr2htN4Cj2 IY2GuPd+SlhDFJd5bhNzFOB3TsNxs2y/hRrQnFET5ke3BAqJgD0QVFrazTXJ+cqpQGLKQHnT+EBlL RyzI38Z6Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfPK-0001ir-Rj; Tue, 08 Sep 2020 15:19:42 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfOi-0001SD-VX for linux-amlogic@lists.infradead.org; Tue, 08 Sep 2020 15:19:11 +0000 Received: by mail-wm1-x342.google.com with SMTP id x23so7762581wmi.3 for ; Tue, 08 Sep 2020 08:19:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0IoBahBXL8EV0Zm9JurRP5zVn3O/ezWTWYb2ZZwdoss=; b=GG9m4KU79FRy3Qgbny/8OL+0RnULk7UHa8hwD7IGdlg/qZhDxf7vKcI4P3TtCRnWdZ t6SU2EesiN0Cw098TrXyhVUAbYiefAj+KMX4mOg1eFswalgfcdxfwWFd/2OhgVTFVRXf g0dRQ0aec6jsWRZ846qt63PSfKpe9CRYDVyuynbySXEdwR52T3mzEDOmJpGxQlgwxhsR IpjPOse9s6p0IfHP9+eYD58xNRKvXxt51uPieX/UxsPiOthcKowdpEe+ob6Bpatn2wNW rrfbpmyD9lJLn0HetNn/Bm5glZadk3/taeSTRnHJRgtnOOemPdW3Cmkd8Y5jL0zjvFCG uWWg== 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=0IoBahBXL8EV0Zm9JurRP5zVn3O/ezWTWYb2ZZwdoss=; b=jN3eP7LdOV+AV1qJE7HdYnzfw7MUrj949g28PMqVKG1X0DW8kmZCA2HkqW9BZRNDPG ge3pReGKJMxs7fr/oUSIsq4JaKlFry6vedNhz5v4SY0sdfZ89dFQ9U2ExL7Wn92ILYxn 0mknP5CDpFe+4GGYAucpMuN3fmgFwi7bzIzzsXZQMLgrHmLGrZOeQ7JUuL7jGzKLI0G3 xr16S+msKN7zFJzR+oJiUwRGUqEPDgdJSSfSpabEv8uCXfStd5ZPhQnFCyye8IUHT2SV G5Nlubf69+QLFo7iSnfLKXTL12WTuChhLid3SZaz7mLzSxrE72hoX9Hwb2v3q+/SjvR8 wE2Q== X-Gm-Message-State: AOAM530TwbvIuDah8mDG2lMCfK0h2BI1iwzXKHfK9L3fFzBVQ69p4BbV Vk8B1Mn7TEJ611SW48hHUn/yLQ== X-Google-Smtp-Source: ABdhPJw6zcnIiatO6SQE5a+MzW0yXoBmBj7sAP9Cf3yM7GxqrkpZS5u2132oDAMPyj0810YP9kSkWQ== X-Received: by 2002:a05:600c:22d1:: with SMTP id 17mr73546wmg.58.1599578343681; Tue, 08 Sep 2020 08:19:03 -0700 (PDT) Received: from bender.baylibre.local ([2a01:e35:2ec0:82b0:5405:9623:e2f1:b2ac]) by smtp.gmail.com with ESMTPSA id d25sm10004886wra.25.2020.09.08.08.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 08:19:03 -0700 (PDT) From: Neil Armstrong To: robh@kernel.org, tomeu.vizoso@collabora.com, steven.price@arm.com, alyssa.rosenzweig@collabora.com Subject: [PATCH 4/5] drm/panfrost: add amlogic reset quirk callback Date: Tue, 8 Sep 2020 17:18:52 +0200 Message-Id: <20200908151853.4837-5-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200908151853.4837-1-narmstrong@baylibre.com> References: <20200908151853.4837-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200908_111905_114365_A0950F8B X-CRM114-Status: GOOD ( 14.00 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:342 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Neil Armstrong , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org The T820, G31 & G52 GPUs integratewd by Amlogic in the respective GXM, G12A/SM1 & G12B SoCs needs a quirk in the PWR registers at the GPU reset time. Since the documentation of the GPU cores are not public, we do not know what does these values, but they permit having a fully functional GPU running with Panfrost. Signed-off-by: Neil Armstrong Reported-by: kernel test robot --- drivers/gpu/drm/panfrost/panfrost_gpu.c | 13 +++++++++++++ drivers/gpu/drm/panfrost/panfrost_gpu.h | 2 ++ drivers/gpu/drm/panfrost/panfrost_regs.h | 3 +++ 3 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index c129aaf77790..018737bd4ac6 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -80,6 +80,19 @@ int panfrost_gpu_soft_reset(struct panfrost_device *pfdev) return 0; } +void panfrost_gpu_amlogic_quirks(struct panfrost_device *pfdev) +{ + /* + * The Amlogic integrated Mali-T820, Mali-G31 & Mali-G52 needs + * these undocumented bits to be set in order to operate + * correctly. + * These GPU_PWR registers contains: + * "device-specific power control value" + */ + gpu_write(pfdev, GPU_PWR_KEY, 0x2968A819); + gpu_write(pfdev, GPU_PWR_OVERRIDE1, 0xfff | (0x20 << 16)); +} + static void panfrost_gpu_init_quirks(struct panfrost_device *pfdev) { u32 quirks = 0; diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.h b/drivers/gpu/drm/panfrost/panfrost_gpu.h index 4112412087b2..a881d7dc812f 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.h +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.h @@ -16,4 +16,6 @@ int panfrost_gpu_soft_reset(struct panfrost_device *pfdev); void panfrost_gpu_power_on(struct panfrost_device *pfdev); void panfrost_gpu_power_off(struct panfrost_device *pfdev); +void panfrost_gpu_amlogic_reset_quirk(struct panfrost_device *pfdev); + #endif diff --git a/drivers/gpu/drm/panfrost/panfrost_regs.h b/drivers/gpu/drm/panfrost/panfrost_regs.h index ea38ac60581c..fa0d02f3c830 100644 --- a/drivers/gpu/drm/panfrost/panfrost_regs.h +++ b/drivers/gpu/drm/panfrost/panfrost_regs.h @@ -51,6 +51,9 @@ #define GPU_STATUS 0x34 #define GPU_STATUS_PRFCNT_ACTIVE BIT(2) #define GPU_LATEST_FLUSH_ID 0x38 +#define GPU_PWR_KEY 0x050 /* (WO) Power manager key register */ +#define GPU_PWR_OVERRIDE0 0x054 /* (RW) Power manager override settings */ +#define GPU_PWR_OVERRIDE1 0x058 /* (RW) Power manager override settings */ #define GPU_FAULT_STATUS 0x3C #define GPU_FAULT_ADDRESS_LO 0x40 #define GPU_FAULT_ADDRESS_HI 0x44 From patchwork Tue Sep 8 15:18:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 11763505 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44D36746 for ; Tue, 8 Sep 2020 15:20:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 169D220738 for ; Tue, 8 Sep 2020 15:20:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lu3eY4AI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="QClkfBuh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 169D220738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oHyshe9jhLjSzbkuyURasRIQ7SSWo0q2iOHhUCDakpU=; b=lu3eY4AIPv5kpiPSvFHIMuA4D U/44MgmUGCvDm1F+612Big4ryvO2dVM0eJeCpW+EHylKuBz8WBu8M1Mgy/KW92Knn71/mv2b+UORz xdMPy7zi08q3Ozg4IOsQaZchViAS2FWNKo+ZcpYbkrfRMnjq8LjtsIK+tQ51R7xF/t1BdGrMj2gz9 nygKpM1gUpbue4cTsf8vDBsHahNdQBK0f4AxK+sL7uBvf4wVW+Mc11p1HHxNHIftJ6Hh4kdPFmD7u a3R2XBJuW4MCkJxPBWb6qORufcZV0ByhUnC+uiRcIAbAKQyK5ej1ct3GcatyiknQcdMjUalZH23Nd E0rNIKDzQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfPQ-0001lr-Ai; Tue, 08 Sep 2020 15:19:48 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kFfOk-0001TC-7A for linux-amlogic@lists.infradead.org; Tue, 08 Sep 2020 15:19:15 +0000 Received: by mail-wr1-x441.google.com with SMTP id z1so19590677wrt.3 for ; Tue, 08 Sep 2020 08:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E2h5/f7B8UduwNBWvSzemM2vuVc1bCQBvZ08jf0eflQ=; b=QClkfBuh7zRtKPZhArDNelPuXMie1hFY7FPB3XsPbRlBLzS1TUzcRStoDJaFj+3aVZ yTZZExlief7f9/Iaz2xUvIL7RcWsHwZQ+dr9MfSesaQgo3huHMHVokyq2FXgZ8GVlJDl 1TS2E9clRVHW910paXbN65GvZZV+smkSMxbGfjOBBa0lyhHQztUhkmg7Dmm1Hfq2NVE6 BmH23sbtkUVAVWuPHKhgTjjrX7RT936M3DSZzYqPmz+fKNSG9gOdKuHoLkvh0mK0u0G7 awgJf92IvgOMOaHm6N4flJkgsHxhNKL/LKSivxXNIt9SKPgp9zu4AtvEo76gxXM6ojik zlpA== 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=E2h5/f7B8UduwNBWvSzemM2vuVc1bCQBvZ08jf0eflQ=; b=D6HIFrWE5gD0PpriHl+k1uwYqsMiJOQD+yjfjzdISA/epm7Yk7X6JPaJOb78KTjj6F sIPZm8Q1N4q7Edxlxu1BbrBkWTf4VABXRzdaCOMTdjaj+d4woSYys9+SzzYRiS00qmFn O3+asoUw0TMWpLIp4tfzRgkhIXrbYbDP4nA4YB2b6LdWQiPY3465HDK/YAz9ebhbkjzF LoYUhx02OdLotR2z+U+T4FEDEYvQI04qShGjQjdrE9kNjHa2AthDsvPd+aJXOv9vzpKH /DXFFX1J9fc/u3R8FSGu0IlnIvIjZNIbIwvopswW2UNnJD1/WFWecawT4ekz1r9psSWW 5UaQ== X-Gm-Message-State: AOAM532dnwWX1pF6TOn1BtZlFx/J5fu21Avme6UG69oy7XNhfPHqNgl0 DlzbyX2ePtJb9rUzBxvau3zauikjXUZmHEmH X-Google-Smtp-Source: ABdhPJy2ANgwewAvMtdvyK0S7iJLntLssA/HK+zsOS39X389rZIqUtFcfuRkd6xLxKT6uQiYWITGiA== X-Received: by 2002:adf:e690:: with SMTP id r16mr135272wrm.15.1599578345135; Tue, 08 Sep 2020 08:19:05 -0700 (PDT) Received: from bender.baylibre.local ([2a01:e35:2ec0:82b0:5405:9623:e2f1:b2ac]) by smtp.gmail.com with ESMTPSA id d25sm10004886wra.25.2020.09.08.08.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 08:19:04 -0700 (PDT) From: Neil Armstrong To: robh@kernel.org, tomeu.vizoso@collabora.com, steven.price@arm.com, alyssa.rosenzweig@collabora.com Subject: [PATCH 5/5] drm/panfrost: add Amlogic GPU integration quirks Date: Tue, 8 Sep 2020 17:18:53 +0200 Message-Id: <20200908151853.4837-6-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20200908151853.4837-1-narmstrong@baylibre.com> References: <20200908151853.4837-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200908_111906_326899_5B502BC1 X-CRM114-Status: GOOD ( 12.83 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:441 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Neil Armstrong , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org This adds the required GPU quirks, including the quirk in the PWR registers at the GPU reset time and the IOMMU quirk for shareability issues observed on G52 in Amlogic G12B SoCs. Signed-off-by: Neil Armstrong Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_drv.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 36463c89e966..efde5e2acc35 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -656,7 +656,25 @@ static const struct panfrost_compatible default_data = { .pm_domain_names = NULL, }; +static const struct panfrost_compatible amlogic_gxm_data = { + .num_supplies = ARRAY_SIZE(default_supplies), + .supply_names = default_supplies, + .vendor_reset_quirk = panfrost_gpu_amlogic_reset_quirk, +}; + +static const struct panfrost_compatible amlogic_g12a_data = { + .num_supplies = ARRAY_SIZE(default_supplies), + .supply_names = default_supplies, + .vendor_reset_quirk = panfrost_gpu_amlogic_reset_quirk, + .pgtbl_quirks = IO_PGTABLE_QUIRK_ARM_BROKEN_SH, +}; + static const struct of_device_id dt_match[] = { + /* Set first to probe before the generic compatibles */ + { .compatible = "amlogic,meson-gxm-mali", + .data = &amlogic_gxm_data, }, + { .compatible = "amlogic,meson-g12a-mali", + .data = &amlogic_g12a_data, }, { .compatible = "arm,mali-t604", .data = &default_data, }, { .compatible = "arm,mali-t624", .data = &default_data, }, { .compatible = "arm,mali-t628", .data = &default_data, },