Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3102550pxk; Mon, 7 Sep 2020 03:19:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtq0oVmHE7XfSUHhCpdG1JkF0j100Lu+MSlGYv8yGOuvW9vrybZ5DUvJDDBP/1i2mlM4ZK X-Received: by 2002:aa7:d403:: with SMTP id z3mr6567330edq.310.1599473969324; Mon, 07 Sep 2020 03:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599473969; cv=none; d=google.com; s=arc-20160816; b=tSNuIxP8zYq70GTESpRKSOiSUosqOSzY6aOuADyA5ChGf22kX1IiDfTz+Gh1w4byO3 jrTU5CFJC8XMnS/KAJOTl2PQQfdbzdFouoawsHceFJEx2Gy1dDcMUTEjC05/aWtx1SBv 4ighMKh04SNRHBMgickB0C/3L26SQWn0YVm+omfYxea1XOPaJsNLeaZZgx01HeeSYi8O uPrXxxOUVflybmtDXM+Ve8F69gcP2Dj5CHeEX0ugAFYj+CkkujHk9y4JpVKkafJ8QIoZ x/HguJK3jSnGtYbwyR5PMP/Ss/qFhrqef6fHU19gGBd0WccXKlCBErqBywADphJIti6O Rokg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2AcZ+ht5heIUGMeBtkrSAl5QfbjkEelxxHKDjkGuZF4=; b=T9jfKAWf4bwDgixkP76NbYxnlduVRNyBWxq+NC3BMiRU2HNtdJIjRQw9q86yWesyKn vIyuHJePmG7RIBjkmpXspMttSBxmT8JR9PpQQWqzf+xTi0df/k+G2nEAKbo0U7bWohxu lhgMNu2H0fOBNBgNuVOdJAsM3a0GsyAJ/Qvcsl9x3qe/5BmPCaXaFEYLQzK9git1p3lq ZboYM7fXHKDXtIEKaTrWm3hX5ujDPFbUpyGFUX3FGZX1wWwtniUrRIXs/a2cZ9wH6FEG CuZbqeLTtONe6L0jz27OJyYHcdtuIvGuJnHX0qx7VREJaaAtrMg7NWPI6kqXsvtykc0i yNCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=KltwrjUz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw20si9380974edb.141.2020.09.07.03.19.07; Mon, 07 Sep 2020 03:19:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=KltwrjUz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728616AbgIGKRu (ORCPT + 99 others); Mon, 7 Sep 2020 06:17:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728742AbgIGKRK (ORCPT ); Mon, 7 Sep 2020 06:17:10 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1257C061757 for ; Mon, 7 Sep 2020 03:17:01 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id e11so12011616wme.0 for ; Mon, 07 Sep 2020 03:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2AcZ+ht5heIUGMeBtkrSAl5QfbjkEelxxHKDjkGuZF4=; b=KltwrjUzSC3k4btOVShbI2P9fHUWGgNbRAPmHJTtAi6/JEb36d5AntVkI4lzadidvf 4rvV0jYBTTbsZi3pZ8fjZbxeP1tjOVlfsPFwAt1bjeCZs7rJDVJbJyN5Lwa+du4rZ+Hk XQEB78tFEop+SHR7b1KscY+z5cBD/vIIRFTh2g5XOrIm2acQOAB9XnMI70w/a5fRXN0U HBto/oEqQAfPKHF2FssPCM57qNk6wqR87VhAw2GXUw13Ft1umShjzltUa0eIU3eZ6lC2 s7noChxVg5u+RbAsNvEWuhOMzXxcYL2eNpw54g3rBv4m0dwYbD2JozVlzVA8w3H6jycl 8oGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2AcZ+ht5heIUGMeBtkrSAl5QfbjkEelxxHKDjkGuZF4=; b=Gzh26B3aYtKL4/ecyRVgsgr3THuAMZLKM/zN06aeaq74QTKNOXwa4RcAhduhFj31ve veYb+/3A3ZwkgEVvIbC7xWHAq6CPgKtkO41EdEMAahaOHDUjUfpjKL6P5K3SWq+AuPQk 1k7EjLtwtbmclQKI64Z2LgfP1rW0a0eDef6sLfYsMhv1HgF+T7kPEw9VbJCvOXPt+/+m JDNZUWdPXcLmT9pHGlZcDeJ5wEXvy6rlhdjd8ipJphNWGUFSnC8Q+hsw4s+9UghZS133 9InuvU5/4n4+G3uT5mhI6baYtvdj5XaCxwk0Efw2mlG1+/T5kfgEDMaCFHvJ9hABiiq2 0pwQ== X-Gm-Message-State: AOAM533rl/Ktqeo+cD7wSnn9/BYTLCQU05Dz2tBUNcII27yQGWuVTtdf z/UttyawJhZe3jlhpPsJ1N8Opg== X-Received: by 2002:a1c:dd87:: with SMTP id u129mr19928577wmg.172.1599473820650; Mon, 07 Sep 2020 03:17:00 -0700 (PDT) Received: from localhost.localdomain (122.105.23.93.rev.sfr.net. [93.23.105.122]) by smtp.gmail.com with ESMTPSA id j7sm28728689wrw.35.2020.09.07.03.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2020 03:17:00 -0700 (PDT) From: Fabien Parent To: iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: joro@8bytes.org, robh+dt@kernel.org, matthias.bgg@gmail.com, yong.wu@mediatek.com, miles.chen@mediatek.com, Fabien Parent Subject: [PATCH v4 3/3] iommu/mediatek: add support for MT8167 Date: Mon, 7 Sep 2020 12:16:49 +0200 Message-Id: <20200907101649.1573134-3-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200907101649.1573134-1-fparent@baylibre.com> References: <20200907101649.1573134-1-fparent@baylibre.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the IOMMU on MT8167 Signed-off-by: Fabien Parent --- V4; * Removed HAS_4GB_MODE flag since this SoC does not seem to support it V3: * use LEGACY_IVRP_PADDR flag instead of using a platform data member V2: * removed if based on m4u_plat, and using instead the new has_legacy_ivrp_paddr member that was introduced in patch 2. --- drivers/iommu/mtk_iommu.c | 8 ++++++++ drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index b1f85a7e9346..4ff071eb5279 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -817,6 +817,13 @@ static const struct mtk_iommu_plat_data mt6779_data = { .larbid_remap = {{0}, {1}, {2}, {3}, {5}, {7, 8}, {10}, {9}}, }; +static const struct mtk_iommu_plat_data mt8167_data = { + .m4u_plat = M4U_MT8167, + .flags = RESET_AXI | HAS_LEGACY_IVRP_PADDR, + .inv_sel_reg = REG_MMU_INV_SEL_GEN1, + .larbid_remap = {{0}, {1}, {2}}, /* Linear mapping. */ +}; + static const struct mtk_iommu_plat_data mt8173_data = { .m4u_plat = M4U_MT8173, .flags = HAS_4GB_MODE | HAS_BCLK | RESET_AXI | @@ -835,6 +842,7 @@ static const struct mtk_iommu_plat_data mt8183_data = { static const struct of_device_id mtk_iommu_of_ids[] = { { .compatible = "mediatek,mt2712-m4u", .data = &mt2712_data}, { .compatible = "mediatek,mt6779-m4u", .data = &mt6779_data}, + { .compatible = "mediatek,mt8167-m4u", .data = &mt8167_data}, { .compatible = "mediatek,mt8173-m4u", .data = &mt8173_data}, { .compatible = "mediatek,mt8183-m4u", .data = &mt8183_data}, {} diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h index 122925dbe547..df32b3e3408b 100644 --- a/drivers/iommu/mtk_iommu.h +++ b/drivers/iommu/mtk_iommu.h @@ -39,6 +39,7 @@ enum mtk_iommu_plat { M4U_MT2701, M4U_MT2712, M4U_MT6779, + M4U_MT8167, M4U_MT8173, M4U_MT8183, }; -- 2.28.0