From patchwork Fri Apr 15 14:20:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Peter X-Patchwork-Id: 12814966 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 D6E67C433F5 for ; Fri, 15 Apr 2022 14:22:41 +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=fUj2RBmCnzKqEmIxgg4ZV+KOYrebtG69L6/sGpp5WA8=; b=S/rH8BilJOUo5E 484TIUwxwOAUeO2/mdgwzO77/+aLyyK26FamOuTl4ICl3X6kIuXUnk6QS8BcdClNmPbcVqV+DTfpN yY3t6L20c+fD+27PeBceJ6+FbGM2gPlsGcFq0dIlVaMccEeHFO5zUl05xLi7qk7RzYfRigojBh7x5 76i6c1KFLHmg3mUQaJZQpqsspfQCa65EtW5QG9w+zdmsy7yNNtcsRQC3JJwe8Rq+JQZs60ijSDBex 2gZjg1Ar8sV9ImD8X4Y3t1BII6Zp9sVVuPVDAguvCbWKmy0TRqoPmjz+45+puIR4LBB7UYwOy4eBZ G6pjgFVTaXjeST/NWWLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfMoy-00AIGV-Px; Fri, 15 Apr 2022 14:21:12 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfMov-00AIEj-B2; Fri, 15 Apr 2022 14:21:11 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 6AC8F5C01E0; Fri, 15 Apr 2022 10:21:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 15 Apr 2022 10:21:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1650032466; x= 1650118866; bh=Tkrx4UCsThsuuZmAg3jLgWOGXjOhgnkx7b8zjDQpi8A=; b=m F+qBGKDwvkqMNuB5SL3EyoDyCLVEq3w1J7a8UVrzfBmMLg0BjUYA+SR1b6EdSpsQ bxR/B44VBg+wM0qGWjOXLMJ7VVXsUUBxXPwwKeNzbObJg1eozP7CDgw9sz5NIUMr zlfUq/vjoEY41UXQrukpiiegf5blrD1Zvcord9KgjXhWTCWvk3CNF4a7Mcz7zc5F DH7D6FOTSnMujzp91aS3blgHe6FachcbK6Hyr8AF36y3cSNAue5a/0LdVilaZ/n6 uUwlnfi9P63BTRDsSSKkb0STBMdR15BL2hX1eNS0geKxjNRkk/OqguMSIwncW05o EfhhyG/KZDsOuRxa6hGJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1650032466; x=1650118866; bh=Tkrx4UCsThsuuZmAg3jLgWOGXjOhgnkx7b8 zjDQpi8A=; b=DhtEoNpgd280U4Fb4Oae++gtIs2iQwoqXpHV5fLHY6GsgZd08x0 Gke7HlZ0Ad+uIgKoPf9H8PLVySM7W27dhT7COSrcs12BLCkvjycez72S8DHJ7QHS rtuOtsThjhKQezyaHCRkJHyP4cVxJ1ecFBF87Ct7OToQaWN5mxmnvxPW7cY+Erfo V7Pc8lsL0F4+HX1k1ZwHuDrZw9DFv9rwPv5g3lVJZvbyt+ugsSu5KfFFMsuayjWZ WvNxdHuTqRv0HebgRjPsfiGvidFeq5IPA0orF3Msi2Dm6iKm7OLou/YIQQvR/MhR uN0pe7cWzAySDMERgPV4lkwIT8bj1bUnqFQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudelhedgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuvhgvnhcu rfgvthgvrhcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrfgrthhtvg hrnhephfefffejvdekleeitdffiefhhfffveffieejteefhedutdfgffeftdejhedtteeh necuffhomhgrihhnpeguvghvihgtvghtrhgvvgdrohhrghenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsvhgvnhesshhvvghnphgvthgvrhdr uggvvh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Apr 2022 10:21:04 -0400 (EDT) From: Sven Peter To: Rob Herring , Krzysztof Kozlowski Cc: Sven Peter , Hector Martin , Alyssa Rosenzweig , Arnd Bergmann , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Marc Zyngier , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Subject: [PATCH v2 1/6] dt-bindings: iommu: Add Apple SART DMA address filter Date: Fri, 15 Apr 2022 16:20:50 +0200 Message-Id: <20220415142055.30873-2-sven@svenpeter.dev> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220415142055.30873-1-sven@svenpeter.dev> References: <20220415142055.30873-1-sven@svenpeter.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220415_072109_790221_D5DFC858 X-CRM114-Status: GOOD ( 16.94 ) 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 Apple SoCs such as the M1 come with a simple DMA address filter called SART. Unlike a real IOMMU no pagetables can be configured but instead DMA transactions can be allowed for up to 16 paddr regions. The consumer also needs special support since not all DMA allocations have to be added to this filter. Signed-off-by: Sven Peter Reviewed-by: Rob Herring --- v1 -> v2: - Moved to bindings/iommu since it is "Close enough to an IOMMU in terms of its purpose" (Rob Herring) .../devicetree/bindings/iommu/apple,sart.yaml | 52 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/iommu/apple,sart.yaml diff --git a/Documentation/devicetree/bindings/iommu/apple,sart.yaml b/Documentation/devicetree/bindings/iommu/apple,sart.yaml new file mode 100644 index 000000000000..1524fa3094ef --- /dev/null +++ b/Documentation/devicetree/bindings/iommu/apple,sart.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iommu/apple,sart.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SART DMA address filter + +maintainers: + - Sven Peter + +description: + Apple SART is a simple address filter for DMA transactions. Regions of + physical memory must be added to the SART's allow list before any + DMA can target these. Unlike a proper IOMMU no remapping can be done and + special support in the consumer driver is required since not all DMA + transactions of a single device are subject to SART filtering. + + SART1 has first been used since at least the A11 (iPhone 8 and iPhone X) + and allows 36 bit of physical address space and filter entries with sizes + up to 24 bit. + + SART2, first seen in A14 and M1, allows 36 bit of physical address space + and filter entry size up to 36 bit. + + SART3, first seen in M1 Pro/Max, extends both the address space and filter + entry size to 42 bit. + +properties: + compatible: + enum: + - apple,t6000-sart + - apple,t8103-sart + + reg: + maxItems: 1 + + power-domains: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + iommu@7bc50000 { + compatible = "apple,t8103-sart"; + reg = <0x7bc50000 0x4000>; + }; diff --git a/MAINTAINERS b/MAINTAINERS index fd768d43e048..4961da640e82 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1836,6 +1836,7 @@ F: Documentation/devicetree/bindings/arm/apple/* F: Documentation/devicetree/bindings/clock/apple,nco.yaml F: Documentation/devicetree/bindings/i2c/apple,i2c.yaml F: Documentation/devicetree/bindings/interrupt-controller/apple,* +F: Documentation/devicetree/bindings/iommu/apple,sart.yaml F: Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml F: Documentation/devicetree/bindings/pci/apple,pcie.yaml F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml