From patchwork Thu Dec 9 16:35:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 12695497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 32599C433F5 for ; Thu, 9 Dec 2021 16:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ghLIw4WDiLnr9oUqnntDOAVLiCZY8hCjORcUcefHuTU=; b=rCxmABcUafRFVI x5hwH3qqKIQUN7UKbhveDZiD+jS67i7jGYfeVG1mQIFH0PwYt0WU/ckooLVRmr5ogmcbRJJAv07pT 02vtW6IT8oqYDUG6WVk3PYaF9jtVHGY47dIO0Iaw2UejqWU4laUmcFkXYQDjjEzYVi9KvxZ9IakGC JTFsrPSrDJHhCEY/oKUHlJcBVb9JtDSlrUB4vd+fxY+67JUoZCTkHjahTPrRUZKfTgeskHyJDLSi/ aYA7C6YlCJtcEZIgty0exq3LbKwylVgBjkiDx5ffO13yO12cXkK0iK0UWdELU46ERD8Ugfb7N7TGO BnvxZCBG9/8YGy0fo0Rw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMP1-00Ggof-Lv; Thu, 09 Dec 2021 16:36:15 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMOw-00Ggms-Bj for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 16:36:11 +0000 Received: by mail-wm1-x334.google.com with SMTP id p27-20020a05600c1d9b00b0033bf8532855so4551688wms.3 for ; Thu, 09 Dec 2021 08:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iI3azBWTRCFEeeRKyJXboLUDLxUqU0ShZoPCiSe0QHI=; b=IvslFsKP2cSAAyw81pK4hpkGOzTdSo/ctRvboBfXswKfysT5fU5LhL/9bRxSPuRWgL iBZHmyOuf9rQ3ILzAxwW6IBHw5NxZDxhUcTtbubGfDs+NS9kEWGeBug16SAcrC+ihzbP Y3NV2KEG6CbS3lZBJtG6eSob23mqkyF0FaClUFW8/vr9tbAJgmVFGqD9wjFdu9Wl+yIA 3hDivw4Ft7xhzx9V2B2OYa9GYDE6KxbUjOC4Y6qvBD6wE6wigFf+MoZHwU0x06SElhur aGAHOZGlfXkirYozfV96mJpJ8ROZP5bUeGazugVqBgrCOBWWtYSbV9Q8+3+bnxK/uSY0 mVNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iI3azBWTRCFEeeRKyJXboLUDLxUqU0ShZoPCiSe0QHI=; b=hghmIfdrLjaNU4+GJHUZGN4MOrQB9j/ttN5IEeEDOOeMPQFUasTxEPLsFpELcIlMay 2pmv+8vUX4jrxFea2RZt7amvcsKhaq4Ne0erDQGdAXJgfvIMDWrLO0hXy/zKs7kr3nim S12kzx13ujfvfOO4+/L+0JpRlhnc4Fc1yQRODJswUwNkW9jXXw7gZ1S/3VCmXuL3B2nS Wv6MTQgsMq9geACxv/uODSQjrg3v/trUTTfT4dpbfk4fKLcLzZunpo/3piXl1mFIf3Ow /LOvsOSaZ4mfy7rnsYLXz2E/Qxph/YPGxiAUa7SYn0FBAgVKh3QMngZ78rhPAXAaUker GHHQ== X-Gm-Message-State: AOAM530hp7G15udUwq7U4uq8bu3Ce4quBUMHoUnNE1uZQxNoXQ1p3GUl RjU2R9qOUGf+QS+tIWFN5Ko= X-Google-Smtp-Source: ABdhPJy/sovjJ1DaI6y5oVUNi8kEueGlCXRc+ly7iHh3Okas8Ii3nmU4WWUlC+CLCxJuYru8/SPnpw== X-Received: by 2002:a1c:1c1:: with SMTP id 184mr8636459wmb.1.1639067766782; Thu, 09 Dec 2021 08:36:06 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id r62sm284530wmr.35.2021.12.09.08.36.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 08:36:06 -0800 (PST) From: Thierry Reding To: Joerg Roedel , Will Deacon , Robin Murphy , Rob Herring Cc: Thierry Reding , Jon Hunter , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/4] dt-bindings: arm-smmu: Document nvidia, memory-controller property Date: Thu, 9 Dec 2021 17:35:57 +0100 Message-Id: <20211209163600.609613-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211209_083610_433375_7F79F9D5 X-CRM114-Status: GOOD ( 13.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thierry Reding On NVIDIA SoC's the ARM SMMU needs to interact with the memory controller in order to map memory clients to the corresponding stream IDs. Document how the nvidia,memory-controller property can be used to achieve this. Note that this is a backwards-incompatible change that is, however, necessary to ensure correctness. Without the new property, most of the devices would still work but it is not guaranteed that all will. Signed-off-by: Thierry Reding Reviewed-by: Rob Herring --- Changes in v2: - clarify why the new nvidia,memory-controller property is required .../devicetree/bindings/iommu/arm,smmu.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml index f66a3effba73..e239157eb30c 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml @@ -155,6 +155,17 @@ properties: power-domains: maxItems: 1 + nvidia,memory-controller: + description: | + A phandle to the memory controller on NVIDIA Tegra186 and later SoCs. + The memory controller needs to be programmed with a mapping of memory + client IDs to ARM SMMU stream IDs. + + If this property is absent, the mapping programmed by early firmware + will be used and it is not guaranteed that IOMMU translations will be + enabled for any given device. + $ref: /schemas/types.yaml#/definitions/phandle + required: - compatible - reg @@ -177,6 +188,12 @@ allOf: reg: minItems: 1 maxItems: 2 + + # The reference to the memory controller is required to ensure that the + # memory client to stream ID mapping can be done synchronously with the + # IOMMU attachment. + required: + - nvidia,memory-controller else: properties: reg: From patchwork Thu Dec 9 16:35:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 12695498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 51E75C4332F for ; Thu, 9 Dec 2021 16:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N1kK78yYF3nZZ8MNf5fnp7RpHbyP2dZgmdr9okkVZVM=; b=rNCn9KrFJT9njN lPG3VA662YB6E8ZOvLRDaeGTF7dBIj8+Y0GwJ/eWbmlqnRObeaj9+XEJB1yBz5jEap4vb2MGqH3Yp HntOW/YwEEev9U05rQPRILH+u7Q3Te+Vo5kqgnrf1bYu9TOkVhZTnWmjAtahWS/saC+4ofPfj9OHe kwaehwVOGoBUvNtBuNgA5O/hIQu2o0nkVdB1hcxjOdwZJzWO3dc/PLJKc/BZWnhlJgISGI3BLDVaD 2yRYlaVy+2JUI9uXN+aG75PiqqyJ5vTdbZ354axvR3Mf3plIxnWOwbTqvETOZVXRHUDJMZN2zFd9j QgkZWpadwbCHN9SEMF/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMPG-00Ggue-UQ; Thu, 09 Dec 2021 16:36:31 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMOw-00GgnF-Vy for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 16:36:12 +0000 Received: by mail-wr1-x432.google.com with SMTP id c4so10662558wrd.9 for ; Thu, 09 Dec 2021 08:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=86gCcT11WeDFdl1AL6yEl0ohyQgOtx0+QoNrmaw2baI=; b=Ga+bX+MxQ2LlUWtzQpm7YKN+3EoZkJIPF4urBsxybQ3zUoQRKwiYd3HPGW2qx8L49P q/wwMfLlhTN/bDG/qODlTV3TjkwsPu9qZDLFv4Ov1BwPD/+eND9vumYd0P4o+EfPii6t EP1P2UFvGfJVvqTbDl125jewEungHH4bTxUx7ZmGM0/Huct4rHA/auNHvDJWz9hkbLQy arWvahGAMpWjEQ4GrSrtaitit0FgX2rsXuFEF7A6GxDXyy+MUCI17Q3HrPRIGthnWHdA 7OK3WKyYh1tDp+1bTWv9YFPZf8gDgsZOJ6eJVxcDKNo0pQ9pCrso9BoCKbJGm5aFchh0 RBPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=86gCcT11WeDFdl1AL6yEl0ohyQgOtx0+QoNrmaw2baI=; b=VQw2flm0dSRGbHzVbt884PV2eOsjA91kIuOgAo4JFLpn6nfyBBcjpj3iA5dYlkDToQ 3I+nAkUIDTwzqmUdQW7NCL7VUsNArZRYztV2Rh4rFTQBdrAHfbt3GtwsPCtmwh1sQkkx XSZJTev3K4jMJqbs7D6drZLUD0heOS78lyMoKGH/VJGKvajvtVww89AGUju79KSOLSgs syuzmIDT+HJ9+wkJKmiStd1Mml6YxirlDMvW13ixmVANvo3jLuaJ79UxsXe5YJjntbCM eqivZcBhHqFrwb1NvJt6Hnqje6PERbzS+a0tOUIIsS0RIzaGewHXseyS3wGKONoHwcdB OUUQ== X-Gm-Message-State: AOAM531MrkRYkrW8lVZErepQeTzspvHfdG6m498eyrXpJqpbIQEmo2Bj rSuFrT2gigwX69grugz2Vmg= X-Google-Smtp-Source: ABdhPJzu/LQIurnEEcsBXxaEe6K46RBSx74oQ7BLemLuFcbFy7zSJ66BBZRQOEPAj2P6+XWrrayDTQ== X-Received: by 2002:a5d:514a:: with SMTP id u10mr7663352wrt.321.1639067769151; Thu, 09 Dec 2021 08:36:09 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id r15sm8899810wmh.13.2021.12.09.08.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 08:36:08 -0800 (PST) From: Thierry Reding To: Joerg Roedel , Will Deacon , Robin Murphy , Rob Herring Cc: Thierry Reding , Jon Hunter , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Rob Herring Subject: [PATCH v2 2/4] dt-bindings: arm-smmu: Add compatible for Tegra234 SOC Date: Thu, 9 Dec 2021 17:35:58 +0100 Message-Id: <20211209163600.609613-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211209163600.609613-1-thierry.reding@gmail.com> References: <20211209163600.609613-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211209_083611_051073_22D0F998 X-CRM114-Status: GOOD ( 10.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thierry Reding The NVIDIA Tegra234 SoC comes with one single-instance ARM SMMU used by isochronous memory clients and two dual-instance ARM SMMUs used by non- isochronous memory clients. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding --- Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml index e239157eb30c..7fd0522bcd84 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml @@ -60,8 +60,9 @@ properties: for improved performance. items: - enum: - - nvidia,tegra194-smmu - nvidia,tegra186-smmu + - nvidia,tegra194-smmu + - nvidia,tegra234-smmu - const: nvidia,smmu-500 - items: - const: arm,mmu-500 @@ -181,8 +182,9 @@ allOf: compatible: contains: enum: - - nvidia,tegra194-smmu - nvidia,tegra186-smmu + - nvidia,tegra194-smmu + - nvidia,tegra234-smmu then: properties: reg: From patchwork Thu Dec 9 16:35:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 12695499 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 101FDC43217 for ; Thu, 9 Dec 2021 16:38:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AISHyRaqE0K9GsfDBnBVxJqDTb83YC071FGtkQXju6Q=; b=XuUmxA7RAhdn6z Gn8BKrRIiIJyH76Xk1l3hFPLQ/8U8z9AZgNAXUBztbbkGf2EZR62HK0VLbsvR/czgVE6alu1Ugeu4 FTq0RUSdMHYWFRueOqRFp8R+tsgIvERAcaWdxJ5zbTiI0p4VaLRKBtFPhrwaGRrdqx2rsD98KPD0Q 9qxfa5By+qCNLSd90Ntb84TV9cklqMvmyv5ALkYItdjNl5u+nveaUzq9yK3kRQ4HDAFr+NCJEzzx8 2ZWTrQgIMY15S7Q0+hfWAyMKtdWeDRO5s7V81B398MqNzVUdp879Wc8osCBBZK76+YuSzv3L3ZUli UpkATfQALo1ntudUe6BQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMPX-00GgzO-3D; Thu, 09 Dec 2021 16:36:47 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMP0-00Ggo9-AH for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 16:36:15 +0000 Received: by mail-wr1-x434.google.com with SMTP id q3so10693919wru.5 for ; Thu, 09 Dec 2021 08:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RBVbB9vWDMJLfuwUYZUrRPLV7w25shhYgWxxhrA4Z48=; b=DGTmwROcRMmvUsuy3YNzANsG6/H/eUb9VX0utTdtacM8z6GqwRXVbC16JeNePjBBHE O55Lqu5LqXYX+xVavU00nqw3JV3zVVvasfffLIOYCVbEYjBFW9sEf63e7WXDdodZoRYU VdG0oFsYnOuIc5CcB7i9KT7XGIj9UPc9DzI6JfaZIhNaBiTRx6DPT9BTC9H2PLGY9Dln KgylB4YajKqGbcfIVCX7ea8KgNU6l+mp3oOP1+5NSJil2XFG3yZaisW4rMhV8dbJ73/w OnhDDp6NUZyATkuzV4x3mnHSiQELVzNokQT7UIOiSyRr01Echrq5VC4Lc2vlGZ3UHlKR 3OKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RBVbB9vWDMJLfuwUYZUrRPLV7w25shhYgWxxhrA4Z48=; b=ygX/QhFJnMCEvp83Xis55DjxJfrn7IrBhK1Jasrz15blqbCei1AGHXTSL1/gA+8bul MRM8i8JbMUeXOV5+fZ89prdJt/+nLtKuJyH7RvfYm7b4AxT7Jh6f99Mdsrt1LzOeB8fz NH6fA/hiLN5zaH307NwZuF2DGY4JEMUOxovqi3mFDDwtx32MbmgcPluG9Qa+2Zxbl8fM feLOSIRi5tL4s/wZAetftz1JxX8/71PVxM4011WX4F7FvmxvtKp5nIXJymK8xPKIEjFc I/VASJRzazNA6+4mt3AJicfSi5SwODvDpeL+aU5IMkspo0JZSPqOeCCufpFHEX8Gh3tf xV/Q== X-Gm-Message-State: AOAM530VmtZnLMA3l00gvcaNrdRlMpBTL8LIbYNCaj22F+8Za0EsNFGp pdGyTjCQlcsDmb0gGjkHOD8= X-Google-Smtp-Source: ABdhPJyoyzm35sKhtbHbEgfcyRTMC6E0F0fB9LiKI1mNHER0VWEYotU23cMbHIBCAVjMsVva3cZv1A== X-Received: by 2002:adf:f491:: with SMTP id l17mr7747810wro.525.1639067771765; Thu, 09 Dec 2021 08:36:11 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id v2sm250094wmc.36.2021.12.09.08.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 08:36:10 -0800 (PST) From: Thierry Reding To: Joerg Roedel , Will Deacon , Robin Murphy , Rob Herring Cc: Thierry Reding , Jon Hunter , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/4] iommu/arm-smmu: Support Tegra234 SMMU Date: Thu, 9 Dec 2021 17:35:59 +0100 Message-Id: <20211209163600.609613-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211209163600.609613-1-thierry.reding@gmail.com> References: <20211209163600.609613-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211209_083614_404428_9137D95D X-CRM114-Status: GOOD ( 11.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thierry Reding Allow the NVIDIA-specific ARM SMMU implementation to bind to the SMMU instances found on Tegra234. Signed-off-by: Thierry Reding Acked-by: Will Deacon --- drivers/iommu/arm/arm-smmu/arm-smmu-impl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c index 2c25cce38060..658f3cc83278 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-impl.c @@ -211,7 +211,8 @@ struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu) if (of_property_read_bool(np, "calxeda,smmu-secure-config-access")) smmu->impl = &calxeda_impl; - if (of_device_is_compatible(np, "nvidia,tegra194-smmu") || + if (of_device_is_compatible(np, "nvidia,tegra234-smmu") || + of_device_is_compatible(np, "nvidia,tegra194-smmu") || of_device_is_compatible(np, "nvidia,tegra186-smmu")) return nvidia_smmu_impl_init(smmu); From patchwork Thu Dec 9 16:36:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 12695500 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E22E8C433F5 for ; Thu, 9 Dec 2021 16:39:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hyYmkoC4SguBmhPF5K1Nos7Def1H260cUkm5aUyrgVI=; b=3I+MQ5Pbikw87n a+JkZPbFEdx6Pn+1wI+WEdrhr1wj8FINUx+4HOTjVV0luwCtq50IRBfetKkhYceGmrGvP0llx0CYZ PWoisMH3xGDgh9/BgNmKH0xJu9/aDANDaPD8twpEqSj8av6K159jf9tILCF8IDg2onfO3av205wgQ MLSGOBoxaEs6vuKMg+01Vf9SGTSFxvusnAliVwUkA20miu1gSJvxA9BGMfq3j5FTfHZINcomliqMs rJB7FzU0SiWVnzJNvu5GiNA7rLgids2kFj42D12GH+E8EumZ5CAlKfKPSbv77EQJO3qzuj2F1GCLk KRrKbWGddXItLdpdm57A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMPm-00Gh5i-MA; Thu, 09 Dec 2021 16:37:03 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvMP1-00GgpL-Hb for linux-arm-kernel@lists.infradead.org; Thu, 09 Dec 2021 16:36:18 +0000 Received: by mail-wr1-x430.google.com with SMTP id a9so10674511wrr.8 for ; Thu, 09 Dec 2021 08:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cpB5QnL+Wf4tMDBJIxxBMIETOl3RQ/RiRgw6HjScLLM=; b=jzKaywGyMIKZ+3Ix9/pUnisQuJEIogyL7ecrGCELw7K2y1NE6vtVR5fP/ed4tWguRv Aw+Q3oQ2AUgSq9Mrz3Ov9AO5WXGYfT49bee2KZHV8CltZPCn2srMDCmqVO0wLHd4G5X6 3BDEYA2xh4jlBebbTZ+UBM9Lvp43YPhozpsaHMxcDBxu0dm1gp22k4sRCJ16fKnUgoAL 0zxOtFcLNOhnBepFcVsogKlSStmeNg3eFNDunJ6LcTBc4iFowTEnxsgEItBCUeJdeR4M 1qfdhulb32cLzWpwH2OvEI76HlHr+bvnepWbs382Fg9Ks1oKe115nJOhVSJxb/FAO/vj c09g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cpB5QnL+Wf4tMDBJIxxBMIETOl3RQ/RiRgw6HjScLLM=; b=p6EOXprvI67K2pQoHnwR8cW98WD0AKqRgOw4tqpVdBwI1CqEGEuhz6wkEJ+Z3j0TkZ INZagUx+MoC2Q0fBf3RsuLDVvTuZNqZ7P6z5NJaXbNdGvKnt+ye+QSpBQEnF04ukXPnk XSg+7mnYzdzk+piM2ZQvWCr9Qi7lFH/750SgccYLh9LNeLlsh4NGSVhPxYDTuRjuc1EV MEVw3AbuY31rFqTYdKf5uyFNUVlzhB7tbCKxneofQp1A0wHvqfmTcpc6CFuSQXD46Lkm n8Tks9i5oIdJ2CfVaraIkZMQZmNdK97+t2WhqWR77cv5iH20BdnPG5mzR+GT0TaEoaoI K52A== X-Gm-Message-State: AOAM530ur24q+AOGMmLEDnIWKsExnMT/OdkkK0mpJ+nVZYYPKtkj+ab+ 8aawHsvc+haNGCwWi4zHapvWyQdgvGgNag== X-Google-Smtp-Source: ABdhPJwPfh9nB8a6JAVGrI8XVNxvUGzdtAKyrwPeQ7A0IEowOB/7N1BpnlgCMyx7a2s7STz1WLrzUQ== X-Received: by 2002:a5d:5588:: with SMTP id i8mr7555511wrv.552.1639067774028; Thu, 09 Dec 2021 08:36:14 -0800 (PST) Received: from localhost ([193.209.96.43]) by smtp.gmail.com with ESMTPSA id l21sm175967wrb.38.2021.12.09.08.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 08:36:13 -0800 (PST) From: Thierry Reding To: Joerg Roedel , Will Deacon , Robin Murphy , Rob Herring Cc: Thierry Reding , Jon Hunter , iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 4/4] arm64: tegra: Add Tegra234 IOMMUs Date: Thu, 9 Dec 2021 17:36:00 +0100 Message-Id: <20211209163600.609613-4-thierry.reding@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211209163600.609613-1-thierry.reding@gmail.com> References: <20211209163600.609613-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211209_083615_628454_C093F051 X-CRM114-Status: GOOD ( 11.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thierry Reding The NVIDIA Tegra234 SoC comes with one single-instance ARM SMMU used by isochronous memory clients and two dual-instance ARM SMMUs used by non- isochronous memory clients. Add the corresponding device tree nodes and hook up existing memory clients (SDHCI and BPMP). Signed-off-by: Thierry Reding --- arch/arm64/boot/dts/nvidia/tegra234.dtsi | 426 +++++++++++++++++++++++ 1 file changed, 426 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi index 3df2217fd826..7acae44a09b8 100644 --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi @@ -160,6 +160,7 @@ mmc@3460000 { interconnects = <&mc TEGRA234_MEMORY_CLIENT_SDMMCRAB &emc>, <&mc TEGRA234_MEMORY_CLIENT_SDMMCWAB &emc>; interconnect-names = "dma-mem", "write"; + iommus = <&smmu_niso1 TEGRA234_SID_SDMMC4>; nvidia,pad-autocal-pull-up-offset-hs400 = <0x00>; nvidia,pad-autocal-pull-down-offset-hs400 = <0x00>; nvidia,pad-autocal-pull-up-offset-1v8-timeout = <0x0a>; @@ -198,6 +199,148 @@ hsp_top0: hsp@3c00000 { #mbox-cells = <2>; }; + smmu_niso1: iommu@8000000 { + compatible = "nvidia,tegra234-smmu", "nvidia,smmu-500"; + reg = <0x8000000 0x1000000>, + <0x7000000 0x1000000>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + stream-match-mask = <0x7f80>; + #global-interrupts = <2>; + #iommu-cells = <1>; + + nvidia,memory-controller = <&mc>; + status = "okay"; + }; + hsp_aon: hsp@c150000 { compatible = "nvidia,tegra234-hsp", "nvidia,tegra194-hsp"; reg = <0x0c150000 0x90000>; @@ -262,6 +405,288 @@ gic: interrupt-controller@f400000 { #interrupt-cells = <3>; interrupt-controller; }; + + smmu_iso: iommu@10000000{ + compatible = "nvidia,tegra234-smmu", "nvidia,smmu-500"; + reg = <0x10000000 0x1000000>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + stream-match-mask = <0x7f80>; + #global-interrupts = <1>; + #iommu-cells = <1>; + + nvidia,memory-controller = <&mc>; + status = "okay"; + }; + + smmu_niso0: iommu@12000000 { + compatible = "nvidia,tegra234-smmu", "nvidia,smmu-500"; + reg = <0x12000000 0x1000000>, + <0x11000000 0x1000000>; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + stream-match-mask = <0x7f80>; + #global-interrupts = <2>; + #iommu-cells = <1>; + + nvidia,memory-controller = <&mc>; + status = "okay"; + }; }; sram@40000000 { @@ -297,6 +722,7 @@ bpmp: bpmp { <&mc TEGRA234_MEMORY_CLIENT_BPMPDMAR &emc>, <&mc TEGRA234_MEMORY_CLIENT_BPMPDMAW &emc>; interconnect-names = "read", "write", "dma-mem", "dma-write"; + iommus = <&smmu_niso1 TEGRA234_SID_BPMP>; bpmp_i2c: i2c { compatible = "nvidia,tegra186-bpmp-i2c";