From nobody Tue Oct 7 01:58:30 2025 Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net [185.136.64.225]) (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 EAE4D2E7651 for ; Wed, 16 Jul 2025 05:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.64.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752644479; cv=none; b=ONx2M/ZIM1LMYDj8vP8SYpZop51gKIfp94KiFvCdy1bht246JnfUzFOl4zz05eVsYaHIt87FTEEeC9Mwi21haTOxr5xOIi5XwmdiUlaMfPnTO7GmdWpaYZF/t1O9IOud9swA/BXuBy/yw/qDIPjTRpWfDWoNNl4jyig6RWzMu4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752644479; c=relaxed/simple; bh=JcpLqjaUr9M1mi4dl/7gUP3Y3UTEl2H4ET8142ZGV6U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KgmJ3zV8azK3Og7jVSlSvoQ9isUQV+6KqWk1oJiJmZNrFj/oJ+v1TpjpoMLIZ6BbGnWEku69GODiYFxhdNrCB757gsG6f43E/w8ekJitMXlDvgec/HTpRmUG0e3iPW+UhzChs6lhTTEqTGJVW1UXda8iocCSCcG0eAfyGd0SN1Q= 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=d1XzJowh; arc=none smtp.client-ip=185.136.64.225 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="d1XzJowh" Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 20250716054115cb030278b72ef2a8e0 for ; Wed, 16 Jul 2025 07:41:16 +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=d1XzJowh2Ulmou3FHdyuR5pXIChcG5Hy8DPJhlccolmhOXKl0i2YMBS1JhfltV2GQ0Sp8c svfXdeNS77ocqlV/PljrgXXjjvHZIiV5TRCMoGcDuTRBf7GJfjKeYQ72f/6jDCOFbieqrY9C YuRXO4CWGl9Q5IlX3FPq3VuHlTF28rG3OzjuZThjG4hZ8j4gEIfyxReTYNf9Z62BXdIq7CWF xBfCokW6FD07z1o+5nNPXqzG5y75FI5g4eZQ0u//XOjGNtr9x4R/pQfJ2YlDO0L/BIRpcB7E H7DMa7iv8b5oSAvKZSSW73GFfOIehEeiefkhmQrqO9PQAEIT0XxMgamA==; 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 v9 (RESEND) 7/7] arm64: dts: ti: iot2050: Add overlay for DMA isolation for devices behind PCI RC Date: Wed, 16 Jul 2025 13:39:50 +0800 Message-Id: <20250716053950.199079-8-huaqian.li@siemens.com> In-Reply-To: <20250716053950.199079-1-huaqian.li@siemens.com> References: <20250716053950.199079-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