From nobody Mon Oct 6 10:17:27 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 6CE2D248F7A for ; Wed, 23 Jul 2025 03:46:27 +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=1753242389; cv=none; b=ZDfAhcOYPQicBscdNqPT6AAT22RV9TOh80v8iORhox6CxE+3ohMoEAGVKWqOCHzCjxu6RKUwJD5DMdr4r7Lt/5MawHtLb+alhM1+iL76K6SVIdR9pFDU9Hk2uYokoRp6N42Pb+uXe+FDgQ9rcrtqzWk4H7tiZfLf1oNpXgI7bqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753242389; c=relaxed/simple; bh=JcpLqjaUr9M1mi4dl/7gUP3Y3UTEl2H4ET8142ZGV6U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XTE6LlMILOAxQfR5mAoqFyZkEqvT4xj5mHi7dzdSkFUe9CQESd4nxl8fv8l2s7jzRUuqyPjjklj3hYJNp0fW/faehu9vpjmbqu5vhL+329NnYY1cQizSL3nqEJ+K715VkZ7zICVF6sBtYe7ciU7qTpT4rjXC/JN62GQs+W4G/Pw= 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=OWIP5tSc; 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="OWIP5tSc" Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20250723034625a25d53b99276cf611b for ; Wed, 23 Jul 2025 05:46:25 +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=OWIP5tScLpijIdXWno3l72DBpUU8dG0iO56tpvSECZ67A0t43T3i2joIm7maPfe06U2qAZ p+MLqFek14H+3N+EFQkLqpngXP+RD/XkY73UBhFUZfx+ZqlYkD6TlrDJt+1wqqaKu9yPn6j7 5r7rD/WMH1HTY/2GHNOL59LLgjhVY7C0vgFNbgil5lSlL1OPAODtcV4amns4XpKFkkFt48L+ CBWf8IyaFDUzNAUfSiPxWpDRZNT/5a1TYCvrJGUgPo3YLlC+v42cfD3rm4SmCS6vVWVnUX/Q deQuYUSnSrNmJkitvIHqhtdXWK/ITgodAATBPKivkdD1W218iAP8Lpuw==; From: huaqian.li@siemens.com To: christophe.jaillet@wanadoo.fr 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, s-vadapalli@ti.com, ssantosh@kernel.org, vigneshr@ti.com Subject: [PATCH v11 7/7] arm64: dts: ti: iot2050: Add overlay for DMA isolation for devices behind PCI RC Date: Wed, 23 Jul 2025 11:45:21 +0800 Message-Id: <20250723034521.138695-8-huaqian.li@siemens.com> In-Reply-To: <20250723034521.138695-1-huaqian.li@siemens.com> References: <20250723034521.138695-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