From patchwork Mon Aug 26 17:56:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 13778317 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 16F12C5472D for ; Mon, 26 Aug 2024 17:58:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4KBzC3UYDzVcntWEjAfh9aq0jCErmi0ZBb3RSeN9zX0=; b=Mlha19xwxQgtBOuGAnYS0/nJc5 IqMOj07KAS8Eid8N993gtxGSzMuP7e7fAm6VuXCHh5Ws37XaRf2dr9xznHB02qesQLFlRQnTMAM00 nRnX5OA3UdcIscIMDjUdAZHvlZtoP34eIHLjs8kdF9QrGmPrck+oPcgMCOcwG9bRYeeuTUJVhOqu3 EbQl7FColDJva2ANLdoCqxYg4qGMsrcy9RUIUyja3c78c0goeo5hOj0i4Rme2xn879VLsQUHXbO/a Oi2IK0ZUFGrmcfbR4sly/uMknBojuJlW3bBv4MIDVoi8yv9pXB+qh1j/dLU7NyFwReraLJgVKTVoP 0f+EXegA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sidzF-00000008J1w-01rX; Mon, 26 Aug 2024 17:58:41 +0000 Received: from mta-64-226.siemens.flowmailer.net ([185.136.64.226]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sidwv-00000008IQD-0S47 for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 17:56:19 +0000 Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 202408261756138c5629c49fa8f82ed7 for ; Mon, 26 Aug 2024 19:56:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=jan.kiszka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=4KBzC3UYDzVcntWEjAfh9aq0jCErmi0ZBb3RSeN9zX0=; b=ZCcF4gcaVjDpTCiNWCyvwvj9pNdY3hNHhxuT8fJ7NDjJQuvRXstfh+c//YUMZBv1AXu6Lb lHF2wUy+JOtHke4eqbkysph6IHt2LdZPISw8yleKjrVzvOFYkFGP9VRw+VCPS5zz1Xyu6+tD 7O6h7Vy2nrb3O9V4jUlc6ia8HH7i3BTTAWPHKJU343MrFsl38l6Xh++D68i51CDRa5riEIRm gKicJxClz/YT5zlg/xTbejISpHBPlcZ58jOPRAosaCjrClijbzC6tLthDWUWH0hmP56IGChY d73E8RXFOwKGGLYokELHjdkZLvcRG/aO3xLNVBK73dlD9BWmtp7WyD1A==; From: Jan Kiszka To: Nishanth Menon , Santosh Shilimkar , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Siddharth Vadapalli , Bao Cheng Su , Hua Qian Li , Diogo Ivo Subject: [PATCH 5/5] arm64: dts: ti: iot2050: Enforce DMA isolation for devices behind PCI RC Date: Mon, 26 Aug 2024 19:56:09 +0200 Message-ID: <270232f43d17c95610904928502ad00bb975304c.1724694969.git.jan.kiszka@siemens.com> In-Reply-To: References: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-294854:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_105617_314132_82C547E2 X-CRM114-Status: GOOD ( 10.35 ) 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: Jan Kiszka Reserve a 64M memory region below the top of 1G RAM (smallest RAM size across the series, space left for firmware carve-outs) 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. Signed-off-by: Jan Kiszka --- .../boot/dts/ti/k3-am65-iot2050-common.dtsi | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi index e76828ccf21b..cc0f33e3519c 100644 --- a/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am65-iot2050-common.dtsi @@ -82,6 +82,11 @@ wdt_reset_memory_region: wdt-memory@a2200000 { reg = <0x00 0xa2200000 0x00 0x1000>; no-map; }; + + pci_restricted_dma_region: restricted-dma@ba000000 { + compatible = "restricted-dma-pool"; + reg = <0 0xba000000 0 0x4000000>; + }; }; leds { @@ -571,6 +576,10 @@ seboot-backup@e80000 { }; }; +&pcie0_rc { + memory-region = <&pci_restricted_dma_region>; +}; + &pcie1_rc { status = "okay"; pinctrl-names = "default"; @@ -580,6 +589,8 @@ &pcie1_rc { phys = <&serdes1 PHY_TYPE_PCIE 0>; phy-names = "pcie-phy0"; reset-gpios = <&wkup_gpio0 27 GPIO_ACTIVE_HIGH>; + + memory-region = <&pci_restricted_dma_region>; }; &mailbox0_cluster0 { @@ -640,3 +651,24 @@ &mcu_r5fss0 { /* lock-step mode not supported on iot2050 boards */ ti,cluster-mode = <0>; }; + +&main_navss { + ti_pvu0: ti-pvu@30f80000 { + compatible = "ti,am654-pvu"; + reg = <0 0x30f80000 0 0x1000>, + <0 0x36000000 0 0x100000>; + reg-names = "cfg", "tlbif"; + interrupts-extended = <&intr_main_navss 390>; + interrupt-names = "pvu"; + }; + + ti_pvu1: ti-pvu@30f81000 { + compatible = "ti,am654-pvu"; + reg = <0 0x30f81000 0 0x1000>, + <0 0x36100000 0 0x100000>; + reg-names = "cfg", "tlbif"; + interrupts-extended = <&intr_main_navss 389>; + interrupt-names = "pvu"; + status = "disabled"; + }; +};