From patchwork Fri Oct 14 08:45:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 2587 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp71081wrs; Fri, 14 Oct 2022 01:50:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UPtLR75yzXE1tmio6wpD1ZsypCeFDcqfrMI9T82zrfcy6JYds8FieG/RjbvMbsZOL1e/h X-Received: by 2002:a17:906:dacd:b0:780:a90c:e144 with SMTP id xi13-20020a170906dacd00b00780a90ce144mr2766016ejb.153.1665737446805; Fri, 14 Oct 2022 01:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665737446; cv=none; d=google.com; s=arc-20160816; b=Xf2K+EMY/BwfkVwtEKXHhQXjJNNDlVrfslVeILaJyYVzwRP3K6tfnlNf3B9AKCK0nz qCMLwP7pBTJSYCx7/JshALfC4a5hQGQBx3ABb8tw0gLXC1JQjP5ak1Nb6Onr/3GAfjDs 5k38MhIoDhtjtt+YEhZIfdr+cuZtONEWnGGRPaoGlCYas4dfNHZ3eaFVc4fwkV3EU4xH V4ujTIP1pFKFpa3osRdztuTt50/5ybSJHIgIgxdSmHERrrWIQbqy7NNlp9ljETxSCMki aKpTLhecpCJMJtPqqWTUksb9QLkXtU2gFVjoNusLrLKi9UWXfTHWt143tBacQKhDDYtU 6VOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Up4hmzyymHTjoWT3TmVNVIxdTbx/P09flhMWRWRA0Mw=; b=xJYxsR83fdy+1odBEjGWqp2EMFL+JqtrqeaHBv/2j4t6u4MpM9hxjmmmTOxmXmjGDY ym7NRXdcFCWYMBUBAX/uX5D78ImkaSm5bMtc5Kl4VCj9PuQqIaEatKg11PEAcnEJl6HU VPphJEdlJDmoWudjyt2TWF/agq/OLp9kuzOOb1CbmZTEd1Ur1zieV6R/Ru+ox8ICDZfs FSGLkS2+A1t2nOZyhHUI4k6ev86rIjT7TNIu4UvxLuUzDr3dW0ufQ1ws3Vio75NR/CSz jK6cjQgGNRONRM4FNjUWPwpq/+XEor6puydkBLId57puyashzDOQsmyCEu65dYwxWefV 3TAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=k+hJjH5Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a0564021e8a00b0045d29efdb5esi794093edf.381.2022.10.14.01.50.20; Fri, 14 Oct 2022 01:50:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=k+hJjH5Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229754AbiJNIpp (ORCPT + 99 others); Fri, 14 Oct 2022 04:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbiJNIph (ORCPT ); Fri, 14 Oct 2022 04:45:37 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC97F537F9 for ; Fri, 14 Oct 2022 01:45:35 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id bv10so6489037wrb.4 for ; Fri, 14 Oct 2022 01:45:35 -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=Up4hmzyymHTjoWT3TmVNVIxdTbx/P09flhMWRWRA0Mw=; b=k+hJjH5ZQG2OfVOeLe8wHf3VzQdJnSqsThOpkISa8gSdb4m2YIzd0HeNf6VoH3uI99 CBVAUM2+NMvS/FijeRXRp7HDyh0we/VsisbBOOOu1osdK/nretXGfgwammhB4qoIUuEH 1TrWc8IowZSea33wtH5c32oEn/KxwvYOtjKmlef2teBNxqPa7+fg9XT7GmoGe4DKkRiY kjRz5nWeyAHVNzQgJph79117CJxO3BDMVMU8oE49ksTs1AB/Ga5lnvl0vtxazbteiJtl eVe7BSgexsSnQcGmrUI7eSTFS6cEahUJ6xrW3WJO4WJxBcpqONpOZlRdm8ziK9bM/r+i Ch9A== 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=Up4hmzyymHTjoWT3TmVNVIxdTbx/P09flhMWRWRA0Mw=; b=iu77/BbEqzm0LC1dwfhwuNXWJI62tZEMaWW/7JZFpBh0UUGLhvBfe1yTxNpyDMtjXw 6/j2TKZlNZSP6WH9F+QPx3UJg0Um/WYYUh9tOdYuS/SjLspt/qbNqAggFlZ3rv8Z6qgu +A/4kiDYbl3jtNIHp749QsGK1gcMF6kvXZDzqa5NWehjKUz+TxC9e+7/NSUi7T22915F zWbf8z0+j9UNJewhYOLvLoTOdy26p/t3YiKINwuJeAJEh5H/v1bZa7NGBEB3skS4kfcW oVxrxuWr7arjNuVdeXa90NC6zJ3IUIoNDdudNJY3AVaHIs3ehrpkya+vq+XuDD4p4/wz QtEg== X-Gm-Message-State: ACrzQf1u/BTT2IjWFQqXm2ce4ewrlM99f8FUV4xuj8g3IbhfAdbWHoeN lHbYQxYVLOEyoCsELYTLK9Ngkg== X-Received: by 2002:adf:f5c5:0:b0:22e:264b:2179 with SMTP id k5-20020adff5c5000000b0022e264b2179mr2497665wrp.386.1665737133973; Fri, 14 Oct 2022 01:45:33 -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 m6-20020a1c2606000000b003c452678025sm6684633wmm.4.2022.10.14.01.45.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 01:45:33 -0700 (PDT) From: Alexandre Mergnat Date: Fri, 14 Oct 2022 10:45:29 +0200 Subject: [PATCH v4 1/3] dt-bindings: iommu: mediatek: add binding documentation for MT8365 SoC MIME-Version: 1.0 Message-Id: <20221001-iommu-support-v4-1-f1e13438dfd2@baylibre.com> References: <20221001-iommu-support-v4-0-f1e13438dfd2@baylibre.com> In-Reply-To: <20221001-iommu-support-v4-0-f1e13438dfd2@baylibre.com> To: Rob Herring , Yong Wu , Krzysztof Kozlowski , Matthias Brugger , Robin Murphy , Joerg Roedel , Will Deacon Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski , linux-mediatek@lists.infradead.org, Markus Schneider-Pargmann , Amjad Ouled-Ameur , Fabien Parent , devicetree@vger.kernel.org, Alexandre Mergnat , iommu@lists.linux.dev, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=6314; i=amergnat@baylibre.com; h=from:subject:message-id; bh=veY/apXDPl5JMIMezq7x83zfGltq7KQ6mfnT4iv01CU=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjSSGrhq0TEcFEc1lz1vsbXk564BtZHQWu+3GtCWRm JjPq7u2JAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY0khqwAKCRArRkmdfjHURQxID/ 9KEI/aU1lXOcwXiIqR3Ee+66WlY3ezvJxXIOqeeQ8H1pXPY8RKgjMmh0Hd4S6WkpE+vjAWIhcy9Wv+ +8jnay2wcSZsaP0xfCiaEFMGtIoq/+d7PAwxQaouojcdkI8at/Uc1prm5B2rM++K8v23CvajfPqpPe t7o/7jydpAuquxMYTuib9+F2M2SFTsNGbfWSwf1bReMy6pJEZ2L6qjZzAUnbWHEuPiEOPJUWBupigF k1xWAaR6YnJ+VGBQcMS9kETqA3RJtyZN1WfNEtgzTUaMIiKOIafbp3IRhm5o8CfrsQLTvIFxwZYBu8 WQ3TLCxeVs7BYh04ySB7NWtld+c7pk+UL6l5+xFuh2lKq9ZVgfD5b3L0zNe3PwaN8Ev7mqQ9VhLlj0 j+so5bgeMEUwXDUbDtVaLHvSkQpmpmbtmUOsQamya/3S1D4W8DmFmatlvprRBHGtTFJjHBjkulw/Fj D+HFb0mSuxUVU7+fIJt4dWkKtbKuVovCRFaIBuNTvIkgppKPy3WuLWaHJg1iUfHpo+rwCpGILrFEGY w/f+0RKQBl3l4fHcthNKtpYFTJGeco1Apu2EGOUsoApiTAUpKnSGKsoXqar4ezzxkrRjipF9IfV9zO PkpB5wGQZnLMTPFlLHr3TIG19MTbR20Xth8HKAMAt5TityhYGOK/nnPNMqdA== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746652308865324375?= X-GMAIL-MSGID: =?utf-8?q?1746652308865324375?= 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 Signed-off-by: Alexandre Mergnat Reviewed-by: Yong Wu --- .../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..4b8cf3ce6963 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/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 Fri Oct 14 08:45:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 2586 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp71078wrs; Fri, 14 Oct 2022 01:50:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6KvNrXvshSl7C9+x0qJih1+Fz+DplDmA2FunJprlXNrqGvoMiiFIqeZWA/9x8HSrNdTcyF X-Received: by 2002:a05:6402:1bc6:b0:45c:7611:d86e with SMTP id ch6-20020a0564021bc600b0045c7611d86emr3391119edb.194.1665737446881; Fri, 14 Oct 2022 01:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665737446; cv=none; d=google.com; s=arc-20160816; b=h6fvShETyg//wl+mB6Wn9KXYehUkaC7QyVR2J6vfVD+HVAR0pnaGzE59csJql3A1PG ukbyKBEplcCLOkUSlgG3D68txo9i3XnQjACYPJaj0VxLy+G4xKrSp51Pgz5WlaXgQEP5 dpR9Q+924YDlWa4OYlyU1eHLjjlvLAXGHgak47ea4ZZCpLPxL/MMHa+Uai7V6S4+iPKU eNZtZV7Uh8lrdoRkae6Z2fJ+XSGal7/aUEsT+aS6+srSQR8TxGpi0WE+3PHCW0BNsNFL 0fkCvZ0NSHjMKFRb8Alyg+NktfgCFGw2CQRiIUZgcTVZRAyroA393yKO5JGUjMn8d6tj U/nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=2vYpiynuBL8tVx/fuIyN5pN5O/L7gpGwgZ6XiNd5Ka4=; b=fG07pPNESysjHoUb97RVFqlWafYgXcmenJzXlou5FG0sde0H0ygBBKoU6NRFXM0Ns3 59AbpEL7vqOQ/jAbT8TV0nKI5XxyRcMqesObYbAS2+W/4Yry6DbOr0R91mHiyV5vhfQb InApQ0q+vvJrI0T7IDW5YF/16M1EsjQrbxUOIdp5RVM762t/VewVTDTK0IpjzaC4dfzS s7hmbmyty7BZnW7SIbSfEPMHTWBc/moto2aO9sRSOWqHrWr7cTWOxsNricXa7HfgJvqI t1VXVRGKyeBTi9OhGWmwNxMySo2tgAB+uLIscC99Yov5dZvPwOcmCLWUkYgT/lichuZO Wybg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=ATcoSn4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a056402524b00b0045c1782d77fsi2070487edd.40.2022.10.14.01.50.20; Fri, 14 Oct 2022 01:50:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=ATcoSn4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbiJNIp5 (ORCPT + 99 others); Fri, 14 Oct 2022 04:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbiJNIpi (ORCPT ); Fri, 14 Oct 2022 04:45:38 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E14E073916 for ; Fri, 14 Oct 2022 01:45:36 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id o20-20020a05600c4fd400b003b4a516c479so3068873wmq.1 for ; Fri, 14 Oct 2022 01:45:36 -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=2vYpiynuBL8tVx/fuIyN5pN5O/L7gpGwgZ6XiNd5Ka4=; b=ATcoSn4Z6sQZdKFeLqRKYSHN0u0vNhgyy0zhjbQp53nDzo2nleJ9ZJJc8nSHIgxgtN rWLuDj+BUUtThpcvO+qBnalmXyfY+ahKvHUzV/MAM/VxtETcW1yj2/py13EJFKb/kN1a SH18364ToIhgJx1t5XhbNRujcCw+6ye5x0Bg67ZN419De3SqvemhSsbhOhd6K8oMEpqX gXP79rjn0pKa9M0pgfmGccDN6Ulc0rWuvwBYkxvqIhqe+6GeIEu8Huoa87JWunuuK+zj WY7LzOUWz4S33zxGos4A6bWzuOzrpUFy2hqukWvAx5fWs+YHSaaUJTxnzvJDhYv6w9tp jQjA== 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=2vYpiynuBL8tVx/fuIyN5pN5O/L7gpGwgZ6XiNd5Ka4=; b=jxDaLSPgTsLkzyFo8S5MdtY/Ud6qNRqdEvi2pf1N5GPpjjaPelMJzwj7dY+NQOS1N5 9wVNAuaQ8TEGUuuPIdeUdXc0FOVhWymrKs1jEzZgCVm3gkAzgn2hlKOqAVDwsPxeLlC0 h0S8rZsh422n4HCezO43ORxVTOA24xQKvCQbbKGjMBqEi3r6ovK3kBO4Ik7W8KSYH6Ry LEFFEJVyS+S60LXtjqTz2HGgEMvlUhc/Hryzjxg2EZuUGLI6HT6AHd2DNugO1yo+4L6A o6gatlLGvxo4ob/H25dwTVMcgfriviRebsgBOPVIGyWSKluS0NMoOLIb8P/kMuaNkELh Lq4Q== X-Gm-Message-State: ACrzQf2iAFM6XuxC86c6pdB/AZgIH4BzbSEur6vYY98R9mSn4FWq6UtD WTVyMFtGXhOCdJQS2FIs7Sp3Wg== X-Received: by 2002:a05:600c:3b99:b0:3c6:8b8e:a624 with SMTP id n25-20020a05600c3b9900b003c68b8ea624mr2679874wms.113.1665737135401; Fri, 14 Oct 2022 01:45:35 -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 m6-20020a1c2606000000b003c452678025sm6684633wmm.4.2022.10.14.01.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 01:45:34 -0700 (PDT) From: Alexandre Mergnat Date: Fri, 14 Oct 2022 10:45:30 +0200 Subject: [PATCH v4 2/3] iommu/mediatek: add support for 6-bit encoded port IDs MIME-Version: 1.0 Message-Id: <20221001-iommu-support-v4-2-f1e13438dfd2@baylibre.com> References: <20221001-iommu-support-v4-0-f1e13438dfd2@baylibre.com> In-Reply-To: <20221001-iommu-support-v4-0-f1e13438dfd2@baylibre.com> To: Rob Herring , Yong Wu , Krzysztof Kozlowski , Matthias Brugger , Robin Murphy , Joerg Roedel , Will Deacon Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski , linux-mediatek@lists.infradead.org, Markus Schneider-Pargmann , Amjad Ouled-Ameur , Fabien Parent , devicetree@vger.kernel.org, Alexandre Mergnat , iommu@lists.linux.dev, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2777; i=amergnat@baylibre.com; h=from:subject:message-id; bh=yHI2W23j32Eio+qvj5sArGXxqz+yEaFNsPuEi2F1ESI=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjSSGr72jkaVUfd01lHWlH70E3IlRnthih2tTn4S8f oPgszB2JAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY0khqwAKCRArRkmdfjHURZcfD/ 4twP9fhese84RdEddlF784ECS6fOnHpJuYrStpE0X919HpgvHrCs1hKdO/vMDvxXxpNuvmoxwQzRRd /DHc7ulpPRkZB9Qj7f3N2O6Cf3OEHLUF7j2+XMbhEJ+tCr2Qr5nby1EXGdam8gM0efQQRBCFx0b/wY Pa3usFg0YPDrhhd3MfEYBq3U/C7WgOKtfxIB89WB7asYOzXEJY4PzmT3hUEYn+8X8OzR4k0Te66CG8 Yi+j/vZepY4WkPWcL3ZYmu1DIbf6yUhitPo9gsuTeOFN9OpBOhzWrDJDQPL++LUZutFu9ZWK3HWjfc vtQKNzPPe8tRoMtgFF8s3bcgkuU4xepPuF6o628AsSbq6ffS3CgZ34T40kbsRGXaG3OA3sRIMAHEiz JhSY0qz22z45OrDrHnjeq1pfrD8KPqW/Sh1ELyWTd18ZlaHdTblGBP/uEvTdQED673ZJiS1YV/JWzI amTnWPPAIPyjY69yPGVthl0XAgtHtvQ0fJKUdo8mCQiwFtkqtCmZHRXUE5BJbvI8aWaZnJNjjSJ8kp 7lGNUDntkhM1QGbZV+7eOV+K4pts5qbShv2iJfnEqUYYY0M3v8CxZV+Kgtz6cWp2wlh+G0CS5FtiMr KhyD1CZsisr9qmOML0uw8LqV4djKDRTsdLnWFYLQXcvKc/yRuZ5aumwLPw0g== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746652308827636601?= X-GMAIL-MSGID: =?utf-8?q?1746652308827636601?= 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 Signed-off-by: Alexandre Mergnat --- drivers/iommu/mtk_iommu.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 5a4e00e4bbbc..50195a900611 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_EXT(a) (((a) >> 8) & 0x7) +#define F_MMU_INT_ID_PORT_ID_EXT(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 HAS_INT_ID_PORT_WIDTH_6 BIT(19) #define MTK_IOMMU_HAS_FLAG_MASK(pdata, _x, mask) \ ((((pdata)->flags) & (mask)) == (_x)) @@ -441,7 +446,11 @@ 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_INT_ID_PORT_WIDTH_6)) { + fault_port = F_MMU_INT_ID_PORT_ID_EXT(regval); + } else { + 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); @@ -449,7 +458,11 @@ static irqreturn_t mtk_iommu_isr(int irq, void *dev_id) fault_larb = F_MMU_INT_ID_COMM_ID_EXT(regval); sub_comm = F_MMU_INT_ID_SUB_COMM_ID_EXT(regval); } else { - fault_larb = F_MMU_INT_ID_LARB_ID(regval); + if (MTK_IOMMU_HAS_FLAG(plat_data, HAS_INT_ID_PORT_WIDTH_6)) { + fault_larb = F_MMU_INT_ID_LARB_ID_EXT(regval); + } else { + fault_larb = F_MMU_INT_ID_LARB_ID(regval); + } } fault_larb = data->plat_data->larbid_remap[fault_larb][sub_comm]; } From patchwork Fri Oct 14 08:45:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 2589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp71452wrs; Fri, 14 Oct 2022 01:51:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6K1vcCw8F/v/1fd8NJIKrhl6bRWPCvOtSotiK5g/dzaMucYs2Chh7dOAS00lx6EQkT5FRp X-Received: by 2002:a17:907:7b86:b0:78d:cb21:da0c with SMTP id ne6-20020a1709077b8600b0078dcb21da0cmr2885015ejc.24.1665737510179; Fri, 14 Oct 2022 01:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665737510; cv=none; d=google.com; s=arc-20160816; b=SUnhS6qzSATb7tWA9rvqugTet4t8Xv73HATqP7Mg/ulKjOKBK0IW/6BLQBERy240WQ HvC38G/TbvbQ+AasWCUJqayMe0C55wF43Nw/k2JERX9Th08CCA/XEFaRnHyFarTdhICN uaTljTPjfyUzbYL8I06unKKlLtEX2DUfFOT5Qco6LmUXVt4x8e/Bc83uBXHkqpUCx691 EEhZmLvFuByL2bPryjvsNr7ge5kqMM909bA64lZwe2O+8vl9IOC+sQFtPonBaa7dbzT+ 4vTetv9lhACq7gQElNOOkznkJgCo24iXVATALqu4iU0EAZvNoeV52X09eFaTLEwEAP46 vbLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=jK/ZA8ZpYldXBDNDXbE1og7C8Juwo1v3zOCfZOVwjtQ=; b=hSXFnSTna0c/VatO4f+MAn8dXCsEdW+L+82XkOmwbf3Yrj7LA/EvAlZzYMX1DUYy/x 21p8o08tL3mRV5hKNzlaQ1JXuQ8bMZ3eaH8oJ/4Oa3lkmMK3KO6YZRGLD7CW+FbyPPdG OEf2lazWUBTeVyFdJAXx2reHSBcD7MqRNjAF1F7H2M/4vnZfgzjffc3sTcgFMIHqCzhr 4PltNcPg4386w6qb7+2f212ZFrn67Rub7udqQTCC5dhoyN3rAsgU8VmgoX/0jgD1jULg mFZe/yN4gLHWqdGVL0qIitQd9DPA8MkI6yLVftl3+Y1DBrKZh1hHssdAymlv+qL9zaYO iveQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=c4HGrOTb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk35-20020a1709077fa300b0078db371355esi1861171ejc.987.2022.10.14.01.51.13; Fri, 14 Oct 2022 01:51:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=c4HGrOTb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbiJNIqB (ORCPT + 99 others); Fri, 14 Oct 2022 04:46:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbiJNIpk (ORCPT ); Fri, 14 Oct 2022 04:45:40 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0019B748DB for ; Fri, 14 Oct 2022 01:45:37 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id fn7-20020a05600c688700b003b4fb113b86so3080371wmb.0 for ; Fri, 14 Oct 2022 01:45:37 -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=jK/ZA8ZpYldXBDNDXbE1og7C8Juwo1v3zOCfZOVwjtQ=; b=c4HGrOTb5Yo0phJrq0cHskbgHHArrHgXZ1xnh0/OZqKYreIP28X7bhGqOeyhEhwoFI 20IALVhmrLvJtd+xc7ri7/D5drW9Sm5cIsIuy0DB/N5ORN6dCBkAhDpFuYBb9aFhog3f WYzeL/XA2drhy44dzShrcAEn93Bb3uy4W/XjW7IlCBeI5YuoCFXf95Nh7xrBvx16hI3f HSpFGWCNeAAnVSCsq5AN32lfS/e19CqCoPNLjvpW7moVC0vsYia9cgmWLdAEp6TVTvAp luAqwjQ/U0Zwgcul4d/WzXknivB+2HnvGV3BHVaYHjYZn5sfX7NdvTD7hlqIeW/kJs2K rbbg== 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=jK/ZA8ZpYldXBDNDXbE1og7C8Juwo1v3zOCfZOVwjtQ=; b=UUA768Dqme+SY44dS48JuSZtKZ9kx/mONRtxHLZlIqlS5zqulDIyJ67cCK7XKoMXYg q4Ym9n5cXgQZoPPhpMkJ/C+ioinTruYKfQJdefqnCnu56+1uGWVZxw7YoJCV7W3HEF4w LAFK/xB31R5Cv9EI6lTrRc1b+8DIf6ZzBScym3Xg9G4lsgeIWXYpyqo6cOx19Gx6JpDH CloKClZztWHo+HZPcZM4q3g1RZCt/BMTChtuU0pda563BBq2MVDKZIXzGBihtV9vK7Lx Kt1HY8AsUU3GZgHoer8Skb1FNUCjiY2Pc36IBP33vOpHgc+QfxW6u+Jy2YHNy7ko5Fob Q9FA== X-Gm-Message-State: ACrzQf1HLx3v28Zo6eBMoHLrtpX5e8768Dt4E65BeIUiOltK+8euNmwb Yt4jkmMhefamfTibNINiMepPLw== X-Received: by 2002:a05:600c:4611:b0:3c5:e3a3:942a with SMTP id m17-20020a05600c461100b003c5e3a3942amr9635205wmo.82.1665737136527; Fri, 14 Oct 2022 01:45:36 -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 m6-20020a1c2606000000b003c452678025sm6684633wmm.4.2022.10.14.01.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 01:45:36 -0700 (PDT) From: Alexandre Mergnat Date: Fri, 14 Oct 2022 10:45:31 +0200 Subject: [PATCH v4 3/3] iommu/mediatek: add support for MT8365 SoC MIME-Version: 1.0 Message-Id: <20221001-iommu-support-v4-3-f1e13438dfd2@baylibre.com> References: <20221001-iommu-support-v4-0-f1e13438dfd2@baylibre.com> In-Reply-To: <20221001-iommu-support-v4-0-f1e13438dfd2@baylibre.com> To: Rob Herring , Yong Wu , Krzysztof Kozlowski , Matthias Brugger , Robin Murphy , Joerg Roedel , Will Deacon Cc: linux-kernel@vger.kernel.org, Krzysztof Kozlowski , linux-mediatek@lists.infradead.org, Markus Schneider-Pargmann , Amjad Ouled-Ameur , Fabien Parent , devicetree@vger.kernel.org, Alexandre Mergnat , iommu@lists.linux.dev, AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1965; i=amergnat@baylibre.com; h=from:subject:message-id; bh=5Lr2zHqNQGwcj6em1b7xul4Vf/YWO9kNyKL5oDTlads=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBjSSGr7BsQTUiLKrxehh8tOo4ZIC5hyHUIZIW9sOAi nwgII0GJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCY0khqwAKCRArRkmdfjHURbuxD/ 0WqvLoBQgSimQKQGAD+x70DIZxlDlnXKz5qAuK2/l59EWQCZbsyJuG/Kbtq/FmKj5opM1RHnmmtuz0 orFwKeYMWtBygxpnBL/fzDvVOcJ3SvVrZnh+5p40r4BdQdGxJK54gl+DUBaIQN+DdVUyLCWHCcvbJ3 X6LREa4Ig5pGEeepwk1leJCpb9sP3dOQtQG0nndXpwZJ6Agrkg3Jzk7/5Wl40T19J/0FxVS8qdECXH gt68v1ZksaWQLSjm+oDFUKlEfS3VMI6fVb/PXAkjbRmKXm9S0pTzFH6kcnGEgx6bro7KuFDSO2nUQS oDZlxIqiOpJWeiO1f01Qy/AWTwuFEeLyqSRGYvR3F9jpVJbsoxxZftZHfKhaZJtVQcqt+TDpUPhsJ/ mRFZvxDiR6s+Yx7aU8Ido4J0plgJ5XFRPhZUuO92mWFHi+PF0CNuG4QFmRXacf8mxeYJJCQOLnMENh 4kQxc78OF+1LLCcpFmeZgF/VGY1I1WkYoPLp7Vh1tFgW/nsPO5kfydYRULda1bwOev5LyZFBLi0DVV SCR22/3TDT4A1PPtOIXIDWiWTD4J5/rmz7nYhhmGbZu4RYVqCXn9lMU76iDugKeqlZXNveAnqLa4T5 UX3eefNZecasDMcNzqNQVDhP2uuYFrTreO+3KlO64P7AZIYGQiwYZ1dS3ZiQ== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746652375251657871?= X-GMAIL-MSGID: =?utf-8?q?1746652375251657871?= 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 Signed-off-by: Alexandre Mergnat Reviewed-by: Yong Wu --- 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 50195a900611..051ed5234538 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 { @@ -1528,6 +1529,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 | HAS_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}, @@ -1540,6 +1552,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}, {} };