From patchwork Wed Nov 2 15:18:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 13028285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D657C4332F for ; Wed, 2 Nov 2022 15:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XD8JTdstVPfn/tUEjX06HES3dCtvTTrPyjIaOvLx60A=; b=bimJN/d7zhfwg3PeixAdJphQwc 0EwBcgrLTyyzCROPRtS+3dkA5h4O6n1kp4bjREAP5K9U2FOzkwBBOSV7oC0kVhzMA4SIRiud1yeJG 1zL7LjeayEjMLb8tZixiXtUOeTE6Nz+oN5w15JLZEZPyWNEHqZ4Dwdq0VVHp5kLh5wU+WXCb+Zr4I xPt+NFKP6gnXnamwrK57qXe28fLwUiX/Nex6yWzkMctGJyuX03FZ8vswn2RyvWHw70oJRPR7DkOM4 zG2l7Z3YG0D/ZseVkzdXmgbL2Yb8bXylSx+lyoxhS09nN+PprFyNOTo2Hnb0M6++HnNe2tNh07XLT QZF8j12Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqFVx-00BhxC-V5; Wed, 02 Nov 2022 15:18:49 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqFVP-00Bhh6-51 for linux-mediatek@lists.infradead.org; Wed, 02 Nov 2022 15:18:19 +0000 Received: by mail-wr1-x430.google.com with SMTP id w14so25013554wru.8 for ; Wed, 02 Nov 2022 08:18:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XD8JTdstVPfn/tUEjX06HES3dCtvTTrPyjIaOvLx60A=; b=cc4G6KxfaQokcHNYhyRODdH1eFv6BTOKMuRaQcIv9vK7XoG48SK8Jf1IkkMBNQcomJ KaMgtz9nqRLbfGkbCpHXuSA0pGpd7l1q0xaR+Ldvrilil38dLRUqL0rTVz9pFd8pohef GUzeQt3y6CEArQkXIL2e78KzuEK1aGVZv8ruCuToJ2I6Jh7Vf5m9QfMGL897pWKzgVGo P080kkWWb9+i3quhZYYyxmDWv6nWAfrmQ0wPuIreNEQCD5ZMBoEXSLI8w4mnsvmSTGi0 e6GjDBVLL75NYHEEHyV5OW1BLI4Cr8BcP9RDgUsQyH6ogsIbRXZEws8hv7do+hGjkd3Z ZyRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XD8JTdstVPfn/tUEjX06HES3dCtvTTrPyjIaOvLx60A=; b=Kr9yJpLGkcr7ybMktaNnhU5ZZbItulFlSv6hrDCtTyl/U5m8GIgLFpP6LxG4YVBG8x Rk0GQJDBEYltpZyci29EnuNHMtOQ+qDJk51n64ufswWVIFwwJLto4kQGjEb+W/TZ+48J SjZijiSucEshomvHSavWqNygJl6O8Owc1tXaJxxpG/RL5S4jc63uhRBBywt2xNmbJbRA DldLzbwId1bBwvH4qs1nuSyqTB3NumIH44JB+wM1SWlNcnZtVxxWVl4Q0y2E0vIjJ2pS 6O5HXz5NyDbAR9j4Oe+qvjRItDOfWFVYatwIBSANsaNBZTr9lqVWCfiGjb1z03SKv32w zswg== X-Gm-Message-State: ACrzQf1PqXK7Bm2PtjxFNkB60zq93kugJ9QR581tuMhOXCQfsJhJjBkr MAZQ9meGDP8tZAg6QtLfeRCbuQ== X-Google-Smtp-Source: AMsMyM54U8ef+hPMLaNfLq4J54lhNC4U17ZBgk6H0dN4zR8Zb9oU2JOmpOfxTvAVT2qoUHvFUJ43mQ== X-Received: by 2002:a05:6000:801:b0:236:617f:d962 with SMTP id bt1-20020a056000080100b00236617fd962mr15884621wrb.75.1667402292745; Wed, 02 Nov 2022 08:18:12 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id bq13-20020a5d5a0d000000b002365921c9aesm13332818wrb.77.2022.11.02.08.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 08:18:12 -0700 (PDT) From: Alexandre Mergnat Date: Wed, 02 Nov 2022 16:18:07 +0100 Subject: [PATCH v6 1/3] dt-bindings: iommu: mediatek: add binding documentation for MT8365 SoC MIME-Version: 1.0 Message-Id: <20221001-iommu-support-v6-1-be4fe8da254b@baylibre.com> References: <20221001-iommu-support-v6-0-be4fe8da254b@baylibre.com> In-Reply-To: <20221001-iommu-support-v6-0-be4fe8da254b@baylibre.com> To: Matthias Brugger , Krzysztof Kozlowski , Joerg Roedel , Rob Herring , Robin Murphy , Will Deacon , Yong Wu Cc: linux-kernel@vger.kernel.org, Alexandre Mergnat , iommu@lists.linux.dev, linux-mediatek@lists.infradead.org, Amjad Ouled-Ameur , Markus Schneider-Pargmann , linux-arm-kernel@lists.infradead.org, Fabien Parent , AngeloGioacchino Del Regno , devicetree@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=6368; i=amergnat@baylibre.com; h=from:subject:message-id; bh=5/uPU5oCsnBuU7Z/wg3JNmSvklPo8fkTK5NWaHQiobk=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjYooyBuYKC7CMc3q48r1T+qWWNhdb6+Q47Hp59WyC M8Lv8EuJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY2KKMgAKCRArRkmdfjHURd7RD/ 4gnKP6mMK1wgnySZx6fAyfIpjbtOMuAnLyYCjtXGMQjnvrgEVoneED6a1x0aAVud8ATbRdpX/dwnq3 wl9hJG5LUUGebUGkqs4agVaDr1yJ8T4rjk4ffmlrj94Qk/LTvEEu/k/IoBdUrfsQyUl1cyGm91KugU Tg99PYFBrmKRSjWtV7xO008WdrW4+/UxZDvVDlxdevfxJud0pFozMOuC0FwNSoh40rxQO8AyAq9+jf obGeOVVT6mi0e2SYF+6bBcR650Cq4+EIf1/2kPqNLvmWhaJN4n1rRtmWXIu3m5fnN5dk410sRS7ShB yH3i3k6FdSjqZpSAJuGX6ePrbz3amlFpkUKKfiKEZ2IilkqedJO41XClFjce601yfmdyqFVGGFmHou AbjjuPfMon707u+4Z+V2sfN2HdktUXA1LvD5W3PWc7AFwvtNWqHIUAIUN5JH4dfrlZaNOHMnPb1ODm 8TkWKRXBtNbwZzARYXYDEEjopW4/w+arsthWErF6PiMEANf5miX5D2ZfCmAaZ8S3vfONyuHSy4iMdQ l/SmqCild6fzzMTDjKpm1sAeOnuoE7Bnkw161ap7RJWW62730BNESCtNM3CeZTo/myOMnivefmqVUy h+scmSBxihUEtdJzWry8D/6rRdXt7zLHHBKpMW2zrsbUSlVmJaY7NVKI2S1A== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_081815_267010_E486888D X-CRM114-Status: GOOD ( 12.27 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Fabien Parent Add IOMMU binding documentation for the MT8365 SoC. Signed-off-by: Fabien Parent Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Reviewed-by: Yong Wu Signed-off-by: Alexandre Mergnat --- .../devicetree/bindings/iommu/mediatek,iommu.yaml | 2 + .../dt-bindings/memory/mediatek,mt8365-larb-port.h | 90 ++++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml index fee0241b5098..725434d9d646 100644 --- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml +++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml @@ -81,6 +81,7 @@ properties: - mediatek,mt8195-iommu-vdo # generation two - mediatek,mt8195-iommu-vpp # generation two - mediatek,mt8195-iommu-infra # generation two + - mediatek,mt8365-m4u # generation two - description: mt7623 generation one items: @@ -130,6 +131,7 @@ properties: dt-binding/memory/mt8186-memory-port.h for mt8186, dt-binding/memory/mt8192-larb-port.h for mt8192. dt-binding/memory/mt8195-memory-port.h for mt8195. + dt-binding/memory/mediatek,mt8365-larb-port.h for mt8365. power-domains: maxItems: 1 diff --git a/include/dt-bindings/memory/mediatek,mt8365-larb-port.h b/include/dt-bindings/memory/mediatek,mt8365-larb-port.h new file mode 100644 index 000000000000..56d5a5dd519e --- /dev/null +++ b/include/dt-bindings/memory/mediatek,mt8365-larb-port.h @@ -0,0 +1,90 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Copyright (c) 2022 MediaTek Inc. + * Author: Yong Wu + */ +#ifndef _DT_BINDINGS_MEMORY_MT8365_LARB_PORT_H_ +#define _DT_BINDINGS_MEMORY_MT8365_LARB_PORT_H_ + +#include + +#define M4U_LARB0_ID 0 +#define M4U_LARB1_ID 1 +#define M4U_LARB2_ID 2 +#define M4U_LARB3_ID 3 + +/* larb0 */ +#define M4U_PORT_DISP_OVL0 MTK_M4U_ID(M4U_LARB0_ID, 0) +#define M4U_PORT_DISP_OVL0_2L MTK_M4U_ID(M4U_LARB0_ID, 1) +#define M4U_PORT_DISP_RDMA0 MTK_M4U_ID(M4U_LARB0_ID, 2) +#define M4U_PORT_DISP_WDMA0 MTK_M4U_ID(M4U_LARB0_ID, 3) +#define M4U_PORT_DISP_RDMA1 MTK_M4U_ID(M4U_LARB0_ID, 4) +#define M4U_PORT_MDP_RDMA0 MTK_M4U_ID(M4U_LARB0_ID, 5) +#define M4U_PORT_MDP_WROT1 MTK_M4U_ID(M4U_LARB0_ID, 6) +#define M4U_PORT_MDP_WROT0 MTK_M4U_ID(M4U_LARB0_ID, 7) +#define M4U_PORT_MDP_RDMA1 MTK_M4U_ID(M4U_LARB0_ID, 8) +#define M4U_PORT_DISP_FAKE0 MTK_M4U_ID(M4U_LARB0_ID, 9) +#define M4U_PORT_APU_READ MTK_M4U_ID(M4U_LARB0_ID, 10) +#define M4U_PORT_APU_WRITE MTK_M4U_ID(M4U_LARB0_ID, 11) + +/* larb1 */ +#define M4U_PORT_VENC_RCPU MTK_M4U_ID(M4U_LARB1_ID, 0) +#define M4U_PORT_VENC_REC MTK_M4U_ID(M4U_LARB1_ID, 1) +#define M4U_PORT_VENC_BSDMA MTK_M4U_ID(M4U_LARB1_ID, 2) +#define M4U_PORT_VENC_SV_COMV MTK_M4U_ID(M4U_LARB1_ID, 3) +#define M4U_PORT_VENC_RD_COMV MTK_M4U_ID(M4U_LARB1_ID, 4) +#define M4U_PORT_VENC_NBM_RDMA MTK_M4U_ID(M4U_LARB1_ID, 5) +#define M4U_PORT_VENC_NBM_RDMA_LITE MTK_M4U_ID(M4U_LARB1_ID, 6) +#define M4U_PORT_JPGENC_Y_RDMA MTK_M4U_ID(M4U_LARB1_ID, 7) +#define M4U_PORT_JPGENC_C_RDMA MTK_M4U_ID(M4U_LARB1_ID, 8) +#define M4U_PORT_JPGENC_Q_TABLE MTK_M4U_ID(M4U_LARB1_ID, 9) +#define M4U_PORT_JPGENC_BSDMA MTK_M4U_ID(M4U_LARB1_ID, 10) +#define M4U_PORT_JPGDEC_WDMA MTK_M4U_ID(M4U_LARB1_ID, 11) +#define M4U_PORT_JPGDEC_BSDMA MTK_M4U_ID(M4U_LARB1_ID, 12) +#define M4U_PORT_VENC_NBM_WDMA MTK_M4U_ID(M4U_LARB1_ID, 13) +#define M4U_PORT_VENC_NBM_WDMA_LITE MTK_M4U_ID(M4U_LARB1_ID, 14) +#define M4U_PORT_VENC_CUR_LUMA MTK_M4U_ID(M4U_LARB1_ID, 15) +#define M4U_PORT_VENC_CUR_CHROMA MTK_M4U_ID(M4U_LARB1_ID, 16) +#define M4U_PORT_VENC_REF_LUMA MTK_M4U_ID(M4U_LARB1_ID, 17) +#define M4U_PORT_VENC_REF_CHROMA MTK_M4U_ID(M4U_LARB1_ID, 18) + +/* larb2 */ +#define M4U_PORT_CAM_IMGO MTK_M4U_ID(M4U_LARB2_ID, 0) +#define M4U_PORT_CAM_RRZO MTK_M4U_ID(M4U_LARB2_ID, 1) +#define M4U_PORT_CAM_AAO MTK_M4U_ID(M4U_LARB2_ID, 2) +#define M4U_PORT_CAM_LCS MTK_M4U_ID(M4U_LARB2_ID, 3) +#define M4U_PORT_CAM_ESFKO MTK_M4U_ID(M4U_LARB2_ID, 4) +#define M4U_PORT_CAM_CAM_SV0 MTK_M4U_ID(M4U_LARB2_ID, 5) +#define M4U_PORT_CAM_CAM_SV1 MTK_M4U_ID(M4U_LARB2_ID, 6) +#define M4U_PORT_CAM_LSCI MTK_M4U_ID(M4U_LARB2_ID, 7) +#define M4U_PORT_CAM_LSCI_D MTK_M4U_ID(M4U_LARB2_ID, 8) +#define M4U_PORT_CAM_AFO MTK_M4U_ID(M4U_LARB2_ID, 9) +#define M4U_PORT_CAM_SPARE MTK_M4U_ID(M4U_LARB2_ID, 10) +#define M4U_PORT_CAM_BPCI MTK_M4U_ID(M4U_LARB2_ID, 11) +#define M4U_PORT_CAM_BPCI_D MTK_M4U_ID(M4U_LARB2_ID, 12) +#define M4U_PORT_CAM_UFDI MTK_M4U_ID(M4U_LARB2_ID, 13) +#define M4U_PORT_CAM_IMGI MTK_M4U_ID(M4U_LARB2_ID, 14) +#define M4U_PORT_CAM_IMG2O MTK_M4U_ID(M4U_LARB2_ID, 15) +#define M4U_PORT_CAM_IMG3O MTK_M4U_ID(M4U_LARB2_ID, 16) +#define M4U_PORT_CAM_WPE0_I MTK_M4U_ID(M4U_LARB2_ID, 17) +#define M4U_PORT_CAM_WPE1_I MTK_M4U_ID(M4U_LARB2_ID, 18) +#define M4U_PORT_CAM_WPE_O MTK_M4U_ID(M4U_LARB2_ID, 19) +#define M4U_PORT_CAM_FD0_I MTK_M4U_ID(M4U_LARB2_ID, 20) +#define M4U_PORT_CAM_FD1_I MTK_M4U_ID(M4U_LARB2_ID, 21) +#define M4U_PORT_CAM_FD0_O MTK_M4U_ID(M4U_LARB2_ID, 22) +#define M4U_PORT_CAM_FD1_O MTK_M4U_ID(M4U_LARB2_ID, 23) + +/* larb3 */ +#define M4U_PORT_HW_VDEC_MC_EXT MTK_M4U_ID(M4U_LARB3_ID, 0) +#define M4U_PORT_HW_VDEC_UFO_EXT MTK_M4U_ID(M4U_LARB3_ID, 1) +#define M4U_PORT_HW_VDEC_PP_EXT MTK_M4U_ID(M4U_LARB3_ID, 2) +#define M4U_PORT_HW_VDEC_PRED_RD_EXT MTK_M4U_ID(M4U_LARB3_ID, 3) +#define M4U_PORT_HW_VDEC_PRED_WR_EXT MTK_M4U_ID(M4U_LARB3_ID, 4) +#define M4U_PORT_HW_VDEC_PPWRAP_EXT MTK_M4U_ID(M4U_LARB3_ID, 5) +#define M4U_PORT_HW_VDEC_TILE_EXT MTK_M4U_ID(M4U_LARB3_ID, 6) +#define M4U_PORT_HW_VDEC_VLD_EXT MTK_M4U_ID(M4U_LARB3_ID, 7) +#define M4U_PORT_HW_VDEC_VLD2_EXT MTK_M4U_ID(M4U_LARB3_ID, 8) +#define M4U_PORT_HW_VDEC_AVC_MV_EXT MTK_M4U_ID(M4U_LARB3_ID, 9) +#define M4U_PORT_HW_VDEC_RG_CTRL_DMA_EXT MTK_M4U_ID(M4U_LARB3_ID, 10) + +#endif From patchwork Wed Nov 2 15:18:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 13028284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE3B6C4332F for ; Wed, 2 Nov 2022 15:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=An4kT4BM9Rci5qYKJ4sPmVN45LRWyfiGrpIHkvgTDG4=; b=skulCVr/pdzNIWNbE9B6m65aM3 UyVjwrew9k4LQ+YngT/0sdepvTETc9MdydsZBKhEc6t7OQGxuvvCxvWQ4mHj4p3IkargS40BzzgTr taXhLUcz4lJ1sy9k7391+uT4USDZULRZPjLGf8g7SjYN+FH+dzwYaHmsrCF0+hMSwwMFifp+EO2i6 T9dV2SyPMKmnTfOvT4p9sAfjrd9LtLVwZfY4Y3tyBr21H0Q5tRGKccMuaAUANcVhP3yJs7J+zOVx+ mL0LIWEUsUEcdomStgvMQjONB6pWKOjYNpq2mtOm701WwxTpv4mFkcyalkWcRepQIzGoZZEWems5y 5foE47dA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqFVw-00Bhw3-1n; Wed, 02 Nov 2022 15:18:48 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqFVP-00Bhhm-Pg for linux-mediatek@lists.infradead.org; Wed, 02 Nov 2022 15:18:19 +0000 Received: by mail-wm1-x330.google.com with SMTP id ja4-20020a05600c556400b003cf6e77f89cso2525334wmb.0 for ; Wed, 02 Nov 2022 08:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=An4kT4BM9Rci5qYKJ4sPmVN45LRWyfiGrpIHkvgTDG4=; b=Ak15HOWMj5ggmZZ/GkuP8pLq3HeA+ApcP4w8G3m8Y+od15bIOgvTXO9VGE/gs+EqnR fL4+LQsXL7wZXQx72Z+0C/ryo7xIe5HU03srcuxyLMSNg72bjGb3vUS5qJuqU1oxRPxk 8hsZxdQhjE41ZPKX0oyw0jatc63LmQZRhRED2Mo7UEzHxwrjZDaVljNU4AZja2buqZcs l9pdDImoSKQ47tquWs1253PraUgkZYmfHFIexQUDcgNwu3cDuN9kNaPIE3RYNWzBJe66 8DnY54tHQe/XL84+fmoKJ9LqIfSAADwkNX3we+n9Fj3A+EKpYs9rsC6fHQp6hhoUwrXp 6BBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=An4kT4BM9Rci5qYKJ4sPmVN45LRWyfiGrpIHkvgTDG4=; b=k6xn3r2Z7UpaJVG20wNW+9Q/6GHO3dV1hIXXDKD60+dykpKhBF7w9DzU94XQBBU0Ta 7Tfomu3aORKGYszR9SjFk4X2er/XjJKcZsnEbjtSmu5i3UJUc32Uf6GXaZY1cOdVaV78 55oWIHQhkxWOItM4FpuSt9Xbgcb+ePLzuovmkjBNppTk5x/nxj7NZK2mFUUPsw1eECUE Bkg6am+Mw7LoeJHMqPgVTy+f31JWuQ2wEJ0maZoWuZsjHdG/ePGUL9AahGnCbo89jKlV mEKFP/lUOpIAQKbEvr/fkbJI7o5DOCjm4RBRM1M8DqBq+fj2U+C3p3BrhBcXSTCNrf96 i+qA== X-Gm-Message-State: ACrzQf2KPIUydH3XzHZEKCk3uIItfVZNL8ls7lF3Dz3ucWS8AhU4h+nu OlFJ1nty73S6PYS4wuv3uhpy+g== X-Google-Smtp-Source: AMsMyM5D8bKtsFea9r6fNhLwBD4zMAiAYZhOBeMFWJL5gaiUeT4b9kPkeK3Hk860ccgg/d+kCEgkKg== X-Received: by 2002:a05:600c:19d2:b0:3c6:fbb9:ca9a with SMTP id u18-20020a05600c19d200b003c6fbb9ca9amr16347370wmq.110.1667402293830; Wed, 02 Nov 2022 08:18:13 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id bq13-20020a5d5a0d000000b002365921c9aesm13332818wrb.77.2022.11.02.08.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 08:18:13 -0700 (PDT) From: Alexandre Mergnat Date: Wed, 02 Nov 2022 16:18:08 +0100 Subject: [PATCH v6 2/3] iommu/mediatek: add support for 6-bit encoded port IDs MIME-Version: 1.0 Message-Id: <20221001-iommu-support-v6-2-be4fe8da254b@baylibre.com> References: <20221001-iommu-support-v6-0-be4fe8da254b@baylibre.com> In-Reply-To: <20221001-iommu-support-v6-0-be4fe8da254b@baylibre.com> To: Matthias Brugger , Krzysztof Kozlowski , Joerg Roedel , Rob Herring , Robin Murphy , Will Deacon , Yong Wu Cc: linux-kernel@vger.kernel.org, Alexandre Mergnat , iommu@lists.linux.dev, linux-mediatek@lists.infradead.org, Amjad Ouled-Ameur , Markus Schneider-Pargmann , linux-arm-kernel@lists.infradead.org, Fabien Parent , AngeloGioacchino Del Regno , devicetree@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2748; i=amergnat@baylibre.com; h=from:subject:message-id; bh=12NL2NIpCRtKtHudS7M2vbMHWUQeZ96+QJE5QCrHjlQ=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjYooyslmq6zZt3zk7YPwEA4DTWaC6O3ikzGVN+bRB b1hhTYKJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY2KKMgAKCRArRkmdfjHURROMD/ 4kETHOn8ZygXYS5ED3s+0Z7ynhPWo4sQxfCbaMUfm3/IGXPeENWKxwHswgWmMBaGBTmgsGkabZChFS r+sf3hFkHm4q924vR2L1jp0A4qohhZIC5XZG3tOhi8leNLmgyY3QHoif9dlsnMz9GKpz7P0NU0FhhC BN1pscvvk5tu/YUHUAaDJIiAU6rGx7AlIih3KhCdhTNMi1lPsMHKCOJ4YBpzIyv77mbynPTdbAISo0 HVDwxSxe8I+Tl5/FXZMJ7UivJlcNYRwHcQjqUIdCuy1DPgQYpxil+lNKdGGltl3iZXD44s0TTJrv0V 22+G/nLQ8S3p6psdJxOEyzwivXF7t/EUimjbox0xqdZRTDLKAutMLhNoAjuH+6ulC0e/6FHw8GweNO UyuYkquVDKxwanLxCfd+7FdrRVJHM/NfBcIXV2T1hFVT8jTjW+QEH6IQ0bPceRkfMkqYYZcDKi4xlH v/w4zzmSAgcIYCAJxwW52b1kOY86TOn9cq0vjhb4EDDzNDNOFIDEosW+C44WcQqJQkW7jt67rASnqW 64ud2CzK9ZbjbEutURBcdXhCsk7ngii4jWyx9FKxTDGekzxBJeJXihZ2oiycaPyEEi6KjkKpnrfjmB mt0fgO1W9KPQbhBmEdhbCuh6jkZW+LzYV3jvsT91gJDGCcF/ZlUHTBOrqN4g== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_081815_882070_63C85472 X-CRM114-Status: GOOD ( 13.94 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Fabien Parent Until now the port ID was always encoded as a 5-bit data. On MT8365, the port ID is encoded as a 6-bit data. This requires to add extra macro F_MMU_INT_ID_LARB_ID_EXT, and F_MMU_INT_ID_PORT_ID_EXT in order to support 6-bit encoded port IDs. Signed-off-by: Fabien Parent Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Yong Wu Signed-off-by: Alexandre Mergnat --- drivers/iommu/mtk_iommu.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 5a4e00e4bbbc..563e3c54a0e2 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -108,8 +108,12 @@ #define F_MMU_INT_ID_SUB_COMM_ID(a) (((a) >> 7) & 0x3) #define F_MMU_INT_ID_COMM_ID_EXT(a) (((a) >> 10) & 0x7) #define F_MMU_INT_ID_SUB_COMM_ID_EXT(a) (((a) >> 7) & 0x7) +/* Macro for 5 bits length port ID field (default) */ #define F_MMU_INT_ID_LARB_ID(a) (((a) >> 7) & 0x7) #define F_MMU_INT_ID_PORT_ID(a) (((a) >> 2) & 0x1f) +/* Macro for 6 bits length port ID field */ +#define F_MMU_INT_ID_LARB_ID_WID_6(a) (((a) >> 8) & 0x7) +#define F_MMU_INT_ID_PORT_ID_WID_6(a) (((a) >> 2) & 0x3f) #define MTK_PROTECT_PA_ALIGN 256 #define MTK_IOMMU_BANK_SZ 0x1000 @@ -139,6 +143,7 @@ #define IFA_IOMMU_PCIE_SUPPORT BIT(16) #define PGTABLE_PA_35_EN BIT(17) #define TF_PORT_TO_ADDR_MT8173 BIT(18) +#define INT_ID_PORT_WIDTH_6 BIT(19) #define MTK_IOMMU_HAS_FLAG_MASK(pdata, _x, mask) \ ((((pdata)->flags) & (mask)) == (_x)) @@ -441,14 +446,19 @@ static irqreturn_t mtk_iommu_isr(int irq, void *dev_id) fault_pa |= (u64)pa34_32 << 32; if (MTK_IOMMU_IS_TYPE(plat_data, MTK_IOMMU_TYPE_MM)) { - fault_port = F_MMU_INT_ID_PORT_ID(regval); if (MTK_IOMMU_HAS_FLAG(plat_data, HAS_SUB_COMM_2BITS)) { fault_larb = F_MMU_INT_ID_COMM_ID(regval); sub_comm = F_MMU_INT_ID_SUB_COMM_ID(regval); + fault_port = F_MMU_INT_ID_PORT_ID(regval); } else if (MTK_IOMMU_HAS_FLAG(plat_data, HAS_SUB_COMM_3BITS)) { fault_larb = F_MMU_INT_ID_COMM_ID_EXT(regval); sub_comm = F_MMU_INT_ID_SUB_COMM_ID_EXT(regval); + fault_port = F_MMU_INT_ID_PORT_ID(regval); + } else if (MTK_IOMMU_HAS_FLAG(plat_data, INT_ID_PORT_WIDTH_6)) { + fault_port = F_MMU_INT_ID_PORT_ID_WID_6(regval); + fault_larb = F_MMU_INT_ID_LARB_ID_WID_6(regval); } else { + fault_port = F_MMU_INT_ID_PORT_ID(regval); fault_larb = F_MMU_INT_ID_LARB_ID(regval); } fault_larb = data->plat_data->larbid_remap[fault_larb][sub_comm]; From patchwork Wed Nov 2 15:18:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 13028286 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC889C433FE for ; Wed, 2 Nov 2022 15:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=T9e18AuOzDnWHjh6xr+jQAEK5xQcjVqynS6u486cJkU=; b=Y6JCvajEzt99Y98LvWOFVXwc93 mgfHbOHe/KCvnHUnID4u+Rij8OIce84LHLjuZIOX2ObeIWUfg2JfpOURj2CCY6QaywjUfv0dgbV8U ymiCHSEEdgB/BIP+8fFZVvmcP1H/baFwOS5hLewGABC7Wi/rAnL8/oEGjnkiVG0nE2UbUB6jx9i4T OC6EkpA1BGg0zZJ7owMP4EPckX8pnFfgI05YAwwFscNvF9koGsbXpLnTRlh0BRgCo0afqoEHLpsQA /8aP200D0px2+CuCEM2hOqLUdzQ8TIyTSt9ftPWwz10KvNNxD0S1pgVcXf3R7+Ve/QDDPaacZMdm5 Sibyl/qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqFVw-00BhwM-U2; Wed, 02 Nov 2022 15:18:48 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqFVQ-00BhiR-Oq for linux-mediatek@lists.infradead.org; Wed, 02 Nov 2022 15:18:19 +0000 Received: by mail-wr1-x434.google.com with SMTP id a14so25041591wru.5 for ; Wed, 02 Nov 2022 08:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=T9e18AuOzDnWHjh6xr+jQAEK5xQcjVqynS6u486cJkU=; b=vVrjNop7hjPDib3wv1ot+HsH3VyGY3cb14mf3za4DKjEZmUbSC2uxLrZbr9QnoCHIu H5/e2OqFLFx7fZkBeLMA/uQdUWoNIURrEKKCt52vEpTGslev/6AHfGyDdH6Xw00LZfAg xm48kYROY6HxVm/Z8NRksM6sxlqr1ajMCnMD9W/j/StqwddMDD1fomQALLVGYcL5Y5jG S0FCj+Aiqu+7h2ZpCXDkrzX6H1bLjZwnOcSwHRODkxDKNvivnbIhWku2tiTBb1p4VZg8 0noIDWAH+red8jcQl3qJxEQ1NLTvQBBtk0t431y/RiB7OiE3vYU4m+zt5DQK8o2lu0W7 G9mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T9e18AuOzDnWHjh6xr+jQAEK5xQcjVqynS6u486cJkU=; b=Ioq+b9iVKkUWfyODovJjOF2Mn5Vqm7EzxzkPkphyRpiUPqITq+NYdGF0m40BuWM2TH RwwIRw7bMb4kgc8xRcGwdnIyiRPuVDwFRwBoGs0GEAWq2aMIIfXnTRnfPGvf33B8I3bC UHjJjchLQBo1Lga8NcxITCGJSlNofp4P7kYqfkBXXm5Cs7DlhHq5aKOPxlNmmfQzbyJX Bn8Ip4dNo5JeVcS7IhGFNkNXtCPf6EtpG4r8ZqV7Ds2o/uDbxQyFE6pLhVbRRT0Ov5q6 pP4VJ7KIVJfUUy88V8QsyEUpW0VTAUgnXK9X1FvVWEzFWmrwJcKgnMRyqJ1mNdC9qVCD SWBA== X-Gm-Message-State: ACrzQf2mknSZmdJ2mg/sAWgh96LP8+qAT0Op8NkDyorBUY0eQrqE2LgM e0JkVXLhjv9AeW/oqJ7WofE2Zg== X-Google-Smtp-Source: AMsMyM6o4omJsNxu8orKzfd9naeNFZCxwtIS7R+A+z31p3n+znaJYmIV7aHiK1qWp4qPwRtqSSxMKQ== X-Received: by 2002:a5d:5967:0:b0:236:bd27:f1b8 with SMTP id e39-20020a5d5967000000b00236bd27f1b8mr13149257wri.390.1667402294756; Wed, 02 Nov 2022 08:18:14 -0700 (PDT) Received: from [127.0.1.1] (158.22.5.93.rev.sfr.net. [93.5.22.158]) by smtp.googlemail.com with ESMTPSA id bq13-20020a5d5a0d000000b002365921c9aesm13332818wrb.77.2022.11.02.08.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 08:18:14 -0700 (PDT) From: Alexandre Mergnat Date: Wed, 02 Nov 2022 16:18:09 +0100 Subject: [PATCH v6 3/3] iommu/mediatek: add support for MT8365 SoC MIME-Version: 1.0 Message-Id: <20221001-iommu-support-v6-3-be4fe8da254b@baylibre.com> References: <20221001-iommu-support-v6-0-be4fe8da254b@baylibre.com> In-Reply-To: <20221001-iommu-support-v6-0-be4fe8da254b@baylibre.com> To: Matthias Brugger , Krzysztof Kozlowski , Joerg Roedel , Rob Herring , Robin Murphy , Will Deacon , Yong Wu Cc: linux-kernel@vger.kernel.org, Alexandre Mergnat , iommu@lists.linux.dev, linux-mediatek@lists.infradead.org, Amjad Ouled-Ameur , Markus Schneider-Pargmann , linux-arm-kernel@lists.infradead.org, Fabien Parent , AngeloGioacchino Del Regno , devicetree@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2006; i=amergnat@baylibre.com; h=from:subject:message-id; bh=Q4NYYQifFh9zAugrVsdD24zlf7qYZx8w4pW2A66Dgc4=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjYooyAnt/3uDKzQTl89xfXRYOhl4D1bU+Q7od77hw ErFRlkKJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY2KKMgAKCRArRkmdfjHURUUFD/ 93Y7hT8/4BU2SdrJ0KdhJzQYPpku8B/wTpGm45+uiAJV6r77tTcgbr7cZSyBAy+xZY+qRMrPGUBVqU Ajk7HHfEUF/WzcXIHzB6KHGSf9c+3D+rNDm6yBs9CXUg0xfe0jkc81bUSf/+aC6XtdBECiWrNn70Xv z5QtntaQBOINOB63LBBI96uXqH0grV99uYxelModQWaNKjnnyBzEdHxp8ey/RqZ0oQfTDV7oFTgjA7 otXN+ux0mGGPdZ8oBe/GvEX7L5kok0LuiJZcKejE4YliRSfIv38O7OauoXtk1LSHQs91f/ddL+dRQ/ D/6p8qf/2vv/21M10jkcf8Vk4zfQDIEnzYEFFVeBl9/nvHmPrT2oszCCkzDs0hPP+zvuvmkZIgY4CI OmxgXt/hKzfsvct9x2WMTlzCxfeeVIxdCJA2d085AYXb6LA6Y71MFI4I9mcLrMqxo1v4+vhdbJPpOQ nY62Wdcvc1qqNbkJy+SJeKRq5wGQNEItSFfJ6+zZgY8aXAKh/1KIkUZhzpAHk7yY9THS1T/eoTjH/z 5M0Trb/g65/NJvhAz1Qyl8HK/QEaIFN/SNGss5FWTgsbx0b8C8HXFFpcQFm9qXM2DGFncyqqxx1QCp 5n+o0IQHkJLe15tSnQyvryaHLrSaEv3uepvuEH7vMOAwwx+nTTeoRryGDb0g== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_081816_829075_EF2FA751 X-CRM114-Status: GOOD ( 11.40 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Fabien Parent Add IOMMU support for MT8365 SoC. Signed-off-by: Fabien Parent Reviewed-by: Amjad Ouled-Ameur Tested-by: Amjad Ouled-Ameur Signed-off-by: Markus Schneider-Pargmann Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Yong Wu Signed-off-by: Alexandre Mergnat --- drivers/iommu/mtk_iommu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 563e3c54a0e2..aff7a9190749 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -170,6 +170,7 @@ enum mtk_iommu_plat { M4U_MT8186, M4U_MT8192, M4U_MT8195, + M4U_MT8365, }; struct mtk_iommu_iova_region { @@ -1525,6 +1526,17 @@ static const struct mtk_iommu_plat_data mt8195_data_vpp = { {4, MTK_INVALID_LARBID, MTK_INVALID_LARBID, MTK_INVALID_LARBID, 6}}, }; +static const struct mtk_iommu_plat_data mt8365_data = { + .m4u_plat = M4U_MT8365, + .flags = RESET_AXI | INT_ID_PORT_WIDTH_6, + .inv_sel_reg = REG_MMU_INV_SEL_GEN1, + .banks_num = 1, + .banks_enable = {true}, + .iova_region = single_domain, + .iova_region_nr = ARRAY_SIZE(single_domain), + .larbid_remap = {{0}, {1}, {2}, {3}, {4}, {5}}, /* Linear mapping. */ +}; + static const struct of_device_id mtk_iommu_of_ids[] = { { .compatible = "mediatek,mt2712-m4u", .data = &mt2712_data}, { .compatible = "mediatek,mt6779-m4u", .data = &mt6779_data}, @@ -1537,6 +1549,7 @@ static const struct of_device_id mtk_iommu_of_ids[] = { { .compatible = "mediatek,mt8195-iommu-infra", .data = &mt8195_data_infra}, { .compatible = "mediatek,mt8195-iommu-vdo", .data = &mt8195_data_vdo}, { .compatible = "mediatek,mt8195-iommu-vpp", .data = &mt8195_data_vpp}, + { .compatible = "mediatek,mt8365-m4u", .data = &mt8365_data}, {} };