From nobody Mon Oct 6 15:17:31 2025 Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net [185.136.65.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09D48225414 for ; Mon, 21 Jul 2025 03:01:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.65.227 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753066868; cv=none; b=gNBDpLOMYtWX2bm2Ck5RgyxA5NhafsgqS3C24XI//1Ci/xC0A/0m+KdNUWgugxG1M0XTllmD3mRWzupHGhZEKh3PW9yQ3FmJlRl3JOOCsU5J1KLVw7iVFFgz8q5GOQ7DmrqKw0CofkU5gRq87aQnX5tG0Yj9iIfheoRz9rnUyCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753066868; c=relaxed/simple; bh=JcpLqjaUr9M1mi4dl/7gUP3Y3UTEl2H4ET8142ZGV6U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AQWXifZDoWhtZM3+hOHt+QCIIjqtlcAQ1HK7IpL4SvO+XEhBhzngg+kfwBBCYUQJ9JvyeQkFOzXYQr2hyw9t91kRAza26RQz6z3keOdG3pgrj9M0XtshFZDUUwYt3mVAVrsCNJV+ls7vRLfpTUQTpOIVWyCAF3YVfRTwgw9nzJQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com; dkim=pass (2048-bit key) header.d=siemens.com header.i=huaqian.li@siemens.com header.b=fMGWOn8t; arc=none smtp.client-ip=185.136.65.227 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=huaqian.li@siemens.com header.b="fMGWOn8t" Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20250721030106e6bdfce20b55d7cc3c for ; Mon, 21 Jul 2025 05:01:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=huaqian.li@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=+LaZDA/FCK3jvCwMvQup/hbQjkRk3GDFDbtf0l3xKc4=; b=fMGWOn8tYiM4HXxNXQ6tapgOIDFZy+c4bIU/C3sKXivaC/yS35CaJsYjA/yWC8KAKQKq2q UBLfXuOakK5uvUEnKw/CmZC2348yl8YrJYbAS7kolx2uyqj5imTAA+b31pWRcNXgSy95JiHY DkYwgUpgAG6Be3uVVWRs1yNEJXOL7a9t5G35j7wnwl9S4Cfz+DgSfVlxmLAAhq/j/aWmM+Wr 3oqSgLuqex67PPl/Rc0evphlS4BgiAm0LjmLusuC82OevzzDUQCJD1q03OuUzBfVmZ3ge2qy Q0xqRmVyOgMOP2T8YNbtBCsLascMhK1V9+cvIeFUN7O4v6REpecCRFhA==; From: huaqian.li@siemens.com To: s-vadapalli@ti.com Cc: baocheng.su@siemens.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, diogo.ivo@siemens.com, helgaas@kernel.org, huaqian.li@siemens.com, jan.kiszka@siemens.com, kristo@kernel.org, krzk+dt@kernel.org, kw@linux.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, nm@ti.com, robh@kernel.org, ssantosh@kernel.org, vigneshr@ti.com Subject: [PATCH v10 7/7] arm64: dts: ti: iot2050: Add overlay for DMA isolation for devices behind PCI RC Date: Mon, 21 Jul 2025 10:59:45 +0800 Message-Id: <20250721025945.204422-8-huaqian.li@siemens.com> In-Reply-To: <20250721025945.204422-1-huaqian.li@siemens.com> References: <20250721025945.204422-1-huaqian.li@siemens.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-959203:519-21489:flowmailer Content-Type: text/plain; charset="utf-8" From: Jan Kiszka Reserve a 64M memory region and ensure that all PCI devices do their DMA only inside that region. This is configured via a restricted-dma-pool and enforced with the help of the first PVU. Applying this isolation is not totally free in terms of overhead and memory consumption. It makes only sense for variants that support secure booting, and generally only when this is actually enable. Therefore model it as overlay that can be activated on demand. The firmware will take care of this via DT fixup during boot and will also provide a way to adjust the pool size. Signed-off-by: Jan Kiszka Signed-off-by: Li Hua Qian --- arch/arm64/boot/dts/ti/Makefile | 5 +++ ...am6548-iot2050-advanced-dma-isolation.dtso | 33 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 arch/arm64/boot/dts/ti/k3-am6548-iot2050-advanced-dma-i= solation.dtso diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makef= ile index c6171de9fe88..66b1d8093fa2 100644 --- a/arch/arm64/boot/dts/ti/Makefile +++ b/arch/arm64/boot/dts/ti/Makefile @@ -84,8 +84,10 @@ k3-am654-gp-evm-dtbs :=3D k3-am654-base-board.dtb \ k3-am654-evm-dtbs :=3D k3-am654-base-board.dtb k3-am654-icssg2.dtbo k3-am654-idk-dtbs :=3D k3-am654-evm.dtb k3-am654-idk.dtbo k3-am654-pcie-us= b2.dtbo k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-dtbs :=3D k3-am6548-iot2050-a= dvanced-m2.dtb \ + k3-am6548-iot2050-advanced-dma-isolation.dtbo \ k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie.dtbo k3-am6548-iot2050-advanced-m2-bkey-usb3-dtbs :=3D k3-am6548-iot2050-advanc= ed-m2.dtb \ + k3-am6548-iot2050-advanced-dma-isolation.dtbo \ k3-am6548-iot2050-advanced-m2-bkey-usb3.dtbo dtb-$(CONFIG_ARCH_K3) +=3D k3-am6528-iot2050-basic.dtb dtb-$(CONFIG_ARCH_K3) +=3D k3-am6528-iot2050-basic-pg2.dtb @@ -288,7 +290,10 @@ DTC_FLAGS_k3-am62p5-sk +=3D -@ DTC_FLAGS_k3-am642-evm +=3D -@ DTC_FLAGS_k3-am642-phyboard-electra-rdk +=3D -@ DTC_FLAGS_k3-am642-tqma64xxl-mbax4xxl +=3D -@ +DTC_FLAGS_k3-am6548-iot2050-advanced +=3D -@ DTC_FLAGS_k3-am6548-iot2050-advanced-m2 +=3D -@ +DTC_FLAGS_k3-am6548-iot2050-advanced-pg2 +=3D -@ +DTC_FLAGS_k3-am6548-iot2050-advanced-sm +=3D -@ DTC_FLAGS_k3-am68-sk-base-board +=3D -@ DTC_FLAGS_k3-am69-sk +=3D -@ DTC_FLAGS_k3-j7200-common-proc-board +=3D -@ diff --git a/arch/arm64/boot/dts/ti/k3-am6548-iot2050-advanced-dma-isolatio= n.dtso b/arch/arm64/boot/dts/ti/k3-am6548-iot2050-advanced-dma-isolation.dt= so new file mode 100644 index 000000000000..dfd75d2dc245 --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am6548-iot2050-advanced-dma-isolation.dtso @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * IOT2050, overlay for isolating DMA requests via PVU + * Copyright (c) Siemens AG, 2024 + * + * Authors: + * Jan Kiszka + */ + +/dts-v1/; +/plugin/; + +&{/reserved-memory} { + #address-cells =3D <2>; + #size-cells =3D <2>; + + pci_restricted_dma_region: restricted-dma@c0000000 { + compatible =3D "restricted-dma-pool"; + reg =3D <0 0xc0000000 0 0x4000000>; + }; +}; + +&pcie0_rc { + memory-region =3D <&pci_restricted_dma_region>; +}; + +&pcie1_rc { + memory-region =3D <&pci_restricted_dma_region>; +}; + +&ti_pvu0 { + status =3D "okay"; +}; --=20 2.34.1