From patchwork Wed Feb 8 05:36:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54191 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3271345wrn; Tue, 7 Feb 2023 21:38:02 -0800 (PST) X-Google-Smtp-Source: AK7set+GaCO9hrphtGxeJoN8yE9mdSRMWUA/W/HnumnbCnE4v3vn2Ypf+yOILuZinuw/hYp5Fl5U X-Received: by 2002:a17:90a:1950:b0:230:ca38:b601 with SMTP id 16-20020a17090a195000b00230ca38b601mr6846367pjh.44.1675834682044; Tue, 07 Feb 2023 21:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675834682; cv=none; d=google.com; s=arc-20160816; b=iSJ63seGqas+RBqCUmz/I3Tyf/1Iwx27ZNoTn1jdQT34lb1vj6IHUrQMDWkFU7a8Eb LOiJ7KEX3D81hBvYiE78dC5ltCJItM8BfSXajAJBfLJhl5kg1wPFa3ML0i3lSYV48FdK +Xy/LJjgwDPjV/xdzk7EMVkn0chmIxk/Xuk889ZnG7832rLLJDhMDxQBZKKvct9UMFyQ gat/bk8IqwIUZbzls+m0IIesPhYaJMnhW3NihLzPrpLMAeBRmQYNnOs197fq3RFrHMJz fvh9A1upvGbzjnksVffxEgEpbWiSk0Ksg4wekA7uzaZ/JSlv83clZd7TQ0Zbi2dmwR07 6lIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=YruzwnhT8Moau1cSUE63d9oggJ6vgbOnFPNrePN8kNQ=; b=Wtnre1eeJBet6ClTlNHJmGfQWVBYOmMPOP7vllpBwAZSgQkOdcEh1f/YL9lNoYjDww DVqGqZ983R5UJmp5y6Q7qRXMr3IdZ/OPaM1UetWrVZ+nzX1N2IsyBzYXqfFT/nkBcQBn KWU0Ac29b43oxiDfLcvS7SGKiZTYbNGv4IhKP3U7Wq/01iQiNuCd/HdvSXX+Bs5Q8Irk alTg6w0BaBt7YKKPSFccJWDK9a5QpVDOk3Xju90PJjuNC2zPwupsZt4+ipPV+q5S5liI K2BOOo5mxKazn29LAq+CiPNIWlLMdcJ8zSLlMkreG+PpA7GATzpU2YflcUkhVqClCBl2 9PLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="T9EU5/iP"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a17090a498b00b002296f8a9e4fsi937048pjh.177.2023.02.07.21.37.49; Tue, 07 Feb 2023 21:38:02 -0800 (PST) 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=@mediatek.com header.s=dk header.b="T9EU5/iP"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbjBHFhg (ORCPT + 99 others); Wed, 8 Feb 2023 00:37:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbjBHFhW (ORCPT ); Wed, 8 Feb 2023 00:37:22 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05AE13B3F6; Tue, 7 Feb 2023 21:37:14 -0800 (PST) X-UUID: a207bf88a77211eda06fc9ecc4dadd91-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=YruzwnhT8Moau1cSUE63d9oggJ6vgbOnFPNrePN8kNQ=; b=T9EU5/iPDcFN7k/S1+13bonWCx+9WorxskdStKwR6L8SjhEhHagJ4m2npSYcyfInr1Dp3XrapSIeccxy8ghX5qk3CLF3IXI2yqvTmGXbuwlsgLNjak8da+4BhVAHpLq4Xz7k67ri+i6eoJEeLdjP2wqcSKvp0fKoiEJsPwobyTk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:534f4a28-2615-4fc3-a914-59a4ad0a6b95,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:90 X-CID-INFO: VERSION:1.1.19,REQID:534f4a28-2615-4fc3-a914-59a4ad0a6b95,IP:0,URL :0,TC:0,Content:-5,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTIO N:quarantine,TS:90 X-CID-META: VersionHash:885ddb2,CLOUDID:b316cdf7-ff42-4fb0-b929-626456a83c14,B ulkID:230208133710E1FKOS5K,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: a207bf88a77211eda06fc9ecc4dadd91-20230208 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1242969659; Wed, 08 Feb 2023 13:37:10 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 13:37:09 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:37:08 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , AngeloGioacchino Del Regno , , , , Yunfei Dong , kyrie wu , , , , Yong Wu , Tiffany Lin , Andrew-CT Chen Subject: [PATCH v2 01/10] dt-bindings: media: mediatek,vcodec: Remove dma-ranges property Date: Wed, 8 Feb 2023 13:36:34 +0800 Message-ID: <20230208053643.28249-2-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757240027630391937?= X-GMAIL-MSGID: =?utf-8?q?1757240027630391937?= After commit f1ad5338a4d5 ("of: Fix "dma-ranges" handling for bus controllers"), the dma-ranges of the leaf node doesn't work. Remove it for vcodec here. 1) For mediatek,vcodec-decoder.yaml and mediatek,vcodec-encoder.yaml, this property is in the leaf node, it is invalid as the above comment. Currently there is only mt8195 VENC node has this property in upstream. Indeed, VENC is affected, but it is not a fatal issue. Originally it expects its iova range locate at 4GB-8GB. However after that commit, its expectation doesn't come true, it will fall back to 0-4GB iova and also could work well. 2) For mediatek,vcodec-subdev-decoder.yaml, It already uses parent-child node, this property works. Instead, MediaTek iommu will control the masters' iova ranges by the master's larb/port id internally, then the dma-ranges property is unnecessary for the master's node. Cc: Tiffany Lin Cc: Andrew-CT Chen Cc: Yunfei Dong Cc: Mauro Carvalho Chehab Cc: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring --- .../devicetree/bindings/media/mediatek,vcodec-decoder.yaml | 5 ----- .../devicetree/bindings/media/mediatek,vcodec-encoder.yaml | 5 ----- .../bindings/media/mediatek,vcodec-subdev-decoder.yaml | 7 ------- 3 files changed, 17 deletions(-) diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml index aa55ca65d6ed..fad59b486d5d 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml @@ -56,11 +56,6 @@ properties: List of the hardware port in respective IOMMU block for current Socs. Refer to bindings/iommu/mediatek,iommu.yaml. - dma-ranges: - maxItems: 1 - description: | - Describes the physical address space of IOMMU maps to memory. - mediatek,vpu: $ref: /schemas/types.yaml#/definitions/phandle description: diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml index 0f2ea8d9a10c..a2051b31fa29 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml @@ -49,11 +49,6 @@ properties: List of the hardware port in respective IOMMU block for current Socs. Refer to bindings/iommu/mediatek,iommu.yaml. - dma-ranges: - maxItems: 1 - description: | - Describes the physical address space of IOMMU maps to memory. - mediatek,vpu: $ref: /schemas/types.yaml#/definitions/phandle description: diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml index c4f20acdc1f8..290594bc91cc 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml @@ -76,11 +76,6 @@ properties: The node of system control processor (SCP), using the remoteproc & rpmsg framework. - dma-ranges: - maxItems: 1 - description: | - Describes the physical address space of IOMMU maps to memory. - "#address-cells": const: 2 @@ -203,7 +198,6 @@ required: - reg - iommus - mediatek,scp - - dma-ranges - ranges if: @@ -236,7 +230,6 @@ examples: compatible = "mediatek,mt8192-vcodec-dec"; mediatek,scp = <&scp>; iommus = <&iommu0 M4U_PORT_L4_VDEC_MC_EXT>; - dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; #address-cells = <2>; #size-cells = <2>; ranges = <0 0 0 0x16000000 0 0x40000>; From patchwork Wed Feb 8 05:36:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54192 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3271481wrn; Tue, 7 Feb 2023 21:38:27 -0800 (PST) X-Google-Smtp-Source: AK7set80F78hFOuaseA5r6ltbKXsh40jGNc9mQDMMedkTMvFljigdIY68nduhPcAo7+XnR3cUdmZ X-Received: by 2002:a62:7bd6:0:b0:587:f436:6ea8 with SMTP id w205-20020a627bd6000000b00587f4366ea8mr5319189pfc.16.1675834706642; Tue, 07 Feb 2023 21:38:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675834706; cv=none; d=google.com; s=arc-20160816; b=NtoSlPtZCSbu8k/Adr08JNmO1mBExymBdyxwG3iMtw2i//i8hI+Lt2urvcTzQCw2tG R3HgwcF9H5EcL8V1W69HWWqI1aQgsNUb5O0164j03WOWF0n1t0SZ3EhSq8UzYv8D7/lE pMnAq10IDbPr4a1ntUMtDXnlflCPtF3ywaZjTctf27qkS66w2+YvU8J/MUzYtemFUszQ LdtAFsK5huyXMCysCQqCqmMEhiord3B+5FUUxMCHT2Bp2JbyDt4hy7UkaU0thapQYtIJ E+/Rmn0Z1cmkQkUoCuqymwI+xkpEr7rF7liYbDiQGQOiWpFYpn6jZfcVglAbbe8dGbUs PlyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VyiQSTtf/H+J6bLVY9o8xyIPf4F3imFPrSDWm8b80ZU=; b=p8qYCoTNUEjn9bxy+koZU41Vdldqifmp/TWY6BC7CpFTekYSwW1ik993LSKkhzdTrn x3On52B+nU4Afx7FiU8ZMWPwVbEwiLtLO8+AeJ7NaZV2w12C/He1Pi3humRECMir6CwT iMqACqdnwQw25IsrM9MZssj/Vo15PJztt1TlmYksILOK/PNUmzCj8qLAE//glgqyzJh6 7xWeZ9jv2RDHhG/28r2pEKx5XlFFALLi8WOWzamilAMKh9zT22Qncs3ZPI95A3n0wvqf KZriGUA8q+OztwwBt6fs5IVME/RWMsA0i/QiM2olS8YAU/vL1FZDZfPQYPAKekslykO0 JY3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=K9SuRt+y; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i186-20020a6287c3000000b00580e8dd6cf1si17481641pfe.73.2023.02.07.21.38.13; Tue, 07 Feb 2023 21:38:26 -0800 (PST) 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=@mediatek.com header.s=dk header.b=K9SuRt+y; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229781AbjBHFhl (ORCPT + 99 others); Wed, 8 Feb 2023 00:37:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbjBHFhh (ORCPT ); Wed, 8 Feb 2023 00:37:37 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46FBA126C3; Tue, 7 Feb 2023 21:37:33 -0800 (PST) X-UUID: ab279322a77211ed945fc101203acc17-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=VyiQSTtf/H+J6bLVY9o8xyIPf4F3imFPrSDWm8b80ZU=; b=K9SuRt+yiY6wvuZwKFW31Tuzil4jBBjRKKykfsAItZGc6yagZoDYXTdKypywcdaWfqGLrrWvO6k6hZmw8EOh0GLMjYqBtxkOg3khWXX6hAVnIaHSXfRDGsfNIQP1lNvzjgUdABrDiHkg/boZA1igVKMAxxG2/qdOSicnNPKBEYs=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:5ba7d739-adbe-4f83-8f64-2ea972a63432,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:885ddb2,CLOUDID:d918cdf7-ff42-4fb0-b929-626456a83c14,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: ab279322a77211ed945fc101203acc17-20230208 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1211764520; Wed, 08 Feb 2023 13:37:25 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 13:37:24 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:37:23 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , AngeloGioacchino Del Regno , , , , Yunfei Dong , kyrie wu , , , , Yong Wu , Bin Liu , Xia Jiang Subject: [PATCH v2 02/10] dt-bindings: media: mediatek,jpeg: Remove dma-ranges property Date: Wed, 8 Feb 2023 13:36:35 +0800 Message-ID: <20230208053643.28249-3-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757240053403019849?= X-GMAIL-MSGID: =?utf-8?q?1757240053403019849?= After commit f1ad5338a4d5 ("of: Fix "dma-ranges" handling for bus controllers"), the dma-ranges of the leaf node doesn't work. Remove it for jpeg here. Currently there is only mt8195 jpeg node has this property in upstream, and it already uses parent-child node, this property did work. But instead, MediaTek iommu will control the masters' iova ranges by the master's larb/port id internally, then this property is unnecessary. Cc: Mauro Carvalho Chehab Cc: Matthias Brugger Cc: Bin Liu Cc: kyrie wu Cc: Xia Jiang Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring --- .../devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml | 7 ------- .../devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml | 7 ------- .../devicetree/bindings/media/mediatek-jpeg-encoder.yaml | 5 ----- 3 files changed, 19 deletions(-) diff --git a/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml b/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml index 71595c013dbb..e5448c60e3eb 100644 --- a/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegdec.yaml @@ -26,11 +26,6 @@ properties: Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details. Ports are according to the HW. - dma-ranges: - maxItems: 1 - description: | - Describes the physical address space of IOMMU maps to memory. - "#address-cells": const: 2 @@ -89,7 +84,6 @@ required: - compatible - power-domains - iommus - - dma-ranges - ranges additionalProperties: false @@ -115,7 +109,6 @@ examples: <&iommu_vpp M4U_PORT_L19_JPGDEC_BSDMA1>, <&iommu_vpp M4U_PORT_L19_JPGDEC_BUFF_OFFSET1>, <&iommu_vpp M4U_PORT_L19_JPGDEC_BUFF_OFFSET0>; - dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; #address-cells = <2>; #size-cells = <2>; ranges; diff --git a/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml b/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml index 95990539f7c0..596186497b68 100644 --- a/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,mt8195-jpegenc.yaml @@ -26,11 +26,6 @@ properties: Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details. Ports are according to the HW. - dma-ranges: - maxItems: 1 - description: | - Describes the physical address space of IOMMU maps to memory. - "#address-cells": const: 2 @@ -89,7 +84,6 @@ required: - compatible - power-domains - iommus - - dma-ranges - ranges additionalProperties: false @@ -113,7 +107,6 @@ examples: <&iommu_vpp M4U_PORT_L20_JPGENC_C_RDMA>, <&iommu_vpp M4U_PORT_L20_JPGENC_Q_TABLE>, <&iommu_vpp M4U_PORT_L20_JPGENC_BSDMA>; - dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; #address-cells = <2>; #size-cells = <2>; ranges; diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml index c8412e8ab353..37800e1908cc 100644 --- a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml @@ -44,11 +44,6 @@ properties: Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml for details. Ports are according to the HW. - dma-ranges: - maxItems: 1 - description: | - Describes the physical address space of IOMMU maps to memory. - required: - compatible - reg From patchwork Wed Feb 8 05:36:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54193 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3271514wrn; Tue, 7 Feb 2023 21:38:30 -0800 (PST) X-Google-Smtp-Source: AK7set/oroN+nmAZ2QgFSVcREtsfyfUKErcByDB+BHU0Dy9DQp9rnN7tsec7iDg1UnMgWhNEPinV X-Received: by 2002:a17:902:db0f:b0:198:fc0a:192b with SMTP id m15-20020a170902db0f00b00198fc0a192bmr7077994plx.64.1675834710376; Tue, 07 Feb 2023 21:38:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675834710; cv=none; d=google.com; s=arc-20160816; b=uZ3Gt0x2kA1SLtO71MYxmwDlohimpZkrmYyqrQmZMxG7y2xGYFWciFk+r9Wm5oiq0p yDxTN0HTNgvgFxEzmVHvFRwrmaX5obzp70TBOM2AnCjd1UUAv7IXbDAtcZKCHddg1NC7 2tE5GzQALghY6XFT+DEAWcNe58Pxt1BaKWEJ094jhuTEuJDra+nN+JAYpNntQ3M6s3Ua mTgfDX36ovGFc2uZ0S0jiNeorjJK3siIG+SBU2+XFiwaWSY/TJLvW+fl7nhbFsH6hWn7 bpUc6im9/xoDoebc76hq54DqffmKXGpiqXN9v5fhayNhbtIuTYZzV/OsXR7PxDs/6D/k INDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=pEaMqDi2txNbEnZR9amkvg6uIEQa6MMAQodXL3vDOS0=; b=Wy/iZ+Qy6/54pl4DKShpKbvvHqcecDuWfxELgewRy0y2tSCvIQK3bkWTwfzOYk2Nhp uCkCq7nnSCtqEqvN9GPwEudKvDhN8WshrTu6mAeDyM2WN8VYULE0H6J7bPnlsvgMkJzd 4//pRQqaaOhXVDeqicnL8wAG1OGazkOgxgDxAEycz8y/9VnRzL6YGqATCBr84zMGLvab 35J4d0IBBKpX//pcvOnfMEWvc8lzc7jVWGIXA2tpkxdcfPxSdX87HdkblAeK4ZFT3qJ8 AA0a3a5BZhH8rOCCct8Me3/7OvLIYsS/vuG0ZKCeLOgzBVAeU8zlBGZLcZUNrdtEMjUS GMtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=g+g5BiNL; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020a63ad0f000000b004e03d6859f1si15899410pgf.289.2023.02.07.21.38.17; Tue, 07 Feb 2023 21:38:30 -0800 (PST) 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=@mediatek.com header.s=dk header.b=g+g5BiNL; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230184AbjBHFhw (ORCPT + 99 others); Wed, 8 Feb 2023 00:37:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230010AbjBHFhr (ORCPT ); Wed, 8 Feb 2023 00:37:47 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 906D7279B8; Tue, 7 Feb 2023 21:37:44 -0800 (PST) X-UUID: b22441a2a77211ed945fc101203acc17-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=pEaMqDi2txNbEnZR9amkvg6uIEQa6MMAQodXL3vDOS0=; b=g+g5BiNL7vLylEv0Mm491VmVGAHKAq7Vw0nuLWsbQPABAZfwf3JI5uovWIZDKQ5kZioMrxfRzeLBRqDBMRl+61b1oN8YiX+0ZvS7q47tyyeWxZbCrpiBOWKAW46LoM9P9DFKlZOWosHRhI1d4npbthKeGNJ8ZQvEdigG2YAZY4g=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:15266141-d2b0-45bc-9b8c-cd8a0bd2d2d6,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:70 X-CID-INFO: VERSION:1.1.19,REQID:15266141-d2b0-45bc-9b8c-cd8a0bd2d2d6,IP:0,URL :0,TC:0,Content:-25,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:70 X-CID-META: VersionHash:885ddb2,CLOUDID:da5fa356-dd49-462e-a4be-2143a3ddc739,B ulkID:230208133738I1HN97XU,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: b22441a2a77211ed945fc101203acc17-20230208 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1136717213; Wed, 08 Feb 2023 13:37:37 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 13:37:36 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:37:35 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , AngeloGioacchino Del Regno , , , , Yunfei Dong , kyrie wu , , , , Yong Wu Subject: [PATCH v2 03/10] iommu/mediatek: Get regionid from larb/port id Date: Wed, 8 Feb 2023 13:36:36 +0800 Message-ID: <20230208053643.28249-4-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757240056968989767?= X-GMAIL-MSGID: =?utf-8?q?1757240056968989767?= After commit f1ad5338a4d5 ("of: Fix "dma-ranges" handling for bus controllers"), the dma-ranges is not allowed for dts leaf node. but we still would like to separate to different masters into different iova regions. Thus we have to separate it by the HW larbid and portid. For example, larb1/2 are in region2 and larb3 is in region3. The problem is that some ports inside a larb are in region4 while some ports inside this larb are in region5. Therefore I define a "larb_region_msk" to help record the information for each a port. Take a example for a larb: [1] = ~0: means all ports in this larb are in region1; [2] = BIT(3) | BIT(4): means port3/4 in this larb are region2; [3] = ~(BIT(3) | BIT(4)): means all the other ports except port3/4 in this larb are region3. This method also avoids the users forget/abuse the iova regions. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 43 +++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index d5a4955910ff..fc3d9be120a0 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -194,6 +193,7 @@ struct mtk_iommu_plat_data { enum mtk_iommu_plat m4u_plat; u32 flags; u32 inv_sel_reg; + const u32 (*larb_region_msk)[32]; char *pericfg_comp_str; struct list_head *hw_list; @@ -508,30 +508,33 @@ static unsigned int mtk_iommu_get_bank_id(struct device *dev, static int mtk_iommu_get_iova_region_id(struct device *dev, const struct mtk_iommu_plat_data *plat_data) { - const struct mtk_iommu_iova_region *rgn = plat_data->iova_region; - const struct bus_dma_region *dma_rgn = dev->dma_range_map; - int i, candidate = -1; - dma_addr_t dma_end; + struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); + unsigned int portidmsk = 0, larbid; + const u32 *rgn_larb_msk; + int i, region_id = -1; - if (!dma_rgn || plat_data->iova_region_nr == 1) + if (plat_data->iova_region_nr == 1) return 0; - dma_end = dma_rgn->dma_start + dma_rgn->size - 1; - for (i = 0; i < plat_data->iova_region_nr; i++, rgn++) { - /* Best fit. */ - if (dma_rgn->dma_start == rgn->iova_base && - dma_end == rgn->iova_base + rgn->size - 1) - return i; - /* ok if it is inside this region. */ - if (dma_rgn->dma_start >= rgn->iova_base && - dma_end < rgn->iova_base + rgn->size) - candidate = i; + larbid = MTK_M4U_TO_LARB(fwspec->ids[0]); + for (i = 0; i < fwspec->num_ids; i++) + portidmsk |= BIT(MTK_M4U_TO_PORT(fwspec->ids[i])); + + for (i = 0; i < plat_data->iova_region_nr; i++) { + rgn_larb_msk = plat_data->larb_region_msk[i]; + if (!rgn_larb_msk) + continue; + + if ((rgn_larb_msk[larbid] & portidmsk) == portidmsk) { + region_id = i; + break; + } } - if (candidate >= 0) - return candidate; - dev_err(dev, "Can NOT find the iommu domain id(%pad 0x%llx).\n", - &dma_rgn->dma_start, dma_rgn->size); + if (region_id >= 0) + return region_id; + dev_err(dev, "Can NOT find the region for larb(%d-%x).\n", + larbid, portidmsk); return -EINVAL; } From patchwork Wed Feb 8 05:36:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3271582wrn; Tue, 7 Feb 2023 21:38:46 -0800 (PST) X-Google-Smtp-Source: AK7set/B94sOT1O5Vx9aNLoKg8m8ZvqGcKTsjIb3wsEfc4XcR77hyw7ZSOeOZ4AGw+OoNJjT2r2C X-Received: by 2002:a05:6a21:6716:b0:bc:6e88:7f58 with SMTP id wh22-20020a056a21671600b000bc6e887f58mr4470144pzb.51.1675834725948; Tue, 07 Feb 2023 21:38:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675834725; cv=none; d=google.com; s=arc-20160816; b=SAPqO0YSLuuulwlyYT5kc3vLUu6PSGAMF33Yvn2co3DwytNqoakjXMJrgPE0wuhO9k wtywmX+pIjd4qPe6Fup9IYNNXRHZ9sLi4mBRXRSnJ5k0061p+sV4uauZu0GWL4q0fnqb MKCUyo3dZzpb0njRmuPtGL6ybBIF5KXyiySxka/7uoWRBFq7zYQ0lJL2ywwwDlOpRLcL TXxjuTGevbzuhBCIAejCLpd7BP4bK/UyR/zXxP/Vb+g/ib0h6ZMQe7SjxQxTcSfPa1oz o2b+faD/t0NOwMRBcUFiQDaOETXSrT0pDzlczrfb10UnyimYr0vWxal5uGwlJkZsTLWu 6YWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/YNErVYUkjC9/9pIn84BESoJK4UIaX0NN4bnv+iDplw=; b=cw7iWeYbWZ49+01rCDs1C2ZtyOH7sqoR8/Bxh7sR49tdF4tE04E4tv24OosvAUt/U/ DvtBLW1FcbkGcinyqTOUwNKWUCPLO/zC6eyFj0v8gd02hpeFKbSjltQTEZTZd3rzsqtT 5CWgQJRqJo8k3Qn8eDR+O8U5vK3xUmxeFSl3kUND4OMbTx6ORW6ISDkIshmuee0IKbtw b3+eKYt/LT6Zi8inlTSytrshQ6q3Hdzbjs7xUwn9RFw8FLpccLT2J9xe+ht5nZKNdHCl BC9y27Nnhsl0fT6gWTUVtknlkJSXdiSKvGULVrpTiHGYU2aaMpAvDeQesITwFBiNdrjT 1rNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Lvu3Fv0J; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t185-20020a6381c2000000b004ce0e7ef3d6si17755232pgd.538.2023.02.07.21.38.30; Tue, 07 Feb 2023 21:38:45 -0800 (PST) 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=@mediatek.com header.s=dk header.b=Lvu3Fv0J; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230239AbjBHFiO (ORCPT + 99 others); Wed, 8 Feb 2023 00:38:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230294AbjBHFiG (ORCPT ); Wed, 8 Feb 2023 00:38:06 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3AC5442CF; Tue, 7 Feb 2023 21:37:56 -0800 (PST) X-UUID: b8e316c6a77211ed945fc101203acc17-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=/YNErVYUkjC9/9pIn84BESoJK4UIaX0NN4bnv+iDplw=; b=Lvu3Fv0JfcrfkMCZfKkCtqOSZNAhfVMZyCcn/8b+RTius08Uy6eB4uVR1afNduyamBWeFBwBlQnGSgy3p3t0OCWeE81z26c8fx0/yFF1bJUuYElnvXrDOGD8dxkCevF4QAIen78SMLPIZ0N34MI8gXwpKDQNOGzvU8Mmd5BxHok=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:fd8a7a10-82ad-4d25-b2ab-1ebf428b1f09,IP:0,U RL:0,TC:0,Content:-20,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:75 X-CID-INFO: VERSION:1.1.19,REQID:fd8a7a10-82ad-4d25-b2ab-1ebf428b1f09,IP:0,URL :0,TC:0,Content:-20,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTI ON:quarantine,TS:75 X-CID-META: VersionHash:885ddb2,CLOUDID:5c1ccdf7-ff42-4fb0-b929-626456a83c14,B ulkID:230208133751JFA2BH46,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:1,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: b8e316c6a77211ed945fc101203acc17-20230208 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 633470860; Wed, 08 Feb 2023 13:37:48 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Wed, 8 Feb 2023 13:37:48 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:37:47 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , "AngeloGioacchino Del Regno" , , , , Yunfei Dong , kyrie wu , , , , Yong Wu Subject: [PATCH v2 04/10] iommu/mediatek: mt8195: Add larb_region_msk Date: Wed, 8 Feb 2023 13:36:37 +0800 Message-ID: <20230208053643.28249-5-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757240073626668766?= X-GMAIL-MSGID: =?utf-8?q?1757240073626668766?= Add larb_region_msk for mt8195. We separate the 16GB iova regions by each device's larbid/portid. Refer to include/dt-bindings/memory/mt8195-memory-port.h Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index fc3d9be120a0..b120382a480b 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1537,6 +1537,21 @@ static const struct mtk_iommu_plat_data mt8195_data_infra = { .iova_region_nr = ARRAY_SIZE(single_domain), }; +static const unsigned int mt8195_larb_region_msk[][32] = { + [0] = {~0, ~0, ~0, ~0}, /* Region0: all ports for larb0/1/2/3 */ + [1] = {0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, ~0, ~0, ~0, ~0, ~0, /* Region1: larb19/20/21/22/23/24 */ + ~0}, + [2] = {0, 0, 0, 0, ~0, ~0, ~0, ~0, /* Region2: the other larbs. */ + ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0, + ~0, ~0, 0, 0, 0, 0, 0, 0, + 0, ~0, ~0, ~0, ~0}, + [3] = {0}, + [4] = {[18] = BIT(0) | BIT(1)}, /* Only larb18 port0/1 */ + [5] = {[18] = BIT(2) | BIT(3)}, /* Only larb18 port2/3 */ +}; + static const struct mtk_iommu_plat_data mt8195_data_vdo = { .m4u_plat = M4U_MT8195, .flags = HAS_BCLK | HAS_SUB_COMM_2BITS | OUT_ORDER_WR_EN | @@ -1547,6 +1562,7 @@ static const struct mtk_iommu_plat_data mt8195_data_vdo = { .banks_enable = {true}, .iova_region = mt8192_multi_dom, .iova_region_nr = ARRAY_SIZE(mt8192_multi_dom), + .larb_region_msk = mt8195_larb_region_msk, .larbid_remap = {{2, 0}, {21}, {24}, {7}, {19}, {9, 10, 11}, {13, 17, 15/* 17b */, 25}, {5}}, }; @@ -1561,6 +1577,7 @@ static const struct mtk_iommu_plat_data mt8195_data_vpp = { .banks_enable = {true}, .iova_region = mt8192_multi_dom, .iova_region_nr = ARRAY_SIZE(mt8192_multi_dom), + .larb_region_msk = mt8195_larb_region_msk, .larbid_remap = {{1}, {3}, {22, MTK_INVALID_LARBID, MTK_INVALID_LARBID, MTK_INVALID_LARBID, 23}, {8}, {20}, {12}, From patchwork Wed Feb 8 05:36:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3271641wrn; Tue, 7 Feb 2023 21:38:57 -0800 (PST) X-Google-Smtp-Source: AK7set+fUiqvGDblTGeI3tnxeqAMMJ2Vuc3qIwcglhscmlYLW5+MREoG8p4ciZzQLlDXpHCqSnUQ X-Received: by 2002:a05:6a20:1449:b0:be:b137:9d2d with SMTP id a9-20020a056a20144900b000beb1379d2dmr7430077pzi.58.1675834737509; Tue, 07 Feb 2023 21:38:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675834737; cv=none; d=google.com; s=arc-20160816; b=0fogburs04fl79t+yG5ItDhVsZO4FAOikHk9f/nDOwRs5428kuzN82rGfDoAseHOp+ Tp4XoSxpyEGLDrER+1D3z2M1Oxo0W7oovuU2WOMEVWEg6bK65ftCaXcmeLmFgnTk6A5e r+fZJC82fzuTtqt83E+xvt/7vdSiRX1RHwQ0WJ1imjGpLNjJR9RDbaLkEPzm+LEjQBAJ Z+0Qymlo93GjTNOV9hpkda6COiczxNmMePTuESOFLRa1EfTw/L6CcE3mhCYm2dW1H4AA SJCVJSojN0C3LDQEPT6bS2JaUTuMfJhZZnW+07ldvfAegJkKiLnv89VIFrqLyPrS4MLc gE4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mRMxNC8NtS0LFRw2BEPBBStsJ/e6KabEygw6jJdX/L0=; b=akIWzIXE4XwL2CsHZSAV5KzfcJHY7YX7dR0XwFU0msADnEM2TYl72Qmlp5xyvSGx58 uaISc/Gq0Sv41KIg3ha49w8HjYxDLS2iyXzbtbcTGsHpPY+uNF+iBXZUmDA6AT+z1L4Y pBzJx8s+dGj7lbTW8bKIUgTPKqVEhLkCMdg/luwniToyEfCRNKkcszmBWR0/RQkUb544 1uSO8ZE986WxJWgsHiDzfzBmnwRkNS2WnsbJllcmIARBksMhyV61uZa0le/8J/ZC6qPI AAxsK2Oj7mVzJMkze9EhvPcFKASarRoUldIEEx8US1GXXApCC8aA2fSrXTco9ZeqHDIJ wI5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=OMxGZLZK; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020aa7972c000000b0059394677948si17976758pfg.164.2023.02.07.21.38.44; Tue, 07 Feb 2023 21:38:57 -0800 (PST) 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=@mediatek.com header.s=dk header.b=OMxGZLZK; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbjBHFiS (ORCPT + 99 others); Wed, 8 Feb 2023 00:38:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230305AbjBHFiH (ORCPT ); Wed, 8 Feb 2023 00:38:07 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A72FC442F0; Tue, 7 Feb 2023 21:38:02 -0800 (PST) X-UUID: bdff3522a77211ed945fc101203acc17-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=mRMxNC8NtS0LFRw2BEPBBStsJ/e6KabEygw6jJdX/L0=; b=OMxGZLZK7R0kHR7Mlw94GlL+KEsXjtzAiSOvN7xDMc22AQqUVowLQ7kKbxP6qxHZhpGIaVAor6C9Sm1HC7qNgYwQfx3VLb47hiqOpucZwnd9OEEzkXYULtANfMCUcOfL1ed0gksPscTtOqbSaWInlSBKtMBNZhUAVAKBZSSRB7k=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:9ca79d15-c71f-4b39-80ad-2a104f319d4f,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.19,REQID:9ca79d15-c71f-4b39-80ad-2a104f319d4f,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:885ddb2,CLOUDID:301dcdf7-ff42-4fb0-b929-626456a83c14,B ulkID:230208133759NEI8JQ9Y,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: bdff3522a77211ed945fc101203acc17-20230208 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1569380585; Wed, 08 Feb 2023 13:37:57 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 13:37:56 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:37:55 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , "AngeloGioacchino Del Regno" , , , , Yunfei Dong , kyrie wu , , , , Yong Wu Subject: [PATCH v2 05/10] iommu/mediatek: mt8186: add larb_region_msk Date: Wed, 8 Feb 2023 13:36:38 +0800 Message-ID: <20230208053643.28249-6-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757240085483183590?= X-GMAIL-MSGID: =?utf-8?q?1757240085483183590?= Add larb_region_msk for mt8186. We separate the 16GB iova regions by each device's larbid/portid. Note: larb5/6/10/12/14/15/18 connect nothing in this SoC. Refer to include/dt-bindings/memory/mt8186-memory-port.h Signed-off-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 b120382a480b..5a9e0fbb534e 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1495,6 +1495,18 @@ static const struct mtk_iommu_plat_data mt8183_data = { .larbid_remap = {{0}, {4}, {5}, {6}, {7}, {2}, {3}, {1}}, }; +static const unsigned int mt8186_larb_region_msk[][32] = { + [0] = {~0, ~0, ~0}, /* Region0: all ports for larb0/1/2 */ + [1] = {0, 0, 0, 0, ~0, 0, 0, ~0}, /* Region1: larb4/7 */ + [2] = {0, 0, 0, 0, 0, 0, 0, 0, /* Region2: larb8/9/11/13/16/17/19/20 */ + ~0, ~0, 0, ~0, 0, ~(u32)(BIT(9) | BIT(10)), 0, 0, + /* larb13: the other ports except port9/10 */ + ~0, ~0, 0, ~0, ~0}, + [3] = {0}, + [4] = {[13] = BIT(9) | BIT(10)}, /* larb13 port9/10 */ + [5] = {[14] = ~0}, /* larb14 */ +}; + static const struct mtk_iommu_plat_data mt8186_data_mm = { .m4u_plat = M4U_MT8186, .flags = HAS_BCLK | HAS_SUB_COMM_2BITS | OUT_ORDER_WR_EN | @@ -1507,6 +1519,7 @@ static const struct mtk_iommu_plat_data mt8186_data_mm = { .banks_enable = {true}, .iova_region = mt8192_multi_dom, .iova_region_nr = ARRAY_SIZE(mt8192_multi_dom), + .larb_region_msk = mt8186_larb_region_msk, }; static const struct mtk_iommu_plat_data mt8192_data = { From patchwork Wed Feb 8 05:36:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3271664wrn; Tue, 7 Feb 2023 21:39:02 -0800 (PST) X-Google-Smtp-Source: AK7set/dZhMCxAMJmr3Kpb2UakE2CU8+H1EiRCjHOP1kuPYXwWFzlsUTvwND1Xj2rTCQN6nYhw4+ X-Received: by 2002:a05:6a20:158e:b0:ac:82ff:9f9e with SMTP id h14-20020a056a20158e00b000ac82ff9f9emr5232866pzj.22.1675834742042; Tue, 07 Feb 2023 21:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675834742; cv=none; d=google.com; s=arc-20160816; b=JKCvHzAJWfZ/XE6fyDemiP+Fb966RU0citPbLDGR2UVeGqNHY1rGMDTfVYewi6Kh/r JqA0pBHmzpCDydx6iuxkOgTCr+ckYMPynwzuGseSzXDZ/JkpkEMY9b2XvMaeb8vpjn/y 1mLRnORNDAiygUqyZsFcfeDQQ8q4hk8FkG7cAufCjkQgj2tJvlFjfJQVDkHhRNJ6KQf4 kp9kjWlYzondX2jZFfODyTBcpQ9iydrQ+EJ3Jxa8Sp18m/o5DCNYxtNoymT2eOU/o3a1 8+mVDQb5+Rudgu8yYtVl4Hc6yv8dHChM8AmfMh3jZXFqoiAhfoyn+jFg1Im762Da9w1s Ifog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=DvLdpvBFoTbv/8lF8zSbZ/zBomvSzV29CTJnZVUJkKU=; b=n3wR5/V4wgJar0VxF3ZhaqfG60V8sazZ1OSRLhLKBl0zfLdzxVXvi4kDhos/1My1v/ UKVMvjBxTgLC80lQVMjQTTjNbN8DSjjkZE0G7kXhjcga6D4GHAvD55xKA99anuc1siYC AYVDK0dCLgWu/C7xPmj1xJUd16xOnI5ngGRTiP/fXdmu9L3DR2e8xZRIrFvUGTJiMiBl gXL4BT9iyvHRXsj6P4ebbCNh+IW2QQ6JKy6OXFO+MUckM3hNGdT96+iPeTC9BvjkTx6O CO4lPaBApOabPBHdbnL6qLN2h9ALCdn9UQ0bX1a5fIPh7A3LKMWB/MNWXJWJ0XEYwATK Q1yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=b8N2WGfl; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p3-20020a639503000000b004f3880f668csi15843353pgd.781.2023.02.07.21.38.48; Tue, 07 Feb 2023 21:39:02 -0800 (PST) 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=@mediatek.com header.s=dk header.b=b8N2WGfl; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230246AbjBHFia (ORCPT + 99 others); Wed, 8 Feb 2023 00:38:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230287AbjBHFi2 (ORCPT ); Wed, 8 Feb 2023 00:38:28 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 318BB442DA; Tue, 7 Feb 2023 21:38:21 -0800 (PST) X-UUID: c815dfd4a77211eda06fc9ecc4dadd91-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=DvLdpvBFoTbv/8lF8zSbZ/zBomvSzV29CTJnZVUJkKU=; b=b8N2WGflwo0oaONoNzBtoKgk2ZcBQkBw+WseitRtiZvBtbFCmLC+XxewfB3WLr5pjtFmBzrU/GHZ4pmkzCVWxdzfE/gc2R3q01hE/EZ8kDnSz+e9/u2IqXgKcioRwbYfqmbSU0+OkN7VLzL72evYH2ipY7858FeNFtAoScy9zDM=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:a5e54634-3509-4ac7-84e2-65ac78221563,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:885ddb2,CLOUDID:c9143e8e-8530-4eff-9f77-222cf6e2895b,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: c815dfd4a77211eda06fc9ecc4dadd91-20230208 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 292321344; Wed, 08 Feb 2023 13:38:14 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 13:38:13 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:38:11 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , AngeloGioacchino Del Regno , , , , Yunfei Dong , kyrie wu , , , , Yong Wu Subject: [PATCH v2 06/10] iommu/mediatek: mt8192: add larb_region_msk Date: Wed, 8 Feb 2023 13:36:39 +0800 Message-ID: <20230208053643.28249-7-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757240090560359991?= X-GMAIL-MSGID: =?utf-8?q?1757240090560359991?= Add larb_region_msk for mt8192. We separate the 16GB iova regions by each device's larbid/portid. Note: larb3/6/8/10/12/15 connect nothing in this SoC. Refer to the comment in include/dt-bindings/memory/mt8192-larb-port.h Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 5a9e0fbb534e..7e8fd0a0536c 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1522,6 +1522,17 @@ static const struct mtk_iommu_plat_data mt8186_data_mm = { .larb_region_msk = mt8186_larb_region_msk, }; +static const unsigned int mt8192_larb_region_msk[][32] = { + [0] = {~0, ~0}, /* Region0: larb0/1 */ + [1] = {0, 0, 0, 0, ~0, ~0, 0, ~0}, /* Region1: larb4/5/7 */ + [2] = {0, 0, ~0, 0, 0, 0, 0, 0, /* Region2: larb2/9/11/13/14/16/17/18/19/20 */ + 0, ~0, 0, ~0, 0, ~(u32)(BIT(9) | BIT(10)), ~(u32)(BIT(4) | BIT(5)), 0, + ~0, ~0, ~0, ~0, ~0}, + [3] = {0}, + [4] = {[13] = BIT(9) | BIT(10)}, /* larb13 port9/10 */ + [5] = {[14] = BIT(4) | BIT(5)}, /* larb14 port4/5 */ +}; + static const struct mtk_iommu_plat_data mt8192_data = { .m4u_plat = M4U_MT8192, .flags = HAS_BCLK | HAS_SUB_COMM_2BITS | OUT_ORDER_WR_EN | @@ -1531,6 +1542,7 @@ static const struct mtk_iommu_plat_data mt8192_data = { .banks_enable = {true}, .iova_region = mt8192_multi_dom, .iova_region_nr = ARRAY_SIZE(mt8192_multi_dom), + .larb_region_msk = mt8192_larb_region_msk, .larbid_remap = {{0}, {1}, {4, 5}, {7}, {2}, {9, 11, 19, 20}, {0, 14, 16}, {0, 13, 18, 17}}, }; From patchwork Wed Feb 8 05:36:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54197 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3271713wrn; Tue, 7 Feb 2023 21:39:15 -0800 (PST) X-Google-Smtp-Source: AK7set9ATNiieul1ShDG9uoPFa2fCR6uZFUMZk3fspwRjVg5QUG7TdbDhxm4hZNG2oNwyeaDXM1G X-Received: by 2002:a17:90a:19:b0:22c:4f41:bbc2 with SMTP id 25-20020a17090a001900b0022c4f41bbc2mr7366743pja.5.1675834755613; Tue, 07 Feb 2023 21:39:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675834755; cv=none; d=google.com; s=arc-20160816; b=TjIFoBVXJkAT3lth9aHPsc00yF2OvIElN1L6PtWJMkypkBpkWu7yfFmp0UwXIRux1Y Sy21kjBTZppD3WKHoOm3CUsZ1Hy2pTuVXuU8FSUNJm/4QYhhXatVa3VPUaYcujP9FEZ2 lv6YXotgSnDnURNLHmhnYzKUP9EkilW/Ljm6XrikE4ZPe2A+58z6dAN/gDujYpGemGZC 3aDBvqXWq5NMr2wOmSq7q5IKJKY7y+YzwR8n7OAAeklWcj865Mh/97ntnLLOazNg73ML uJGIugQsFOUBSyeWkdYkPAKiRkuhFTzXoZ3QmqeAqB39+bdc0ILP6AGcmUW2dTWB/Ny8 /g2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Xl1CilNBVbkJItVNSibY1tzmDqH8d48UMU079vqS8Mc=; b=uwFsD4gkKNjRA6BOXS9F6eA+ccNIojJaCEOYyI/xa7gwS3ITXKGq3pq5zJ2bvNCru0 af569ltVVm1Yn6pByycAd+PEpLw1loJ7Cf/fKxAEQCDTDIaho/ocdLUkFnAu3FYv67Yv /4C1bQtGT5vm/QBLi9lCw2Wb9ec2+dVWNgTr2zgUXbf5S76DUCg92Q4C6W27McrQM0vT xvO650P0pfnIn/US4/PFCyqqOKBMxuBHklx2Is3aq+ZE+QseHgFUGgyxd/vh8unt8tXS dp7hdxylrLUXkA6+mcDqfswy6Dvim8tYDxK9CIPnZfVJDPLu/BSkBJ7/Ih+DYMNyYSZd wQGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=iQsd76Mi; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a17090a34c700b00230f6f58ba3si1324252pjf.17.2023.02.07.21.39.02; Tue, 07 Feb 2023 21:39:15 -0800 (PST) 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=@mediatek.com header.s=dk header.b=iQsd76Mi; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230377AbjBHFiq (ORCPT + 99 others); Wed, 8 Feb 2023 00:38:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230327AbjBHFim (ORCPT ); Wed, 8 Feb 2023 00:38:42 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 964D8442CF; Tue, 7 Feb 2023 21:38:30 -0800 (PST) X-UUID: ce5c8708a77211ed945fc101203acc17-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=Xl1CilNBVbkJItVNSibY1tzmDqH8d48UMU079vqS8Mc=; b=iQsd76MiUJgqMXDqGzfwTXE8KD1mbOF5oR3HeiDsSmkwWqUP/z1Fhk9cyjMmOp5qU6BfuyPXCyFxolaYO3cPKRDxBTplDmYSpmZSHnBDEl4j3qEu11VOn3eNK8L/irfVEXS9ZLxf71deGGm9BePl55W19YCc5W98z/FwbTeDGdA=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:cf94aeb0-a608-4e85-b7fd-c7ace1989842,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:885ddb2,CLOUDID:33163e8e-8530-4eff-9f77-222cf6e2895b,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: ce5c8708a77211ed945fc101203acc17-20230208 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1227592973; Wed, 08 Feb 2023 13:38:24 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 13:38:23 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:38:22 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , "AngeloGioacchino Del Regno" , , , , Yunfei Dong , kyrie wu , , , , Yong Wu Subject: [PATCH v2 07/10] iommu/mediatek: Add a gap for the iova regions Date: Wed, 8 Feb 2023 13:36:40 +0800 Message-ID: <20230208053643.28249-8-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757240105064686669?= X-GMAIL-MSGID: =?utf-8?q?1757240105064686669?= As the removed property in the vcodec dt-binding, the property is: dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; The length is 0xfff0_0000 rather than 0x1_0000_0000, this means it requires 1M as a gap. This is because the end address for some vcodec HW is (address + size). If the size is 4G, the end address may be 0x2_0000_0000, and the width for vcodec register only is 32, then the HW may get the ZERO address. Currently the consumer's dma-ranges property doesn't work, IOMMU have to consider this problem. Add a bigger gap(8M) for all the regions to avoid it. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 7e8fd0a0536c..2e8ffcec35d9 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -304,15 +304,15 @@ static LIST_HEAD(m4ulist); /* List all the M4U HWs */ #define for_each_m4u(data, head) list_for_each_entry(data, head, list) static const struct mtk_iommu_iova_region single_domain[] = { - {.iova_base = 0, .size = SZ_4G}, + {.iova_base = 0, .size = SZ_4G - SZ_8M}, }; static const struct mtk_iommu_iova_region mt8192_multi_dom[] = { - { .iova_base = 0x0, .size = SZ_4G}, /* 0 ~ 4G */ + { .iova_base = 0x0, .size = SZ_4G - SZ_8M}, /* 0 ~ 4G, 8M as a gap. */ #if IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT) - { .iova_base = SZ_4G, .size = SZ_4G}, /* 4G ~ 8G */ - { .iova_base = SZ_4G * 2, .size = SZ_4G}, /* 8G ~ 12G */ - { .iova_base = SZ_4G * 3, .size = SZ_4G}, /* 12G ~ 16G */ + { .iova_base = SZ_4G, .size = SZ_4G - SZ_8M}, /* 4G ~ 8G */ + { .iova_base = SZ_4G * 2, .size = SZ_4G - SZ_8M}, /* 8G ~ 12G */ + { .iova_base = SZ_4G * 3, .size = SZ_4G - SZ_8M}, /* 12G ~ 16G */ { .iova_base = 0x240000000ULL, .size = 0x4000000}, /* CCU0 */ { .iova_base = 0x244000000ULL, .size = 0x4000000}, /* CCU1 */ From patchwork Wed Feb 8 05:36:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3271818wrn; Tue, 7 Feb 2023 21:39:34 -0800 (PST) X-Google-Smtp-Source: AK7set9NqX/g76+i+B16URnO2pcoDCAxSQXjidiXKaNaRHVZkQJ4P2bC1xQVrBuAKfENo/YMYLc2 X-Received: by 2002:a05:6a21:29c6:b0:b8:c6ec:a269 with SMTP id tv6-20020a056a2129c600b000b8c6eca269mr4538746pzb.16.1675834774270; Tue, 07 Feb 2023 21:39:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675834774; cv=none; d=google.com; s=arc-20160816; b=Y1hp6XnR5QJTznb3B1pP/vwk9pXZVbHycq1WAStcDH9QOVFf30CtxzsZA3aLTInO/l kxDi2Tt8rqrobjR5qOT6XwAyaapUE7ZjDxnPg3NG3mlFPYdwAiE0/cev9oKjRhZME+KF WZKyZgPdV5jUevaFj0/RSxJVHOgAXObhs7AEnBdqzNaIbczfCVjb6VgCJ/iQ0T3efaZd u3WSW8Q95Y0XwLYvzNRfwYFLy3l9wFWkMlYK/FmqPbOUF5LRF6CXcUIXAk8OTxQz7PVr N3WZJgMI/NsTrPKMCGjZcrHSQJ7Fl/HZ/kSNu7IXeLq0hwq7mVPWCj/EB0ROL6SdqCl0 OvRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PyGFaiQpYwvJRNsu5FUdDc+UhFlL928fq4ghNZboUsU=; b=XoUSz9jxgcWhnPoz02XTBB/MNxrXOPEiUVrNO+9lUjtK0nweIuOUlWiV1ms9Du/Ol+ RDFx17+/HviSEYO3wXQyil08uYBcKqfa9Zv/nV2rc/dJ6mnYugFlvnf/+euWPTWMSSdK uq1iMVHkzjfvUl7ioToapztYonn7WEA5BRzTDIxF2wP+0myiGWWkxS/u9BQqX1jI6x4R PZg/NDsuCgvI/JKdVfpoSdJk3YZMKiR7LvokQKYKGFtXPOzE0dXQrdx9qETtNWPtZC5m 8e7C2EDJd/BtKwycyhwrRlqW56NyBlkixCu4JJex6/YmbaME23J7jrHOOT1MUAp3FqIY c1ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=LVPmaJCa; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a65-20020a639044000000b004ba031995f2si18530614pge.26.2023.02.07.21.39.21; Tue, 07 Feb 2023 21:39:34 -0800 (PST) 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=@mediatek.com header.s=dk header.b=LVPmaJCa; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbjBHFjA (ORCPT + 99 others); Wed, 8 Feb 2023 00:39:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230312AbjBHFit (ORCPT ); Wed, 8 Feb 2023 00:38:49 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E16F442E9; Tue, 7 Feb 2023 21:38:41 -0800 (PST) X-UUID: d5a2e07aa77211eda06fc9ecc4dadd91-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=PyGFaiQpYwvJRNsu5FUdDc+UhFlL928fq4ghNZboUsU=; b=LVPmaJCagWVrdUTOIGC0RYk+ilj7TUvv0LTLOQ5F5cdHaS0QPK3ravJoG48806ky59/4SCLWR12DTiAPFUFazEZujMKgkOZlHBUU08KYUuZUuDYpOhWaQAOiUQgwImFe/JrAzCQyLIV49mhUUWWqnAOBD10pctZGs8NkMeTfoAY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:c882f954-0690-42ee-b5ba-140a26998967,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:885ddb2,CLOUDID:3121cdf7-ff42-4fb0-b929-626456a83c14,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-UUID: d5a2e07aa77211eda06fc9ecc4dadd91-20230208 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1396741238; Wed, 08 Feb 2023 13:38:37 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 13:38:35 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:38:34 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , AngeloGioacchino Del Regno , , , , Yunfei Dong , kyrie wu , , , , Yong Wu Subject: [PATCH v2 08/10] arm64: dts: mt8195: Add dma-ranges for the parent "soc" node Date: Wed, 8 Feb 2023 13:36:41 +0800 Message-ID: <20230208053643.28249-9-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757240124174360212?= X-GMAIL-MSGID: =?utf-8?q?1757240124174360212?= After commit f1ad5338a4d5 ("of: Fix "dma-ranges" handling for bus controllers"), the dma-ranges property is not allowed for the leaf node. But our iommu/dma-ranges is 16GB, we still expect separate the 16GB dma-range like: a) display is in 0 - 4GB; b) vcodec is in 4GB - 8GB; c) camera is in 8GB - 12GB. We can not expect all the masters add a parent node for them, especial for the existed drivers/nodes. Thus, we add whole the 16GB dma-ranges in the parent "soc" node. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi index 8f1264d5290b..0f5a31ca1b70 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -364,6 +364,7 @@ #size-cells = <2>; compatible = "simple-bus"; ranges; + dma-ranges = <0x0 0x0 0x0 0x0 0x4 0x0>; gic: interrupt-controller@c000000 { compatible = "arm,gic-v3"; From patchwork Wed Feb 8 05:36:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54200 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3280077wrn; Tue, 7 Feb 2023 22:03:08 -0800 (PST) X-Google-Smtp-Source: AK7set+K4mPzw63HWZyUR3FkMitt70UrWpVhDsMOpcuNhK9vpO6b7CfJSUfwsTKGExHaAuMFOO0Y X-Received: by 2002:a17:906:3ec3:b0:878:8294:9179 with SMTP id d3-20020a1709063ec300b0087882949179mr5989922ejj.54.1675836188580; Tue, 07 Feb 2023 22:03:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675836188; cv=none; d=google.com; s=arc-20160816; b=dUqfyn5w0a0axkKAH9cnsJMdGuESLq7tfQjgpm1LQPj3gVxo48g8/za+flOgl64a+X 4EL/o/SEoGNRFYEvGeyvs/eIVRiLQR8fH+1XJ31CGlFmVtvg1uOvsrMs2tcbKl8K0m8f wd8eii3e4AH8e7lDqtbpMyJabIMLOokTX7TNwfyt/yaNvMjBafPLIF0CXxfiMMAhayGZ d5MSLZFHUUCBWyYY/6l59KieFuDO6XY1v88WCdcJ+zR0fewSSMk/8QWE0Z/Z/eU/8WA+ vXkFp2vWqexCbaRZXKcj+ZEkj/wgTY290jB58KHU/YE5r4SNt2F7+7Dg6TtoestkmZ1y Wrfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=6NHS2KCzcmLYPt4o9uTG7GnDL5CYjHINzLfnsbF5K0Q=; b=t5jINYHbUWREpIIcBCYrmODkXivoMoAE3e0tktqmHKJnL8Yu39KwFVwNC7qgXQMEe4 dFeWESGP0woQ62I1VnDxJ1NPYIuMtYfGzXxJ5W1TLPbyZhAnVyYza5TM8wp7kt+BGFI/ odzR5fRtXmMiXOCKyhGU9xNvHAbiAuOQBftQjPVnP1sAYSV6JUywrPZLmxgwaxQuLJZ+ qVw9/R5RN78SDARwnSpMafvm++6rik1GaS0/QRcvZVBcBvN4DSos45aP2xm+V+PzPL3s FOt3MD8+XwRL0VJ9LX0AZFgtKYzL+3ZJPmBkqGtCjprF4Me6nS+N7AAe1Nizorb0N9/3 F6GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=aZxnTqS5; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w21-20020a05640234d500b004a2357e19d2si22347427edc.33.2023.02.07.22.02.44; Tue, 07 Feb 2023 22:03:08 -0800 (PST) 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=@mediatek.com header.s=dk header.b=aZxnTqS5; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230331AbjBHFjU (ORCPT + 99 others); Wed, 8 Feb 2023 00:39:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230290AbjBHFjR (ORCPT ); Wed, 8 Feb 2023 00:39:17 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9FA1CDFA; Tue, 7 Feb 2023 21:38:51 -0800 (PST) X-UUID: dac9ef58a77211ed945fc101203acc17-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=6NHS2KCzcmLYPt4o9uTG7GnDL5CYjHINzLfnsbF5K0Q=; b=aZxnTqS5GOz/ms+Z9vH4gzzn+gTgJYRb3o/TmCgquLFoEIDy+JicWbRllBp7FsF3IZIOUgqFfEtepqWyTWoLfMYhH7iGHuoPjYeOCzvcQmvoAKKgBXEdeEF9T8eVBerQjP5WNQNPpeGv9LLC2Hx/l4YGGZbselquaBnOmyh3/kI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:e3d2a112-1254-40da-ac69-f8e8c5fc1fa1,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:885ddb2,CLOUDID:8b22cdf7-ff42-4fb0-b929-626456a83c14,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: dac9ef58a77211ed945fc101203acc17-20230208 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1479023298; Wed, 08 Feb 2023 13:38:45 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 13:38:44 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:38:43 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , AngeloGioacchino Del Regno , , , , Yunfei Dong , kyrie wu , , , , Yong Wu Subject: [PATCH v2 09/10] arm64: dts: mt8195: Remove the unnecessary dma-ranges Date: Wed, 8 Feb 2023 13:36:42 +0800 Message-ID: <20230208053643.28249-10-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757241607227261646?= X-GMAIL-MSGID: =?utf-8?q?1757241607227261646?= After we add the dma-ranges in the parent "soc" node, this property is unnecessary for the leaf node. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt8195.dtsi b/arch/arm64/boot/dts/mediatek/mt8195.dtsi index 0f5a31ca1b70..7d87cbabc9f1 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195.dtsi @@ -2300,7 +2300,6 @@ power-domains = <&spm MT8195_POWER_DOMAIN_VENC>; #address-cells = <2>; #size-cells = <2>; - dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; }; jpgdec-master { @@ -2312,7 +2311,6 @@ <&iommu_vdo M4U_PORT_L19_JPGDEC_BSDMA1>, <&iommu_vdo M4U_PORT_L19_JPGDEC_BUFF_OFFSET1>, <&iommu_vdo M4U_PORT_L19_JPGDEC_BUFF_OFFSET0>; - dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; #address-cells = <2>; #size-cells = <2>; ranges; @@ -2384,7 +2382,6 @@ <&iommu_vpp M4U_PORT_L20_JPGENC_C_RDMA>, <&iommu_vpp M4U_PORT_L20_JPGENC_Q_TABLE>, <&iommu_vpp M4U_PORT_L20_JPGENC_BSDMA>; - dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; #address-cells = <2>; #size-cells = <2>; ranges; From patchwork Wed Feb 8 05:36:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Wu X-Patchwork-Id: 54199 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3276372wrn; Tue, 7 Feb 2023 21:54:00 -0800 (PST) X-Google-Smtp-Source: AK7set9TDXCYPbJ+7QVvZwtU2HY5a4sEbfrxnyTL5pIo+QrDJAc0zqtWIncXXtebu2Nchmk333Dj X-Received: by 2002:a17:903:41ca:b0:199:28b9:789e with SMTP id u10-20020a17090341ca00b0019928b9789emr6119547ple.32.1675835639997; Tue, 07 Feb 2023 21:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675835639; cv=none; d=google.com; s=arc-20160816; b=cMOy8THXEFmzOzRFL1vAGoXu489AAyZ3nR3qgpWmjZa9RUYoiavZHQbcJxqKcBsavV 3802Kq3kkzZP8QAhjCGrcM88O/k4zHEiIdcPOGueQMyEPpiJd5nkyPPlN4Jd0VfusvMC PKxzPrfeXqb41yS5RMfz9JZ5ukT16Vl+NO9cUPXIBrW5JWl1N2zGS2enivd/EAV+tGrQ 5bVWuvaDzMu93O2c6iVRvtR8fwKgSzHjwWa7anfMMnXVwJVITdx7NpBN3VSdngX3PnvH 38joFVodg3Uq/LY4LpyJFz8aoEnkgBVasn+aevYBaSzwHxTTr/vly3NF8KeSpTbuekT2 XYdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BZeA43XoOAkEaxyj8RL5V/54tyfKVdYzibdG9XTu4Dc=; b=G/PT6WHkOfDYmieGChFdMH/Dl8Kxs3NM0zvs/IDpJj5LuNmzC4XxVB1Cazgzy2Dpt6 UHciyyOSuz/UKMFC4FWmu0I9ZWkIGZZZUxZvU5EnqyyJaKIMNDqMFuLdC3PZxsWSgKVb q3SXDVGhixf1EqAMmlEb911tjO8N/P0LqHGk6FdDodIExNiMaDdt8aTrYgtglyr3PYWq Nz6GZKr+GAY33U6Hf0l/2lD1l/CPaPWAwyG4D3xxB94f5e+8kywT0K9QUNSAbZdW/DEi iNm49kLvP8qylxK91r1hiKVvnc1y2D1e/J5yFocrW44KuWlttSVsu7lgiADVubQ/i0C7 3UkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="A8XHCV4/"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a170903124900b00186b3cb9b80si19252968plh.354.2023.02.07.21.53.38; Tue, 07 Feb 2023 21:53:59 -0800 (PST) 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=@mediatek.com header.s=dk header.b="A8XHCV4/"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbjBHFkA (ORCPT + 99 others); Wed, 8 Feb 2023 00:40:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230351AbjBHFj6 (ORCPT ); Wed, 8 Feb 2023 00:39:58 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92CE02528A; Tue, 7 Feb 2023 21:39:22 -0800 (PST) X-UUID: e1163d3aa77211eda06fc9ecc4dadd91-20230208 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=BZeA43XoOAkEaxyj8RL5V/54tyfKVdYzibdG9XTu4Dc=; b=A8XHCV4/Ir4wiI4MzpszaFk48EheS5wPWekSumfIHT0mEwF/346V8eWLP+C6mbR/xK4NBmqePD9cI8CNbG/ggR+I1CPKKJO0fyvxBIpxHT21HOWlgcT7LFt2et7OvgS/HmTX86mlEIyMw2w+OJ3bjhRkH0Xqx2n4tIw/V33m5YI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.19,REQID:86ec7934-0248-4946-9b20-4386a2609b01,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:95 X-CID-INFO: VERSION:1.1.19,REQID:86ec7934-0248-4946-9b20-4386a2609b01,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS981B3D,ACTION :quarantine,TS:95 X-CID-META: VersionHash:885ddb2,CLOUDID:c1193e8e-8530-4eff-9f77-222cf6e2895b,B ulkID:230208133859YBXLKTZR,BulkQuantity:0,Recheck:0,SF:38|29|28|17|19|48,T C:nil,Content:0,EDM:-3,IP:nil,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-UUID: e1163d3aa77211eda06fc9ecc4dadd91-20230208 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1276488235; Wed, 08 Feb 2023 13:38:56 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Wed, 8 Feb 2023 13:38:54 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 8 Feb 2023 13:38:53 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Mauro Carvalho Chehab , Rob Herring CC: Will Deacon , Robin Murphy , Krzysztof Kozlowski , Hans Verkuil , , , , , , , , AngeloGioacchino Del Regno , , , , Yunfei Dong , kyrie wu , , , , Yong Wu Subject: [PATCH v2 10/10] arm64: dts: mt8186: Add dma-ranges for the parent "soc" node Date: Wed, 8 Feb 2023 13:36:43 +0800 Message-ID: <20230208053643.28249-11-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230208053643.28249-1-yong.wu@mediatek.com> References: <20230208053643.28249-1-yong.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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?1757241032185704086?= X-GMAIL-MSGID: =?utf-8?q?1757241032185704086?= Prepare for the MM nodes whose dma-ranges(iova range) is 16GB. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8186.dtsi b/arch/arm64/boot/dts/mediatek/mt8186.dtsi index a0d3e1f731bd..251eace411c0 100644 --- a/arch/arm64/boot/dts/mediatek/mt8186.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8186.dtsi @@ -324,6 +324,7 @@ #address-cells = <2>; #size-cells = <2>; compatible = "simple-bus"; + dma-ranges = <0x0 0x0 0x0 0x0 0x4 0x0>; ranges; gic: interrupt-controller@c000000 {